@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
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
3
|
import { RhiError } from '@forgeax/engine-rhi';
|
|
4
|
+
import type { MaterialShaderManifestVariant } from '@forgeax/engine-shader';
|
|
4
5
|
import { describe, expect, it, vi } from 'vitest';
|
|
6
|
+
import { deviceOptionsForAdapter } from '../assembly/device-feature-admission';
|
|
5
7
|
import {
|
|
6
8
|
allowsUnlitPreparedFallback,
|
|
9
|
+
isSharedMaterialUserRegionCompatible,
|
|
7
10
|
normalizeMaterialShaderVariantSet,
|
|
8
11
|
resolveMaterialShaderBindingContract,
|
|
9
12
|
resolveMaterialShaderVariantSet,
|
|
@@ -17,6 +20,7 @@ import {
|
|
|
17
20
|
type PipelineBuilderContext,
|
|
18
21
|
validateTemporalPipelineContract,
|
|
19
22
|
} from '../pipeline-builder';
|
|
23
|
+
import { effectiveMaterialLayoutIdentity } from '../record/main-pass-geometry';
|
|
20
24
|
import { userRegionTextureFieldOrder } from '../record/main-pass-material';
|
|
21
25
|
|
|
22
26
|
const hdrpVariantKey =
|
|
@@ -24,7 +28,10 @@ const hdrpVariantKey =
|
|
|
24
28
|
const urpVariantKey =
|
|
25
29
|
'CLUSTER_FORWARD_AVAILABLE=false+STORAGE_BUFFER_AVAILABLE=true+VERTEX_COLOR_AVAILABLE=false';
|
|
26
30
|
|
|
27
|
-
function noColorVariant(
|
|
31
|
+
function noColorVariant(
|
|
32
|
+
definesKey: string,
|
|
33
|
+
clusterForward: boolean,
|
|
34
|
+
): MaterialShaderManifestVariant {
|
|
28
35
|
return {
|
|
29
36
|
definesKey,
|
|
30
37
|
defines: {
|
|
@@ -47,6 +54,25 @@ function noColorManifest() {
|
|
|
47
54
|
}
|
|
48
55
|
|
|
49
56
|
describe('material shader variant identity', () => {
|
|
57
|
+
it('requests the extended-lighting sampled-texture limit when the adapter supports it', () => {
|
|
58
|
+
const features = new Set<GPUFeatureName>();
|
|
59
|
+
expect(
|
|
60
|
+
deviceOptionsForAdapter({
|
|
61
|
+
features,
|
|
62
|
+
limits: { maxSampledTexturesPerShaderStage: 48 },
|
|
63
|
+
} as never),
|
|
64
|
+
).toEqual({
|
|
65
|
+
requiredFeatures: [],
|
|
66
|
+
requiredLimits: { maxSampledTexturesPerShaderStage: 21 },
|
|
67
|
+
});
|
|
68
|
+
expect(
|
|
69
|
+
deviceOptionsForAdapter({
|
|
70
|
+
features,
|
|
71
|
+
limits: { maxSampledTexturesPerShaderStage: 16 },
|
|
72
|
+
} as never),
|
|
73
|
+
).toBeUndefined();
|
|
74
|
+
});
|
|
75
|
+
|
|
50
76
|
it('preserves the distinction between absent, canonical, and explicit requests', () => {
|
|
51
77
|
const manifest = noColorManifest();
|
|
52
78
|
|
|
@@ -60,6 +86,17 @@ describe('material shader variant identity', () => {
|
|
|
60
86
|
).toBe(urpVariantKey);
|
|
61
87
|
});
|
|
62
88
|
|
|
89
|
+
it('keeps physical root declarations out of capability variant selection', () => {
|
|
90
|
+
const manifest = noColorManifest();
|
|
91
|
+
expect(
|
|
92
|
+
selectNoColorPbrVariant(
|
|
93
|
+
manifest,
|
|
94
|
+
true,
|
|
95
|
+
`${hdrpVariantKey}+CLEARCOAT_TEXTURE_AVAILABLE=true+TRANSMISSION_AVAILABLE=true`,
|
|
96
|
+
)?.definesKey,
|
|
97
|
+
).toBe(hdrpVariantKey);
|
|
98
|
+
});
|
|
99
|
+
|
|
63
100
|
it('closes the WebGL2 colored PBR axes on the URP variant and layout', () => {
|
|
64
101
|
const variants = [
|
|
65
102
|
{
|
|
@@ -200,6 +237,62 @@ describe('material shader variant identity', () => {
|
|
|
200
237
|
).toBe('SKINNING_DISABLED=false+STORAGE_BUFFER_AVAILABLE=false');
|
|
201
238
|
});
|
|
202
239
|
|
|
240
|
+
it('disables extended lighting when the device cannot sample its shared layout topology', () => {
|
|
241
|
+
const variants = [
|
|
242
|
+
{ defines: { EXTENDED_LIGHTING_AVAILABLE: false } },
|
|
243
|
+
{ defines: { EXTENDED_LIGHTING_AVAILABLE: true } },
|
|
244
|
+
];
|
|
245
|
+
|
|
246
|
+
expect(
|
|
247
|
+
resolveMaterialShaderVariantSet(
|
|
248
|
+
'EXTENDED_LIGHTING_AVAILABLE=true',
|
|
249
|
+
variants,
|
|
250
|
+
'webgpu',
|
|
251
|
+
true,
|
|
252
|
+
16,
|
|
253
|
+
),
|
|
254
|
+
).toBe('EXTENDED_LIGHTING_AVAILABLE=false');
|
|
255
|
+
expect(
|
|
256
|
+
resolveMaterialShaderVariantSet(
|
|
257
|
+
'EXTENDED_LIGHTING_AVAILABLE=true',
|
|
258
|
+
variants,
|
|
259
|
+
'webgpu',
|
|
260
|
+
true,
|
|
261
|
+
19,
|
|
262
|
+
),
|
|
263
|
+
).toBe('EXTENDED_LIGHTING_AVAILABLE=false');
|
|
264
|
+
expect(
|
|
265
|
+
resolveMaterialShaderVariantSet(
|
|
266
|
+
'EXTENDED_LIGHTING_AVAILABLE=true',
|
|
267
|
+
variants,
|
|
268
|
+
'webgpu',
|
|
269
|
+
true,
|
|
270
|
+
20,
|
|
271
|
+
),
|
|
272
|
+
).toBe('');
|
|
273
|
+
expect(
|
|
274
|
+
resolveMaterialShaderVariantSet(undefined, variants, 'webgpu', true, 20),
|
|
275
|
+
).toBeUndefined();
|
|
276
|
+
expect(
|
|
277
|
+
resolveMaterialShaderVariantSet(
|
|
278
|
+
'EXTENDED_LIGHTING_AVAILABLE=false',
|
|
279
|
+
variants,
|
|
280
|
+
'webgpu',
|
|
281
|
+
true,
|
|
282
|
+
20,
|
|
283
|
+
),
|
|
284
|
+
).toBe('');
|
|
285
|
+
expect(
|
|
286
|
+
resolveMaterialShaderVariantSet(
|
|
287
|
+
'EXTENDED_LIGHTING_AVAILABLE=true',
|
|
288
|
+
variants,
|
|
289
|
+
'webgpu',
|
|
290
|
+
false,
|
|
291
|
+
19,
|
|
292
|
+
),
|
|
293
|
+
).toBe('EXTENDED_LIGHTING_AVAILABLE=false');
|
|
294
|
+
});
|
|
295
|
+
|
|
203
296
|
it('keeps sprite region variants on the explicit empty-key contract', () => {
|
|
204
297
|
const variants = [
|
|
205
298
|
{
|
|
@@ -421,13 +514,12 @@ describe('temporal material PSO creation contract', () => {
|
|
|
421
514
|
});
|
|
422
515
|
|
|
423
516
|
describe('material shader capability variant resolution', () => {
|
|
424
|
-
it('
|
|
517
|
+
it('rewrites only backend capability axes', () => {
|
|
425
518
|
const variants = [
|
|
426
519
|
{
|
|
427
520
|
defines: {
|
|
428
521
|
CLUSTER_FORWARD_AVAILABLE: false,
|
|
429
522
|
STORAGE_BUFFER_AVAILABLE: false,
|
|
430
|
-
TRANSMISSION_AVAILABLE: false,
|
|
431
523
|
VERTEX_COLOR_AVAILABLE: false,
|
|
432
524
|
},
|
|
433
525
|
},
|
|
@@ -435,7 +527,6 @@ describe('material shader capability variant resolution', () => {
|
|
|
435
527
|
defines: {
|
|
436
528
|
CLUSTER_FORWARD_AVAILABLE: false,
|
|
437
529
|
STORAGE_BUFFER_AVAILABLE: false,
|
|
438
|
-
TRANSMISSION_AVAILABLE: true,
|
|
439
530
|
VERTEX_COLOR_AVAILABLE: false,
|
|
440
531
|
},
|
|
441
532
|
},
|
|
@@ -448,17 +539,7 @@ describe('material shader capability variant resolution', () => {
|
|
|
448
539
|
false,
|
|
449
540
|
),
|
|
450
541
|
).toBe(
|
|
451
|
-
'CLUSTER_FORWARD_AVAILABLE=false+STORAGE_BUFFER_AVAILABLE=false+
|
|
452
|
-
);
|
|
453
|
-
expect(
|
|
454
|
-
resolveMaterialShaderVariantSet(
|
|
455
|
-
'CLUSTER_FORWARD_AVAILABLE=false+STORAGE_BUFFER_AVAILABLE=true+TRANSMISSION_AVAILABLE=true+VERTEX_COLOR_AVAILABLE=false',
|
|
456
|
-
variants,
|
|
457
|
-
'wgpu-webgl2',
|
|
458
|
-
false,
|
|
459
|
-
),
|
|
460
|
-
).toBe(
|
|
461
|
-
'CLUSTER_FORWARD_AVAILABLE=false+STORAGE_BUFFER_AVAILABLE=false+TRANSMISSION_AVAILABLE=true+VERTEX_COLOR_AVAILABLE=false',
|
|
542
|
+
'CLUSTER_FORWARD_AVAILABLE=false+STORAGE_BUFFER_AVAILABLE=false+VERTEX_COLOR_AVAILABLE=false',
|
|
462
543
|
);
|
|
463
544
|
});
|
|
464
545
|
|
|
@@ -484,6 +565,16 @@ describe('material shader capability variant resolution', () => {
|
|
|
484
565
|
});
|
|
485
566
|
|
|
486
567
|
describe('material shader binding contract', () => {
|
|
568
|
+
it('does not reuse the shared PBR layout when compact texture names shift semantics', () => {
|
|
569
|
+
expect(
|
|
570
|
+
isSharedMaterialUserRegionCompatible([
|
|
571
|
+
{ name: 'baseColor', type: 'color' },
|
|
572
|
+
{ name: 'baseColorTexture', type: 'texture2d' },
|
|
573
|
+
{ name: 'normalTexture', type: 'texture2d' },
|
|
574
|
+
]),
|
|
575
|
+
).toBe(false);
|
|
576
|
+
});
|
|
577
|
+
|
|
487
578
|
it('preserves compact authored texture order for custom material schemas', () => {
|
|
488
579
|
expect(
|
|
489
580
|
userRegionTextureFieldOrder([
|
|
@@ -497,7 +588,6 @@ describe('material shader binding contract', () => {
|
|
|
497
588
|
'baseColorTexture',
|
|
498
589
|
'metallicRoughnessTexture',
|
|
499
590
|
'normalTexture',
|
|
500
|
-
'specularTintTexture',
|
|
501
591
|
'emissiveTexture',
|
|
502
592
|
'occlusionTexture',
|
|
503
593
|
'transmissionTexture',
|
|
@@ -574,8 +664,29 @@ describe('material shader binding contract', () => {
|
|
|
574
664
|
});
|
|
575
665
|
|
|
576
666
|
describe('material shader color-domain contract', () => {
|
|
667
|
+
it('keeps shared sprite layouts stable while splitting standard clearcoat maps', () => {
|
|
668
|
+
const sharedSpriteSchema = [{ name: 'tint', type: 'color' as const }];
|
|
669
|
+
const standardClearcoatSchema = [
|
|
670
|
+
{ name: 'clearcoat', type: 'f32' as const },
|
|
671
|
+
{ name: 'clearcoatTexture', type: 'texture2d' as const },
|
|
672
|
+
];
|
|
673
|
+
|
|
674
|
+
expect(effectiveMaterialLayoutIdentity('forgeax::sprite', sharedSpriteSchema)).toBeUndefined();
|
|
675
|
+
expect(
|
|
676
|
+
effectiveMaterialLayoutIdentity('forgeax::default-standard-pbr', standardClearcoatSchema),
|
|
677
|
+
).toBeTypeOf('string');
|
|
678
|
+
expect(
|
|
679
|
+
effectiveMaterialLayoutIdentity('forgeax::default-standard-pbr', [
|
|
680
|
+
{ name: 'clearcoat', type: 'f32' as const },
|
|
681
|
+
]),
|
|
682
|
+
).toBeUndefined();
|
|
683
|
+
});
|
|
684
|
+
|
|
577
685
|
it('routes HDR sprite targets to fs_main_hdr while unorm targets use fs_main', () => {
|
|
578
|
-
const source =
|
|
686
|
+
const source = [
|
|
687
|
+
readFileSync(resolve(import.meta.dirname, '../assembly/webgpu-renderer.ts'), 'utf8'),
|
|
688
|
+
readFileSync(resolve(import.meta.dirname, '../assembly/webgpu-ready.ts'), 'utf8'),
|
|
689
|
+
].join('\n');
|
|
579
690
|
expect(source).toContain(
|
|
580
691
|
"isHdr &&\n (materialShaderId === 'forgeax::sprite' || materialShaderId === 'forgeax::sprite-lit')",
|
|
581
692
|
);
|
|
@@ -583,6 +694,38 @@ describe('material shader color-domain contract', () => {
|
|
|
583
694
|
expect(source).toContain('colorFormat: isHdr ? HDR_COLOR_ATTACHMENT_FORMAT : ldrColorFormat');
|
|
584
695
|
expect(source).toContain("entryPoint = 'fs_main_hdr'");
|
|
585
696
|
});
|
|
697
|
+
|
|
698
|
+
it('keeps physical map layout derivation in the shared pipeline owner', () => {
|
|
699
|
+
const source = readFileSync(
|
|
700
|
+
resolve(import.meta.dirname, '../assembly/webgpu-renderer.ts'),
|
|
701
|
+
'utf8',
|
|
702
|
+
);
|
|
703
|
+
expect(source).toContain('isCanonicalStandardPbrMaterialShader(materialShaderId)');
|
|
704
|
+
expect(source).toContain('requiresStandardMapLayout');
|
|
705
|
+
});
|
|
706
|
+
|
|
707
|
+
it('does not reuse the scalar shared BGL for authored clearcoat maps', () => {
|
|
708
|
+
const source = readFileSync(
|
|
709
|
+
resolve(import.meta.dirname, '../assembly/webgpu-renderer.ts'),
|
|
710
|
+
'utf8',
|
|
711
|
+
);
|
|
712
|
+
expect(source).toMatch(
|
|
713
|
+
/if \(\s*!isStandardMapLayout\s*&&\s*isSharedMaterialUserRegionCompatible\(/u,
|
|
714
|
+
);
|
|
715
|
+
});
|
|
716
|
+
|
|
717
|
+
it('keeps the fixed standard texture ABI before authored clearcoat slots', () => {
|
|
718
|
+
const pipelineSource = readFileSync(resolve(import.meta.dirname, '../pbr-pipeline.ts'), 'utf8');
|
|
719
|
+
const recordSource = readFileSync(
|
|
720
|
+
resolve(import.meta.dirname, '../record/main-pass-material.ts'),
|
|
721
|
+
'utf8',
|
|
722
|
+
);
|
|
723
|
+
expect(pipelineSource).toContain(
|
|
724
|
+
'const physicalFields = physicalTextureFields(effectiveSchema)',
|
|
725
|
+
);
|
|
726
|
+
expect(pipelineSource).toContain('appendTextureInjection(afterTransmission, physicalFields)');
|
|
727
|
+
expect(recordSource).toContain('BUILTIN_USER_REGION_TEXTURE_FIELDS');
|
|
728
|
+
});
|
|
586
729
|
});
|
|
587
730
|
|
|
588
731
|
describe('material shader vertex input contract', () => {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import {
|
|
3
|
+
createContinuationTerminator,
|
|
4
|
+
executeRendererFrameTransaction,
|
|
5
|
+
} from '../assembly/renderer-frame-transaction';
|
|
6
|
+
|
|
7
|
+
describe('renderer frame generation fence', () => {
|
|
8
|
+
it('rejects a generation that changes between finish and submit', () => {
|
|
9
|
+
const activeOwner = { scope: { generation: 3 } };
|
|
10
|
+
const submitted: string[] = [];
|
|
11
|
+
const result = executeRendererFrameTransaction({
|
|
12
|
+
build: () => ({ ok: true, value: 'command' }),
|
|
13
|
+
execute: () => ({ ok: true, value: undefined }),
|
|
14
|
+
finish: () => {
|
|
15
|
+
activeOwner.scope = { generation: 4 };
|
|
16
|
+
return { ok: true, value: undefined };
|
|
17
|
+
},
|
|
18
|
+
submit: () => {
|
|
19
|
+
submitted.push('stale-command');
|
|
20
|
+
return { ok: true, value: undefined };
|
|
21
|
+
},
|
|
22
|
+
commit: () => undefined,
|
|
23
|
+
generationFence: {
|
|
24
|
+
capturedGeneration: 3,
|
|
25
|
+
currentGeneration: () => activeOwner.scope.generation,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
expect(result).toEqual({ ok: false, error: { stage: 'submit' } });
|
|
30
|
+
expect(submitted).toEqual([]);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('terminates completion and all async continuations exactly once', async () => {
|
|
34
|
+
const terminator = createContinuationTerminator();
|
|
35
|
+
const completion = terminator.promise();
|
|
36
|
+
|
|
37
|
+
expect(terminator.terminate({ code: 'device-lost' })).toBe(true);
|
|
38
|
+
expect(terminator.terminate({ code: 'disposed' })).toBe(false);
|
|
39
|
+
expect(terminator.isTerminated()).toBe(true);
|
|
40
|
+
await expect(completion).resolves.toEqual({ code: 'device-lost' });
|
|
41
|
+
|
|
42
|
+
expect(terminator.guard('readback')).toBe(false);
|
|
43
|
+
expect(terminator.guard('query')).toBe(false);
|
|
44
|
+
expect(terminator.guard('mapAsync')).toBe(false);
|
|
45
|
+
expect(terminator.guard('queue-completion')).toBe(false);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import {
|
|
3
|
+
buildGenerationAggregate,
|
|
4
|
+
createGenerationAllocator,
|
|
5
|
+
type GenerationAggregate,
|
|
6
|
+
type GenerationPublication,
|
|
7
|
+
publishGeneration,
|
|
8
|
+
} from '../assembly/recovery/generation';
|
|
9
|
+
import { DeviceScope, type LifecycleResourceSpec } from '../device/device-scope';
|
|
10
|
+
|
|
11
|
+
type TestAggregate = GenerationAggregate<
|
|
12
|
+
{ readonly id: string },
|
|
13
|
+
{ readonly id: string },
|
|
14
|
+
{ readonly id: string },
|
|
15
|
+
{ readonly id: string },
|
|
16
|
+
{ readonly id: string }
|
|
17
|
+
>;
|
|
18
|
+
|
|
19
|
+
function root(
|
|
20
|
+
kind: LifecycleResourceSpec<unknown>['kind'],
|
|
21
|
+
order: string[],
|
|
22
|
+
): LifecycleResourceSpec<unknown> {
|
|
23
|
+
return {
|
|
24
|
+
kind,
|
|
25
|
+
create: () => {
|
|
26
|
+
order.push(`create:${kind}`);
|
|
27
|
+
return { kind };
|
|
28
|
+
},
|
|
29
|
+
cleanup: () => {
|
|
30
|
+
order.push(`cleanup:${kind}`);
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
describe('generation assembly', () => {
|
|
36
|
+
it('keeps the candidate detached and publishes one immutable aggregate', async () => {
|
|
37
|
+
const order: string[] = [];
|
|
38
|
+
const scope = DeviceScope.create(4, 'renderer');
|
|
39
|
+
const candidate = await buildGenerationAggregate<TestAggregate>({
|
|
40
|
+
scope,
|
|
41
|
+
device: { id: 'device-4' },
|
|
42
|
+
context: { id: 'context-4' },
|
|
43
|
+
pipeline: { id: 'pipeline-4' },
|
|
44
|
+
producerBindings: { id: 'producers-4' },
|
|
45
|
+
graph: { id: 'graph-4' },
|
|
46
|
+
roots: [root('surface', order), root('pipeline', order)],
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
expect(candidate.ok).toBe(true);
|
|
50
|
+
if (!candidate.ok) return;
|
|
51
|
+
|
|
52
|
+
const publication: GenerationPublication<TestAggregate | undefined> = {
|
|
53
|
+
current: undefined,
|
|
54
|
+
};
|
|
55
|
+
expect(publication.current).toBeUndefined();
|
|
56
|
+
expect(Object.isFrozen(candidate.value)).toBe(true);
|
|
57
|
+
expect(candidate.value.generation).toBe(4);
|
|
58
|
+
expect(candidate.value.scope).toBe(scope);
|
|
59
|
+
expect(order).toEqual(['create:surface', 'create:pipeline']);
|
|
60
|
+
|
|
61
|
+
publishGeneration(publication, candidate.value, (value) => value.scope.isAlive());
|
|
62
|
+
|
|
63
|
+
expect(publication.current).toBe(candidate.value);
|
|
64
|
+
expect(publication.current?.device.id).toBe('device-4');
|
|
65
|
+
expect(publication.current?.context.id).toBe('context-4');
|
|
66
|
+
expect(publication.current?.pipeline.id).toBe('pipeline-4');
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it('allocates each candidate generation exactly once without moving the active generation', () => {
|
|
70
|
+
const allocator = createGenerationAllocator(9);
|
|
71
|
+
|
|
72
|
+
expect(allocator.next()).toBe(10);
|
|
73
|
+
expect(allocator.next()).toBe(11);
|
|
74
|
+
expect(allocator.next()).toBe(12);
|
|
75
|
+
expect(allocator.activeGeneration).toBe(9);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import {
|
|
3
|
+
buildGenerationAggregate,
|
|
4
|
+
type GenerationAggregate,
|
|
5
|
+
} from '../assembly/recovery/generation';
|
|
6
|
+
import { DeviceScope, type LifecycleResourceSpec } from '../device/device-scope';
|
|
7
|
+
|
|
8
|
+
type FailureAggregate = GenerationAggregate<
|
|
9
|
+
{ readonly id: string },
|
|
10
|
+
{ readonly id: string },
|
|
11
|
+
{ readonly id: string },
|
|
12
|
+
{ readonly id: string },
|
|
13
|
+
{ readonly id: string }
|
|
14
|
+
>;
|
|
15
|
+
|
|
16
|
+
const kinds: LifecycleResourceSpec<unknown>['kind'][] = [
|
|
17
|
+
'surface',
|
|
18
|
+
'pipeline',
|
|
19
|
+
'buffer',
|
|
20
|
+
'texture',
|
|
21
|
+
'feature',
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
function root(
|
|
25
|
+
kind: LifecycleResourceSpec<unknown>['kind'],
|
|
26
|
+
events: string[],
|
|
27
|
+
failure: boolean,
|
|
28
|
+
): LifecycleResourceSpec<unknown> {
|
|
29
|
+
return {
|
|
30
|
+
kind,
|
|
31
|
+
create: () => {
|
|
32
|
+
events.push(`create:${kind}`);
|
|
33
|
+
if (failure) throw new Error(`failure:${kind}`);
|
|
34
|
+
return { kind };
|
|
35
|
+
},
|
|
36
|
+
cleanup: () => {
|
|
37
|
+
events.push(`cleanup:${kind}`);
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function aggregate(scope: DeviceScope): FailureAggregate {
|
|
43
|
+
return Object.freeze({
|
|
44
|
+
generation: scope.generation,
|
|
45
|
+
scope,
|
|
46
|
+
device: { id: `device-${scope.generation}` },
|
|
47
|
+
context: { id: `context-${scope.generation}` },
|
|
48
|
+
pipeline: { id: `pipeline-${scope.generation}` },
|
|
49
|
+
producerBindings: { id: `producers-${scope.generation}` },
|
|
50
|
+
graph: { id: `graph-${scope.generation}` },
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
describe('generation assembly failure matrix', () => {
|
|
55
|
+
it.each(kinds)('abandons a candidate when the %s root fails', async (failedKind) => {
|
|
56
|
+
const events: string[] = [];
|
|
57
|
+
const activeScope = DeviceScope.create(9, 'renderer');
|
|
58
|
+
const active = aggregate(activeScope);
|
|
59
|
+
const candidateScope = DeviceScope.create(11, 'renderer');
|
|
60
|
+
const result = await buildGenerationAggregate<FailureAggregate>({
|
|
61
|
+
scope: candidateScope,
|
|
62
|
+
device: { id: 'device-11' },
|
|
63
|
+
context: { id: 'context-11' },
|
|
64
|
+
pipeline: { id: 'pipeline-11' },
|
|
65
|
+
producerBindings: { id: 'producers-11' },
|
|
66
|
+
graph: { id: 'graph-11' },
|
|
67
|
+
roots: kinds.map((kind) => root(kind, events, kind === failedKind)),
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
expect(result.ok).toBe(false);
|
|
71
|
+
if (result.ok) return;
|
|
72
|
+
expect(result.error.code).toBe('generation-assembly-failed');
|
|
73
|
+
expect(result.error.generation).toBe(11);
|
|
74
|
+
expect(result.error.resourceKind).toBe(failedKind);
|
|
75
|
+
expect(result.error.cleanupFailures).toEqual([]);
|
|
76
|
+
expect(candidateScope.state).toBe('abandoned');
|
|
77
|
+
expect(events.filter((event) => event.startsWith('cleanup:'))).toEqual(
|
|
78
|
+
events
|
|
79
|
+
.filter((event) => event.startsWith('create:') && !event.endsWith(failedKind))
|
|
80
|
+
.reverse()
|
|
81
|
+
.map((event) => event.replace('create:', 'cleanup:')),
|
|
82
|
+
);
|
|
83
|
+
expect(active.scope.state).toBe('active');
|
|
84
|
+
expect(active.generation).toBe(9);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('keeps the active aggregate unchanged when candidate publication is skipped', async () => {
|
|
88
|
+
const events: string[] = [];
|
|
89
|
+
const activeScope = DeviceScope.create(20, 'renderer');
|
|
90
|
+
const active = aggregate(activeScope);
|
|
91
|
+
const candidateScope = DeviceScope.create(22, 'renderer');
|
|
92
|
+
const result = await buildGenerationAggregate<FailureAggregate>({
|
|
93
|
+
scope: candidateScope,
|
|
94
|
+
device: { id: 'device-22' },
|
|
95
|
+
context: { id: 'context-22' },
|
|
96
|
+
pipeline: { id: 'pipeline-22' },
|
|
97
|
+
producerBindings: { id: 'producers-22' },
|
|
98
|
+
graph: { id: 'graph-22' },
|
|
99
|
+
roots: [root('surface', events, false), root('pipeline', events, true)],
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
expect(result.ok).toBe(false);
|
|
103
|
+
expect(active).toEqual(aggregate(activeScope));
|
|
104
|
+
expect(active.scope.state).toBe('active');
|
|
105
|
+
expect(candidateScope.generation).toBe(22);
|
|
106
|
+
expect(events).toEqual(['create:surface', 'create:pipeline', 'cleanup:surface']);
|
|
107
|
+
});
|
|
108
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { createRendererProducerRootMatrix } from '../render-system';
|
|
3
|
+
|
|
4
|
+
describe('renderer producer root matrix', () => {
|
|
5
|
+
it('enumerates the current baseline resource families with one owner each', () => {
|
|
6
|
+
const matrix = createRendererProducerRootMatrix();
|
|
7
|
+
|
|
8
|
+
expect(matrix.map((root) => root.kind)).toEqual([
|
|
9
|
+
'backend-surface',
|
|
10
|
+
'shader-material-pipeline',
|
|
11
|
+
'mesh-texture-sampler',
|
|
12
|
+
'render-scene',
|
|
13
|
+
'gpu-driven',
|
|
14
|
+
'feature',
|
|
15
|
+
'external-source',
|
|
16
|
+
'render-graph',
|
|
17
|
+
'target-history',
|
|
18
|
+
'observation-lease',
|
|
19
|
+
]);
|
|
20
|
+
expect(new Set(matrix.map((root) => root.owner)).size).toBe(matrix.length);
|
|
21
|
+
expect(matrix.every((root) => root.candidateScope === 'device-scope')).toBe(true);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('separates visible roots from lazy non-visible work', () => {
|
|
25
|
+
const matrix = createRendererProducerRootMatrix();
|
|
26
|
+
const visible = matrix.filter((root) => root.visibility === 'visible-workset');
|
|
27
|
+
const lazy = matrix.filter((root) => root.visibility === 'non-visible-lazy');
|
|
28
|
+
|
|
29
|
+
expect(visible.length).toBeGreaterThan(0);
|
|
30
|
+
expect(lazy.length).toBeGreaterThan(0);
|
|
31
|
+
expect(lazy.every((root) => root.disabledWork === 'zero')).toBe(true);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import {
|
|
3
|
+
classifyRecoveryCapability,
|
|
4
|
+
type RecoveryCapabilityFacts,
|
|
5
|
+
} from '../gpu-driven/production-raster';
|
|
6
|
+
|
|
7
|
+
const allCapabilities: RecoveryCapabilityFacts = {
|
|
8
|
+
generation: 7,
|
|
9
|
+
compute: true,
|
|
10
|
+
storageBuffer: true,
|
|
11
|
+
indirectDrawing: true,
|
|
12
|
+
multisample: true,
|
|
13
|
+
shaderCompilation: true,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
describe('renderer recovery capability matrix', () => {
|
|
17
|
+
it('publishes the standard fallback when optional capability is absent', () => {
|
|
18
|
+
const result = classifyRecoveryCapability({
|
|
19
|
+
...allCapabilities,
|
|
20
|
+
multisample: false,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
expect(result).toEqual({
|
|
24
|
+
status: 'fallback',
|
|
25
|
+
generation: 7,
|
|
26
|
+
disabled: [],
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('reports optional GPU-driven work as disabled without allocation', () => {
|
|
31
|
+
const result = classifyRecoveryCapability({
|
|
32
|
+
...allCapabilities,
|
|
33
|
+
compute: false,
|
|
34
|
+
storageBuffer: false,
|
|
35
|
+
indirectDrawing: false,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
expect(result).toEqual({
|
|
39
|
+
status: 'disabled',
|
|
40
|
+
generation: 7,
|
|
41
|
+
disabled: ['gpu-driven'],
|
|
42
|
+
allocations: 0,
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('refuses a generation that lacks a core shader capability', () => {
|
|
47
|
+
const result = classifyRecoveryCapability({
|
|
48
|
+
...allCapabilities,
|
|
49
|
+
shaderCompilation: false,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
expect(result).toEqual({
|
|
53
|
+
status: 'refused',
|
|
54
|
+
generation: 7,
|
|
55
|
+
failedOwner: 'shader-material-pipeline',
|
|
56
|
+
resourceKind: 'pipeline',
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
});
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import {
|
|
3
|
+
createRecoveryFailedError,
|
|
4
|
+
RECOVERY_PHASES,
|
|
5
|
+
type RecoveryFailureDetail,
|
|
6
|
+
} from '../errors/recover';
|
|
7
|
+
|
|
8
|
+
const receipt = Object.freeze({ owner: 'renderer', generation: 4, resourceCount: 3 });
|
|
9
|
+
|
|
10
|
+
function detail(overrides: Partial<RecoveryFailureDetail> = {}): RecoveryFailureDetail {
|
|
11
|
+
return {
|
|
12
|
+
phase: 'compile-graph',
|
|
13
|
+
oldGeneration: 4,
|
|
14
|
+
candidateGeneration: 5,
|
|
15
|
+
attempt: 2,
|
|
16
|
+
elapsedMs: 120,
|
|
17
|
+
retryable: true,
|
|
18
|
+
guidance: 'retry',
|
|
19
|
+
owner: 'standard-pipeline',
|
|
20
|
+
resourceKind: 'pipeline',
|
|
21
|
+
lastOutcome: 'failed',
|
|
22
|
+
rehydratedRoots: 3,
|
|
23
|
+
staleLossEvents: 1,
|
|
24
|
+
cause: new Error('candidate failed'),
|
|
25
|
+
cleanupFailures: [],
|
|
26
|
+
receipt,
|
|
27
|
+
...overrides,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
describe('renderer recovery error contract', () => {
|
|
32
|
+
it('keeps recovery phases and guidance closed and machine-readable', () => {
|
|
33
|
+
expect(RECOVERY_PHASES).toEqual([
|
|
34
|
+
'quiesce',
|
|
35
|
+
'acquire-adapter',
|
|
36
|
+
'acquire-device',
|
|
37
|
+
'rehydrate',
|
|
38
|
+
'compile-graph',
|
|
39
|
+
'publish',
|
|
40
|
+
'cleanup',
|
|
41
|
+
]);
|
|
42
|
+
|
|
43
|
+
const failure = createRecoveryFailedError(detail());
|
|
44
|
+
expect(failure.code).toBe('recovery-failed');
|
|
45
|
+
expect(failure.expected).toContain('complete replacement');
|
|
46
|
+
expect(failure.hint).toContain('detail');
|
|
47
|
+
expect(failure.detail.phase).toBe('compile-graph');
|
|
48
|
+
expect(failure.detail.oldGeneration).toBe(4);
|
|
49
|
+
expect(failure.detail.candidateGeneration).toBe(5);
|
|
50
|
+
expect(failure.detail.attempt).toBe(2);
|
|
51
|
+
expect(failure.detail.elapsedMs).toBe(120);
|
|
52
|
+
expect(failure.detail.retryable).toBe(true);
|
|
53
|
+
expect(failure.detail.guidance).toBe('retry');
|
|
54
|
+
expect(failure.detail.owner).toBe('standard-pipeline');
|
|
55
|
+
expect(failure.detail.resourceKind).toBe('pipeline');
|
|
56
|
+
expect(failure.detail.lastOutcome).toBe('failed');
|
|
57
|
+
expect(failure.detail.rehydratedRoots).toBe(3);
|
|
58
|
+
expect(failure.detail.staleLossEvents).toBe(1);
|
|
59
|
+
expect(failure.detail.cleanupFailures).toEqual([]);
|
|
60
|
+
expect(Object.isFrozen(failure.detail)).toBe(true);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it.each([
|
|
64
|
+
['retry', true],
|
|
65
|
+
['repair-owner', true],
|
|
66
|
+
['rebuild-renderer', false],
|
|
67
|
+
] as const)('preserves the %s guidance branch', (guidance, retryable) => {
|
|
68
|
+
const failure = createRecoveryFailedError(detail({ guidance, retryable }));
|
|
69
|
+
expect(failure.detail.guidance).toBe(guidance);
|
|
70
|
+
expect(failure.detail.retryable).toBe(retryable);
|
|
71
|
+
expect(failure.message).not.toContain('retry');
|
|
72
|
+
});
|
|
73
|
+
});
|