Parent: #126
Problem
Bloom's GPU path tracer is the closest in-engine correctness oracle for BRDF energy, direct/indirect visibility, motion reprojection, and denoising. It cannot serve that role unless its golden tests are deterministic and trusted.
The audit found the two path-tracing goldens in native/shared/tests/golden_render.rs failing on the audited worktree:
pt_progressive: large mean error plus broad black/speckled regions;
pt_realtime_motion: lower mean error but localized high-error trails/outliers.
The worktree contains renderer changes, so the first task is to reproduce on a clean main checkout before assigning blame. Do not update the goldens to make the test green. First determine whether the baseline, harness, backend, or renderer is wrong.
Outcome
A deterministic GPU path-tracing correctness suite that:
- passes on every supported ray-query backend within documented backend-specific tolerance;
- fails loudly on transport, TLAS/BLAS, temporal reprojection, denoiser, or resource-lifetime regressions;
- emits enough evidence for an agent to diagnose a failure without reproducing locally;
- can act as a reference for realtime renderer changes.
Implementation contract
1. Reproduce and classify
- Run each PT golden separately on clean
main, recording commit, OS, adapter, driver, backend, features, and actual diff metrics.
- Capture
pt_progressive.actual.png and pt_realtime_motion.actual.png plus heatmaps.
- Add debug captures for raw radiance, albedo, normal, depth, motion, moments/variance, history length, and denoised output.
- Classify the first divergent stage. Do not start by widening tolerances.
2. Make stochastic inputs explicit
- Put the sample seed, sample index, camera frame index, and jitter sequence under test control.
- Reset all path-tracing history and resource state at test start.
- Ensure headless initialization cannot inherit process-global or prior-test state.
- Document which floating-point/backend differences are expected and why.
3. Fix the first incorrect stage
Likely areas include native/shared/src/renderer/pt_pass.rs, native/shared/src/renderer/shaders/pt.rs, TLAS/BLAS update ordering in renderer/mod.rs, motion matrices, SVGF history validation, and render-graph resource ordering. Fix the earliest provably incorrect stage rather than compensating downstream.
4. Improve the failure artifact
On failure, write an artifact directory containing:
- expected, actual, absolute-diff, and false-color heatmap PNGs;
- JSON with mean/max error, outlier percentage, SSIM, adapter/backend, seed, frames/spp, and enabled features;
- named intermediate buffers when
BLOOM_GOLDEN_DIAGNOSTICS=1.
Acceptance criteria
Verification
cd native/shared
cargo test --release golden_pt_progressive -- --nocapture
cargo test --release golden_pt_realtime_motion -- --nocapture
cargo test --release golden -- --nocapture
Run the relevant reference scene through tools/bloom-reference and attach the result metadata to the PR.
Non-goals
- Adding new path-tracing features.
- Raising tolerances to hide a structural regression.
- Requiring ray query on baseline adapters.
Dependencies
None. This blocks quality claims in every renderer issue under #126.
Parent: #126
Problem
Bloom's GPU path tracer is the closest in-engine correctness oracle for BRDF energy, direct/indirect visibility, motion reprojection, and denoising. It cannot serve that role unless its golden tests are deterministic and trusted.
The audit found the two path-tracing goldens in
native/shared/tests/golden_render.rsfailing on the audited worktree:pt_progressive: large mean error plus broad black/speckled regions;pt_realtime_motion: lower mean error but localized high-error trails/outliers.The worktree contains renderer changes, so the first task is to reproduce on a clean
maincheckout before assigning blame. Do not update the goldens to make the test green. First determine whether the baseline, harness, backend, or renderer is wrong.Outcome
A deterministic GPU path-tracing correctness suite that:
Implementation contract
1. Reproduce and classify
main, recording commit, OS, adapter, driver, backend, features, and actual diff metrics.pt_progressive.actual.pngandpt_realtime_motion.actual.pngplus heatmaps.2. Make stochastic inputs explicit
3. Fix the first incorrect stage
Likely areas include
native/shared/src/renderer/pt_pass.rs,native/shared/src/renderer/shaders/pt.rs, TLAS/BLAS update ordering inrenderer/mod.rs, motion matrices, SVGF history validation, and render-graph resource ordering. Fix the earliest provably incorrect stage rather than compensating downstream.4. Improve the failure artifact
On failure, write an artifact directory containing:
BLOOM_GOLDEN_DIAGNOSTICS=1.Acceptance criteria
golden_pt_progressiveandgolden_pt_realtime_motionpass three consecutive runs on the same adapter with identical or explicitly bounded metrics.tools/bloom-referenceare used to sanity-check the static scene's energy and occlusion; any expected model difference is documented.Verification
Run the relevant reference scene through
tools/bloom-referenceand attach the result metadata to the PR.Non-goals
Dependencies
None. This blocks quality claims in every renderer issue under #126.