@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,391 @@
|
|
|
1
|
+
import * as SceneOwner from '@forgeax/engine-scene';
|
|
2
|
+
// collect-scene-mount-collapse.test.ts — M2 mount-collapse tests
|
|
3
|
+
// (feat-20260703-collect-nested-sceneinstance-to-mount-roundtrip).
|
|
4
|
+
//
|
|
5
|
+
// M1T7 AUDIT (feat-20260707-engine-world-clone-transient-for-editor-ssot):
|
|
6
|
+
// Classification: (c) unaffected — Children used only for runtime hierarchy
|
|
7
|
+
// wiring (w.get, w.addComponent), never for collect output assertions.
|
|
8
|
+
// SceneInstance absence assertions at lines 87-89 / 137-140 check that
|
|
9
|
+
// SceneInstance is absent from output — already true with old hardcoded skip
|
|
10
|
+
// and preserved by the new transient check. No test modification required.
|
|
11
|
+
|
|
12
|
+
import type { Asset } from '@forgeax/engine-assets-runtime';
|
|
13
|
+
import { AssetRegistry, resolveAssetHandle } from '@forgeax/engine-assets-runtime';
|
|
14
|
+
import { defineComponent, type EntityHandle, World } from '@forgeax/engine-ecs';
|
|
15
|
+
import { AssetGuid } from '@forgeax/engine-pack/guid';
|
|
16
|
+
import { SceneInstance } from '@forgeax/engine-render';
|
|
17
|
+
import { ChildOf, Children } from '@forgeax/engine-scene';
|
|
18
|
+
import type { Handle, SceneAsset } from '@forgeax/engine-types';
|
|
19
|
+
import { err, ok } from '@forgeax/engine-types';
|
|
20
|
+
import { describe, expect, it } from 'vitest';
|
|
21
|
+
import { rootsToSceneAsset } from '../collect-scene-asset';
|
|
22
|
+
import { makeMockShaderRegistry } from './helpers/mock-shader-registry';
|
|
23
|
+
import { registerSceneComponents } from './helpers/register-scene-components';
|
|
24
|
+
|
|
25
|
+
function mkReg() {
|
|
26
|
+
return new AssetRegistry(makeMockShaderRegistry());
|
|
27
|
+
}
|
|
28
|
+
function pg(s: string): AssetGuid {
|
|
29
|
+
const r = AssetGuid.parse(s);
|
|
30
|
+
if (!r.ok) throw new Error(`bad GUID`);
|
|
31
|
+
return r.value;
|
|
32
|
+
}
|
|
33
|
+
function soi(reg: AssetRegistry, p: SceneAsset, g: string) {
|
|
34
|
+
(reg as unknown as { _originIndex: WeakMap<SceneAsset, string> })._originIndex.set(p, g);
|
|
35
|
+
}
|
|
36
|
+
function rs(w: World, a: SceneAsset) {
|
|
37
|
+
registerSceneComponents(w);
|
|
38
|
+
return w.allocSharedRef('SceneAsset', a);
|
|
39
|
+
}
|
|
40
|
+
function wr(w: World, ph: Handle<'SceneAsset', 'shared'>, ch: Handle<'SceneAsset', 'shared'>) {
|
|
41
|
+
SceneOwner.worldSetSceneAssetResolver(w, (_s, pH) =>
|
|
42
|
+
(pH as unknown as number) === (ph as unknown as number)
|
|
43
|
+
? ok(ch)
|
|
44
|
+
: err({ code: 'asset-not-found' }),
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
function rcoAll(reg: AssetRegistry, w: World, root: EntityHandle) {
|
|
48
|
+
for (const e of w.iterDescendants(root)) {
|
|
49
|
+
if (!w.get(e, SceneInstance).ok) continue;
|
|
50
|
+
const s = SceneOwner.worldGetSceneAssetForInstance(w, e);
|
|
51
|
+
if (!s.ok) continue;
|
|
52
|
+
const c = resolveAssetHandle<SceneAsset>(w, s.value as unknown as Handle<string, 'shared'>);
|
|
53
|
+
if (!c.ok) continue;
|
|
54
|
+
soi(reg, c.value as SceneAsset, G1);
|
|
55
|
+
soi(reg, c.value as SceneAsset, G2);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const G1 = 'cbe42beb-8975-5096-b3a1-3dda4cb4c077';
|
|
60
|
+
const G2 = 'f6af7007-158f-4d92-9e47-93bf2f213e1f';
|
|
61
|
+
|
|
62
|
+
// ── m2-t1: Form 2 — root itself is SceneInstance ──
|
|
63
|
+
describe('m2-t1 — Form 2: root itself is SceneInstance', () => {
|
|
64
|
+
it('whole tree collapses: root stripped, child mount excludes members', () => {
|
|
65
|
+
const reg = mkReg();
|
|
66
|
+
const w = new World();
|
|
67
|
+
const child: SceneAsset = {
|
|
68
|
+
kind: 'scene',
|
|
69
|
+
entities: [{ localId: 0 as never, components: { Transform: {} } }],
|
|
70
|
+
};
|
|
71
|
+
reg.catalog(pg(G1), child as Asset);
|
|
72
|
+
|
|
73
|
+
const parent: SceneAsset = {
|
|
74
|
+
kind: 'scene',
|
|
75
|
+
entities: [{ localId: 0 as never, components: { Transform: { pos: [10, 0, 0] } } }],
|
|
76
|
+
mounts: [{ localId: 1 as never, source: 0, memberFirst: 2 as never, memberCount: 1 }],
|
|
77
|
+
};
|
|
78
|
+
const ch = rs(w, child);
|
|
79
|
+
const ph = rs(w, parent);
|
|
80
|
+
wr(w, ph, ch);
|
|
81
|
+
|
|
82
|
+
const inst = SceneOwner.worldInstantiateScene(w, ph);
|
|
83
|
+
expect(inst.ok).toBe(true);
|
|
84
|
+
if (!inst.ok) return;
|
|
85
|
+
rcoAll(reg, w, inst.value.root);
|
|
86
|
+
|
|
87
|
+
const res = rootsToSceneAsset(reg, w, [inst.value.root]);
|
|
88
|
+
expect(res.ok).toBe(true);
|
|
89
|
+
if (!res.ok) return;
|
|
90
|
+
|
|
91
|
+
// Root is SceneInstance → root's own entities are owned.
|
|
92
|
+
// Child's member entities are excluded.
|
|
93
|
+
const s = res.value;
|
|
94
|
+
expect(s.entities.length).toBeGreaterThanOrEqual(1); // parent's own entity
|
|
95
|
+
for (const e of s.entities) {
|
|
96
|
+
expect(
|
|
97
|
+
(e.components as Record<string, Record<string, unknown>>).SceneInstance,
|
|
98
|
+
).toBeUndefined();
|
|
99
|
+
}
|
|
100
|
+
// Child anchor produces a mount.
|
|
101
|
+
expect(s.mounts).toBeDefined();
|
|
102
|
+
expect(s.mounts?.length).toBe(1);
|
|
103
|
+
expect(s.mounts?.[0]?.source).toBe(G1);
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
// ── m2-t2: Form 1 — deep anchor ──
|
|
108
|
+
describe('m2-t2 — Form 1: deep anchor with ChildOf parent', () => {
|
|
109
|
+
it('anchor subtree collapses, ancestors preserved as owned', () => {
|
|
110
|
+
const reg = mkReg();
|
|
111
|
+
const w = new World();
|
|
112
|
+
const child: SceneAsset = {
|
|
113
|
+
kind: 'scene',
|
|
114
|
+
entities: [
|
|
115
|
+
{ localId: 0 as never, components: { Transform: { pos: [1, 0, 0] } } },
|
|
116
|
+
{ localId: 1 as never, components: { Transform: { pos: [2, 0, 0] } } },
|
|
117
|
+
],
|
|
118
|
+
};
|
|
119
|
+
reg.catalog(pg(G1), child as Asset);
|
|
120
|
+
const ch = rs(w, child);
|
|
121
|
+
|
|
122
|
+
const outerRes = w.spawn({ component: ChildOf, data: { parent: 0 as EntityHandle } });
|
|
123
|
+
expect(outerRes.ok).toBe(true);
|
|
124
|
+
if (!outerRes.ok) return;
|
|
125
|
+
const outerE = outerRes.value;
|
|
126
|
+
|
|
127
|
+
const ci = SceneOwner.worldInstantiateScene(w, ch, outerE);
|
|
128
|
+
expect(ci.ok).toBe(true);
|
|
129
|
+
if (!ci.ok) return;
|
|
130
|
+
rcoAll(reg, w, ci.value.root);
|
|
131
|
+
|
|
132
|
+
// Wire Children on outer root so collectSubtree discovers anchor.
|
|
133
|
+
const ec = w.get(outerE, Children as never);
|
|
134
|
+
if (!ec.ok)
|
|
135
|
+
w.addComponent(outerE, { component: Children, data: { entities: [ci.value.root] } } as never);
|
|
136
|
+
|
|
137
|
+
const res = rootsToSceneAsset(reg, w, [outerE]);
|
|
138
|
+
expect(res.ok).toBe(true);
|
|
139
|
+
if (!res.ok) return;
|
|
140
|
+
|
|
141
|
+
// Outer root is NOT SceneInstance → no mount for it.
|
|
142
|
+
// Child anchor produces a mount; its member entities excluded from owned.
|
|
143
|
+
expect(res.value.mounts).toBeDefined();
|
|
144
|
+
expect(res.value.mounts?.length).toBe(1);
|
|
145
|
+
expect(res.value.mounts?.[0]?.source).toBe(G1);
|
|
146
|
+
for (const e of res.value.entities) {
|
|
147
|
+
expect(
|
|
148
|
+
(e.components as Record<string, Record<string, unknown>>).SceneInstance,
|
|
149
|
+
).toBeUndefined();
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
// ── m2-t3: AC-03 window invariants ──
|
|
155
|
+
describe('m2-t3 — AC-03 window invariants', () => {
|
|
156
|
+
it('mount window covers full totalSlots', () => {
|
|
157
|
+
const reg = mkReg();
|
|
158
|
+
const w = new World();
|
|
159
|
+
const ca: SceneAsset = {
|
|
160
|
+
kind: 'scene',
|
|
161
|
+
entities: [{ localId: 0 as never, components: { Transform: {} } }],
|
|
162
|
+
};
|
|
163
|
+
reg.catalog(pg(G1), ca as Asset);
|
|
164
|
+
const ch = rs(w, ca);
|
|
165
|
+
|
|
166
|
+
const pa: SceneAsset = {
|
|
167
|
+
kind: 'scene',
|
|
168
|
+
entities: [{ localId: 0 as never, components: { Transform: {} } }],
|
|
169
|
+
mounts: [{ localId: 1 as never, source: 0, memberFirst: 2 as never, memberCount: 1 }],
|
|
170
|
+
};
|
|
171
|
+
const ph = rs(w, pa);
|
|
172
|
+
wr(w, ph, ch);
|
|
173
|
+
const inst = SceneOwner.worldInstantiateScene(w, ph);
|
|
174
|
+
expect(inst.ok).toBe(true);
|
|
175
|
+
if (!inst.ok) return;
|
|
176
|
+
rcoAll(reg, w, inst.value.root);
|
|
177
|
+
|
|
178
|
+
const res = rootsToSceneAsset(reg, w, [inst.value.root]);
|
|
179
|
+
expect(res.ok).toBe(true);
|
|
180
|
+
if (!res.ok) return;
|
|
181
|
+
expect(res.value.mounts?.[0]?.memberCount).toBe(1);
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
it('sparse localId does not shrink window', () => {
|
|
185
|
+
const reg = mkReg();
|
|
186
|
+
const w = new World();
|
|
187
|
+
const ca: SceneAsset = {
|
|
188
|
+
kind: 'scene',
|
|
189
|
+
entities: [
|
|
190
|
+
{ localId: 0 as never, components: { Transform: { pos: [1, 0, 0] } } },
|
|
191
|
+
{ localId: 1 as never, components: { Transform: { pos: [2, 0, 0] } } },
|
|
192
|
+
],
|
|
193
|
+
};
|
|
194
|
+
reg.catalog(pg(G1), ca as Asset);
|
|
195
|
+
const ch = rs(w, ca);
|
|
196
|
+
|
|
197
|
+
const pa: SceneAsset = {
|
|
198
|
+
kind: 'scene',
|
|
199
|
+
entities: [{ localId: 0 as never, components: { Transform: {} } }],
|
|
200
|
+
mounts: [{ localId: 1 as never, source: 0, memberFirst: 2 as never, memberCount: 2 }],
|
|
201
|
+
};
|
|
202
|
+
const ph = rs(w, pa);
|
|
203
|
+
wr(w, ph, ch);
|
|
204
|
+
const inst = SceneOwner.worldInstantiateScene(w, ph);
|
|
205
|
+
expect(inst.ok).toBe(true);
|
|
206
|
+
if (!inst.ok) return;
|
|
207
|
+
rcoAll(reg, w, inst.value.root);
|
|
208
|
+
|
|
209
|
+
// Despawn one member to create sparse mapping.
|
|
210
|
+
// Member slots start at memberFirst=2 (mount entity is at mapping[1]).
|
|
211
|
+
// Despawning the mount entity would cascade-kill the child synthetic root
|
|
212
|
+
// (ChildOf.linkedSpawn=true), erasing the anchor entirely.
|
|
213
|
+
const si = w.get(inst.value.root, SceneInstance);
|
|
214
|
+
if (si.ok && si.value.mapping[2] !== undefined) w.despawn(si.value.mapping[2] as EntityHandle);
|
|
215
|
+
|
|
216
|
+
const res = rootsToSceneAsset(reg, w, [inst.value.root]);
|
|
217
|
+
expect(res.ok).toBe(true);
|
|
218
|
+
if (!res.ok) return;
|
|
219
|
+
expect(res.value.mounts?.[0]?.memberCount).toBe(2); // totalSlots, not live count
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
it('multiple child mounts have non-overlapping windows', () => {
|
|
223
|
+
const reg = mkReg();
|
|
224
|
+
const w = new World();
|
|
225
|
+
const cA: SceneAsset = {
|
|
226
|
+
kind: 'scene',
|
|
227
|
+
entities: [{ localId: 0 as never, components: { Transform: {} } }],
|
|
228
|
+
};
|
|
229
|
+
const cB: SceneAsset = {
|
|
230
|
+
kind: 'scene',
|
|
231
|
+
entities: [
|
|
232
|
+
{ localId: 0 as never, components: { Transform: {} } },
|
|
233
|
+
{ localId: 1 as never, components: { Transform: {} } },
|
|
234
|
+
],
|
|
235
|
+
};
|
|
236
|
+
reg.catalog(pg(G1), cA as Asset);
|
|
237
|
+
reg.catalog(pg(G2), cB as Asset);
|
|
238
|
+
const hA = rs(w, cA);
|
|
239
|
+
const hB = rs(w, cB);
|
|
240
|
+
|
|
241
|
+
const pa: SceneAsset = {
|
|
242
|
+
kind: 'scene',
|
|
243
|
+
entities: [{ localId: 0 as never, components: { Transform: {} } }],
|
|
244
|
+
mounts: [
|
|
245
|
+
{ localId: 1 as never, source: 0, memberFirst: 3 as never, memberCount: 1 },
|
|
246
|
+
{ localId: 2 as never, source: 1, memberFirst: 4 as never, memberCount: 2 },
|
|
247
|
+
],
|
|
248
|
+
};
|
|
249
|
+
const ph = rs(w, pa);
|
|
250
|
+
SceneOwner.worldSetSceneAssetResolver(w, (sIdx, pH) =>
|
|
251
|
+
(pH as unknown as number) !== (ph as unknown as number)
|
|
252
|
+
? err({ code: 'asset-not-found' })
|
|
253
|
+
: sIdx === 0
|
|
254
|
+
? ok(hA)
|
|
255
|
+
: ok(hB),
|
|
256
|
+
);
|
|
257
|
+
|
|
258
|
+
const inst = SceneOwner.worldInstantiateScene(w, ph);
|
|
259
|
+
expect(inst.ok).toBe(true);
|
|
260
|
+
if (!inst.ok) return;
|
|
261
|
+
for (const e of w.iterDescendants(inst.value.root)) {
|
|
262
|
+
if (!w.get(e, SceneInstance).ok) continue;
|
|
263
|
+
const s = SceneOwner.worldGetSceneAssetForInstance(w, e);
|
|
264
|
+
if (!s.ok) continue;
|
|
265
|
+
const c = resolveAssetHandle<SceneAsset>(w, s.value as unknown as Handle<string, 'shared'>);
|
|
266
|
+
if (!c.ok) continue;
|
|
267
|
+
soi(reg, c.value as SceneAsset, c.value.entities.length === 1 ? G1 : G2);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
const res = rootsToSceneAsset(reg, w, [inst.value.root]);
|
|
271
|
+
expect(res.ok).toBe(true);
|
|
272
|
+
if (!res.ok) return;
|
|
273
|
+
|
|
274
|
+
const ms = res.value.mounts ?? [];
|
|
275
|
+
expect(ms.length).toBe(2);
|
|
276
|
+
const W = ms
|
|
277
|
+
.map((m) => ({ f: m.memberFirst as number, c: m.memberCount }))
|
|
278
|
+
.sort((a, b) => a.f - b.f);
|
|
279
|
+
for (let i = 0; i < W.length - 1; i++) {
|
|
280
|
+
const cur = W[i];
|
|
281
|
+
const next = W[i + 1];
|
|
282
|
+
if (!cur || !next) throw new Error('window index out of range');
|
|
283
|
+
expect(cur.f + cur.c).toBeLessThanOrEqual(next.f);
|
|
284
|
+
}
|
|
285
|
+
const owned = new Set(res.value.entities.map((e) => e.localId as unknown as number));
|
|
286
|
+
for (const w of W)
|
|
287
|
+
for (let lid = w.f; lid < w.f + w.c; lid++) expect(owned.has(lid)).toBe(false);
|
|
288
|
+
});
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
// ── m2-t4: Graft preservation ──
|
|
292
|
+
describe('m2-t4 — graft preservation', () => {
|
|
293
|
+
it('graft entity under a member survives as owned', () => {
|
|
294
|
+
const reg = mkReg();
|
|
295
|
+
const w = new World();
|
|
296
|
+
const ca: SceneAsset = {
|
|
297
|
+
kind: 'scene',
|
|
298
|
+
entities: [{ localId: 0 as never, components: { Transform: {} } }],
|
|
299
|
+
};
|
|
300
|
+
reg.catalog(pg(G1), ca as Asset);
|
|
301
|
+
const ch = rs(w, ca);
|
|
302
|
+
|
|
303
|
+
const pa: SceneAsset = {
|
|
304
|
+
kind: 'scene',
|
|
305
|
+
entities: [{ localId: 0 as never, components: { Transform: {} } }],
|
|
306
|
+
mounts: [{ localId: 1 as never, source: 0, memberFirst: 2 as never, memberCount: 1 }],
|
|
307
|
+
};
|
|
308
|
+
const ph = rs(w, pa);
|
|
309
|
+
wr(w, ph, ch);
|
|
310
|
+
const inst = SceneOwner.worldInstantiateScene(w, ph);
|
|
311
|
+
expect(inst.ok).toBe(true);
|
|
312
|
+
if (!inst.ok) return;
|
|
313
|
+
const root = inst.value.root;
|
|
314
|
+
rcoAll(reg, w, root);
|
|
315
|
+
|
|
316
|
+
const si = w.get(root, SceneInstance);
|
|
317
|
+
if (!si.ok) return;
|
|
318
|
+
const member = si.value.mapping[0];
|
|
319
|
+
if (member === undefined) return;
|
|
320
|
+
|
|
321
|
+
// Graft a prop entity under the member.
|
|
322
|
+
const prop = w.spawn({ component: ChildOf, data: { parent: member as EntityHandle } });
|
|
323
|
+
expect(prop.ok).toBe(true);
|
|
324
|
+
if (!prop.ok) return;
|
|
325
|
+
w.addComponent(
|
|
326
|
+
member as EntityHandle,
|
|
327
|
+
{ component: Children, data: { entities: [prop.value] } } as never,
|
|
328
|
+
);
|
|
329
|
+
|
|
330
|
+
const res = rootsToSceneAsset(reg, w, [root]);
|
|
331
|
+
expect(res.ok).toBe(true);
|
|
332
|
+
if (!res.ok) return;
|
|
333
|
+
|
|
334
|
+
// Prop should survive as owned entity (not eaten by mount).
|
|
335
|
+
let propFound = false;
|
|
336
|
+
for (const e of res.value.entities) {
|
|
337
|
+
if ((e.components as Record<string, Record<string, unknown>>).ChildOf) {
|
|
338
|
+
propFound = true;
|
|
339
|
+
break;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
expect(propFound).toBe(true);
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
it('unmappable cross-window entity ref fails fast', () => {
|
|
346
|
+
const reg = mkReg();
|
|
347
|
+
const w = new World();
|
|
348
|
+
const ca: SceneAsset = {
|
|
349
|
+
kind: 'scene',
|
|
350
|
+
entities: [{ localId: 0 as never, components: { Transform: {} } }],
|
|
351
|
+
};
|
|
352
|
+
reg.catalog(pg(G1), ca as Asset);
|
|
353
|
+
const ch = rs(w, ca);
|
|
354
|
+
|
|
355
|
+
const pa: SceneAsset = {
|
|
356
|
+
kind: 'scene',
|
|
357
|
+
entities: [{ localId: 0 as never, components: { Transform: {} } }],
|
|
358
|
+
mounts: [{ localId: 1 as never, source: 0, memberFirst: 2 as never, memberCount: 1 }],
|
|
359
|
+
};
|
|
360
|
+
const ph = rs(w, pa);
|
|
361
|
+
wr(w, ph, ch);
|
|
362
|
+
const inst = SceneOwner.worldInstantiateScene(w, ph);
|
|
363
|
+
expect(inst.ok).toBe(true);
|
|
364
|
+
if (!inst.ok) return;
|
|
365
|
+
const root = inst.value.root;
|
|
366
|
+
rcoAll(reg, w, root);
|
|
367
|
+
|
|
368
|
+
const si = w.get(root, SceneInstance);
|
|
369
|
+
if (!si.ok) return;
|
|
370
|
+
const member = si.value.mapping[0];
|
|
371
|
+
if (member === undefined) return;
|
|
372
|
+
|
|
373
|
+
// Graft with ChildOf.parent pointing outside closure.
|
|
374
|
+
// Spawn `outside` without ChildOf — no parent linkage, so it stays
|
|
375
|
+
// unreachable from the root subtree and _rlid(graft.parent) fails.
|
|
376
|
+
const outside = w.spawn();
|
|
377
|
+
expect(outside.ok).toBe(true);
|
|
378
|
+
if (!outside.ok) return;
|
|
379
|
+
|
|
380
|
+
const CrossWindowRef = defineComponent('CrossWindowRef', { target: 'entity' });
|
|
381
|
+
registerSceneComponents(w, [CrossWindowRef]);
|
|
382
|
+
const graft = w.spawn(
|
|
383
|
+
{ component: ChildOf, data: { parent: member as EntityHandle } },
|
|
384
|
+
{ component: CrossWindowRef, data: { target: outside.value } },
|
|
385
|
+
);
|
|
386
|
+
expect(graft.ok).toBe(true);
|
|
387
|
+
if (!graft.ok) return;
|
|
388
|
+
const res = rootsToSceneAsset(reg, w, [root]);
|
|
389
|
+
expect(res.ok).toBe(false); // fail-fast
|
|
390
|
+
});
|
|
391
|
+
});
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
// TDD phase "red": collect-subtree.ts does not exist yet.
|
|
9
9
|
|
|
10
10
|
import { type EntityHandle, World } from '@forgeax/engine-ecs';
|
|
11
|
-
import { collectSubtree } from '@forgeax/engine-
|
|
12
|
-
import { ChildOf, Name } from '@forgeax/engine-scene';
|
|
11
|
+
import { ChildOf, collectSubtree, Name } from '@forgeax/engine-scene';
|
|
13
12
|
import { describe, expect, it } from 'vitest';
|
|
14
13
|
|
|
15
14
|
// Build a chain of N entities linked by Children.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as SceneOwner from '@forgeax/engine-scene';
|
|
2
|
+
|
|
2
3
|
// feat-20260707-engine-world-clone-transient-for-editor-ssot M1 / m1t3:
|
|
3
4
|
// Children-absent collect test (AC-04).
|
|
4
5
|
//
|
|
@@ -11,12 +12,18 @@ import * as SceneOwner from '@forgeax/engine-scene';
|
|
|
11
12
|
// the bug exists. After m1t6 fixes collect to skip transient components,
|
|
12
13
|
// the test must PASS.
|
|
13
14
|
|
|
15
|
+
import { AssetRegistry } from '@forgeax/engine-assets-runtime';
|
|
14
16
|
import { World } from '@forgeax/engine-ecs';
|
|
17
|
+
import { AssetGuid } from '@forgeax/engine-pack/guid';
|
|
15
18
|
import type { LocalEntityId, SceneAsset, SceneEntity } from '@forgeax/engine-types';
|
|
16
19
|
import { describe, expect, it } from 'vitest';
|
|
17
20
|
import { rootsToSceneAsset } from '../collect-scene-asset';
|
|
21
|
+
import { makeMockShaderRegistry } from './helpers/mock-shader-registry';
|
|
18
22
|
import { registerSceneComponents } from './helpers/register-scene-components';
|
|
19
|
-
|
|
23
|
+
|
|
24
|
+
function makeRegistry(): AssetRegistry {
|
|
25
|
+
return new AssetRegistry(makeMockShaderRegistry());
|
|
26
|
+
}
|
|
20
27
|
|
|
21
28
|
function localId(n: number): LocalEntityId {
|
|
22
29
|
return n as LocalEntityId;
|
|
@@ -38,14 +45,16 @@ describe('m1t3 — Children absent from collect (AC-04)', () => {
|
|
|
38
45
|
|
|
39
46
|
const world = new World();
|
|
40
47
|
registerSceneComponents(world);
|
|
41
|
-
const
|
|
48
|
+
const reg = makeRegistry();
|
|
49
|
+
const sg = AssetGuid.parse('00000000-0000-0000-0000-000000000000');
|
|
50
|
+
if (sg.ok) reg.catalog(sg.value, asset);
|
|
42
51
|
// biome-ignore lint/suspicious/noExplicitAny: branded type mismatch
|
|
43
52
|
const handle = world.allocSharedRef('SceneAsset', asset) as any;
|
|
44
53
|
const res = SceneOwner.worldInstantiateScene(world, handle);
|
|
45
54
|
expect(res.ok).toBe(true);
|
|
46
55
|
if (!res.ok) return;
|
|
47
56
|
|
|
48
|
-
const collected = rootsToSceneAsset(
|
|
57
|
+
const collected = rootsToSceneAsset(reg, world, [res.value.root]);
|
|
49
58
|
expect(collected.ok).toBe(true);
|
|
50
59
|
if (!collected.ok) return;
|
|
51
60
|
|
|
@@ -83,10 +92,13 @@ describe('m1t3 — Children absent from collect (AC-04)', () => {
|
|
|
83
92
|
|
|
84
93
|
const world = new World();
|
|
85
94
|
registerSceneComponents(world);
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
95
|
+
const reg = makeRegistry();
|
|
96
|
+
const sg0 = AssetGuid.parse('00000000-0000-0000-0000-000000000000');
|
|
97
|
+
const sg1 = AssetGuid.parse('11111111-1111-1111-1111-111111111111');
|
|
98
|
+
const sg2 = AssetGuid.parse('22222222-2222-2222-2222-222222222222');
|
|
99
|
+
if (sg0.ok) reg.catalog(sg0.value, leafAsset);
|
|
100
|
+
if (sg1.ok) reg.catalog(sg1.value, midAsset);
|
|
101
|
+
if (sg2.ok) reg.catalog(sg2.value, outerAsset);
|
|
90
102
|
|
|
91
103
|
// biome-ignore lint/suspicious/noExplicitAny: branded type mismatch
|
|
92
104
|
const leafH = world.allocSharedRef('SceneAsset', leafAsset) as any;
|
|
@@ -113,7 +125,7 @@ describe('m1t3 — Children absent from collect (AC-04)', () => {
|
|
|
113
125
|
if (!leafInst.ok) return;
|
|
114
126
|
|
|
115
127
|
// Collect from outer root.
|
|
116
|
-
const collected = rootsToSceneAsset(
|
|
128
|
+
const collected = rootsToSceneAsset(reg, world, [outerInst.value.root]);
|
|
117
129
|
expect(collected.ok).toBe(true);
|
|
118
130
|
if (!collected.ok) return;
|
|
119
131
|
|
|
@@ -136,14 +148,16 @@ describe('m1t3 — Children absent from collect (AC-04)', () => {
|
|
|
136
148
|
|
|
137
149
|
const world = new World();
|
|
138
150
|
registerSceneComponents(world);
|
|
139
|
-
const
|
|
151
|
+
const reg = makeRegistry();
|
|
152
|
+
const sg = AssetGuid.parse('00000000-0000-0000-0000-000000000000');
|
|
153
|
+
if (sg.ok) reg.catalog(sg.value, asset);
|
|
140
154
|
// biome-ignore lint/suspicious/noExplicitAny: branded type mismatch
|
|
141
155
|
const handle = world.allocSharedRef('SceneAsset', asset) as any;
|
|
142
156
|
const res = SceneOwner.worldInstantiateScene(world, handle);
|
|
143
157
|
expect(res.ok).toBe(true);
|
|
144
158
|
if (!res.ok) return;
|
|
145
159
|
|
|
146
|
-
const collected = rootsToSceneAsset(
|
|
160
|
+
const collected = rootsToSceneAsset(reg, world, [res.value.root]);
|
|
147
161
|
expect(collected.ok).toBe(true);
|
|
148
162
|
if (!collected.ok) return;
|
|
149
163
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as SceneOwner from '@forgeax/engine-scene';
|
|
2
|
+
|
|
1
3
|
// feat-20260707-engine-world-clone-transient-for-editor-ssot M1 / m1t4:
|
|
2
4
|
// AC-05 roundtrip regression test (red-first — falsification anchor).
|
|
3
5
|
//
|
|
@@ -10,31 +12,33 @@
|
|
|
10
12
|
// (b) Each child's ChildOf.parent points back (bijective check).
|
|
11
13
|
// (c) Degenerate: zero parent-child scene round-trips correctly.
|
|
12
14
|
|
|
15
|
+
import { AssetRegistry } from '@forgeax/engine-assets-runtime';
|
|
13
16
|
import type { EntityHandle } from '@forgeax/engine-ecs';
|
|
14
17
|
import { World } from '@forgeax/engine-ecs';
|
|
18
|
+
import { AssetGuid } from '@forgeax/engine-pack/guid';
|
|
19
|
+
import { ChildOf, Children, propagateTransforms, Transform } from '@forgeax/engine-scene';
|
|
15
20
|
import type { LocalEntityId, SceneAsset } from '@forgeax/engine-types';
|
|
16
21
|
import { describe, expect, it } from 'vitest';
|
|
17
|
-
import '@forgeax/engine-render/internal';
|
|
18
|
-
import * as SceneOwner from '@forgeax/engine-scene';
|
|
19
|
-
import { ChildOf, Children, propagateTransforms, Transform } from '@forgeax/engine-scene';
|
|
20
22
|
import { rootsToSceneAsset } from '../collect-scene-asset';
|
|
23
|
+
import { makeMockShaderRegistry } from './helpers/mock-shader-registry';
|
|
21
24
|
import { registerSceneComponents } from './helpers/register-scene-components';
|
|
22
|
-
import { createTestSceneAssetStore } from './helpers/scene-asset-port';
|
|
23
25
|
|
|
24
26
|
// Read the resolved world mat4 (column-major 16 floats) from the Transform
|
|
25
27
|
// world column array view.
|
|
26
28
|
function worldOf(world: World, entity: EntityHandle): Float32Array {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
return world.get(entity, Transform).unwrap().world;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function makeRegistry(): AssetRegistry {
|
|
33
|
+
return new AssetRegistry(makeMockShaderRegistry());
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
function localId(n: number): LocalEntityId {
|
|
33
37
|
return n as LocalEntityId;
|
|
34
38
|
}
|
|
35
39
|
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
// biome-ignore lint/suspicious/noExplicitAny: branded Handle type mismatch
|
|
41
|
+
function registerSceneAsset(world: World, asset: SceneAsset): any {
|
|
38
42
|
return world.allocSharedRef('SceneAsset', asset);
|
|
39
43
|
}
|
|
40
44
|
|
|
@@ -53,21 +57,28 @@ describe('m1t4 — AC-05 roundtrip regression (red-first)', () => {
|
|
|
53
57
|
};
|
|
54
58
|
|
|
55
59
|
const world = new World();
|
|
56
|
-
|
|
60
|
+
registerSceneComponents(world);
|
|
61
|
+
const reg = makeRegistry();
|
|
62
|
+
const sg = AssetGuid.parse('00000000-0000-0000-0000-000000000000');
|
|
63
|
+
if (sg.ok) reg.catalog(sg.value, asset);
|
|
57
64
|
const handle = registerSceneAsset(world, asset);
|
|
58
65
|
const res = SceneOwner.worldInstantiateScene(world, handle);
|
|
59
66
|
expect(res.ok).toBe(true);
|
|
60
67
|
if (!res.ok) return;
|
|
61
68
|
|
|
62
69
|
// Collect from the instantiated scene.
|
|
63
|
-
const collected = rootsToSceneAsset(
|
|
70
|
+
const collected = rootsToSceneAsset(reg, world, [res.value.root]);
|
|
64
71
|
expect(collected.ok).toBe(true);
|
|
65
72
|
if (!collected.ok) return;
|
|
66
73
|
|
|
67
74
|
// Round-trip to a fresh world.
|
|
68
75
|
const world2 = new World();
|
|
69
76
|
registerSceneComponents(world2);
|
|
70
|
-
const
|
|
77
|
+
const reg2 = makeRegistry();
|
|
78
|
+
const sg2 = AssetGuid.parse('11111111-1111-1111-1111-111111111111');
|
|
79
|
+
if (sg2.ok) reg2.catalog(sg2.value, collected.value);
|
|
80
|
+
// biome-ignore lint/suspicious/noExplicitAny: branded Handle type mismatch
|
|
81
|
+
const h2 = world2.allocSharedRef('SceneAsset', collected.value) as any;
|
|
71
82
|
const inst2 = SceneOwner.worldInstantiateScene(world2, h2);
|
|
72
83
|
expect(inst2.ok).toBe(true);
|
|
73
84
|
if (!inst2.ok) return;
|
|
@@ -115,27 +126,33 @@ describe('m1t4 — AC-05 roundtrip regression (red-first)', () => {
|
|
|
115
126
|
};
|
|
116
127
|
|
|
117
128
|
const world = new World();
|
|
118
|
-
|
|
129
|
+
registerSceneComponents(world);
|
|
130
|
+
const reg = makeRegistry();
|
|
131
|
+
const sg = AssetGuid.parse('00000000-0000-0000-0000-000000000000');
|
|
132
|
+
if (sg.ok) reg.catalog(sg.value, asset);
|
|
119
133
|
const handle = registerSceneAsset(world, asset);
|
|
120
134
|
const res = SceneOwner.worldInstantiateScene(world, handle);
|
|
121
135
|
expect(res.ok).toBe(true);
|
|
122
136
|
if (!res.ok) return;
|
|
123
137
|
|
|
124
|
-
const collected = rootsToSceneAsset(
|
|
138
|
+
const collected = rootsToSceneAsset(reg, world, [res.value.root]);
|
|
125
139
|
expect(collected.ok).toBe(true);
|
|
126
140
|
if (!collected.ok) return;
|
|
127
141
|
|
|
128
142
|
// Round-trip through a second world.
|
|
129
143
|
const world2 = new World();
|
|
130
144
|
registerSceneComponents(world2);
|
|
131
|
-
const
|
|
132
|
-
const
|
|
145
|
+
const reg2 = makeRegistry();
|
|
146
|
+
const sg2 = AssetGuid.parse('11111111-1111-1111-1111-111111111111');
|
|
147
|
+
if (sg2.ok) reg2.catalog(sg2.value, collected.value);
|
|
148
|
+
// biome-ignore lint/suspicious/noExplicitAny: branded Handle type mismatch
|
|
149
|
+
const h2 = world2.allocSharedRef('SceneAsset', collected.value) as any;
|
|
133
150
|
const inst2 = SceneOwner.worldInstantiateScene(world2, h2);
|
|
134
151
|
expect(inst2.ok).toBe(true);
|
|
135
152
|
if (!inst2.ok) return;
|
|
136
153
|
|
|
137
154
|
// Second collect also works.
|
|
138
|
-
const collected2 = rootsToSceneAsset(
|
|
155
|
+
const collected2 = rootsToSceneAsset(reg2, world2, [inst2.value.root]);
|
|
139
156
|
expect(collected2.ok).toBe(true);
|
|
140
157
|
});
|
|
141
158
|
});
|
|
@@ -172,7 +189,10 @@ describe('w1 — AC-04 transient world roundtrip numeric equivalence', () => {
|
|
|
172
189
|
};
|
|
173
190
|
|
|
174
191
|
const world = new World();
|
|
175
|
-
|
|
192
|
+
registerSceneComponents(world);
|
|
193
|
+
const reg = makeRegistry();
|
|
194
|
+
const sg = AssetGuid.parse('00000000-0000-0000-0000-000000000000');
|
|
195
|
+
if (sg.ok) reg.catalog(sg.value, asset);
|
|
176
196
|
const handle = registerSceneAsset(world, asset);
|
|
177
197
|
const res = SceneOwner.worldInstantiateScene(world, handle);
|
|
178
198
|
expect(res.ok).toBe(true);
|
|
@@ -182,7 +202,7 @@ describe('w1 — AC-04 transient world roundtrip numeric equivalence', () => {
|
|
|
182
202
|
expect(propagateTransforms(world).ok).toBe(true);
|
|
183
203
|
// The Transform entity is the child of the synthetic root; locate it via
|
|
184
204
|
// the collect closure being 2 entities (root + our entity).
|
|
185
|
-
const collected = rootsToSceneAsset(
|
|
205
|
+
const collected = rootsToSceneAsset(reg, world, [res.value.root]);
|
|
186
206
|
expect(collected.ok).toBe(true);
|
|
187
207
|
if (!collected.ok) return;
|
|
188
208
|
|
|
@@ -195,7 +215,11 @@ describe('w1 — AC-04 transient world roundtrip numeric equivalence', () => {
|
|
|
195
215
|
// Round-trip into a fresh world.
|
|
196
216
|
const world2 = new World();
|
|
197
217
|
registerSceneComponents(world2);
|
|
198
|
-
const
|
|
218
|
+
const reg2 = makeRegistry();
|
|
219
|
+
const sg2 = AssetGuid.parse('11111111-1111-1111-1111-111111111111');
|
|
220
|
+
if (sg2.ok) reg2.catalog(sg2.value, collected.value);
|
|
221
|
+
// biome-ignore lint/suspicious/noExplicitAny: branded Handle type mismatch
|
|
222
|
+
const h2 = world2.allocSharedRef('SceneAsset', collected.value) as any;
|
|
199
223
|
const inst2 = SceneOwner.worldInstantiateScene(world2, h2);
|
|
200
224
|
expect(inst2.ok).toBe(true);
|
|
201
225
|
if (!inst2.ok) return;
|