@forgeax/engine-render 0.1.21 → 0.1.24
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 +281 -38
- package/dist/assembly/backend-contract.d.ts +13 -0
- package/dist/assembly/backend-contract.d.ts.map +1 -1
- package/dist/assembly/bundler-contract.d.ts +9 -0
- package/dist/assembly/bundler-contract.d.ts.map +1 -0
- package/dist/assembly/device-feature-admission.d.ts +8 -0
- package/dist/assembly/device-feature-admission.d.ts.map +1 -1
- package/dist/assembly/extended-lighting-fallback.d.ts +13 -0
- package/dist/assembly/extended-lighting-fallback.d.ts.map +1 -0
- package/dist/assembly/factory.d.ts +7 -235
- package/dist/assembly/factory.d.ts.map +1 -1
- package/dist/assembly/host-contract.d.ts +10 -0
- package/dist/assembly/host-contract.d.ts.map +1 -1
- package/dist/assembly/material/assembly.d.ts +3 -2
- package/dist/assembly/material/assembly.d.ts.map +1 -1
- package/dist/assembly/material/standard-layer-projection.d.ts +10 -0
- package/dist/assembly/material/standard-layer-projection.d.ts.map +1 -0
- package/dist/assembly/material-shader-policy.d.ts +168 -0
- package/dist/assembly/material-shader-policy.d.ts.map +1 -0
- package/dist/assembly/material-shader-prewarm.d.ts +21 -0
- package/dist/assembly/material-shader-prewarm.d.ts.map +1 -0
- package/dist/assembly/mesh-ssbo-grow.d.ts +88 -0
- package/dist/assembly/mesh-ssbo-grow.d.ts.map +1 -0
- package/dist/assembly/recovery/device-loss-fanout.d.ts +14 -0
- package/dist/assembly/recovery/device-loss-fanout.d.ts.map +1 -0
- package/dist/assembly/recovery/generation.d.ts +46 -0
- package/dist/assembly/recovery/generation.d.ts.map +1 -0
- package/dist/assembly/recovery/recovery-attempt.d.ts +63 -0
- package/dist/assembly/recovery/recovery-attempt.d.ts.map +1 -0
- package/dist/assembly/recovery/renderer-recover.d.ts +115 -0
- package/dist/assembly/recovery/renderer-recover.d.ts.map +1 -0
- package/dist/assembly/renderer-facade.d.ts +10 -0
- package/dist/assembly/renderer-facade.d.ts.map +1 -0
- package/dist/assembly/renderer-frame-transaction.d.ts +17 -0
- package/dist/assembly/renderer-frame-transaction.d.ts.map +1 -1
- package/dist/assembly/renderer-helpers.d.ts +19 -0
- package/dist/assembly/renderer-helpers.d.ts.map +1 -0
- package/dist/assembly/renderer-lifecycle.d.ts +34 -0
- package/dist/assembly/renderer-lifecycle.d.ts.map +1 -1
- package/dist/assembly/shader-prewarm-policy.d.ts +15 -0
- package/dist/assembly/shader-prewarm-policy.d.ts.map +1 -0
- package/dist/assembly/webgpu-ready-contract.d.ts +9 -0
- package/dist/assembly/webgpu-ready-contract.d.ts.map +1 -0
- package/dist/assembly/webgpu-ready.d.ts +55 -0
- package/dist/assembly/webgpu-ready.d.ts.map +1 -0
- package/dist/assembly/webgpu-renderer.d.ts +152 -0
- package/dist/assembly/webgpu-renderer.d.ts.map +1 -0
- package/dist/authoring.mjs +1 -1
- package/dist/{chunk-PCHBPYML.mjs → chunk-GE3SDD72.mjs} +37 -5
- package/dist/chunk-GE3SDD72.mjs.map +1 -0
- package/dist/chunk-KZFTK6DO.mjs +1191 -0
- package/dist/chunk-KZFTK6DO.mjs.map +1 -0
- package/dist/{chunk-FS2KNUQH.mjs → chunk-Q752SHI5.mjs} +332 -568
- package/dist/chunk-Q752SHI5.mjs.map +1 -0
- package/dist/{chunk-6OPXDQ2E.mjs → chunk-RR5L4SRS.mjs} +33 -294
- package/dist/chunk-RR5L4SRS.mjs.map +1 -0
- package/dist/chunk-TFH5I7JJ.mjs +296 -0
- package/dist/chunk-TFH5I7JJ.mjs.map +1 -0
- package/dist/chunk-UQYS7FRM.mjs +1003 -0
- package/dist/chunk-UQYS7FRM.mjs.map +1 -0
- package/dist/chunk-YKB5DQV7.mjs +345 -0
- package/dist/chunk-YKB5DQV7.mjs.map +1 -0
- package/dist/{chunk-5YADUCA7.mjs → chunk-YRUYGA4A.mjs} +1189 -1217
- package/dist/chunk-YRUYGA4A.mjs.map +1 -0
- package/dist/chunk-Z3YYH2MB.mjs +5082 -0
- package/dist/chunk-Z3YYH2MB.mjs.map +1 -0
- package/dist/cluster-binner.d.ts +5 -0
- package/dist/cluster-binner.d.ts.map +1 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/light-helpers.d.ts +4 -0
- package/dist/components/light-helpers.d.ts.map +1 -1
- package/dist/components/light-probe.d.ts +9 -0
- package/dist/components/light-probe.d.ts.map +1 -0
- package/dist/components/rect-area-light.d.ts +12 -0
- package/dist/components/rect-area-light.d.ts.map +1 -0
- package/dist/components/scene-instance.d.ts +4 -0
- package/dist/components/scene-instance.d.ts.map +1 -1
- package/dist/components/spot-light.d.ts +3 -0
- package/dist/components/spot-light.d.ts.map +1 -1
- package/dist/construct-renderer.mjs +27276 -23232
- package/dist/construct-renderer.mjs.map +1 -1
- package/dist/device/device-scope.d.ts +2 -0
- package/dist/device/device-scope.d.ts.map +1 -1
- package/dist/device/gpu-residency.d.ts +32 -5
- package/dist/device/gpu-residency.d.ts.map +1 -1
- package/dist/device/lifecycle-transaction.d.ts +2 -0
- package/dist/device/lifecycle-transaction.d.ts.map +1 -0
- package/dist/environment/frame.d.ts +5 -0
- package/dist/environment/frame.d.ts.map +1 -1
- package/dist/environment/inspection.d.ts +7 -0
- package/dist/environment/inspection.d.ts.map +1 -1
- package/dist/environment/lifecycle.d.ts +20 -2
- package/dist/environment/lifecycle.d.ts.map +1 -1
- package/dist/errors/gpu-driven.d.ts +26 -0
- package/dist/errors/gpu-driven.d.ts.map +1 -0
- package/dist/errors/index.d.ts +1 -0
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/recover.d.ts +67 -3
- package/dist/errors/recover.d.ts.map +1 -1
- package/dist/errors/render.d.ts +39 -1
- package/dist/errors/render.d.ts.map +1 -1
- package/dist/extract/contracts.d.ts +899 -0
- package/dist/extract/contracts.d.ts.map +1 -0
- package/dist/extract/gpu-driven.d.ts +50 -0
- package/dist/extract/gpu-driven.d.ts.map +1 -0
- package/dist/extract/visibility.d.ts.map +1 -1
- package/dist/features/host.d.ts +2 -0
- package/dist/features/host.d.ts.map +1 -1
- package/dist/features/prepared-gpu-work.d.ts +3 -0
- package/dist/features/prepared-gpu-work.d.ts.map +1 -1
- package/dist/features/prepared-graphics-store.d.ts +2 -0
- package/dist/features/prepared-graphics-store.d.ts.map +1 -1
- package/dist/gpu-driven/batch-topology.d.ts +34 -0
- package/dist/gpu-driven/batch-topology.d.ts.map +1 -1
- package/dist/gpu-driven/prepared-draw.d.ts +63 -0
- package/dist/gpu-driven/prepared-draw.d.ts.map +1 -0
- package/dist/gpu-driven/production-raster.d.ts +126 -2
- package/dist/gpu-driven/production-raster.d.ts.map +1 -1
- package/dist/gpu-driven/view-gpu.d.ts +64 -1
- package/dist/gpu-driven/view-gpu.d.ts.map +1 -1
- package/dist/gpu-scene-schema.d.ts +14 -0
- package/dist/gpu-scene-schema.d.ts.map +1 -1
- package/dist/gpu-scene.d.ts +9 -1
- package/dist/gpu-scene.d.ts.map +1 -1
- package/dist/gpu-usage.d.ts +0 -1
- package/dist/gpu-usage.d.ts.map +1 -1
- package/dist/hdrp-buffers.d.ts +3 -3
- package/dist/hdrp-buffers.d.ts.map +1 -1
- package/dist/ibl/IblPipelineCache.d.ts +7 -6
- package/dist/ibl/IblPipelineCache.d.ts.map +1 -1
- package/dist/ibl/skylight-bind-group.d.ts +7 -1
- package/dist/ibl/skylight-bind-group.d.ts.map +1 -1
- package/dist/index.d.ts +13 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +90 -5
- package/dist/index.mjs.map +1 -1
- package/dist/inspection-types.d.ts +163 -1
- package/dist/inspection-types.d.ts.map +1 -1
- package/dist/internal.d.ts +9 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.mjs +23 -2
- package/dist/internal.mjs.map +1 -1
- package/dist/light-buffer-layout.d.ts +60 -148
- package/dist/light-buffer-layout.d.ts.map +1 -1
- package/dist/materials.d.ts +34 -10
- package/dist/materials.d.ts.map +1 -1
- package/dist/mesh-material-bindings.d.ts +56 -0
- package/dist/mesh-material-bindings.d.ts.map +1 -1
- package/dist/occlusion-proxy.d.ts +4 -0
- package/dist/occlusion-proxy.d.ts.map +1 -0
- package/dist/pbr-pipeline.d.ts +58 -21
- package/dist/pbr-pipeline.d.ts.map +1 -1
- package/dist/pipeline/standard-forward-lane.d.ts.map +1 -1
- package/dist/pipeline/standard-lighting/graph.d.ts.map +1 -1
- package/dist/pipeline/standard-lighting/light-frame.d.ts +3 -3
- package/dist/pipeline/standard-lighting/light-frame.d.ts.map +1 -1
- package/dist/pipeline/standard-lighting/topology.d.ts +1 -1
- package/dist/pipeline/standard-lighting/topology.d.ts.map +1 -1
- package/dist/pipeline/standard-lighting/transport.d.ts.map +1 -1
- package/dist/pipeline/standard-pipeline.d.ts.map +1 -1
- package/dist/pipeline-builder.d.ts +2 -0
- package/dist/pipeline-builder.d.ts.map +1 -1
- package/dist/pipeline-spec.d.ts +1 -1
- package/dist/pipeline-spec.d.ts.map +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/points-lines/prepare.d.ts +3 -0
- package/dist/points-lines/prepare.d.ts.map +1 -1
- package/dist/points-lines/standard-owner.d.ts +33 -0
- package/dist/points-lines/standard-owner.d.ts.map +1 -0
- package/dist/prepare/extended-lighting/ltc-resources.d.ts +31 -0
- package/dist/prepare/extended-lighting/ltc-resources.d.ts.map +1 -0
- package/dist/prepare/extended-lighting/resources.d.ts +72 -0
- package/dist/prepare/extended-lighting/resources.d.ts.map +1 -0
- package/dist/prepare/extended-lighting/spot-modifiers.d.ts +42 -0
- package/dist/prepare/extended-lighting/spot-modifiers.d.ts.map +1 -0
- package/dist/prepare/extended-lighting/state.d.ts +24 -0
- package/dist/prepare/extended-lighting/state.d.ts.map +1 -0
- package/dist/record/frame-lighting.d.ts +8 -6
- package/dist/record/frame-lighting.d.ts.map +1 -1
- package/dist/record/frame-snapshot.d.ts +55 -10
- package/dist/record/frame-snapshot.d.ts.map +1 -1
- package/dist/record/frame-targets.d.ts.map +1 -1
- package/dist/record/frame.d.ts +21 -5
- package/dist/record/frame.d.ts.map +1 -1
- package/dist/record/gpu-timing.d.ts +19 -7
- package/dist/record/gpu-timing.d.ts.map +1 -1
- package/dist/record/helpers.d.ts +0 -20
- package/dist/record/helpers.d.ts.map +1 -1
- package/dist/record/main-pass-geometry.d.ts +20 -2
- package/dist/record/main-pass-geometry.d.ts.map +1 -1
- package/dist/record/main-pass-material.d.ts +10 -18
- package/dist/record/main-pass-material.d.ts.map +1 -1
- package/dist/record/main-pass-sprite-draws.d.ts.map +1 -1
- package/dist/record/main-pass.d.ts.map +1 -1
- package/dist/record/mesh-ssbo.d.ts +11 -3
- package/dist/record/mesh-ssbo.d.ts.map +1 -1
- package/dist/record/recovery-pipeline.d.ts +30 -0
- package/dist/record/recovery-pipeline.d.ts.map +1 -0
- package/dist/record/render-context.d.ts +82 -9
- package/dist/record/render-context.d.ts.map +1 -1
- package/dist/record/shadow-pass.d.ts.map +1 -1
- package/dist/record/typed-frame-graph.d.ts +49 -2
- package/dist/record/typed-frame-graph.d.ts.map +1 -1
- package/dist/record/view-ubo.d.ts +1 -2
- package/dist/record/view-ubo.d.ts.map +1 -1
- package/dist/recovery/render-system-candidate.d.ts +65 -0
- package/dist/recovery/render-system-candidate.d.ts.map +1 -0
- package/dist/reflection/inspection.d.ts +10 -0
- package/dist/reflection/inspection.d.ts.map +1 -0
- package/dist/reflection/projection.d.ts +49 -0
- package/dist/reflection/projection.d.ts.map +1 -1
- package/dist/reflection/record-owner.d.ts +60 -0
- package/dist/reflection/record-owner.d.ts.map +1 -0
- package/dist/render-contract.d.ts +78 -15
- package/dist/render-contract.d.ts.map +1 -1
- package/dist/render-pipeline.d.ts +7 -0
- package/dist/render-pipeline.d.ts.map +1 -1
- package/dist/render-system-extract-tail.d.ts +12 -0
- package/dist/render-system-extract-tail.d.ts.map +1 -0
- package/dist/render-system-extract.d.ts +252 -30
- package/dist/render-system-extract.d.ts.map +1 -1
- package/dist/render-system.d.ts +140 -5
- package/dist/render-system.d.ts.map +1 -1
- package/dist/scene/probe-blend-record.d.ts +22 -0
- package/dist/scene/probe-blend-record.d.ts.map +1 -0
- package/dist/scene/probe-blend.d.ts +142 -0
- package/dist/scene/probe-blend.d.ts.map +1 -0
- package/dist/scene/render-scene-types.d.ts +0 -6
- package/dist/scene/render-scene-types.d.ts.map +1 -1
- package/dist/scene/render-scene.d.ts +122 -9
- package/dist/scene/render-scene.d.ts.map +1 -1
- package/dist/scene/visibility/bounds.d.ts +20 -0
- package/dist/scene/visibility/bounds.d.ts.map +1 -0
- package/dist/scene/visibility/budget.d.ts +16 -0
- package/dist/scene/visibility/budget.d.ts.map +1 -0
- package/dist/scene/visibility/facet.d.ts +73 -0
- package/dist/scene/visibility/facet.d.ts.map +1 -0
- package/dist/scene/visibility/gpu-frame-timing.d.ts +41 -0
- package/dist/scene/visibility/gpu-frame-timing.d.ts.map +1 -0
- package/dist/scene/visibility/gpu-lod.d.ts +46 -0
- package/dist/scene/visibility/gpu-lod.d.ts.map +1 -0
- package/dist/scene/visibility/inspection.d.ts +132 -0
- package/dist/scene/visibility/inspection.d.ts.map +1 -0
- package/dist/scene/visibility/lod-selector.d.ts +25 -0
- package/dist/scene/visibility/lod-selector.d.ts.map +1 -0
- package/dist/scene/visibility/occlusion-confidence.d.ts +81 -0
- package/dist/scene/visibility/occlusion-confidence.d.ts.map +1 -0
- package/dist/scene/visibility/occlusion-pass.d.ts +57 -0
- package/dist/scene/visibility/occlusion-pass.d.ts.map +1 -0
- package/dist/scene/visibility/occlusion-query-pool.d.ts +57 -0
- package/dist/scene/visibility/occlusion-query-pool.d.ts.map +1 -0
- package/dist/scene/visibility/occlusion-runtime.d.ts +96 -0
- package/dist/scene/visibility/occlusion-runtime.d.ts.map +1 -0
- package/dist/scene/visibility/types.d.ts +34 -0
- package/dist/scene/visibility/types.d.ts.map +1 -0
- package/dist/ssr/admission.d.ts +122 -0
- package/dist/ssr/admission.d.ts.map +1 -0
- package/dist/ssr/composition.d.ts +32 -0
- package/dist/ssr/composition.d.ts.map +1 -0
- package/dist/ssr/errors.d.ts +39 -0
- package/dist/ssr/errors.d.ts.map +1 -0
- package/dist/ssr/identity.d.ts +13 -0
- package/dist/ssr/identity.d.ts.map +1 -0
- package/dist/systems/skin-palette-allocator.d.ts +1 -1
- package/dist/temporal/frame-coordinator.d.ts +13 -0
- package/dist/temporal/frame-coordinator.d.ts.map +1 -1
- package/dist/temporal/frame.d.ts +2 -0
- package/dist/temporal/frame.d.ts.map +1 -1
- package/dist/temporal/index.mjs +6 -5
- package/dist/temporal/taa-history-store.d.ts +15 -1
- package/dist/temporal/taa-history-store.d.ts.map +1 -1
- package/dist/temporal/transaction.d.ts +5 -0
- package/dist/temporal/transaction.d.ts.map +1 -1
- package/dist/temporal/view.d.ts +7 -0
- package/dist/temporal/view.d.ts.map +1 -1
- package/dist/tilemap-chunk-extract-system.d.ts +1 -1
- package/dist/typed-render-graph-primitives.d.ts +4 -0
- package/dist/typed-render-graph-primitives.d.ts.map +1 -1
- package/dist/volume/passes.d.ts +8 -4
- package/dist/volume/passes.d.ts.map +1 -1
- package/package.json +20 -20
- package/src/__tests__/cluster-grid-default-surface.unit.test.ts +5 -0
- package/src/__tests__/detached-inspection.integration.test.ts +6 -0
- package/src/__tests__/device-feature-admission.unit.test.ts +19 -1
- package/src/__tests__/device-loss-fanout.unit.test.ts +107 -0
- package/src/__tests__/device-scope-lifecycle.unit.test.ts +21 -0
- package/src/__tests__/direct-light-snapshot.unit.test.ts +59 -3
- package/src/__tests__/environment-generation.integration.test.ts +39 -0
- package/src/__tests__/evidence-identity.ts +13 -0
- package/src/__tests__/evidence-identity.unit.test.ts +24 -0
- package/src/__tests__/expose-renderer-errors.unit.test.ts +34 -0
- package/src/__tests__/extended-lighting-recovery.browser.test.ts +14 -0
- package/src/__tests__/extended-lighting-recovery.dawn.test.ts +14 -0
- package/src/__tests__/extended-lighting-recovery.integration.test.ts +81 -0
- package/src/__tests__/extended-lighting-resources.unit.test.ts +51 -0
- package/src/__tests__/extended-lighting-zero-feature.integration.test.ts +52 -0
- package/src/__tests__/factory-contract.integration.test.ts +154 -6
- package/src/__tests__/fallback-row-stride-surface.unit.test.ts +4 -1
- package/src/__tests__/frame-observation.contract.test.ts +15 -0
- package/src/__tests__/gpu-driven-batch-topology-pbr.unit.test.ts +146 -0
- package/src/__tests__/gpu-driven-indirect-raster-evidence.ts +1 -0
- package/src/__tests__/gpu-driven-indirect-raster.dawn.test.ts +1 -0
- package/src/__tests__/gpu-driven-production.integration.test.ts +572 -9
- package/src/__tests__/gpu-driven-scaling.unit.test.ts +66 -2
- package/src/__tests__/gpu-driven-view-gpu-evidence.ts +26 -1
- package/src/__tests__/gpu-driven-view-graph.integration.test.ts +89 -2
- package/src/__tests__/gpu-driven-view.browser.test.ts +3 -3
- package/src/__tests__/gpu-driven-view.dawn.test.ts +3 -3
- package/src/__tests__/gpu-driven-view.unit.test.ts +50 -0
- package/src/__tests__/gpu-lod-evidence.ts +188 -0
- package/src/__tests__/gpu-lod-fallback.integration.test.ts +10 -0
- package/src/__tests__/gpu-lod-indirect.integration.test.ts +40 -0
- package/src/__tests__/gpu-lod-parity.dawn.test.ts +29 -0
- package/src/__tests__/gpu-lod-readiness.integration.test.ts +52 -0
- package/src/__tests__/gpu-lod-schema.unit.test.ts +66 -0
- package/src/__tests__/gpu-lod-selector.unit.test.ts +28 -0
- package/src/__tests__/gpu-lod-silhouette.browser.test.ts +13 -0
- package/src/__tests__/gpu-resource-store-stride.unit.test.ts +66 -1
- package/src/__tests__/gpu-scene.dawn.test.ts +8 -1
- package/src/__tests__/gpu-scene.unit.test.ts +49 -3
- package/src/__tests__/ibl/face-uniforms.unit.test.ts +2 -0
- package/src/__tests__/ibl-residency-publication.unit.test.ts +113 -0
- package/src/__tests__/light-buffer-layout.unit.test.ts +113 -3
- package/src/__tests__/light-inspection.unit.test.ts +55 -0
- package/src/__tests__/light-resource-error.unit.test.ts +43 -0
- package/src/__tests__/lighting-scene-roundtrip.integration.test.ts +109 -0
- package/src/__tests__/lod-bounds.unit.test.ts +42 -0
- package/src/__tests__/lod-cpu-lane.integration.test.ts +55 -0
- package/src/__tests__/lod-cpu-no-change.perf.test.ts +19 -0
- package/src/__tests__/lod-gpu-frame-timing.unit.test.ts +49 -0
- package/src/__tests__/lod-multi-view.integration.test.ts +63 -0
- package/src/__tests__/lod-occlusion-device-loss.integration.test.ts +27 -0
- package/src/__tests__/lod-occlusion-final-decision.integration.test.ts +47 -0
- package/src/__tests__/lod-occlusion-inspection.integration.test.ts +217 -0
- package/src/__tests__/lod-occlusion-inspection.schema.test-d.ts +14 -0
- package/src/__tests__/lod-occlusion-inspection.unit.test.ts +72 -0
- package/src/__tests__/lod-occlusion-visual-evidence.ts +91 -0
- package/src/__tests__/lod-occlusion.browser.test.ts +15 -0
- package/src/__tests__/lod-occlusion.dawn.test.ts +20 -0
- package/src/__tests__/lod-selector.profile.test.ts +35 -0
- package/src/__tests__/lod-selector.unit.test.ts +68 -0
- package/src/__tests__/lod-visibility-identity.unit.test.ts +198 -0
- package/src/__tests__/lod-visibility-lifecycle.integration.test.ts +132 -0
- package/src/__tests__/ltc-resources.unit.test.ts +32 -0
- package/src/__tests__/material-contract-inventory.unit.test.ts +41 -9
- package/src/__tests__/material-cooked-projection.unit.test.ts +19 -1
- package/src/__tests__/material-static-dynamic-route.unit.test.ts +29 -0
- package/src/__tests__/material-stride-surface.unit.test.ts +7 -3
- package/src/__tests__/materials-standard-contract.unit.test.ts +104 -0
- package/src/__tests__/mesh-buffer-usage-surface.unit.test.ts +1 -1
- package/src/__tests__/occlusion-confidence.unit.test.ts +168 -0
- package/src/__tests__/occlusion-invalidation.integration.test.ts +37 -0
- package/src/__tests__/occlusion-pass-routing.unit.test.ts +16 -0
- package/src/__tests__/occlusion-pass.dawn.test.ts +20 -0
- package/src/__tests__/occlusion-pass.integration.test.ts +43 -0
- package/src/__tests__/occlusion-pass.rhi-null.test.ts +22 -0
- package/src/__tests__/occlusion-query-pool.rhi-null.test.ts +21 -0
- package/src/__tests__/occlusion-query-pool.unit.test.ts +95 -0
- package/src/__tests__/occlusion-query-ticket.integration.test.ts +47 -0
- package/src/__tests__/occlusion-query.dawn.test.ts +16 -0
- package/src/__tests__/occlusion-query.evidence.ts +178 -0
- package/src/__tests__/occlusion-query.rhi-null.test.ts +31 -0
- package/src/__tests__/occlusion-runtime.unit.test.ts +120 -0
- package/src/__tests__/physical-clearcoat.integration.test.ts +89 -0
- package/src/__tests__/prepared-gpu-driven-pbr.integration.test.ts +196 -0
- package/src/__tests__/prepared-graphics-pipeline-warmup.unit.test.ts +1 -1
- package/src/__tests__/probe-bindings.unit.test.ts +200 -0
- package/src/__tests__/probe-blend-numeric.unit.test.ts +67 -0
- package/src/__tests__/probe-blend-oracle.unit.test.ts +136 -0
- package/src/__tests__/probe-capacity.integration.test.ts +97 -0
- package/src/__tests__/probe-recovery.integration.test.ts +104 -0
- package/src/__tests__/probe-scene-dirty.integration.test.ts +211 -0
- package/src/__tests__/profiler-phase-catalog.test.ts +4 -1
- package/src/__tests__/profiler-phase-token.test.ts +1 -0
- package/src/__tests__/recover-error-policy-owner.unit.test.ts +6 -3
- package/src/__tests__/recovery-candidate-prepare.contract.test.ts +140 -0
- package/src/__tests__/rect-area-boundary.unit.test.ts +24 -0
- package/src/__tests__/reflection-fallback-graph.unit.test.ts +67 -0
- package/src/__tests__/reflection-fallback-inspection.unit.test.ts +77 -0
- package/src/__tests__/reflection-fallback-lifecycle.integration.test.ts +21 -0
- package/src/__tests__/reflection-fallback-projection.unit.test.ts +90 -0
- package/src/__tests__/reflection-fallback-source.unit.test.ts +32 -0
- package/src/__tests__/reflection-probe-owner-placement.unit.test.ts +39 -0
- package/src/__tests__/reflection-probe-record-owner.characterization.unit.test.ts +120 -0
- package/src/__tests__/render-error-code-owner.test-d.ts +1 -0
- package/src/__tests__/render-feature-docs.unit.test.ts +12 -7
- package/src/__tests__/render-graph-fallback.integration.test.ts +24 -0
- package/src/__tests__/render-perf/extended-lighting.bench.test.ts +66 -0
- package/src/__tests__/render-scene-projection.unit.test.ts +447 -18
- package/src/__tests__/renderer-factory-material-contract.unit.test.ts +160 -17
- package/src/__tests__/renderer-frame-generation-fence.integration.test.ts +47 -0
- package/src/__tests__/renderer-generation-assembly.unit.test.ts +77 -0
- package/src/__tests__/renderer-generation-failure.unit.test.ts +108 -0
- package/src/__tests__/renderer-producer-root-matrix.integration.test.ts +33 -0
- package/src/__tests__/renderer-recovery-capability-matrix.unit.test.ts +59 -0
- package/src/__tests__/renderer-recovery-contract.unit.test.ts +73 -0
- package/src/__tests__/renderer-recovery-lifecycle.unit.test.ts +216 -0
- package/src/__tests__/renderer-target-history-recovery.integration.test.ts +80 -0
- package/src/__tests__/shader-manifest-fixture.ts +13 -16
- package/src/__tests__/shader-stage-surface.unit.test.ts +1 -1
- package/src/__tests__/skin-motion-regression.unit.test.ts +22 -0
- package/src/__tests__/skinned-shadow-caster.test.ts +2 -2
- package/src/__tests__/spot-modifier-projection.unit.test.ts +70 -0
- package/src/__tests__/ssr-admission-matrix.integration.test.ts +206 -0
- package/src/__tests__/ssr-composition.unit.test.ts +46 -0
- package/src/__tests__/ssr-fallback-zero-work.bench.test.ts +94 -0
- package/src/__tests__/ssr-recovery-errors.unit.test.ts +58 -0
- package/src/__tests__/standard-cluster-variant-resolution.unit.test.ts +67 -0
- package/src/__tests__/standard-clustered-pipeline.unit.test.ts +7 -0
- package/src/__tests__/standard-layer-projection.unit.test.ts +23 -0
- package/src/__tests__/standard-lighting-inspection.integration.test.ts +1 -1
- package/src/__tests__/standard-lighting-write.unit.test.ts +66 -2
- package/src/__tests__/temporal-fallback-generation.integration.test.ts +16 -0
- package/src/__tests__/temporal-view.unit.test.ts +3 -3
- package/src/__tests__/transmission-prewarm.unit.test.ts +111 -32
- package/src/__tests__/visibility-budget.integration.test.ts +140 -0
- package/src/__tests__/visibility-budget.unit.test.ts +70 -0
- package/src/__tests__/visibility-extract.integration.test.ts +11 -6
- package/src/__tests__/volumetric-fog-point-spot-accumulation.integration.test.ts +6 -3
- package/src/__tests__/volumetric-fog-stage-readback.dawn.test.ts +31 -28
- package/src/__tests__/volumetric-fog-topology.unit.test.ts +3 -1
- package/src/assembly/backend-contract.ts +13 -0
- package/src/assembly/bundler-contract.ts +9 -0
- package/src/assembly/device-feature-admission.ts +26 -9
- package/src/assembly/extended-lighting-fallback.ts +216 -0
- package/src/assembly/factory.ts +81 -9634
- package/src/assembly/host-contract.ts +10 -0
- package/src/assembly/material/assembly.ts +18 -2
- package/src/assembly/material/standard-layer-projection.ts +16 -0
- package/src/assembly/material-shader-policy.ts +854 -0
- package/src/assembly/material-shader-prewarm.ts +88 -0
- package/src/assembly/mesh-ssbo-grow.ts +270 -0
- package/src/assembly/recovery/device-loss-fanout.ts +89 -0
- package/src/assembly/recovery/generation.ts +141 -0
- package/src/assembly/recovery/recovery-attempt.ts +800 -0
- package/src/assembly/recovery/renderer-recover.ts +906 -0
- package/src/assembly/renderer-facade.ts +342 -0
- package/src/assembly/renderer-frame-transaction.ts +45 -0
- package/src/assembly/renderer-helpers.ts +99 -0
- package/src/assembly/renderer-lifecycle.ts +159 -0
- package/src/assembly/shader-prewarm-policy.ts +157 -0
- package/src/assembly/webgpu-ready-contract.ts +14 -0
- package/src/assembly/webgpu-ready.ts +4079 -0
- package/src/assembly/webgpu-renderer.ts +4095 -0
- package/src/cluster-binner.ts +31 -0
- package/src/components/__tests__/lighting-authoring.unit.test.ts +39 -0
- package/src/components/__tests__/rect-area-light.unit.test.ts +33 -0
- package/src/components/camera.ts +1 -1
- package/src/components/index.ts +3 -0
- package/src/components/light-helpers.ts +52 -1
- package/src/components/light-probe.ts +13 -0
- package/src/components/rect-area-light.ts +15 -0
- package/src/components/scene-instance.ts +6 -0
- package/src/components/spot-light.ts +3 -0
- package/src/debug-draw-glue.ts +1 -1
- package/src/device/__tests__/extended-lighting-recovery.unit.test.ts +24 -0
- package/src/device/device-scope.ts +35 -6
- package/src/device/gpu-residency.ts +334 -35
- package/src/device/lifecycle-transaction.ts +12 -0
- package/src/environment/frame.ts +6 -0
- package/src/environment/inspection.ts +10 -0
- package/src/environment/lifecycle.ts +122 -9
- package/src/errors/gpu-driven.ts +92 -0
- package/src/errors/index.ts +1 -0
- package/src/errors/recover.ts +108 -5
- package/src/errors/render.ts +72 -1
- package/src/extract/camera.ts +3 -3
- package/src/extract/contracts.ts +974 -0
- package/src/extract/gpu-driven.ts +108 -0
- package/src/extract/visibility.ts +0 -23
- package/src/features/host.ts +16 -0
- package/src/features/prepared-gpu-work.ts +20 -2
- package/src/features/prepared-graphics-store.ts +17 -0
- package/src/gpu-driven/batch-topology.ts +206 -28
- package/src/gpu-driven/prepared-draw.ts +208 -0
- package/src/gpu-driven/production-raster.ts +1046 -39
- package/src/gpu-driven/view-gpu.ts +411 -29
- package/src/gpu-scene-schema.ts +13 -0
- package/src/gpu-scene.ts +137 -67
- package/src/gpu-usage.ts +0 -1
- package/src/hdrp-buffers.ts +6 -6
- package/src/ibl/IblPipelineCache.ts +134 -50
- package/src/ibl/skylight-bind-group.ts +26 -0
- package/src/index.ts +83 -1
- package/src/inspection-types.ts +220 -1
- package/src/internal.ts +38 -0
- package/src/light-buffer-layout.ts +157 -324
- package/src/materials.ts +278 -47
- package/src/mesh-material-bindings.ts +59 -0
- package/src/occlusion-proxy.ts +64 -0
- package/src/pbr-pipeline.ts +290 -60
- package/src/pipeline/standard-forward-lane.ts +47 -0
- package/src/pipeline/standard-lighting/graph.ts +2 -1
- package/src/pipeline/standard-lighting/light-frame.ts +3 -2
- package/src/pipeline/standard-lighting/topology.ts +1 -1
- package/src/pipeline/standard-lighting/transport.ts +2 -1
- package/src/pipeline/standard-pipeline.ts +2 -0
- package/src/pipeline-builder.ts +5 -2
- package/src/pipeline-spec.ts +12 -1
- package/src/plugin.ts +4 -0
- package/src/points-lines/__tests__/cache-recovery.unit.test.ts +22 -0
- package/src/points-lines/prepare.ts +9 -0
- package/src/points-lines/standard-owner.ts +403 -0
- package/src/prepare/__tests__/extended-lighting-capability.unit.test.ts +56 -0
- package/src/prepare/extended-lighting/ltc-resources.ts +136 -0
- package/src/prepare/extended-lighting/resources.ts +389 -0
- package/src/prepare/extended-lighting/spot-modifiers.ts +194 -0
- package/src/prepare/extended-lighting/state.ts +92 -0
- package/src/record/__tests__/frame-targets-recovery.unit.test.ts +60 -0
- package/src/record/__tests__/gpu-timing.unit.test.ts +177 -0
- package/src/record/__tests__/main-pass-geometry.unit.test.ts +26 -1
- package/src/record/__tests__/mesh-ssbo.unit.test.ts +38 -0
- package/src/record/__tests__/recovery-pipeline.unit.test.ts +124 -0
- package/src/record/__tests__/sprite-material-abi.unit.test.ts +28 -13
- package/src/record/__tests__/standard-pbr-ubo-layout.unit.test.ts +47 -4
- package/src/record/__tests__/temporal-payload.unit.test.ts +29 -28
- package/src/record/__tests__/typed-frame-graph-plan.unit.test.ts +21 -2
- package/src/record/frame-lighting.ts +252 -53
- package/src/record/frame-snapshot.ts +72 -12
- package/src/record/frame-targets.ts +11 -1
- package/src/record/frame.ts +416 -95
- package/src/record/gpu-timing.ts +108 -44
- package/src/record/helpers.ts +1 -59
- package/src/record/main-pass-geometry.ts +434 -44
- package/src/record/main-pass-material.ts +324 -210
- package/src/record/main-pass-sprite-draws.ts +58 -92
- package/src/record/main-pass.ts +94 -6
- package/src/record/mesh-ssbo.ts +79 -46
- package/src/record/recovery-pipeline.ts +695 -0
- package/src/record/render-context.ts +99 -7
- package/src/record/shadow-pass.ts +66 -40
- package/src/record/typed-frame-graph.ts +270 -84
- package/src/record/view-ubo.ts +17 -27
- package/src/recovery/render-system-candidate.ts +839 -0
- package/src/reflection/inspection.ts +67 -0
- package/src/reflection/projection.ts +196 -1
- package/src/reflection/record-owner.ts +1283 -0
- package/src/render-contract.ts +82 -12
- package/src/render-pipeline.ts +5 -0
- package/src/render-system-extract-tail.ts +2983 -0
- package/src/render-system-extract.ts +290 -2784
- package/src/render-system.ts +1597 -1192
- package/src/scene/__tests__/changed-block-summary.candidate.test.ts +36 -0
- package/src/scene/probe-blend-record.ts +54 -0
- package/src/scene/probe-blend.ts +813 -0
- package/src/scene/render-scene-types.ts +0 -7
- package/src/scene/render-scene.ts +972 -184
- package/src/scene/visibility/bounds.ts +57 -0
- package/src/scene/visibility/budget.ts +40 -0
- package/src/scene/visibility/facet.ts +400 -0
- package/src/scene/visibility/gpu-frame-timing.ts +101 -0
- package/src/scene/visibility/gpu-lod.ts +119 -0
- package/src/scene/visibility/inspection.ts +313 -0
- package/src/scene/visibility/lod-selector.ts +84 -0
- package/src/scene/visibility/occlusion-confidence.ts +478 -0
- package/src/scene/visibility/occlusion-pass.ts +165 -0
- package/src/scene/visibility/occlusion-query-pool.ts +178 -0
- package/src/scene/visibility/occlusion-runtime.ts +672 -0
- package/src/scene/visibility/types.ts +50 -0
- package/src/ssr/admission.ts +451 -0
- package/src/ssr/composition.ts +73 -0
- package/src/ssr/errors.ts +76 -0
- package/src/ssr/identity.ts +12 -0
- package/src/systems/skin-palette-allocator.ts +1 -1
- package/src/temporal/frame-coordinator.ts +30 -1
- package/src/temporal/frame.ts +14 -1
- package/src/temporal/taa-history-store.ts +46 -2
- package/src/temporal/temporal-view.ts +1 -1
- package/src/temporal/transaction.ts +9 -0
- package/src/temporal/view.ts +11 -0
- package/src/tilemap-chunk-extract-system.ts +5 -5
- package/src/transmission/__tests__/standard-transmission.dawn.test.ts +19 -12
- package/src/typed-render-graph-primitives.ts +48 -0
- package/src/volume/passes.ts +46 -49
- package/dist/.tsbuildinfo +0 -1
- package/dist/chunk-5YADUCA7.mjs.map +0 -1
- package/dist/chunk-6OPXDQ2E.mjs.map +0 -1
- package/dist/chunk-BXBQQKFQ.mjs +0 -67
- package/dist/chunk-BXBQQKFQ.mjs.map +0 -1
- package/dist/chunk-FS2KNUQH.mjs.map +0 -1
- package/dist/chunk-PCHBPYML.mjs.map +0 -1
- package/dist/chunk-VFPLTKCU.mjs +0 -192
- package/dist/chunk-VFPLTKCU.mjs.map +0 -1
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { RhiNullCommandEncoder, RhiNullDevice, RhiNullQueue, rhi } from '@forgeax/engine-rhi-null';
|
|
2
|
+
import { ok } from '@forgeax/engine-types';
|
|
3
|
+
import { describe, expect, it } from 'vitest';
|
|
4
|
+
import {
|
|
5
|
+
acquireDeviceGeneration,
|
|
6
|
+
probeCandidateGraphExecution,
|
|
7
|
+
runRecoveryStep,
|
|
8
|
+
} from '../assembly/recovery/recovery-attempt';
|
|
9
|
+
import {
|
|
10
|
+
createRecoveryContinuation,
|
|
11
|
+
createRecoveryDeadline,
|
|
12
|
+
createRendererLifecycle,
|
|
13
|
+
createSingleFlight,
|
|
14
|
+
RECOVERY_ADAPTER_DEADLINE_MS,
|
|
15
|
+
RECOVERY_DEVICE_DEADLINE_MS,
|
|
16
|
+
RECOVERY_PHASES,
|
|
17
|
+
RECOVERY_TOTAL_DEADLINE_MS,
|
|
18
|
+
} from '../assembly/renderer-lifecycle';
|
|
19
|
+
|
|
20
|
+
describe('renderer recovery lifecycle', () => {
|
|
21
|
+
it('exhausts the public lifecycle states and rejects illegal transitions', () => {
|
|
22
|
+
const lifecycle = createRendererLifecycle();
|
|
23
|
+
|
|
24
|
+
expect(lifecycle.state()).toBe('alive');
|
|
25
|
+
expect(lifecycle.transition('device-lost')).toBe(true);
|
|
26
|
+
expect(lifecycle.transition('recovering')).toBe(true);
|
|
27
|
+
expect(lifecycle.transition('alive')).toBe(true);
|
|
28
|
+
expect(lifecycle.transition('faulted')).toBe(false);
|
|
29
|
+
expect(lifecycle.transition('disposed')).toBe(true);
|
|
30
|
+
expect(lifecycle.transition('alive')).toBe(false);
|
|
31
|
+
expect(lifecycle.states()).toEqual([
|
|
32
|
+
'alive',
|
|
33
|
+
'device-lost',
|
|
34
|
+
'recovering',
|
|
35
|
+
'faulted',
|
|
36
|
+
'disposed',
|
|
37
|
+
]);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('shares one recovery promise and one candidate for concurrent callers', async () => {
|
|
41
|
+
let attempts = 0;
|
|
42
|
+
let release: (() => void) | undefined;
|
|
43
|
+
const flight = createSingleFlight(async () => {
|
|
44
|
+
attempts += 1;
|
|
45
|
+
await new Promise<void>((resolve) => {
|
|
46
|
+
release = resolve;
|
|
47
|
+
});
|
|
48
|
+
return { candidate: attempts };
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const first = flight.run();
|
|
52
|
+
const second = flight.run();
|
|
53
|
+
expect(first).toBe(second);
|
|
54
|
+
expect(flight.inFlight()).toBe(first);
|
|
55
|
+
expect(attempts).toBe(1);
|
|
56
|
+
|
|
57
|
+
release?.();
|
|
58
|
+
await expect(first).resolves.toEqual({ candidate: 1 });
|
|
59
|
+
expect(flight.inFlight()).toBeUndefined();
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('enforces the 20 second attempt and 10 second acquisition budgets', () => {
|
|
63
|
+
const deadline = createRecoveryDeadline(1000);
|
|
64
|
+
|
|
65
|
+
expect(deadline.totalDeadlineMs).toBe(RECOVERY_TOTAL_DEADLINE_MS);
|
|
66
|
+
expect(deadline.adapterDeadlineMs).toBe(RECOVERY_ADAPTER_DEADLINE_MS);
|
|
67
|
+
expect(deadline.deviceDeadlineMs).toBe(RECOVERY_DEVICE_DEADLINE_MS);
|
|
68
|
+
expect(deadline.isValid('acquire-adapter', 10_999)).toBe(true);
|
|
69
|
+
expect(deadline.isValid('acquire-adapter', 11_000)).toBe(false);
|
|
70
|
+
expect(deadline.isValid('acquire-device', 11_000)).toBe(false);
|
|
71
|
+
expect(deadline.isValid('compile-graph', 20_999)).toBe(true);
|
|
72
|
+
expect(deadline.isValid('compile-graph', 21_000)).toBe(false);
|
|
73
|
+
expect(RECOVERY_PHASES).toEqual([
|
|
74
|
+
'quiesce',
|
|
75
|
+
'acquire-adapter',
|
|
76
|
+
'acquire-device',
|
|
77
|
+
'rehydrate',
|
|
78
|
+
'compile-graph',
|
|
79
|
+
'publish',
|
|
80
|
+
'cleanup',
|
|
81
|
+
]);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it('reports acquisition phases in their execution order', async () => {
|
|
85
|
+
const phases: string[] = [];
|
|
86
|
+
const result = await acquireDeviceGeneration(
|
|
87
|
+
{ rhi },
|
|
88
|
+
{} as HTMLCanvasElement,
|
|
89
|
+
undefined,
|
|
90
|
+
undefined,
|
|
91
|
+
(phase) => phases.push(phase),
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
expect(result.ok).toBe(true);
|
|
95
|
+
expect(phases).toEqual(['acquire-adapter', 'acquire-device']);
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
it('treats the null graph probe as structural-only and rejects a non-null pixel mismatch', async () => {
|
|
99
|
+
const adapter = (await rhi.requestAdapter()).unwrap();
|
|
100
|
+
const nullDevice = (await adapter.requestDevice()).unwrap();
|
|
101
|
+
const texture = nullDevice
|
|
102
|
+
.createTexture({
|
|
103
|
+
label: 'recovery-probe-test.texture',
|
|
104
|
+
size: { width: 1, height: 1, depthOrArrayLayers: 1 },
|
|
105
|
+
mipLevelCount: 1,
|
|
106
|
+
sampleCount: 1,
|
|
107
|
+
dimension: '2d',
|
|
108
|
+
format: 'rgba8unorm',
|
|
109
|
+
usage: 0x11,
|
|
110
|
+
viewFormats: undefined,
|
|
111
|
+
textureBindingViewDimension: undefined,
|
|
112
|
+
})
|
|
113
|
+
.unwrap();
|
|
114
|
+
const view = nullDevice.createTextureView(texture, { dimension: '2d' }).unwrap();
|
|
115
|
+
const nullProbe = await probeCandidateGraphExecution(nullDevice, {
|
|
116
|
+
texture,
|
|
117
|
+
view,
|
|
118
|
+
format: 'rgba8unorm',
|
|
119
|
+
});
|
|
120
|
+
expect(nullProbe.ok).toBe(true);
|
|
121
|
+
|
|
122
|
+
class PixellessNonNullDevice extends RhiNullDevice {
|
|
123
|
+
override get caps() {
|
|
124
|
+
return { ...super.caps, backendKind: 'webgpu' as const };
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
const nonNullDevice = new PixellessNonNullDevice(
|
|
128
|
+
new RhiNullQueue(),
|
|
129
|
+
(bookkeeper, device) => new RhiNullCommandEncoder(bookkeeper, device),
|
|
130
|
+
);
|
|
131
|
+
const nonNullTexture = nonNullDevice
|
|
132
|
+
.createTexture({
|
|
133
|
+
label: 'recovery-probe-test.non-null-texture',
|
|
134
|
+
size: { width: 1, height: 1, depthOrArrayLayers: 1 },
|
|
135
|
+
mipLevelCount: 1,
|
|
136
|
+
sampleCount: 1,
|
|
137
|
+
dimension: '2d',
|
|
138
|
+
format: 'rgba8unorm',
|
|
139
|
+
usage: 0x11,
|
|
140
|
+
viewFormats: undefined,
|
|
141
|
+
textureBindingViewDimension: undefined,
|
|
142
|
+
})
|
|
143
|
+
.unwrap();
|
|
144
|
+
const nonNullView = nonNullDevice
|
|
145
|
+
.createTextureView(nonNullTexture, { dimension: '2d' })
|
|
146
|
+
.unwrap();
|
|
147
|
+
const nonNullProbe = await probeCandidateGraphExecution(nonNullDevice, {
|
|
148
|
+
texture: nonNullTexture,
|
|
149
|
+
view: nonNullView,
|
|
150
|
+
format: 'rgba8unorm',
|
|
151
|
+
});
|
|
152
|
+
expect(nonNullProbe.ok).toBe(false);
|
|
153
|
+
if (!nonNullProbe.ok) expect(nonNullProbe.error.code).toBe('webgpu-runtime-error');
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
it('invalidates late continuation and cleans the candidate exactly once', () => {
|
|
157
|
+
let cleanupCount = 0;
|
|
158
|
+
const continuation = createRecoveryContinuation(createRecoveryDeadline(0), () => {
|
|
159
|
+
cleanupCount += 1;
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
expect(continuation.isValid('compile-graph', 19_999)).toBe(true);
|
|
163
|
+
continuation.abandon(20_000);
|
|
164
|
+
expect(continuation.isValid('compile-graph', 20_000)).toBe(false);
|
|
165
|
+
continuation.cleanupOnce();
|
|
166
|
+
continuation.cleanupOnce();
|
|
167
|
+
expect(cleanupCount).toBe(1);
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
it('invalidates an async step on timeout before a late completion can write', async () => {
|
|
171
|
+
let cleanupCount = 0;
|
|
172
|
+
let lateWrites = 0;
|
|
173
|
+
const startedAt = Date.now();
|
|
174
|
+
const deadline = {
|
|
175
|
+
startedAt,
|
|
176
|
+
totalDeadlineMs: 1,
|
|
177
|
+
adapterDeadlineMs: 1,
|
|
178
|
+
deviceDeadlineMs: 1,
|
|
179
|
+
deadlineAt: startedAt + 1,
|
|
180
|
+
beginDeviceAcquisition: (_now: number) => undefined,
|
|
181
|
+
isValid: (
|
|
182
|
+
_phase:
|
|
183
|
+
| 'quiesce'
|
|
184
|
+
| 'acquire-adapter'
|
|
185
|
+
| 'acquire-device'
|
|
186
|
+
| 'rehydrate'
|
|
187
|
+
| 'compile-graph'
|
|
188
|
+
| 'publish'
|
|
189
|
+
| 'cleanup',
|
|
190
|
+
now: number,
|
|
191
|
+
) => now < startedAt + 1,
|
|
192
|
+
elapsed: (now: number) => Math.max(0, now - startedAt),
|
|
193
|
+
};
|
|
194
|
+
const continuation = createRecoveryContinuation(deadline, () => {
|
|
195
|
+
cleanupCount += 1;
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
const outcome = await runRecoveryStep(
|
|
199
|
+
async (attemptToken) => {
|
|
200
|
+
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
201
|
+
if (attemptToken?.isValid('compile-graph', Date.now())) lateWrites += 1;
|
|
202
|
+
return ok(undefined);
|
|
203
|
+
},
|
|
204
|
+
'compile-graph',
|
|
205
|
+
deadline,
|
|
206
|
+
Date.now,
|
|
207
|
+
continuation,
|
|
208
|
+
);
|
|
209
|
+
|
|
210
|
+
expect(outcome.kind).toBe('timeout');
|
|
211
|
+
if (outcome.kind === 'timeout') expect(outcome.timeout.cause.code).toBe('webgpu-runtime-error');
|
|
212
|
+
await new Promise((resolve) => setTimeout(resolve, 20));
|
|
213
|
+
expect(lateWrites).toBe(0);
|
|
214
|
+
expect(cleanupCount).toBe(1);
|
|
215
|
+
});
|
|
216
|
+
});
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { TaaHistoryStore } from '../temporal/taa-history-store';
|
|
3
|
+
|
|
4
|
+
type RecoveryReceipt = {
|
|
5
|
+
readonly deviceGeneration: number;
|
|
6
|
+
readonly completed: boolean;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type RecoverableHistory = TaaHistoryStore & {
|
|
10
|
+
recoverForGeneration(deviceGeneration: number): void;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
function recover(store: TaaHistoryStore, deviceGeneration: number): void {
|
|
14
|
+
(store as RecoverableHistory).recoverForGeneration(deviceGeneration);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function commit(store: TaaHistoryStore, receipt: RecoveryReceipt): void {
|
|
18
|
+
const attempt = store.begin('device-generation');
|
|
19
|
+
attempt.commit(receipt as never);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
describe('M4 / m4_t2 — target history recovery keeps logical token', () => {
|
|
23
|
+
it('publishes uninitialized replacement storage with neutral fallback', () => {
|
|
24
|
+
const store = new TaaHistoryStore();
|
|
25
|
+
const token = (
|
|
26
|
+
store.inspect() as typeof store.inspect extends () => infer T ? T : never & { token: string }
|
|
27
|
+
).token;
|
|
28
|
+
|
|
29
|
+
recover(store, 8);
|
|
30
|
+
|
|
31
|
+
expect(store.inspect()).toMatchObject({
|
|
32
|
+
token,
|
|
33
|
+
deviceGeneration: 8,
|
|
34
|
+
content: 'uninitialized',
|
|
35
|
+
fallback: 'neutral-texture',
|
|
36
|
+
valid: false,
|
|
37
|
+
requestVersion: 0,
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('raises history only for a matching completed receipt', () => {
|
|
42
|
+
const store = new TaaHistoryStore();
|
|
43
|
+
recover(store, 8);
|
|
44
|
+
const before = store.inspect();
|
|
45
|
+
|
|
46
|
+
commit(store, { deviceGeneration: 7, completed: true });
|
|
47
|
+
expect(store.inspect()).toMatchObject({
|
|
48
|
+
token: before.token,
|
|
49
|
+
deviceGeneration: 8,
|
|
50
|
+
content: 'uninitialized',
|
|
51
|
+
valid: false,
|
|
52
|
+
requestVersion: 0,
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
commit(store, { deviceGeneration: 8, completed: false });
|
|
56
|
+
expect(store.inspect().valid).toBe(false);
|
|
57
|
+
|
|
58
|
+
commit(store, { deviceGeneration: 8, completed: true });
|
|
59
|
+
expect(store.inspect()).toMatchObject({
|
|
60
|
+
token: before.token,
|
|
61
|
+
deviceGeneration: 8,
|
|
62
|
+
content: 'active',
|
|
63
|
+
valid: true,
|
|
64
|
+
requestVersion: 1,
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it('does not invent once or on-demand requests during replacement', () => {
|
|
69
|
+
const store = new TaaHistoryStore();
|
|
70
|
+
recover(store, 9);
|
|
71
|
+
const inspection = store.inspect() as typeof store.inspect extends () => infer T
|
|
72
|
+
? T
|
|
73
|
+
: never & {
|
|
74
|
+
requestVersion: number;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
expect(inspection.requestVersion).toBe(0);
|
|
78
|
+
expect(inspection.content).toBe('uninitialized');
|
|
79
|
+
});
|
|
80
|
+
});
|
|
@@ -58,22 +58,19 @@ const standardPbrVariants = (() => {
|
|
|
58
58
|
const variants = [];
|
|
59
59
|
for (const cluster of [false, true]) {
|
|
60
60
|
for (const storage of [false, true]) {
|
|
61
|
-
for (const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
: sortedDefines.map(([key, value]) => `${key}=${value}`).join('+');
|
|
75
|
-
variants.push({ definesKey, defines, composedWgsl: pbrWgsl });
|
|
76
|
-
}
|
|
61
|
+
for (const vertexColor of [false, true]) {
|
|
62
|
+
const defines = {
|
|
63
|
+
CLUSTER_FORWARD_AVAILABLE: cluster,
|
|
64
|
+
STORAGE_BUFFER_AVAILABLE: storage,
|
|
65
|
+
VERTEX_COLOR_AVAILABLE: vertexColor,
|
|
66
|
+
};
|
|
67
|
+
const sortedDefines = Object.entries(defines).sort(([left], [right]) =>
|
|
68
|
+
left < right ? -1 : left > right ? 1 : 0,
|
|
69
|
+
);
|
|
70
|
+
const definesKey = sortedDefines.every(([, value]) => value)
|
|
71
|
+
? ''
|
|
72
|
+
: sortedDefines.map(([key, value]) => `${key}=${value}`).join('+');
|
|
73
|
+
variants.push({ definesKey, defines, composedWgsl: pbrWgsl });
|
|
77
74
|
}
|
|
78
75
|
}
|
|
79
76
|
}
|
|
@@ -20,7 +20,7 @@ const fragmentConsumerSources = [
|
|
|
20
20
|
pbrPipelineSource,
|
|
21
21
|
iblPipelineCacheSource,
|
|
22
22
|
readFileSync(new URL('../ibl/skylight-bind-group.ts', import.meta.url), 'utf8'),
|
|
23
|
-
readFileSync(new URL('../assembly/
|
|
23
|
+
readFileSync(new URL('../assembly/webgpu-renderer.ts', import.meta.url), 'utf8'),
|
|
24
24
|
];
|
|
25
25
|
|
|
26
26
|
describe('shader stage owner', () => {
|
|
@@ -53,6 +53,17 @@ describe('custom skinned mesh motion consumer contract', () => {
|
|
|
53
53
|
composedWgsl: '@group(2) @binding(1) var<storage> palette: array<u32>;',
|
|
54
54
|
paramSchema: '[]',
|
|
55
55
|
variants: [
|
|
56
|
+
{
|
|
57
|
+
definesKey:
|
|
58
|
+
'CLUSTER_FORWARD_AVAILABLE=false+PROBE_BLEND_AVAILABLE=true+STORAGE_BUFFER_AVAILABLE=true+VERTEX_COLOR_AVAILABLE=false',
|
|
59
|
+
defines: {
|
|
60
|
+
CLUSTER_FORWARD_AVAILABLE: false,
|
|
61
|
+
PROBE_BLEND_AVAILABLE: true,
|
|
62
|
+
STORAGE_BUFFER_AVAILABLE: true,
|
|
63
|
+
VERTEX_COLOR_AVAILABLE: false,
|
|
64
|
+
},
|
|
65
|
+
composedWgsl: 'probe-urp',
|
|
66
|
+
},
|
|
56
67
|
{
|
|
57
68
|
definesKey:
|
|
58
69
|
'CLUSTER_FORWARD_AVAILABLE=false+STORAGE_BUFFER_AVAILABLE=true+VERTEX_COLOR_AVAILABLE=false',
|
|
@@ -63,6 +74,17 @@ describe('custom skinned mesh motion consumer contract', () => {
|
|
|
63
74
|
},
|
|
64
75
|
composedWgsl: '@group(2) @binding(1) var<storage> palette: array<u32>;',
|
|
65
76
|
},
|
|
77
|
+
{
|
|
78
|
+
definesKey:
|
|
79
|
+
'CLUSTER_FORWARD_AVAILABLE=true+PROBE_BLEND_AVAILABLE=true+STORAGE_BUFFER_AVAILABLE=true+VERTEX_COLOR_AVAILABLE=false',
|
|
80
|
+
defines: {
|
|
81
|
+
CLUSTER_FORWARD_AVAILABLE: true,
|
|
82
|
+
PROBE_BLEND_AVAILABLE: true,
|
|
83
|
+
STORAGE_BUFFER_AVAILABLE: true,
|
|
84
|
+
VERTEX_COLOR_AVAILABLE: false,
|
|
85
|
+
},
|
|
86
|
+
composedWgsl: 'probe-hdrp',
|
|
87
|
+
},
|
|
66
88
|
{
|
|
67
89
|
definesKey:
|
|
68
90
|
'CLUSTER_FORWARD_AVAILABLE=true+STORAGE_BUFFER_AVAILABLE=true+VERTEX_COLOR_AVAILABLE=false',
|
|
@@ -122,10 +122,10 @@ describe('skinned shadow caster', () => {
|
|
|
122
122
|
'const projectorAvailable = pipelineState.projectorAvailable !== false;',
|
|
123
123
|
);
|
|
124
124
|
expect(recordSource).toContain(
|
|
125
|
-
'...(
|
|
125
|
+
'...(extendedLighting\n ? extendedLightingCacheKeys\n : projectorAvailable\n ? [pipelineState.defaultWhiteTextureView, pipelineState.defaultSampler]',
|
|
126
126
|
);
|
|
127
127
|
expect(recordSource).toContain(
|
|
128
|
-
'...(projectorAvailable\n ? [\n {\n binding: 11,',
|
|
128
|
+
'...(!extendedLighting && projectorAvailable\n ? [\n {\n binding: 11,',
|
|
129
129
|
);
|
|
130
130
|
expect(recordSource).toContain('binding: 12');
|
|
131
131
|
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import {
|
|
3
|
+
prepareCookieProjection,
|
|
4
|
+
projectCookieUv,
|
|
5
|
+
projectIesCoordinates,
|
|
6
|
+
spotModifierProduct,
|
|
7
|
+
} from '../prepare/extended-lighting/spot-modifiers';
|
|
8
|
+
|
|
9
|
+
describe('Spot modifier projection', () => {
|
|
10
|
+
it('keeps the shared multiplication order and unit identities', () => {
|
|
11
|
+
expect(
|
|
12
|
+
spotModifierProduct({ brdf: 2, range: 0.8, cone: 0.5, ies: 0.25, cookie: 0.4, shadow: 0.75 }),
|
|
13
|
+
).toBe(2 * 0.8 * 0.5 * 0.25 * 0.4 * 0.75);
|
|
14
|
+
expect(spotModifierProduct({ brdf: 1, range: 1, cone: 1, shadow: 1 })).toBe(1);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('projects roll and non-square cookie dimensions into stable coordinates', () => {
|
|
18
|
+
const coords = projectIesCoordinates([0, 0, -1], 90);
|
|
19
|
+
expect(coords).toMatchObject({ azimuth: expect.any(Number), elevation: expect.any(Number) });
|
|
20
|
+
expect(projectCookieUv([0, 0, -1], 90, 2)).toMatchObject({
|
|
21
|
+
u: expect.any(Number),
|
|
22
|
+
v: expect.any(Number),
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('returns black behind the light and outside the projected cone', () => {
|
|
27
|
+
expect(projectIesCoordinates([0, 0, 1], 0)).toBeUndefined();
|
|
28
|
+
expect(projectCookieUv([0, 2, -1], 0, 1)).toBeUndefined();
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('projects non-square sRGB RGBA data once into linear fixed-size slices', () => {
|
|
32
|
+
const asset = {
|
|
33
|
+
kind: 'texture' as const,
|
|
34
|
+
shape: { viewDimension: '2d' as const, extent: { width: 2, height: 1 } },
|
|
35
|
+
format: 'rgba8unorm-srgb' as const,
|
|
36
|
+
colorSpace: 'srgb' as const,
|
|
37
|
+
mipmap: false,
|
|
38
|
+
mips: { kind: 'none' as const },
|
|
39
|
+
data: new Uint8Array([128, 0, 0, 128, 0, 255, 0, 255]),
|
|
40
|
+
};
|
|
41
|
+
const projection = prepareCookieProjection(asset);
|
|
42
|
+
|
|
43
|
+
expect(projection).toBeDefined();
|
|
44
|
+
expect(projection?.data.byteLength).toBe(256 * 256 * 4);
|
|
45
|
+
expect(projection?.aspect).toBe(2);
|
|
46
|
+
expect(projection?.matrix[0]).toBeCloseTo(0.5, 6);
|
|
47
|
+
expect(projection?.matrix[5]).toBe(1);
|
|
48
|
+
// The first source texel is sampled near its center. 128 sRGB is not
|
|
49
|
+
// copied as 128 linear; it is converted to roughly 55 linear bytes.
|
|
50
|
+
expect(projection?.data[0]).toBeLessThan(70);
|
|
51
|
+
expect(projection?.data[1]).toBe(0);
|
|
52
|
+
expect(projection?.data[3]).toBe(128);
|
|
53
|
+
const right = 256 * 4 - 4;
|
|
54
|
+
expect(projection?.data[right + 1]).toBeGreaterThan(240);
|
|
55
|
+
expect(projection).toBe(prepareCookieProjection(asset));
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('rejects a non-RGBA8 source instead of silently binding raw bytes', () => {
|
|
59
|
+
const asset = {
|
|
60
|
+
kind: 'texture' as const,
|
|
61
|
+
shape: { viewDimension: '2d' as const, extent: { width: 1, height: 1 } },
|
|
62
|
+
format: 'rgba16float' as const,
|
|
63
|
+
colorSpace: 'linear' as const,
|
|
64
|
+
mipmap: false,
|
|
65
|
+
mips: { kind: 'none' as const },
|
|
66
|
+
data: new Uint8Array(8),
|
|
67
|
+
};
|
|
68
|
+
expect(prepareCookieProjection(asset)).toBeUndefined();
|
|
69
|
+
});
|
|
70
|
+
});
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import {
|
|
3
|
+
admitSsrM0,
|
|
4
|
+
projectSsrDependencies,
|
|
5
|
+
SSR_FORMAT_STAGES,
|
|
6
|
+
type SsrAdmissionIdentity,
|
|
7
|
+
type SsrFormatReceipt,
|
|
8
|
+
type SsrReflectionFallbackReceipt,
|
|
9
|
+
} from '../ssr/admission';
|
|
10
|
+
|
|
11
|
+
const identity: SsrAdmissionIdentity = {
|
|
12
|
+
sourceHead: 'head',
|
|
13
|
+
sourceTree: 'tree',
|
|
14
|
+
lockSha256: 'lock',
|
|
15
|
+
buildSha256: 'build',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const reflectionFallback = {
|
|
19
|
+
identity,
|
|
20
|
+
source: 'probe' as const,
|
|
21
|
+
sourceGeneration: 4,
|
|
22
|
+
projectionGeneration: 4,
|
|
23
|
+
deviceGeneration: 2,
|
|
24
|
+
state: 'active' as const,
|
|
25
|
+
candidateVisible: false as const,
|
|
26
|
+
coverage: 1,
|
|
27
|
+
brdfSignature: 'standard-pbr-ibl-v1',
|
|
28
|
+
} satisfies SsrReflectionFallbackReceipt;
|
|
29
|
+
|
|
30
|
+
const format = {
|
|
31
|
+
identity,
|
|
32
|
+
profile: 'r32float-mip-sampled-storage' as const,
|
|
33
|
+
verdict: 'admitted' as const,
|
|
34
|
+
evidence: 'real' as const,
|
|
35
|
+
stages: SSR_FORMAT_STAGES.map((stage) => ({
|
|
36
|
+
stage,
|
|
37
|
+
verdict: 'admitted' as const,
|
|
38
|
+
evidence: 'real' as const,
|
|
39
|
+
})),
|
|
40
|
+
deviceGeneration: 2,
|
|
41
|
+
sampleType: 'unfilterable-float' as const,
|
|
42
|
+
usages: ['texture-binding', 'storage-binding', 'copy-src'] as const,
|
|
43
|
+
readback: { byteLength: 4, values: [1] },
|
|
44
|
+
probeExecutions: 1,
|
|
45
|
+
} satisfies SsrFormatReceipt;
|
|
46
|
+
|
|
47
|
+
const temporal = {
|
|
48
|
+
identity,
|
|
49
|
+
successfulSubmit: true as const,
|
|
50
|
+
generation: 4,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
describe('SSR M0 admission matrix', () => {
|
|
54
|
+
it('keeps an unrequested unbound renderer on the ordinary zero-work path', () => {
|
|
55
|
+
const result = projectSsrDependencies({
|
|
56
|
+
requested: false,
|
|
57
|
+
identity: undefined,
|
|
58
|
+
reflectionFallback: undefined,
|
|
59
|
+
format: undefined,
|
|
60
|
+
temporal: undefined,
|
|
61
|
+
});
|
|
62
|
+
expect(result.status).toBe('fallback-only');
|
|
63
|
+
expect(result.failure?.code).toBe('ssr-not-requested');
|
|
64
|
+
expect(result.work.temporalDemand).toBe(0);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('keeps unrequested SSR at fallback-only with exact zero work', () => {
|
|
68
|
+
const result = admitSsrM0({ requested: false, identity });
|
|
69
|
+
expect(result.status).toBe('fallback-only');
|
|
70
|
+
expect(result.work).toEqual({
|
|
71
|
+
attachmentCount: 0,
|
|
72
|
+
passCount: 0,
|
|
73
|
+
bindingCount: 0,
|
|
74
|
+
resourceCount: 0,
|
|
75
|
+
historyCount: 0,
|
|
76
|
+
temporalDemand: 0,
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it.each([
|
|
81
|
+
['producer', { format, temporal }, 'rebuild'],
|
|
82
|
+
['format', { reflectionFallback, temporal }, 'retry'],
|
|
83
|
+
['temporal', { reflectionFallback, format }, 'retry'],
|
|
84
|
+
] as const)('blocks when the %s receipt is absent', (_, receipts, action) => {
|
|
85
|
+
const result = admitSsrM0({ requested: true, identity, ...receipts });
|
|
86
|
+
expect(result.status).toBe('fallback-only');
|
|
87
|
+
expect(result.work.temporalDemand).toBe(0);
|
|
88
|
+
expect(result.failure?.detail.action).toBe(action);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it('publishes a typed owner recovery action on every blocked path', () => {
|
|
92
|
+
const notRequested = admitSsrM0({ requested: false, identity });
|
|
93
|
+
expect(notRequested.failure?.detail.action).toBe('retry');
|
|
94
|
+
|
|
95
|
+
const mismatched = admitSsrM0({
|
|
96
|
+
requested: true,
|
|
97
|
+
identity,
|
|
98
|
+
reflectionFallback: {
|
|
99
|
+
...reflectionFallback,
|
|
100
|
+
identity: { ...identity, sourceHead: 'old-head' },
|
|
101
|
+
},
|
|
102
|
+
format,
|
|
103
|
+
temporal,
|
|
104
|
+
});
|
|
105
|
+
expect(mismatched.failure?.detail).toMatchObject({
|
|
106
|
+
owner: 'producer',
|
|
107
|
+
action: 'rebuild',
|
|
108
|
+
identityField: 'sourceHead',
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
const stale = admitSsrM0({
|
|
112
|
+
requested: true,
|
|
113
|
+
identity,
|
|
114
|
+
reflectionFallback,
|
|
115
|
+
format,
|
|
116
|
+
temporal,
|
|
117
|
+
previousGeneration: reflectionFallback.projectionGeneration + 1,
|
|
118
|
+
});
|
|
119
|
+
expect(stale.failure?.detail.action).toBe('retry');
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it('rejects malformed coverage or extent without creating SSR work', () => {
|
|
123
|
+
const malformed = admitSsrM0({
|
|
124
|
+
requested: true,
|
|
125
|
+
identity,
|
|
126
|
+
reflectionFallback: {
|
|
127
|
+
...reflectionFallback,
|
|
128
|
+
coverage: 2,
|
|
129
|
+
extent: [0, 1, 1],
|
|
130
|
+
},
|
|
131
|
+
format,
|
|
132
|
+
temporal,
|
|
133
|
+
});
|
|
134
|
+
expect(malformed.status).toBe('fallback-only');
|
|
135
|
+
expect(malformed.failure?.code).toBe('ssr-reflection-fallback-unavailable');
|
|
136
|
+
expect(malformed.work).toEqual({
|
|
137
|
+
attachmentCount: 0,
|
|
138
|
+
passCount: 0,
|
|
139
|
+
bindingCount: 0,
|
|
140
|
+
resourceCount: 0,
|
|
141
|
+
historyCount: 0,
|
|
142
|
+
temporalDemand: 0,
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it('blocks structural-only format evidence and every identity mismatch', () => {
|
|
147
|
+
const structuralOnly = {
|
|
148
|
+
...format,
|
|
149
|
+
verdict: 'structural-only' as const,
|
|
150
|
+
};
|
|
151
|
+
const blocked = admitSsrM0({
|
|
152
|
+
requested: true,
|
|
153
|
+
identity,
|
|
154
|
+
reflectionFallback,
|
|
155
|
+
format: structuralOnly,
|
|
156
|
+
temporal,
|
|
157
|
+
});
|
|
158
|
+
expect(blocked.status).toBe('fallback-only');
|
|
159
|
+
|
|
160
|
+
const structuralReceipt = {
|
|
161
|
+
...format,
|
|
162
|
+
evidence: 'structural' as const,
|
|
163
|
+
};
|
|
164
|
+
const structuralBlocked = admitSsrM0({
|
|
165
|
+
requested: true,
|
|
166
|
+
identity,
|
|
167
|
+
reflectionFallback,
|
|
168
|
+
format: structuralReceipt,
|
|
169
|
+
temporal,
|
|
170
|
+
});
|
|
171
|
+
expect(structuralBlocked.status).toBe('fallback-only');
|
|
172
|
+
|
|
173
|
+
for (const field of Object.keys(identity) as (keyof SsrAdmissionIdentity)[]) {
|
|
174
|
+
const mismatched = admitSsrM0({
|
|
175
|
+
requested: true,
|
|
176
|
+
identity,
|
|
177
|
+
reflectionFallback: {
|
|
178
|
+
...reflectionFallback,
|
|
179
|
+
identity: { ...identity, [field]: `old-${field}` },
|
|
180
|
+
},
|
|
181
|
+
format,
|
|
182
|
+
temporal,
|
|
183
|
+
});
|
|
184
|
+
expect(mismatched.status, field).toBe('fallback-only');
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
it('admits only three matching receipts and reports nonzero work', () => {
|
|
189
|
+
const result = admitSsrM0({
|
|
190
|
+
requested: true,
|
|
191
|
+
identity,
|
|
192
|
+
reflectionFallback,
|
|
193
|
+
format,
|
|
194
|
+
temporal,
|
|
195
|
+
});
|
|
196
|
+
expect(result.status).toBe('admitted');
|
|
197
|
+
expect(result.work).toEqual({
|
|
198
|
+
attachmentCount: 1,
|
|
199
|
+
passCount: 1,
|
|
200
|
+
bindingCount: 1,
|
|
201
|
+
resourceCount: 1,
|
|
202
|
+
historyCount: 0,
|
|
203
|
+
temporalDemand: 0,
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
});
|