@forgeax/engine-runtime 0.1.4 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -83
- package/dist/.tsbuildinfo +1 -1
- package/dist/__tests__/animation-graph-collect-roundtrip.test.d.ts +2 -0
- package/dist/__tests__/animation-graph-collect-roundtrip.test.d.ts.map +1 -0
- package/dist/__tests__/animation-graph-serialize.unit.test.d.ts +2 -0
- package/dist/__tests__/animation-graph-serialize.unit.test.d.ts.map +1 -0
- package/dist/__tests__/asset-brand-and-name-retirement.test.d.ts +2 -0
- package/dist/__tests__/asset-brand-and-name-retirement.test.d.ts.map +1 -0
- package/dist/__tests__/asset-error-exhaustive.test-d.d.ts +11 -0
- package/dist/__tests__/asset-error-exhaustive.test-d.d.ts.map +1 -0
- package/dist/__tests__/asset-registry-guid-reverse.test.d.ts +2 -0
- package/dist/__tests__/asset-registry-guid-reverse.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry-hdr-equirect.test.d.ts +2 -0
- package/dist/__tests__/asset-registry-hdr-equirect.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry-mesh-pack-payload.dawn.test.d.ts +2 -0
- package/dist/__tests__/asset-registry-mesh-pack-payload.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry-mounts.test.d.ts +2 -0
- package/dist/__tests__/asset-registry-mounts.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry.browser.test.d.ts +2 -0
- package/dist/__tests__/asset-registry.browser.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry.dawn.test.d.ts +2 -0
- package/dist/__tests__/asset-registry.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry.listCatalog.test.d.ts +2 -0
- package/dist/__tests__/asset-registry.listCatalog.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry.mesh-bin.test.d.ts +2 -0
- package/dist/__tests__/asset-registry.mesh-bin.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry.pack-cache.test.d.ts +2 -0
- package/dist/__tests__/asset-registry.pack-cache.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry.raw-container-failfast.test.d.ts +2 -0
- package/dist/__tests__/asset-registry.raw-container-failfast.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry.recursive.spec.d.ts +2 -0
- package/dist/__tests__/asset-registry.recursive.spec.d.ts.map +1 -0
- package/dist/__tests__/asset-registry.unit.test.d.ts +2 -0
- package/dist/__tests__/asset-registry.unit.test.d.ts.map +1 -0
- package/dist/__tests__/asset.unit.test.d.ts +2 -0
- package/dist/__tests__/asset.unit.test.d.ts.map +1 -0
- package/dist/__tests__/audio-load-by-guid.unit.test.d.ts +2 -0
- package/dist/__tests__/audio-load-by-guid.unit.test.d.ts.map +1 -0
- package/dist/__tests__/backend-selection.integration.test.d.ts +2 -0
- package/dist/__tests__/backend-selection.integration.test.d.ts.map +1 -0
- package/dist/__tests__/basis-catalog-dispatch.integration.test.d.ts +2 -0
- package/dist/__tests__/basis-catalog-dispatch.integration.test.d.ts.map +1 -0
- package/dist/__tests__/builtin-asset-registry.unit.test.d.ts +2 -0
- package/dist/__tests__/builtin-asset-registry.unit.test.d.ts.map +1 -0
- package/dist/__tests__/collect-scene-asset.test.d.ts +1 -2
- package/dist/__tests__/collect-scene-asset.test.d.ts.map +1 -1
- package/dist/__tests__/collect-scene-mount-collapse.test.d.ts +2 -0
- package/dist/__tests__/collect-scene-mount-collapse.test.d.ts.map +1 -0
- package/dist/__tests__/collect-transient-roundtrip.test.d.ts +1 -1
- package/dist/__tests__/collect-transient-roundtrip.test.d.ts.map +1 -1
- package/dist/__tests__/collect-transient-skip.test.d.ts +1 -2
- package/dist/__tests__/collect-transient-skip.test.d.ts.map +1 -1
- package/dist/__tests__/compressed-texture-physical-extent.integration.test.d.ts +2 -0
- package/dist/__tests__/compressed-texture-physical-extent.integration.test.d.ts.map +1 -0
- package/dist/__tests__/dawn/mesh-update-dawn.test.d.ts +2 -0
- package/dist/__tests__/dawn/mesh-update-dawn.test.d.ts.map +1 -0
- package/dist/__tests__/dawn/upload-texture.dawn.test.d.ts +2 -0
- package/dist/__tests__/dawn/upload-texture.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/draw-published.d.ts +2 -2
- package/dist/__tests__/draw-published.d.ts.map +1 -1
- package/dist/__tests__/dynamic-texture-store.unit.test.d.ts +2 -0
- package/dist/__tests__/dynamic-texture-store.unit.test.d.ts.map +1 -0
- package/dist/__tests__/errors.unit.test.d.ts +2 -0
- package/dist/__tests__/errors.unit.test.d.ts.map +1 -0
- package/dist/__tests__/extract-skin-mismatch.unit.test.d.ts +2 -0
- package/dist/__tests__/extract-skin-mismatch.unit.test.d.ts.map +1 -0
- package/dist/__tests__/fetch-binary-decompress.test.d.ts +2 -0
- package/dist/__tests__/fetch-binary-decompress.test.d.ts.map +1 -0
- package/dist/__tests__/four-path-compression.integration.test.d.ts +2 -0
- package/dist/__tests__/four-path-compression.integration.test.d.ts.map +1 -0
- package/dist/__tests__/fullscreen-feature-host.dawn.test.d.ts +2 -0
- package/dist/__tests__/fullscreen-feature-host.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/guid-for-asset.unit.test.d.ts +2 -0
- package/dist/__tests__/guid-for-asset.unit.test.d.ts.map +1 -0
- package/dist/__tests__/handle-migration.test.d.ts +2 -0
- package/dist/__tests__/handle-migration.test.d.ts.map +1 -0
- package/dist/__tests__/helpers/register-runtime-components.d.ts.map +1 -1
- package/dist/__tests__/host-custom-kind-contract.test-d.d.ts +2 -0
- package/dist/__tests__/host-custom-kind-contract.test-d.d.ts.map +1 -0
- package/dist/__tests__/host-custom-kind-contract.test.d.ts +2 -0
- package/dist/__tests__/host-custom-kind-contract.test.d.ts.map +1 -0
- package/dist/__tests__/inspect-name.test.d.ts +2 -0
- package/dist/__tests__/inspect-name.test.d.ts.map +1 -0
- package/dist/__tests__/instantiate-mount-deferred-wiring.test.d.ts +2 -0
- package/dist/__tests__/instantiate-mount-deferred-wiring.test.d.ts.map +1 -0
- package/dist/__tests__/loadbyguid-payload.unit.test.d.ts +2 -0
- package/dist/__tests__/loadbyguid-payload.unit.test.d.ts.map +1 -0
- package/dist/__tests__/loadbyguid-texture-intern.unit.test.d.ts +2 -0
- package/dist/__tests__/loadbyguid-texture-intern.unit.test.d.ts.map +1 -0
- package/dist/__tests__/loader-extract-graceful.test.d.ts +2 -0
- package/dist/__tests__/loader-extract-graceful.test.d.ts.map +1 -0
- package/dist/__tests__/loader-name-survival.test.d.ts +2 -0
- package/dist/__tests__/loader-name-survival.test.d.ts.map +1 -0
- package/dist/__tests__/mesh-bin-contract.test.d.ts +2 -0
- package/dist/__tests__/mesh-bin-contract.test.d.ts.map +1 -0
- package/dist/__tests__/mesh-bin-skin-roundtrip.unit.test.d.ts +2 -0
- package/dist/__tests__/mesh-bin-skin-roundtrip.unit.test.d.ts.map +1 -0
- package/dist/__tests__/mesh-bin.test.d.ts +2 -0
- package/dist/__tests__/mesh-bin.test.d.ts.map +1 -0
- package/dist/__tests__/mesh-loader-skin-contract.unit.test.d.ts +2 -0
- package/dist/__tests__/mesh-loader-skin-contract.unit.test.d.ts.map +1 -0
- package/dist/__tests__/new-kind-refs-contract.test.d.ts +2 -0
- package/dist/__tests__/new-kind-refs-contract.test.d.ts.map +1 -0
- package/dist/__tests__/package-promotion.test.d.ts +2 -0
- package/dist/__tests__/package-promotion.test.d.ts.map +1 -0
- package/dist/__tests__/package-rename.test.d.ts +2 -0
- package/dist/__tests__/package-rename.test.d.ts.map +1 -0
- package/dist/__tests__/recover-error-exhaustive.test-d.d.ts +1 -1
- package/dist/__tests__/recover-error-exhaustive.test-d.d.ts.map +1 -1
- package/dist/__tests__/render-error-exhaustive.test-d.d.ts +1 -1
- package/dist/__tests__/render-error-exhaustive.test-d.d.ts.map +1 -1
- package/dist/__tests__/render-feature-prepared-graphics.fixture.d.ts +10 -0
- package/dist/__tests__/render-feature-prepared-graphics.fixture.d.ts.map +1 -0
- package/dist/__tests__/render-system-extract.unit.test.d.ts +2 -0
- package/dist/__tests__/render-system-extract.unit.test.d.ts.map +1 -0
- package/dist/__tests__/renderer-test-utils.d.ts +10 -0
- package/dist/__tests__/renderer-test-utils.d.ts.map +1 -0
- package/dist/__tests__/renderer.test-d.d.ts +2 -0
- package/dist/__tests__/renderer.test-d.d.ts.map +1 -0
- package/dist/__tests__/resolve-asset-handle-err.test.d.ts +2 -0
- package/dist/__tests__/resolve-asset-handle-err.test.d.ts.map +1 -0
- package/dist/__tests__/resolve-asset-handle.unit.test.d.ts +2 -0
- package/dist/__tests__/resolve-asset-handle.unit.test.d.ts.map +1 -0
- package/dist/__tests__/resolveName-fallback.test.d.ts +2 -0
- package/dist/__tests__/resolveName-fallback.test.d.ts.map +1 -0
- package/dist/__tests__/resolveName-null-package.test.d.ts +2 -0
- package/dist/__tests__/resolveName-null-package.test.d.ts.map +1 -0
- package/dist/__tests__/resolveName-unified-entry.test.d.ts +2 -0
- package/dist/__tests__/resolveName-unified-entry.test.d.ts.map +1 -0
- package/dist/__tests__/resolveName.test.d.ts +2 -0
- package/dist/__tests__/resolveName.test.d.ts.map +1 -0
- package/dist/__tests__/roots-to-scene-asset.test.d.ts +1 -1
- package/dist/__tests__/roots-to-scene-asset.test.d.ts.map +1 -1
- package/dist/__tests__/roundtrip-primitive.test.d.ts +2 -0
- package/dist/__tests__/roundtrip-primitive.test.d.ts.map +1 -0
- package/dist/__tests__/scene-bare-guid-refs-instantiate.test.d.ts +2 -0
- package/dist/__tests__/scene-bare-guid-refs-instantiate.test.d.ts.map +1 -0
- package/dist/__tests__/scene-instance-authoring.integration.test.d.ts +2 -0
- package/dist/__tests__/scene-instance-authoring.integration.test.d.ts.map +1 -0
- package/dist/__tests__/scene-mount-fixed-point.test.d.ts +2 -0
- package/dist/__tests__/scene-mount-fixed-point.test.d.ts.map +1 -0
- package/dist/__tests__/scene-mount-roundtrip.test.d.ts +2 -0
- package/dist/__tests__/scene-mount-roundtrip.test.d.ts.map +1 -0
- package/dist/__tests__/scene-mount-wrapper-roundtrip.test.d.ts +2 -0
- package/dist/__tests__/scene-mount-wrapper-roundtrip.test.d.ts.map +1 -0
- package/dist/__tests__/scene-sugar-instantiate.test.d.ts +2 -0
- package/dist/__tests__/scene-sugar-instantiate.test.d.ts.map +1 -0
- package/dist/__tests__/serialize-mounts-roundtrip.test.d.ts +2 -0
- package/dist/__tests__/serialize-mounts-roundtrip.test.d.ts.map +1 -0
- package/dist/__tests__/serialize-scene-asset.test.d.ts +1 -1
- package/dist/__tests__/serialize-scene-asset.test.d.ts.map +1 -1
- package/dist/__tests__/template-game-default-api-contract.test.d.ts +2 -0
- package/dist/__tests__/template-game-default-api-contract.test.d.ts.map +1 -0
- package/dist/__tests__/tileset-asset-validate.test.d.ts +2 -0
- package/dist/__tests__/tileset-asset-validate.test.d.ts.map +1 -0
- package/dist/__tests__/transcode-fallback.unit.test.d.ts +2 -0
- package/dist/__tests__/transcode-fallback.unit.test.d.ts.map +1 -0
- package/dist/__tests__/transient-runtime-behavior.test.d.ts +2 -0
- package/dist/__tests__/transient-runtime-behavior.test.d.ts.map +1 -0
- package/dist/__tests__/video-loader-consumption.test.d.ts +2 -0
- package/dist/__tests__/video-loader-consumption.test.d.ts.map +1 -0
- package/dist/__tests__/video-loader-smoke.dawn.test.d.ts +2 -0
- package/dist/__tests__/video-loader-smoke.dawn.test.d.ts.map +1 -0
- package/dist/backend-selection.d.ts +13 -0
- package/dist/backend-selection.d.ts.map +1 -0
- package/dist/collect-scene-asset.d.ts +7 -4
- package/dist/collect-scene-asset.d.ts.map +1 -1
- package/dist/createRenderer.d.ts +14 -2
- package/dist/createRenderer.d.ts.map +1 -1
- package/dist/errors/environment.d.ts +1 -1
- package/dist/errors/environment.d.ts.map +1 -1
- package/dist/index.d.ts +20 -82
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +107 -108
- package/dist/index.mjs.map +1 -1
- package/dist/renderer-host.d.ts +9 -0
- package/dist/renderer-host.d.ts.map +1 -0
- package/dist/renderer-host.mjs +62 -0
- package/dist/renderer-host.mjs.map +1 -0
- package/dist/scene-instances/index.d.ts +2 -0
- package/dist/scene-instances/index.d.ts.map +1 -0
- package/dist/scene-utils/mount-override-fold.d.ts +1 -2
- package/dist/scene-utils/mount-override-fold.d.ts.map +1 -1
- package/dist/systems/sprite-animation-tick.d.ts +1 -1
- package/dist/systems/sprite-animation-tick.d.ts.map +1 -1
- package/dist/systems/transparent-sort.d.ts +1 -2
- package/dist/systems/transparent-sort.d.ts.map +1 -1
- package/dist/tilemap-register-validate.d.ts.map +1 -1
- package/package.json +34 -33
- package/src/__tests__/active-camera.unit.test.ts +19 -9
- package/src/__tests__/animation-graph-collect-roundtrip.test.ts +213 -0
- package/src/__tests__/animation-graph-serialize.unit.test.ts +171 -0
- package/src/__tests__/append-injection.test.ts +1 -1
- package/src/__tests__/asset-brand-and-name-retirement.test.ts +102 -0
- package/src/__tests__/asset-error-exhaustive.test-d.ts +62 -0
- package/src/__tests__/asset-registry-guid-reverse.test.ts +608 -0
- package/src/__tests__/asset-registry-hdr-equirect.test.ts +78 -0
- package/src/__tests__/asset-registry-mesh-pack-payload.dawn.test.ts +232 -0
- package/src/__tests__/asset-registry-mounts.test.ts +806 -0
- package/src/__tests__/asset-registry.browser.test.ts +81 -0
- package/src/__tests__/asset-registry.dawn.test.ts +94 -0
- package/src/__tests__/asset-registry.listCatalog.test.ts +170 -0
- package/src/__tests__/asset-registry.mesh-bin.test.ts +316 -0
- package/src/__tests__/asset-registry.pack-cache.test.ts +969 -0
- package/src/__tests__/asset-registry.raw-container-failfast.test.ts +225 -0
- package/src/__tests__/asset-registry.recursive.spec.ts +1397 -0
- package/src/__tests__/asset-registry.unit.test.ts +1030 -0
- package/src/__tests__/asset.unit.test.ts +7107 -0
- package/src/__tests__/audio-load-by-guid.unit.test.ts +126 -0
- package/src/__tests__/backend-selection.integration.test.ts +11 -0
- package/src/__tests__/basis-catalog-dispatch.integration.test.ts +320 -0
- package/src/__tests__/bind-group-cache-keying.test.ts +4 -4
- package/src/__tests__/block-upload-math.unit.test.ts +2 -2
- package/src/__tests__/builtin-asset-registry.unit.test.ts +112 -0
- package/src/__tests__/builtin-shader-register-e2e.test.ts +1 -1
- package/src/__tests__/cache-false-eviction.test.ts +2 -1
- package/src/__tests__/cache-isolation-matrix.test.ts +2 -1
- package/src/__tests__/camera-clear-snapshot-equivalence.unit.test.ts +5 -6
- package/src/__tests__/clamp-to-last.e2e.browser.test.ts +29 -19
- package/src/__tests__/collect-scene-asset.test.ts +49 -52
- package/src/__tests__/collect-scene-mount-collapse.test.ts +391 -0
- package/src/__tests__/collect-subtree.unit.test.ts +1 -2
- package/src/__tests__/collect-transient-children-absent.test.ts +24 -10
- package/src/__tests__/collect-transient-roundtrip.test.ts +44 -20
- package/src/__tests__/collect-transient-skip.test.ts +24 -13
- package/src/__tests__/components.test-d.ts +1 -6
- package/src/__tests__/components.unit.test.ts +20 -19
- package/src/__tests__/composite-skybox-cross-world.browser.test.ts +59 -27
- package/src/__tests__/compressed-texture-physical-extent.integration.test.ts +139 -0
- package/src/__tests__/create-renderer-assembly.integration.test.ts +42 -29
- package/src/__tests__/createRenderer-dispose.test.ts +35 -402
- package/src/__tests__/createRenderer.browser-no-webgpu.test.ts +25 -30
- package/src/__tests__/createRenderer.unit.test.ts +1 -1
- package/src/__tests__/dawn/hello-sprite-nineslice-section.dawn.test.ts +27 -63
- package/src/__tests__/dawn/ibl-precompute-readback.dawn.test.ts +56 -47
- package/src/__tests__/dawn/instances-per-instance-pbr.dawn.test.ts +49 -29
- package/src/__tests__/dawn/instances-shadow.dawn.test.ts +26 -15
- package/src/__tests__/dawn/instances-uniform-fallback.dawn.test.ts +13 -14
- package/src/__tests__/dawn/material-alpha.dawn.test.ts +23 -31
- package/src/__tests__/dawn/material-cooked-fixture.dawn.test.ts +24 -9
- package/src/__tests__/dawn/{mesh-update.dawn.test.ts → mesh-update-dawn.test.ts} +42 -134
- package/src/__tests__/dawn/mipmap-srgb-linear.dawn.test.ts +14 -7
- package/src/__tests__/dawn/per-entity-material-texture-isolation.dawn.test.ts +16 -28
- package/src/__tests__/dawn/sprite-nineslice-mesh-bind.dawn.test.ts +23 -39
- package/src/__tests__/dawn/upload-texture.dawn.test.ts +198 -0
- package/src/__tests__/dawn/user-handle-mesh-render.dawn.test.ts +12 -14
- package/src/__tests__/dawn/user-mesh-upload.dawn.test.ts +27 -22
- package/src/__tests__/dawn/zero-manifest-mesh-fail.dawn.test.ts +25 -28
- package/src/__tests__/dawn/zero-manifest-ready.dawn.test.ts +10 -11
- package/src/__tests__/demo-sortscope-migration.unit.test.ts +5 -5
- package/src/__tests__/derive-bgl-integration.test.ts +34 -44
- package/src/__tests__/derive-render-data-skin.unit.test.ts +1 -1
- package/src/__tests__/draw-published.ts +11 -4
- package/src/__tests__/dynamic-texture-store.unit.test.ts +190 -0
- package/src/__tests__/equirect-bc6h.integration.test.ts +144 -21
- package/src/__tests__/errors.unit.test.ts +1227 -0
- package/src/__tests__/extract-frames-graceful-degradation.test.ts +3 -7
- package/src/__tests__/extract-frames-merge.test.ts +35 -22
- package/src/__tests__/extract-record-no-hardcoded-texture-fields.test.ts +5 -16
- package/src/__tests__/extract-skin-mismatch.unit.test.ts +322 -0
- package/src/__tests__/fetch-binary-decompress.test.ts +356 -0
- package/src/__tests__/four-path-compression.integration.test.ts +395 -0
- package/src/__tests__/frame-targets-shadow-regression.unit.test.ts +1 -1
- package/src/__tests__/fullscreen-feature-host.dawn.test.ts +80 -0
- package/src/__tests__/fullscreen-post-bgl-depth.test.ts +4 -2
- package/src/__tests__/fullscreen-post-depth-params-arity.test.ts +3 -3
- package/src/__tests__/fullscreen-post-process-pass.dawn.test.ts +39 -23
- package/src/__tests__/fullscreen-post-process-pass.unit.test.ts +4 -2
- package/src/__tests__/fxaa-pixel-diff.dawn.test.ts +28 -17
- package/src/__tests__/fxaa-validation-and-resize.dawn.test.ts +29 -18
- package/src/__tests__/fxaa-zero-overhead.dawn.test.ts +16 -12
- package/src/__tests__/geometry.unit.test.ts +525 -159
- package/src/__tests__/glyph-tilemap-worldid.test.ts +1 -1
- package/src/__tests__/gpu-resource-cow-survivor.test.ts +6 -4
- package/src/__tests__/guid-for-asset.unit.test.ts +102 -0
- package/src/__tests__/handle-migration.test.ts +136 -0
- package/src/__tests__/helpers/register-runtime-components.ts +4 -2
- package/src/__tests__/helpers/register-scene-components.ts +1 -1
- package/src/__tests__/host-custom-kind-contract.test-d.ts +47 -0
- package/src/__tests__/host-custom-kind-contract.test.ts +578 -0
- package/src/__tests__/inspect-name.test.ts +139 -0
- package/src/__tests__/instances.test-d.ts +1 -1
- package/src/__tests__/instantiate-mount-deferred-wiring.test.ts +112 -0
- package/src/__tests__/light-casters-9-light.browser.test.ts +73 -76
- package/src/__tests__/light-gpu-byte-neutral.unit.test.ts +7 -10
- package/src/__tests__/light-snapshot.test-d.ts +2 -2
- package/src/__tests__/lights-vec-negative.unit.test.ts +1 -1
- package/src/__tests__/lights.unit.test.ts +31 -511
- package/src/__tests__/loadbyguid-payload.unit.test.ts +117 -0
- package/src/__tests__/loadbyguid-texture-intern.unit.test.ts +213 -0
- package/src/__tests__/loader-extract-graceful.test.ts +146 -0
- package/src/__tests__/loader-name-survival.test.ts +213 -0
- package/src/__tests__/m3-vec-negative.unit.test.ts +3 -2
- package/src/__tests__/material-texture-uv-scale.unit.test.ts +101 -31
- package/src/__tests__/materials.unit.test.ts +10 -27
- package/src/__tests__/mesh-bin-contract.test.ts +28 -0
- package/src/__tests__/mesh-bin-skin-roundtrip.unit.test.ts +149 -0
- package/src/__tests__/mesh-bin.test.ts +38 -0
- package/src/__tests__/mesh-loader-skin-contract.unit.test.ts +120 -0
- package/src/__tests__/mesh-ssbo-grow.unit.test.ts +3 -3
- package/src/__tests__/mip-gate.unit.test.ts +1 -1
- package/src/__tests__/msaa-sprite-pixel-diff.dawn.test.ts +29 -68
- package/src/__tests__/new-kind-refs-contract.test.ts +132 -0
- package/src/__tests__/node-shims.d.ts +4 -6
- package/src/__tests__/package-promotion.test.ts +88 -0
- package/src/__tests__/package-rename.test.ts +103 -0
- package/src/__tests__/pass-selector.unit.test.ts +2 -2
- package/src/__tests__/pbr-pipeline.unit.test.ts +21 -25
- package/src/__tests__/pipeline-builder-msaa.unit.test.ts +6 -9
- package/src/__tests__/pipeline-cache-keying.unit.test.ts +6 -9
- package/src/__tests__/pipeline-spec.test.ts +16 -177
- package/src/__tests__/pipeline.unit.test.ts +154 -1693
- package/src/__tests__/point-light-shadow.dawn.test.ts +33 -42
- package/src/__tests__/point-light-shadow.unit.test.ts +19 -60
- package/src/__tests__/post-process-error-codes.unit.test.ts +4 -1
- package/src/__tests__/post-process-params-component.unit.test.ts +1 -1
- package/src/__tests__/post-process-params-extract.unit.test.ts +2 -5
- package/src/__tests__/postprocess-camera-consistency.test.ts +4 -7
- package/src/__tests__/profiler-assembly.integration.test.ts +1 -1
- package/src/__tests__/propagate-transforms.dawn.test.ts +12 -11
- package/src/__tests__/record-worldid-isolation.test.ts +7 -29
- package/src/__tests__/recover-error-exhaustive.test-d.ts +1 -1
- package/src/__tests__/render-error-exhaustive.test-d.ts +117 -71
- package/src/__tests__/render-feature-assembly.test-d.ts +20 -9
- package/src/__tests__/render-feature-prepared-graphics-docs.unit.test.ts +8 -6
- package/src/__tests__/render-feature-prepared-graphics.browser.test.ts +65 -559
- package/src/__tests__/render-feature-prepared-graphics.dawn.test.ts +57 -544
- package/src/__tests__/render-feature-prepared-graphics.fixture.ts +104 -0
- package/src/__tests__/render-feature-prepared-graphics.integration.test.ts +40 -248
- package/src/__tests__/render-feature-prepared-graphics.regression.integration.test.ts +83 -340
- package/src/__tests__/render-feature-recover.integration.test.ts +9 -49
- package/src/__tests__/render-feature-runtime-surface.test-d.ts +17 -20
- package/src/__tests__/render-schema-consumer.integration.test.ts +20 -13
- package/src/__tests__/render-schema-owner-boundary.unit.test.ts +2 -6
- package/src/__tests__/render-system-cross-world-overlay-queue.test.ts +5 -5
- package/src/__tests__/render-system-extract-dispatch-ordering.test.ts +16 -31
- package/src/__tests__/render-system-extract.test.ts +36 -51
- package/src/__tests__/render-system-extract.unit.test.ts +360 -0
- package/src/__tests__/render-system-fold-bucket.unit.test.ts +3 -5
- package/src/__tests__/render-system-fold-fallback.unit.test.ts +6 -3
- package/src/__tests__/render-system-fold-material.unit.test.ts +3 -5
- package/src/__tests__/render-system-fold-metrics.unit.test.ts +5 -5
- package/src/__tests__/render-system-fold-modegate.unit.test.ts +6 -6
- package/src/__tests__/render-system-fold.dawn.test.ts +7 -5
- package/src/__tests__/render-system-mega.test.ts +292 -190
- package/src/__tests__/render-system-owner-split-contract.test.ts +10 -32
- package/src/__tests__/render-system-record-multi-material-textureview.test.ts +59 -45
- package/src/__tests__/render-system-record-per-submesh-transparency.test.ts +23 -29
- package/src/__tests__/render-system-record.test.ts +398 -235
- package/src/__tests__/render-system-record.unit.test.ts +25 -26
- package/src/__tests__/render-system-skin-bg.unit.test.ts +8 -12
- package/src/__tests__/renderer-consumer.test-d.ts +16 -3
- package/src/__tests__/renderer-health.unit.test.ts +26 -916
- package/src/__tests__/renderer-lifecycle.integration.test.ts +19 -6
- package/src/__tests__/renderer-recover.unit.test.ts +49 -1069
- package/src/__tests__/renderer-result.test-d.ts +19 -9
- package/src/__tests__/renderer-surface.unit.test.ts +3 -5
- package/src/__tests__/renderer-test-utils.ts +56 -0
- package/src/__tests__/renderer.test-d.ts +61 -0
- package/src/__tests__/resolve-asset-handle-err.test.ts +111 -0
- package/src/__tests__/resolve-asset-handle.unit.test.ts +64 -0
- package/src/__tests__/resolve-depth-only-view.test.ts +1 -1
- package/src/__tests__/resolveName-fallback.test.ts +64 -0
- package/src/__tests__/resolveName-null-package.test.ts +38 -0
- package/src/__tests__/resolveName-unified-entry.test.ts +65 -0
- package/src/__tests__/resolveName.test.ts +64 -0
- package/src/__tests__/rhi-null-command-flow.unit.test.ts +56 -260
- package/src/__tests__/rhi-null-renderer-lifecycle.unit.test.ts +41 -169
- package/src/__tests__/roots-to-scene-asset.test.ts +199 -93
- package/src/__tests__/roundtrip-primitive.test.ts +351 -0
- package/src/__tests__/scene-bare-guid-refs-instantiate.test.ts +123 -0
- package/src/__tests__/scene-equirect-roundtrip.test.ts +103 -16
- package/src/__tests__/scene-instance-authoring.integration.test.ts +8 -0
- package/src/__tests__/scene-instance-bridge.integration.test.ts +1 -1
- package/src/__tests__/scene-instance-component.test.ts +1 -1
- package/src/__tests__/scene-mount-fixed-point.test.ts +257 -0
- package/src/__tests__/scene-mount-roundtrip.test.ts +987 -0
- package/src/__tests__/scene-mount-wrapper-roundtrip.test.ts +202 -0
- package/src/__tests__/scene-sugar-instantiate.test.ts +324 -0
- package/src/__tests__/serialize-mounts-roundtrip.test.ts +533 -0
- package/src/__tests__/serialize-scene-asset.test.ts +219 -22
- package/src/__tests__/shadow-caster-empty-schema.test.ts +3 -3
- package/src/__tests__/shadow-csm-cascade-loadop.test.ts +37 -17
- package/src/__tests__/shadow-csm-component.test.ts +3 -5
- package/src/__tests__/shadow-csm-extract.test.ts +2 -100
- package/src/__tests__/shadow-csm-orthoz.test.ts +2 -16
- package/src/__tests__/shadow-csm-runtime-vary.dawn.test.ts +19 -14
- package/src/__tests__/shadow-csm-tile-consistency.test.ts +32 -26
- package/src/__tests__/shadow-csm-ubo.dawn.test.ts +8 -49
- package/src/__tests__/shadow-csm-ubo.test.ts +3 -25
- package/src/__tests__/shadow-csm-viewport.browser.test.ts +1 -1
- package/src/__tests__/shadow-fields-observable.dawn.test.ts +67 -56
- package/src/__tests__/shadow-m1.dawn.test.ts +8 -9
- package/src/__tests__/shadow-mesh-ssbo-order.test.ts +11 -27
- package/src/__tests__/skin-errors.unit.test.ts +1 -1
- package/src/__tests__/skin-extract-getarrayview-count.unit.test.ts +7 -5
- package/src/__tests__/skylight-lazy-projection.test.ts +36 -15
- package/src/__tests__/sparse-tag-scene-roundtrip.test.ts +5 -5
- package/src/__tests__/sprite-cullmode-flip.dawn.test.ts +47 -64
- package/src/__tests__/sprite-lit-bgl-byte-identical.test.ts +15 -14
- package/src/__tests__/sprite-lit-extract-branch.test.ts +1 -1
- package/src/__tests__/sprite-lit-pipeline-cache-key.test.ts +1 -1
- package/src/__tests__/ssao-bgl.test.ts +16 -9
- package/src/__tests__/ssao-buffers.test.ts +2 -2
- package/src/__tests__/ssao-data.test.ts +2 -2
- package/src/__tests__/ssao-errors.test.ts +1 -1
- package/src/__tests__/ssao-passes.test.ts +68 -392
- package/src/__tests__/ssao-pipelines.test.ts +1 -1
- package/src/__tests__/ssao-uniform-layout.test.ts +8 -6
- package/src/__tests__/stencil-outline-pixel.dawn.test.ts +25 -17
- package/src/__tests__/swap-chain-format.unit.test.ts +5 -7
- package/src/__tests__/systems.unit.test.ts +536 -1326
- package/src/__tests__/template-game-default-api-contract.test.ts +362 -0
- package/src/__tests__/text.unit.test.ts +56 -33
- package/src/__tests__/tilemap-childed-despawn.test.ts +8 -14
- package/src/__tests__/tilemap-chunk-extract.overhang-bounds.test.ts +8 -12
- package/src/__tests__/tilemap-chunk-extract.propagate-order.test.ts +2 -1
- package/src/__tests__/tilemap-chunk-extract.test.ts +13 -17
- package/src/__tests__/tilemap-dirty-rebuild.test.ts +7 -11
- package/src/__tests__/tilemap-material-cache.test.ts +8 -13
- package/src/__tests__/tilemap-multi-atlas.test.ts +12 -32
- package/src/__tests__/tilemap-owner-boundary.unit.test.ts +5 -2
- package/src/__tests__/tilemap-region-pack.test.ts +8 -12
- package/src/__tests__/tilemap-spawn-flip-pivot.test.ts +8 -12
- package/src/__tests__/tilemap-uv-inset.test.ts +11 -14
- package/src/__tests__/tilemap-validate.test.ts +1 -1
- package/src/__tests__/tileset-asset-validate.test.ts +638 -0
- package/src/__tests__/transcode-fallback.unit.test.ts +207 -0
- package/src/__tests__/transform-hierarchy-pixel-diff.dawn.test.ts +36 -28
- package/src/__tests__/transient-fields-collect.test.ts +28 -21
- package/src/__tests__/transient-runtime-behavior.test.ts +227 -0
- package/src/__tests__/transparent-sort-tilemap-sprite-interleave.test.ts +4 -4
- package/src/__tests__/variant-selection.unit.test.ts +1 -1
- package/src/__tests__/video-extract-bindgroup.dawn.test.ts +89 -136
- package/src/__tests__/video-loader-consumption.test.ts +86 -0
- package/src/__tests__/video-loader-smoke.dawn.test.ts +60 -0
- package/src/__tests__/view-ubo-layout.browser.test.ts +0 -22
- package/src/__tests__/world-entity-key.test.ts +1 -1
- package/src/__tests__/world-scene-despawn.test.ts +1 -1
- package/src/__tests__/world-scene-instantiate.test.ts +2 -36
- package/src/__tests__/world-scene-nested.test.ts +1 -1
- package/src/__tests__/world-scene-override.test.ts +1 -1
- package/src/backend-selection.ts +69 -0
- package/src/collect-scene-asset.ts +35 -23
- package/src/components/__tests__/camera.test-d.ts +1 -1
- package/src/components/__tests__/camera.test.ts +1 -1
- package/src/components/__tests__/sprite-animation.test-d.ts +2 -2
- package/src/components/__tests__/tile-layer.test-d.ts +1 -1
- package/src/components/__tests__/tile-layer.unit.test.ts +2 -2
- package/src/createRenderer.ts +24 -36
- package/src/errors/environment.ts +1 -1
- package/src/index.ts +51 -113
- package/src/renderer-host.ts +33 -0
- package/src/scene-instances/__tests__/post-spawn-resolve-joints.unit.test.ts +1 -1
- package/src/scene-instances/index.ts +4 -0
- package/src/scene-utils/mount-override-fold.ts +3 -7
- package/src/systems/__tests__/transparent-sort.bench.ts +3 -3
- package/src/systems/sprite-animation-tick.ts +1 -1
- package/src/systems/transparent-sort.ts +38 -38
- package/src/tilemap-register-validate.ts +4 -4
- package/dist/__tests__/bind-group-cache-binding.test.d.ts +0 -2
- package/dist/__tests__/bind-group-cache-binding.test.d.ts.map +0 -1
- package/dist/__tests__/bind-group-cache-frame.test.d.ts +0 -2
- package/dist/__tests__/bind-group-cache-frame.test.d.ts.map +0 -1
- package/dist/__tests__/dawn/mesh-update.dawn.test.d.ts +0 -2
- package/dist/__tests__/dawn/mesh-update.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/dispatch-fullscreen-pass-composite-swapchain.dawn.test.d.ts +0 -2
- package/dist/__tests__/dispatch-fullscreen-pass-composite-swapchain.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/dispatch-fullscreen-pass-custom-reads.dawn.test.d.ts +0 -2
- package/dist/__tests__/dispatch-fullscreen-pass-custom-reads.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/dispatch-fullscreen-pass-depth-composite.dawn.test.d.ts +0 -2
- package/dist/__tests__/dispatch-fullscreen-pass-depth-composite.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/dispatch-fullscreen-pass-params.unit.test.d.ts +0 -2
- package/dist/__tests__/dispatch-fullscreen-pass-params.unit.test.d.ts.map +0 -1
- package/dist/__tests__/fog-producer-manifest.d.ts +0 -131
- package/dist/__tests__/fog-producer-manifest.d.ts.map +0 -1
- package/dist/__tests__/fog-producer-pixel-probe.d.ts +0 -42
- package/dist/__tests__/fog-producer-pixel-probe.d.ts.map +0 -1
- package/dist/__tests__/fog-producer-pixel.browser.test.d.ts +0 -2
- package/dist/__tests__/fog-producer-pixel.browser.test.d.ts.map +0 -1
- package/dist/__tests__/fog-producer-pixel.dawn.test.d.ts +0 -2
- package/dist/__tests__/fog-producer-pixel.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/fog-producer-real-fixture.d.ts +0 -5
- package/dist/__tests__/fog-producer-real-fixture.d.ts.map +0 -1
- package/dist/__tests__/fog-producer-vfx-effect.d.ts +0 -3
- package/dist/__tests__/fog-producer-vfx-effect.d.ts.map +0 -1
- package/dist/__tests__/fog-scene-asset.integration.test.d.ts +0 -2
- package/dist/__tests__/fog-scene-asset.integration.test.d.ts.map +0 -1
- package/dist/__tests__/gpu-resource-store-cubemap-status.test.d.ts +0 -2
- package/dist/__tests__/gpu-resource-store-cubemap-status.test.d.ts.map +0 -1
- package/dist/__tests__/gpu-resource.test.d.ts +0 -2
- package/dist/__tests__/gpu-resource.test.d.ts.map +0 -1
- package/dist/__tests__/hdrp-bgl-slots.browser.test.d.ts +0 -2
- package/dist/__tests__/hdrp-bgl-slots.browser.test.d.ts.map +0 -1
- package/dist/__tests__/hdrp-buffers.unit.test.d.ts +0 -2
- package/dist/__tests__/hdrp-buffers.unit.test.d.ts.map +0 -1
- package/dist/__tests__/hdrp-execute-filter.unit.test.d.ts +0 -2
- package/dist/__tests__/hdrp-execute-filter.unit.test.d.ts.map +0 -1
- package/dist/__tests__/hdrp-gbuffer-attachments.browser.test.d.ts +0 -2
- package/dist/__tests__/hdrp-gbuffer-attachments.browser.test.d.ts.map +0 -1
- package/dist/__tests__/hdrp-pipeline-asset-type.test-d.d.ts +0 -2
- package/dist/__tests__/hdrp-pipeline-asset-type.test-d.d.ts.map +0 -1
- package/dist/__tests__/hdrp-ssao-boundary.test.d.ts +0 -2
- package/dist/__tests__/hdrp-ssao-boundary.test.d.ts.map +0 -1
- package/dist/__tests__/hdrp-ssao-falsification.test.d.ts +0 -2
- package/dist/__tests__/hdrp-ssao-falsification.test.d.ts.map +0 -1
- package/dist/__tests__/helpers/primitive-world.d.ts +0 -8
- package/dist/__tests__/helpers/primitive-world.d.ts.map +0 -1
- package/dist/__tests__/helpers/render-asset-port.d.ts +0 -15
- package/dist/__tests__/helpers/render-asset-port.d.ts.map +0 -1
- package/dist/__tests__/helpers/scene-asset-port.d.ts +0 -9
- package/dist/__tests__/helpers/scene-asset-port.d.ts.map +0 -1
- package/dist/__tests__/material-derived-coordinates.integration.test.d.ts +0 -2
- package/dist/__tests__/material-derived-coordinates.integration.test.d.ts.map +0 -1
- package/dist/__tests__/pipeline-layout-selection.test.d.ts +0 -2
- package/dist/__tests__/pipeline-layout-selection.test.d.ts.map +0 -1
- package/dist/__tests__/post-process-reads-narrowing.test-d.d.ts +0 -2
- package/dist/__tests__/post-process-reads-narrowing.test-d.d.ts.map +0 -1
- package/dist/__tests__/post-process-register-roundtrip.dawn.test.d.ts +0 -2
- package/dist/__tests__/post-process-register-roundtrip.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/render-feature-zero-feature.browser.test.d.ts +0 -2
- package/dist/__tests__/render-feature-zero-feature.browser.test.d.ts.map +0 -1
- package/dist/__tests__/render-pipeline-trivial.dawn.test.d.ts +0 -2
- package/dist/__tests__/render-pipeline-trivial.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/shadow-csm-caster-membership.test.d.ts +0 -2
- package/dist/__tests__/shadow-csm-caster-membership.test.d.ts.map +0 -1
- package/dist/__tests__/shadow-csm-pssm.test.d.ts +0 -2
- package/dist/__tests__/shadow-csm-pssm.test.d.ts.map +0 -1
- package/dist/__tests__/shadow-csm-temporal.browser.test.d.ts +0 -2
- package/dist/__tests__/shadow-csm-temporal.browser.test.d.ts.map +0 -1
- package/dist/__tests__/shadow-csm-viewport.test.d.ts +0 -2
- package/dist/__tests__/shadow-csm-viewport.test.d.ts.map +0 -1
- package/dist/__tests__/shadow-m2.dawn.test.d.ts +0 -2
- package/dist/__tests__/shadow-m2.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/shadow-m3-calibrate-run.dawn.test.d.ts +0 -2
- package/dist/__tests__/shadow-m3-calibrate-run.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/shadow-m3-calibrate.d.ts +0 -83
- package/dist/__tests__/shadow-m3-calibrate.d.ts.map +0 -1
- package/dist/__tests__/shadow-m3.dawn.test.d.ts +0 -2
- package/dist/__tests__/shadow-m3.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/shadow-probe-control-flow.dawn.test.d.ts +0 -2
- package/dist/__tests__/shadow-probe-control-flow.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/shadow-quality-metrics.dawn.test.d.ts +0 -2
- package/dist/__tests__/shadow-quality-metrics.dawn.test.d.ts.map +0 -1
- package/dist/__tests__/temporal-off-path.unit.test.d.ts +0 -2
- package/dist/__tests__/temporal-off-path.unit.test.d.ts.map +0 -1
- package/dist/__tests__/video-cache-regression.unit.test.d.ts +0 -2
- package/dist/__tests__/video-cache-regression.unit.test.d.ts.map +0 -1
- package/dist/asset-kind.d.ts +0 -4
- package/dist/asset-kind.d.ts.map +0 -1
- package/dist/errors/sprite-animation.d.ts +0 -3
- package/dist/errors/sprite-animation.d.ts.map +0 -1
- package/dist/scene-asset-port.d.ts +0 -17
- package/dist/scene-asset-port.d.ts.map +0 -1
- package/dist/scene-collect-errors.d.ts +0 -22
- package/dist/scene-collect-errors.d.ts.map +0 -1
- package/dist/shadow-m3-calibrate.d.ts +0 -40
- package/dist/shadow-m3-calibrate.d.ts.map +0 -1
- package/src/__tests__/bind-group-cache-binding.test.ts +0 -2513
- package/src/__tests__/bind-group-cache-frame.test.ts +0 -1511
- package/src/__tests__/dispatch-fullscreen-pass-composite-swapchain.dawn.test.ts +0 -204
- package/src/__tests__/dispatch-fullscreen-pass-custom-reads.dawn.test.ts +0 -297
- package/src/__tests__/dispatch-fullscreen-pass-depth-composite.dawn.test.ts +0 -271
- package/src/__tests__/dispatch-fullscreen-pass-params.unit.test.ts +0 -321
- package/src/__tests__/fog-producer-manifest.ts +0 -162
- package/src/__tests__/fog-producer-pixel-probe.ts +0 -263
- package/src/__tests__/fog-producer-pixel.browser.test.ts +0 -26
- package/src/__tests__/fog-producer-pixel.dawn.test.ts +0 -55
- package/src/__tests__/fog-producer-real-fixture.ts +0 -805
- package/src/__tests__/fog-producer-vfx-effect.ts +0 -272
- package/src/__tests__/fog-scene-asset.integration.test.ts +0 -123
- package/src/__tests__/gpu-resource-store-cubemap-status.test.ts +0 -207
- package/src/__tests__/gpu-resource.test.ts +0 -1206
- package/src/__tests__/hdrp-bgl-slots.browser.test.ts +0 -50
- package/src/__tests__/hdrp-buffers.unit.test.ts +0 -70
- package/src/__tests__/hdrp-execute-filter.unit.test.ts +0 -200
- package/src/__tests__/hdrp-gbuffer-attachments.browser.test.ts +0 -64
- package/src/__tests__/hdrp-pipeline-asset-type.test-d.ts +0 -139
- package/src/__tests__/hdrp-ssao-boundary.test.ts +0 -237
- package/src/__tests__/hdrp-ssao-falsification.test.ts +0 -289
- package/src/__tests__/helpers/primitive-world.ts +0 -91
- package/src/__tests__/helpers/render-asset-port.ts +0 -65
- package/src/__tests__/helpers/scene-asset-port.ts +0 -23
- package/src/__tests__/material-derived-coordinates.integration.test.ts +0 -100
- package/src/__tests__/pipeline-layout-selection.test.ts +0 -298
- package/src/__tests__/post-process-reads-narrowing.test-d.ts +0 -52
- package/src/__tests__/post-process-register-roundtrip.dawn.test.ts +0 -230
- package/src/__tests__/render-feature-zero-feature.browser.test.ts +0 -152
- package/src/__tests__/render-pipeline-trivial.dawn.test.ts +0 -525
- package/src/__tests__/shadow-csm-caster-membership.test.ts +0 -232
- package/src/__tests__/shadow-csm-pssm.test.ts +0 -142
- package/src/__tests__/shadow-csm-temporal.browser.test.ts +0 -145
- package/src/__tests__/shadow-csm-viewport.test.ts +0 -74
- package/src/__tests__/shadow-m2.dawn.test.ts +0 -394
- package/src/__tests__/shadow-m3-calibrate-run.dawn.test.ts +0 -248
- package/src/__tests__/shadow-m3-calibrate.ts +0 -203
- package/src/__tests__/shadow-m3.dawn.test.ts +0 -288
- package/src/__tests__/shadow-probe-control-flow.dawn.test.ts +0 -264
- package/src/__tests__/shadow-quality-metrics.dawn.test.ts +0 -324
- package/src/__tests__/temporal-off-path.unit.test.ts +0 -69
- package/src/__tests__/video-cache-regression.unit.test.ts +0 -186
- package/src/asset-kind.ts +0 -7
- package/src/errors/sprite-animation.ts +0 -5
- package/src/scene-asset-port.ts +0 -32
- package/src/scene-collect-errors.ts +0 -30
- package/src/shadow-m3-calibrate.ts +0 -171
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// feat-20260623-world-space-video-asset M2 / w3 — AC-02: VideoAsset
|
|
2
|
+
// consumption-path type inference in a real unit test (not just test-d).
|
|
3
|
+
//
|
|
4
|
+
// AC-02 (requirements.md:76-78): `const v = await registry.loadByGuid<VideoAsset>(guid)`
|
|
5
|
+
// must return a VideoAsset where `v.url` is inferable as `string` without
|
|
6
|
+
// an `as` cast. `switch (asset.kind)` must narrow to VideoAsset on
|
|
7
|
+
// `case 'video'` with TypeScript exhaustiveness.
|
|
8
|
+
//
|
|
9
|
+
// Pattern: host-custom-kind-contract.test.ts:38-75 (loadByGuid<P> + no as cast).
|
|
10
|
+
// This is the TDD test for M2 — it verifies the consumption path works
|
|
11
|
+
// with catalogued payloads (dev path). The prod (pack-index) path is
|
|
12
|
+
// enabled by videoLoader in w4.
|
|
13
|
+
//
|
|
14
|
+
// Structural variant (b) from video-asset-union.test-d.ts moved into a real
|
|
15
|
+
// unit so the consumption path is exercised with a concrete AssetRegistry,
|
|
16
|
+
// not just a *.test-d.ts compile-only check.
|
|
17
|
+
|
|
18
|
+
import { AssetRegistry } from '@forgeax/engine-assets-runtime';
|
|
19
|
+
import { AssetGuid } from '@forgeax/engine-pack/guid';
|
|
20
|
+
import type { Asset, VideoAsset } from '@forgeax/engine-types';
|
|
21
|
+
import { describe, expect, it } from 'vitest';
|
|
22
|
+
import { makeMockShaderRegistry } from './helpers/mock-shader-registry';
|
|
23
|
+
|
|
24
|
+
function parseGuid(s: string): AssetGuid {
|
|
25
|
+
const r = AssetGuid.parse(s);
|
|
26
|
+
if (!r.ok) throw new Error(`invalid test GUID: ${s}`);
|
|
27
|
+
return r.value;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function makeRegistry(): AssetRegistry {
|
|
31
|
+
return new AssetRegistry(makeMockShaderRegistry());
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
describe('AC-02 — VideoAsset consumption path type inference (real unit)', () => {
|
|
35
|
+
it('loadByGuid<VideoAsset> returns payload with .url inferable as string, no as cast', async () => {
|
|
36
|
+
const reg = makeRegistry();
|
|
37
|
+
|
|
38
|
+
const guid = parseGuid('c0000000-0000-4000-a000-00000000a001');
|
|
39
|
+
const video: VideoAsset = { kind: 'video', url: 'test-clip.webm' };
|
|
40
|
+
|
|
41
|
+
reg.catalog(guid, video);
|
|
42
|
+
|
|
43
|
+
// loadByGuid<VideoAsset> returns Result<VideoAsset, ...>.
|
|
44
|
+
// v.url is inferable as string without any `as VideoAsset` cast.
|
|
45
|
+
const loadResult = await reg.loadByGuid<VideoAsset>(guid);
|
|
46
|
+
expect(loadResult.ok).toBe(true);
|
|
47
|
+
if (!loadResult.ok) throw new Error('unreachable');
|
|
48
|
+
const v = loadResult.value;
|
|
49
|
+
// Type inference: v.url is string; no `as` cast needed.
|
|
50
|
+
expect(v.url).toBe('test-clip.webm');
|
|
51
|
+
expect(v.kind).toBe('video');
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('switch(asset.kind) narrows to VideoAsset on case "video"', () => {
|
|
55
|
+
// The Asset union (15 members) includes VideoAsset per M1/w2.
|
|
56
|
+
// TS strict + exhaustive switch ensures this compiles only if
|
|
57
|
+
// 'video' is a recognised discriminant that narrows to VideoAsset.
|
|
58
|
+
const asset: Asset = { kind: 'video', url: 'switch-test.webm' };
|
|
59
|
+
switch (asset.kind) {
|
|
60
|
+
case 'video':
|
|
61
|
+
// Narrowed to VideoAsset — .url is string, no `as`.
|
|
62
|
+
expect(asset.url).toBe('switch-test.webm');
|
|
63
|
+
break;
|
|
64
|
+
default:
|
|
65
|
+
// TS exhaustiveness: the 14 other Asset.kind discriminants
|
|
66
|
+
// are covered by this branch; the switch would fail to compile
|
|
67
|
+
// if 'video' were absent from the union.
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it('registry.lookup<VideoAsset> returns catalogued payload with .url accessible', () => {
|
|
73
|
+
const reg = makeRegistry();
|
|
74
|
+
|
|
75
|
+
const guid = parseGuid('c0000000-0000-4000-a000-00000000a002');
|
|
76
|
+
const video: VideoAsset = { kind: 'video', url: 'lookup-test.webm' };
|
|
77
|
+
|
|
78
|
+
reg.catalog(guid, video);
|
|
79
|
+
const v = reg.lookup<VideoAsset>(guid);
|
|
80
|
+
expect(v).toBeDefined();
|
|
81
|
+
// biome-ignore lint/style/noNonNullAssertion: asserted above
|
|
82
|
+
expect(v!.url).toBe('lookup-test.webm');
|
|
83
|
+
// biome-ignore lint/style/noNonNullAssertion: asserted above
|
|
84
|
+
expect(v!.kind).toBe('video');
|
|
85
|
+
});
|
|
86
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// feat-20260623-world-space-video-asset M2 / w5 — AC-03: dawn structural
|
|
2
|
+
// smoke for the VideoAsset register + loadByGuid link.
|
|
3
|
+
//
|
|
4
|
+
// AC-03 (requirements.md): register a VideoAsset { url } via catalog,
|
|
5
|
+
// loadByGuid<VideoAsset> returns the payload successfully, process exit
|
|
6
|
+
// code 0. Structural-only — dawn-node has no HTMLVideoElement, so no
|
|
7
|
+
// pixel verification (plan-strategy S5.2).
|
|
8
|
+
//
|
|
9
|
+
// The default loader set (wireDefaultLoaders) already includes videoLoader
|
|
10
|
+
// (w4), so the AssetRegistry's built-in loaders field dispatches 'video'
|
|
11
|
+
// kind through videoLoader without manual registration.
|
|
12
|
+
|
|
13
|
+
import { AssetRegistry } from '@forgeax/engine-assets-runtime';
|
|
14
|
+
import { AssetGuid } from '@forgeax/engine-pack/guid';
|
|
15
|
+
import type { VideoAsset } from '@forgeax/engine-types';
|
|
16
|
+
import { describe, expect, it } from 'vitest';
|
|
17
|
+
import { makeMockShaderRegistry } from './helpers/mock-shader-registry';
|
|
18
|
+
|
|
19
|
+
const GUID_SMOKE_A = '00000000-0000-7000-8000-00000000a010';
|
|
20
|
+
|
|
21
|
+
function parseGuid(s: string): AssetGuid {
|
|
22
|
+
const r = AssetGuid.parse(s);
|
|
23
|
+
if (!r.ok) throw new Error(`invalid test GUID: ${s}`);
|
|
24
|
+
return r.value;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
describe('AC-03 — VideoAsset register + loadByGuid dawn structural smoke', () => {
|
|
28
|
+
it('catalog + loadByGuid<VideoAsset> round-trips payload in dawn context', async () => {
|
|
29
|
+
const reg = new AssetRegistry(makeMockShaderRegistry());
|
|
30
|
+
|
|
31
|
+
const guid = parseGuid(GUID_SMOKE_A);
|
|
32
|
+
const video: VideoAsset = { kind: 'video', url: 'test-clip.webm' };
|
|
33
|
+
|
|
34
|
+
reg.catalog(guid, video);
|
|
35
|
+
|
|
36
|
+
const result = await reg.loadByGuid<VideoAsset>(guid);
|
|
37
|
+
expect(result.ok).toBe(true);
|
|
38
|
+
if (!result.ok) throw new Error('expected ok');
|
|
39
|
+
expect(result.value.url).toBe('test-clip.webm');
|
|
40
|
+
expect(result.value.kind).toBe('video');
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('loadByGuid succeeds when videoLoader dispatches through default loader set', async () => {
|
|
44
|
+
// The AssetRegistry constructor wires the default loader set via
|
|
45
|
+
// createDefaultLoaderRegistry(), which includes videoLoader (w4).
|
|
46
|
+
// This test verifies the dispatch path works without manual
|
|
47
|
+
// registry.loaders.register(videoLoader).
|
|
48
|
+
const reg = new AssetRegistry(makeMockShaderRegistry());
|
|
49
|
+
|
|
50
|
+
// Confirm 'video' is in the registered kinds.
|
|
51
|
+
expect(reg.loaders.registeredKinds()).toContain('video');
|
|
52
|
+
expect(reg.loaders.get('video')).toBeDefined();
|
|
53
|
+
|
|
54
|
+
const guid = parseGuid('00000000-0000-7000-8000-00000000a011');
|
|
55
|
+
reg.catalog(guid, { kind: 'video', url: 'loader-dispatch.webm' } as VideoAsset);
|
|
56
|
+
|
|
57
|
+
const result = await reg.loadByGuid<VideoAsset>(guid);
|
|
58
|
+
expect(result.ok).toBe(true);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
@@ -31,10 +31,6 @@
|
|
|
31
31
|
// (w15, AC-12 / AC-14); this gate locks the byte layout itself.
|
|
32
32
|
|
|
33
33
|
import { describe, expect, it } from 'vitest';
|
|
34
|
-
// @ts-expect-error Vite provides raw text imports to the browser test runner.
|
|
35
|
-
import viewUboSource from '../../../render/src/record/view-ubo.ts?raw';
|
|
36
|
-
// @ts-expect-error Vite provides raw text imports to the browser test runner.
|
|
37
|
-
import commonViewSource from '../../../shader/src/common.wgsl?raw';
|
|
38
34
|
|
|
39
35
|
const browserReady = typeof navigator !== 'undefined' && navigator.gpu !== undefined;
|
|
40
36
|
|
|
@@ -163,21 +159,3 @@ describe('w4 view UBO 240 B std140 layout (AC-06, browser)', () => {
|
|
|
163
159
|
},
|
|
164
160
|
);
|
|
165
161
|
});
|
|
166
|
-
|
|
167
|
-
describe('Fog View ABI transport (M2)', () => {
|
|
168
|
-
it('host payload grows beyond the stale 784 B prefix and carries Fog facts', async () => {
|
|
169
|
-
const source = await viewUboSource;
|
|
170
|
-
expect(source).toContain('VIEW_PAYLOAD_FLOATS = 240');
|
|
171
|
-
expect(source).toContain('heightFalloff');
|
|
172
|
-
expect(source).toContain('maxOpacity');
|
|
173
|
-
expect(source).not.toContain('VIEW_PAYLOAD_FLOATS = 196');
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
it('shader View carries Fog in the existing uniform binding', async () => {
|
|
177
|
-
const [viewSource, commonSource] = await Promise.all([viewUboSource, commonViewSource]);
|
|
178
|
-
expect(viewSource).toContain('viewPayload[232]');
|
|
179
|
-
expect(commonSource).toContain('fog : FogViewParams');
|
|
180
|
-
expect(commonSource).toContain('@group(0) @binding(0) var<uniform> view : View;');
|
|
181
|
-
expect(commonSource).not.toContain('@group(0) @binding(10)');
|
|
182
|
-
});
|
|
183
|
-
});
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
// plan-strategy D-1/D-9
|
|
15
15
|
// requirements AC-03
|
|
16
16
|
|
|
17
|
-
import { worldEntityKey } from '@forgeax/engine-render/internal';
|
|
18
17
|
import { describe, expect, it } from 'vitest';
|
|
18
|
+
import { worldEntityKey } from '../../../render/src/record/frame-snapshot';
|
|
19
19
|
|
|
20
20
|
describe('worldEntityKey', () => {
|
|
21
21
|
// ── Identity: worldId=0 ──────────────────────────────────────────────────
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// - opts.keepDetached preserves members marked via detachSceneMember.
|
|
11
11
|
|
|
12
12
|
import { World } from '@forgeax/engine-ecs';
|
|
13
|
-
import { SceneInstance } from '@forgeax/engine-render
|
|
13
|
+
import { SceneInstance } from '@forgeax/engine-render';
|
|
14
14
|
import {
|
|
15
15
|
ChildOf,
|
|
16
16
|
Transform,
|
|
@@ -19,10 +19,9 @@
|
|
|
19
19
|
// w23: perf — 100 entities x 5 components instantiates < 50ms (plan §5.4).
|
|
20
20
|
|
|
21
21
|
import { defineComponent, World } from '@forgeax/engine-ecs';
|
|
22
|
-
import { SceneInstance } from '@forgeax/engine-render
|
|
22
|
+
import { SceneInstance } from '@forgeax/engine-render';
|
|
23
23
|
import {
|
|
24
24
|
ChildOf,
|
|
25
|
-
Children,
|
|
26
25
|
Transform,
|
|
27
26
|
worldGetSceneAssetForInstance,
|
|
28
27
|
worldInstantiateScene,
|
|
@@ -35,7 +34,7 @@ function registerSceneAsset(
|
|
|
35
34
|
asset: SceneAsset,
|
|
36
35
|
extraComponents: readonly Parameters<World['components']['register']>[0][] = [],
|
|
37
36
|
): Handle<'SceneAsset', 'shared'> {
|
|
38
|
-
for (const component of [SceneInstance, ChildOf,
|
|
37
|
+
for (const component of [SceneInstance, ChildOf, Transform, ...extraComponents]) {
|
|
39
38
|
world.components.register(component).unwrap();
|
|
40
39
|
}
|
|
41
40
|
return world.allocSharedRef('SceneAsset', asset);
|
|
@@ -193,36 +192,3 @@ describe('world.instantiateScene perf (w23) — 100 entities x 5 components', ()
|
|
|
193
192
|
expect(dt).toBeLessThan(50);
|
|
194
193
|
});
|
|
195
194
|
});
|
|
196
|
-
|
|
197
|
-
describe('M2 direct Scene owner contract', () => {
|
|
198
|
-
it('keeps successful member materialization and diagnostics on the real World path', () => {
|
|
199
|
-
const world = new World();
|
|
200
|
-
const asset: SceneAsset = {
|
|
201
|
-
kind: 'scene',
|
|
202
|
-
entities: [{ localId: 0 as never, components: { Transform: {} } }],
|
|
203
|
-
};
|
|
204
|
-
const result = worldInstantiateScene(world, registerSceneAsset(world, asset));
|
|
205
|
-
|
|
206
|
-
expect(result.ok).toBe(true);
|
|
207
|
-
if (!result.ok) return;
|
|
208
|
-
expect(result.value.diagnostics).toEqual([]);
|
|
209
|
-
const instance = world.get(result.value.root, SceneInstance);
|
|
210
|
-
expect(instance.ok).toBe(true);
|
|
211
|
-
if (instance.ok) expect(instance.value.mapping.length).toBe(1);
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
it('rolls back a failed component lookup without a partial SceneInstance root', () => {
|
|
215
|
-
const world = new World();
|
|
216
|
-
const result = worldInstantiateScene(
|
|
217
|
-
world,
|
|
218
|
-
registerSceneAsset(world, {
|
|
219
|
-
kind: 'scene',
|
|
220
|
-
entities: [{ localId: 0 as never, components: { M2MissingComponent: { value: 3 } } }],
|
|
221
|
-
} as SceneAsset),
|
|
222
|
-
);
|
|
223
|
-
|
|
224
|
-
expect(result.ok).toBe(false);
|
|
225
|
-
const query = world.query({ read: [SceneInstance] });
|
|
226
|
-
expect(query.ok ? Array.from(query.value) : []).toHaveLength(0);
|
|
227
|
-
});
|
|
228
|
-
});
|
|
@@ -16,7 +16,7 @@ import * as SceneOwner from '@forgeax/engine-scene';
|
|
|
16
16
|
// do not leak across mount instances)
|
|
17
17
|
|
|
18
18
|
import { defineComponent, World } from '@forgeax/engine-ecs';
|
|
19
|
-
import { SceneInstance } from '@forgeax/engine-render
|
|
19
|
+
import { SceneInstance } from '@forgeax/engine-render';
|
|
20
20
|
import { ChildOf } from '@forgeax/engine-scene';
|
|
21
21
|
import type { Handle, SceneAsset } from '@forgeax/engine-types';
|
|
22
22
|
import { err, ok } from '@forgeax/engine-types';
|
|
@@ -16,7 +16,7 @@ import * as SceneOwner from '@forgeax/engine-scene';
|
|
|
16
16
|
// with detail.{ comp, field, expectedType, actualType }.
|
|
17
17
|
|
|
18
18
|
import { defineComponent, World } from '@forgeax/engine-ecs';
|
|
19
|
-
import { SceneInstance } from '@forgeax/engine-render
|
|
19
|
+
import { SceneInstance } from '@forgeax/engine-render';
|
|
20
20
|
import { Transform } from '@forgeax/engine-scene';
|
|
21
21
|
import type { Handle, SceneAsset } from '@forgeax/engine-types';
|
|
22
22
|
import { ok } from '@forgeax/engine-types';
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { RendererOptions } from '@forgeax/engine-render';
|
|
2
|
+
import type { RhiBackendPack } from '@forgeax/engine-render/internal/construct-renderer';
|
|
3
|
+
import { err, ok, RhiError } from '@forgeax/engine-rhi';
|
|
4
|
+
import * as rhiWebgpu from '@forgeax/engine-rhi-webgpu';
|
|
5
|
+
|
|
6
|
+
export function loadRhiPack(
|
|
7
|
+
mod: Record<string, unknown>,
|
|
8
|
+
instrumentation?: RhiBackendPack['instrumentation'],
|
|
9
|
+
): RhiBackendPack {
|
|
10
|
+
const rhi = mod.rhi as unknown as RhiBackendPack['rhi'];
|
|
11
|
+
const createShaderModule = mod.createShaderModule as
|
|
12
|
+
| RhiBackendPack['createShaderModule']
|
|
13
|
+
| undefined;
|
|
14
|
+
const translateErrorEventToRhiError = mod.translateErrorEventToRhiError as
|
|
15
|
+
| RhiBackendPack['translateErrorEventToRhiError']
|
|
16
|
+
| undefined;
|
|
17
|
+
const rawDeviceAccessor = mod._internal_getRawDevice as unknown as
|
|
18
|
+
| RhiBackendPack['_internal_getRawDevice']
|
|
19
|
+
| undefined;
|
|
20
|
+
const backendInstrumentation = mod.instrumentation as
|
|
21
|
+
| RhiBackendPack['instrumentation']
|
|
22
|
+
| undefined;
|
|
23
|
+
const pack: RhiBackendPack = {
|
|
24
|
+
rhi,
|
|
25
|
+
...(createShaderModule === undefined ? {} : { createShaderModule }),
|
|
26
|
+
...(translateErrorEventToRhiError === undefined ? {} : { translateErrorEventToRhiError }),
|
|
27
|
+
...(rawDeviceAccessor === undefined ? {} : { _internal_getRawDevice: rawDeviceAccessor }),
|
|
28
|
+
};
|
|
29
|
+
const resolvedInstrumentation = instrumentation ?? backendInstrumentation;
|
|
30
|
+
return resolvedInstrumentation === undefined
|
|
31
|
+
? pack
|
|
32
|
+
: { ...pack, instrumentation: resolvedInstrumentation };
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Selects one backend pack; render receives only this typed owner contract. */
|
|
36
|
+
export async function loadBackendPack(
|
|
37
|
+
options: RendererOptions | undefined,
|
|
38
|
+
preferWgpu = false,
|
|
39
|
+
): Promise<
|
|
40
|
+
| { readonly ok: true; readonly value: RhiBackendPack }
|
|
41
|
+
| { readonly ok: false; readonly error: RhiError }
|
|
42
|
+
> {
|
|
43
|
+
const explicit = options?.rhi;
|
|
44
|
+
if (explicit !== undefined && explicit !== null) {
|
|
45
|
+
return ok(loadRhiPack({ rhi: explicit, ...(explicit as object) }, options?.rhiInstrumentation));
|
|
46
|
+
}
|
|
47
|
+
const nav =
|
|
48
|
+
typeof globalThis === 'undefined'
|
|
49
|
+
? undefined
|
|
50
|
+
: (globalThis as { navigator?: { gpu?: unknown } }).navigator;
|
|
51
|
+
if (!preferWgpu && nav?.gpu !== undefined && nav.gpu !== null) {
|
|
52
|
+
return ok(
|
|
53
|
+
loadRhiPack(rhiWebgpu as unknown as Record<string, unknown>, options?.rhiInstrumentation),
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
const mod = (await import('@forgeax/engine-rhi-wgpu')) as Record<string, unknown>;
|
|
58
|
+
await (mod.ensureReady as () => Promise<unknown>)();
|
|
59
|
+
return ok(loadRhiPack(mod, options?.rhiInstrumentation));
|
|
60
|
+
} catch (cause) {
|
|
61
|
+
return err(
|
|
62
|
+
new RhiError({
|
|
63
|
+
code: 'rhi-not-available',
|
|
64
|
+
expected: 'a usable RHI backend is available',
|
|
65
|
+
hint: `failed to load wgpu backend: ${String(cause)}`,
|
|
66
|
+
}),
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
// ── serialize mounts (M3) ──
|
|
25
25
|
// serializeSceneAssetToPack maps in-memory mounts[].source GUID strings to
|
|
26
26
|
// refs[] indices, memberFirst/memberCount/localId/parent numeric pass-through.
|
|
27
|
-
//
|
|
27
|
+
// _resolveSceneGuids (asset-registry.ts) carries mounts through the reload
|
|
28
28
|
// chain: recursively resolves child scene GUIDs, registers child copies in
|
|
29
29
|
// the origin reverse-index (D-7), and protects against mount-source cycles
|
|
30
30
|
// (R-9). registry.instantiate wires an identity resolver so resolved mount
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
//
|
|
33
33
|
// ── round-trip closure ──
|
|
34
34
|
// The round-trip instantiate -> collect (rootsToSceneAsset) -> serialize
|
|
35
|
-
// (serializeSceneAssetToPack) -> reload
|
|
35
|
+
// (serializeSceneAssetToPack) -> reload (loadByGuid + registry.instantiate)
|
|
36
36
|
// -> instantiate produces a structurally equivalent live subtree (AC-04).
|
|
37
37
|
// The equivalence benchmark is a second collect (fixed-point): after the
|
|
38
38
|
// first reload, the second collect output equals the first (D-9 normalization
|
|
@@ -44,6 +44,12 @@
|
|
|
44
44
|
// proven to be a mount entity, components is left undefined (one-time
|
|
45
45
|
// normalization on first reload; fixed-point from second collect onward).
|
|
46
46
|
|
|
47
|
+
import {
|
|
48
|
+
builtinMeshGuid,
|
|
49
|
+
resolveAssetHandle,
|
|
50
|
+
SceneCollectAssetGuidUnresolvedError,
|
|
51
|
+
SceneCollectEntityRefOutOfClosureError,
|
|
52
|
+
} from '@forgeax/engine-assets-runtime';
|
|
47
53
|
import {
|
|
48
54
|
componentDefinition,
|
|
49
55
|
type Component as EcsComponent,
|
|
@@ -52,9 +58,10 @@ import {
|
|
|
52
58
|
} from '@forgeax/engine-ecs';
|
|
53
59
|
import { classifyEntityField } from '@forgeax/engine-ecs/externalization';
|
|
54
60
|
import { componentSchema } from '@forgeax/engine-ecs/internal';
|
|
55
|
-
import {
|
|
61
|
+
import { SceneInstance } from '@forgeax/engine-render';
|
|
56
62
|
import { err, ok, type Result } from '@forgeax/engine-rhi';
|
|
57
63
|
import {
|
|
64
|
+
collectSubtree,
|
|
58
65
|
externalizeSceneAsset,
|
|
59
66
|
SCENE_COLLECT_PROFILE,
|
|
60
67
|
worldGetSceneAssetForInstance,
|
|
@@ -69,13 +76,13 @@ import type {
|
|
|
69
76
|
SceneEntity,
|
|
70
77
|
SceneInstanceMount,
|
|
71
78
|
} from '@forgeax/engine-types';
|
|
72
|
-
import type { SceneAssetPort } from './scene-asset-port';
|
|
73
|
-
import {
|
|
74
|
-
SceneCollectAssetGuidUnresolvedError,
|
|
75
|
-
SceneCollectEntityRefOutOfClosureError,
|
|
76
|
-
} from './scene-collect-errors';
|
|
77
79
|
import { foldMountOverrides } from './scene-utils/mount-override-fold';
|
|
78
80
|
|
|
81
|
+
/** The collector needs identity lookup, not an authoring registry implementation. */
|
|
82
|
+
export interface SceneAssetGuidLookup {
|
|
83
|
+
guidOf(asset: Asset): string | undefined;
|
|
84
|
+
}
|
|
85
|
+
|
|
79
86
|
// Shared helpers
|
|
80
87
|
function _isArrayLike(value: unknown): value is ArrayLike<unknown> {
|
|
81
88
|
// SceneAsset values are ordinary JSON arrays at the boundary. Use the
|
|
@@ -114,14 +121,16 @@ function classifyFieldSchema(fieldType: string | undefined): SchemaFieldClass |
|
|
|
114
121
|
// lives in exactly one place; `field` names the failing field in the error.
|
|
115
122
|
function _handleToGuid(
|
|
116
123
|
world: World,
|
|
117
|
-
|
|
124
|
+
registry: SceneAssetGuidLookup,
|
|
118
125
|
handle: number,
|
|
119
126
|
field: string,
|
|
120
127
|
): Result<string | undefined, SceneCollectAssetGuidUnresolvedError> {
|
|
121
128
|
if (handle === 0) return ok(undefined); // NULL sentinel
|
|
122
|
-
const
|
|
129
|
+
const builtinGuid = builtinMeshGuid(handle as unknown as Handle<string, 'shared'>);
|
|
130
|
+
if (builtinGuid !== undefined) return ok(builtinGuid);
|
|
131
|
+
const assetRes = resolveAssetHandle(world, handle as unknown as Handle<string, 'shared'>);
|
|
123
132
|
if (!assetRes.ok) return err(new SceneCollectAssetGuidUnresolvedError(field, handle));
|
|
124
|
-
const guid =
|
|
133
|
+
const guid = registry.guidOf(assetRes.value as Asset);
|
|
125
134
|
if (guid === undefined) return err(new SceneCollectAssetGuidUnresolvedError(field, handle));
|
|
126
135
|
return ok(guid);
|
|
127
136
|
}
|
|
@@ -133,14 +142,14 @@ function _handleToGuid(
|
|
|
133
142
|
// values pass through untouched.
|
|
134
143
|
function _serializeSharedFieldValue(
|
|
135
144
|
world: World,
|
|
136
|
-
|
|
145
|
+
registry: SceneAssetGuidLookup,
|
|
137
146
|
classification: SchemaFieldClass,
|
|
138
147
|
value: unknown,
|
|
139
148
|
field: string,
|
|
140
149
|
): Result<unknown, SceneCollectAssetGuidUnresolvedError> {
|
|
141
150
|
if (classification.scalar) {
|
|
142
151
|
if (typeof value !== 'number') return ok(value);
|
|
143
|
-
return _handleToGuid(world,
|
|
152
|
+
return _handleToGuid(world, registry, value, field); // undefined -> caller omits
|
|
144
153
|
}
|
|
145
154
|
if (!Array.isArray(value)) return ok(value);
|
|
146
155
|
const mapped: Array<string | number> = [];
|
|
@@ -149,7 +158,7 @@ function _serializeSharedFieldValue(
|
|
|
149
158
|
mapped.push(elem as number);
|
|
150
159
|
continue;
|
|
151
160
|
}
|
|
152
|
-
const g = _handleToGuid(world,
|
|
161
|
+
const g = _handleToGuid(world, registry, elem, field);
|
|
153
162
|
if (!g.ok) return g;
|
|
154
163
|
mapped.push(g.value ?? 0); // NULL sentinel keeps positional 0
|
|
155
164
|
}
|
|
@@ -164,7 +173,7 @@ function _serializeSharedFieldValue(
|
|
|
164
173
|
// override IS that field so it cannot be omitted). Non-shared fields pass through.
|
|
165
174
|
function _serializeOverrideValueHandles(
|
|
166
175
|
world: World,
|
|
167
|
-
|
|
176
|
+
registry: SceneAssetGuidLookup,
|
|
168
177
|
ov: MountOverride,
|
|
169
178
|
): Result<unknown, SceneCollectAssetGuidUnresolvedError> {
|
|
170
179
|
const comp = world.components.resolve(ov.comp);
|
|
@@ -172,7 +181,7 @@ function _serializeOverrideValueHandles(
|
|
|
172
181
|
if (ov.field !== undefined) {
|
|
173
182
|
const classification = schema ? classifyFieldSchema(schema[ov.field]) : undefined;
|
|
174
183
|
if (!classification || classification.kind !== 'shared') return ok(ov.value);
|
|
175
|
-
const conv = _serializeSharedFieldValue(world,
|
|
184
|
+
const conv = _serializeSharedFieldValue(world, registry, classification, ov.value, ov.field);
|
|
176
185
|
if (!conv.ok) return conv;
|
|
177
186
|
// Field-patch: keep the field even at NULL sentinel (the override IS the
|
|
178
187
|
// field); undefined only arises for a scalar handle 0 -> emit 0.
|
|
@@ -192,7 +201,7 @@ function _serializeOverrideValueHandles(
|
|
|
192
201
|
}
|
|
193
202
|
const conv = _serializeSharedFieldValue(
|
|
194
203
|
world,
|
|
195
|
-
|
|
204
|
+
registry,
|
|
196
205
|
classification,
|
|
197
206
|
src[fieldName],
|
|
198
207
|
fieldName,
|
|
@@ -251,7 +260,7 @@ export function serializeSceneAssetToPack(
|
|
|
251
260
|
* filter (not subtree pruning): graft entities under members survive as owned.
|
|
252
261
|
*/
|
|
253
262
|
export function rootsToSceneAsset(
|
|
254
|
-
|
|
263
|
+
registry: SceneAssetGuidLookup,
|
|
255
264
|
world: World,
|
|
256
265
|
roots: EntityHandle[],
|
|
257
266
|
): Result<
|
|
@@ -402,7 +411,10 @@ export function rootsToSceneAsset(
|
|
|
402
411
|
sh.error as unknown as number,
|
|
403
412
|
),
|
|
404
413
|
);
|
|
405
|
-
const pr =
|
|
414
|
+
const pr = resolveAssetHandle<SceneAsset>(
|
|
415
|
+
world,
|
|
416
|
+
sh.value as unknown as Handle<string, 'shared'>,
|
|
417
|
+
);
|
|
406
418
|
if (!pr.ok)
|
|
407
419
|
return err(
|
|
408
420
|
new SceneCollectAssetGuidUnresolvedError(
|
|
@@ -410,7 +422,7 @@ export function rootsToSceneAsset(
|
|
|
410
422
|
sh.value as unknown as number,
|
|
411
423
|
),
|
|
412
424
|
);
|
|
413
|
-
const g =
|
|
425
|
+
const g = registry.guidOf(pr.value as Asset);
|
|
414
426
|
if (g === undefined)
|
|
415
427
|
return err(
|
|
416
428
|
new SceneCollectAssetGuidUnresolvedError(
|
|
@@ -482,11 +494,11 @@ export function rootsToSceneAsset(
|
|
|
482
494
|
let mountOverrides: MountOverride[] | undefined;
|
|
483
495
|
const foldStateRes = worldGetSceneInstanceState(world, a.entityRaw as EntityHandle);
|
|
484
496
|
if (foldStateRes.ok) {
|
|
485
|
-
const rawOverrides = foldMountOverrides(world,
|
|
497
|
+
const rawOverrides = foldMountOverrides(world, foldStateRes.value);
|
|
486
498
|
if (rawOverrides.length > 0) {
|
|
487
499
|
mountOverrides = [];
|
|
488
500
|
for (const ov of rawOverrides) {
|
|
489
|
-
const convRes = _serializeOverrideValueHandles(world,
|
|
501
|
+
const convRes = _serializeOverrideValueHandles(world, registry, ov);
|
|
490
502
|
if (!convRes.ok) return convRes;
|
|
491
503
|
mountOverrides.push({
|
|
492
504
|
...ov,
|
|
@@ -664,7 +676,7 @@ export function rootsToSceneAsset(
|
|
|
664
676
|
}
|
|
665
677
|
const conv = _serializeSharedFieldValue(
|
|
666
678
|
world,
|
|
667
|
-
|
|
679
|
+
registry,
|
|
668
680
|
sharedClass,
|
|
669
681
|
normalized,
|
|
670
682
|
fieldName,
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
// Charter P3: required-field omission must produce compile-time error,
|
|
8
8
|
// not runtime silent fallback.
|
|
9
9
|
|
|
10
|
-
import { orthographic, perspective } from '@forgeax/engine-render/internal';
|
|
11
10
|
import { describe, expectTypeOf, it } from 'vitest';
|
|
11
|
+
import { orthographic, perspective } from '../../../../render/src/components/camera';
|
|
12
12
|
|
|
13
13
|
describe('perspective factory type-level', () => {
|
|
14
14
|
it('perspective({ fov: 60, aspect: 4/3 }) type-checks OK', () => {
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
// exercises the world.get path.
|
|
15
15
|
|
|
16
16
|
import { World } from '@forgeax/engine-ecs';
|
|
17
|
-
import { Camera, perspective } from '@forgeax/engine-render/internal';
|
|
18
17
|
import { describe, expect, expectTypeOf, it } from 'vitest';
|
|
18
|
+
import { Camera, perspective } from '../../../../render/src/components/camera';
|
|
19
19
|
|
|
20
20
|
describe('camera.ts autoAspect bool column (w8)', () => {
|
|
21
21
|
it('world.get(cam, Camera).autoAspect reads a JS boolean, not a number', () => {
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
|
|
46
46
|
import type { Component, SchemaOf, ShapeOf } from '@forgeax/engine-ecs';
|
|
47
47
|
import type { SpriteAnimation } from '@forgeax/engine-render/authoring';
|
|
48
|
+
import { describe, expectTypeOf, it } from 'vitest';
|
|
48
49
|
import {
|
|
49
50
|
SPRITE_PLAYBACK_MODE_CLAMP,
|
|
50
51
|
SPRITE_PLAYBACK_MODE_LOOP,
|
|
51
|
-
} from '
|
|
52
|
-
import { describe, expectTypeOf, it } from 'vitest';
|
|
52
|
+
} from '../../../../render/src/components/sprite-playback-mode';
|
|
53
53
|
|
|
54
54
|
describe('SpriteAnimation — Component token shape (AC-02 schema lock)', () => {
|
|
55
55
|
it("name literal type is 'SpriteAnimation'", () => {
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
// AGENTS.md §Component naming.
|
|
6
6
|
|
|
7
7
|
import type { EcsError, EntityHandle, SchemaOf, World } from '@forgeax/engine-ecs';
|
|
8
|
-
import { markTileLayerDirty, type TileLayer } from '@forgeax/engine-render/authoring';
|
|
9
8
|
import type { Result } from '@forgeax/engine-types';
|
|
10
9
|
import { describe, expectTypeOf, it } from 'vitest';
|
|
10
|
+
import { markTileLayerDirty, type TileLayer } from '../../../../render/src/components/tile-layer';
|
|
11
11
|
|
|
12
12
|
describe('TileLayer component schema (M0 baseline)', () => {
|
|
13
13
|
it('type-level: schema fields remain owner-defined and typed', () => {
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
// P1 (progressive disclosure — `'layer'` / `'per-cell'` reads directly).
|
|
27
27
|
|
|
28
28
|
import { World } from '@forgeax/engine-ecs';
|
|
29
|
+
import { describe, expect, expectTypeOf, it } from 'vitest';
|
|
29
30
|
import {
|
|
30
31
|
decodeSortScope,
|
|
31
32
|
encodeSortScope,
|
|
32
33
|
type SortScope,
|
|
33
34
|
TileLayer,
|
|
34
|
-
} from '
|
|
35
|
-
import { describe, expect, expectTypeOf, it } from 'vitest';
|
|
35
|
+
} from '../../../../render/src/components';
|
|
36
36
|
|
|
37
37
|
describe('TileLayer.sortScope union lock (w5, round-2 production)', () => {
|
|
38
38
|
it("'layer' is assignable to SortScope", () => {
|