Hardware DXR integration test
Run ./tools/Build-RayTracing.ps1 -Test from the repository root. This builds the exact production C++ and HLSL module, creates a headless D3D11 device on the default hardware adapter, opens the D3D12 sidecar, dispatches real ray queries, and reads GPU pixels back. No game process, world, game models or mock ray tracer is used. A DXR 1.1 GPU is required; unsupported hardware fails explicitly.
Checks:
- Two triangles occlude a receiver: expected composite about 0.595; depth-zero sky remains exactly 1.
- A green DDS produces green diffuse bounce and green reflection from behind the camera, outside the raster inputs.
- Invalid indices and nonfinite vertex data are rejected.
- A sentinel D3D11 input-assembler binding survives the sidecar pass.
- Reprojected GI converges across 32 jittered frames; the last 16 samples have a bounded range.
- Retiring/replacing geometry keeps the frame counter continuous. A deliberately large unused range is compacted, then surviving triangle indices and material references still produce the expected GPU color.
- A distant nonzero-depth surface beyond FP16 coordinate range remains finite and unchanged.
- An actual HDR cubemap lights an otherwise unlit receiver; environment distribution/MIS preserves its expected mean. A moving rigid plane accumulates history and reduces variance without losing energy.
- A perspective camera rotates across a stationary world-space plane with view-space G-buffer normals. The final history count must exceed 70% of its cap; identity matrices alone cannot exercise camera reprojection.
- Inserting/removing an unrelated offscreen instance changes TLAS indices without resetting the surviving receiver's history. A different stable identity at the exact same position must start at one sample instead of inheriting that history.
- Opaque path lighting runs before transparency. Replacing the intermediate HDR with synthetic transparent/particle content and calling the glass-only finish must preserve that content exactly.
- A direct-sun-only receiver with alternating fine normal detail must produce identical pixels with spatial denoising on and off. Deterministic sunlight stays outside the stochastic indirect-light filter.
The test verifies GPU execution and resource/data contracts. It does not prove all game materials, transparency, moving multi-grid scenes, image quality or performance. Those need the live checks described in docs/RAYTRACING.md.