Commit Graph

3 Commits

Author SHA1 Message Date
75974c532a docs: fix the native conformance run paths 2026-11-23 21:38:21 -08:00
a9447cae88 conformance run.ps1: check the renderer before deleting, and delete only a run's own output
run.ps1 ran `Remove-Item $Output -Recurse -Force` on whatever -Output named, before checking that
conform_native.exe was built: a mistyped -Output (a drive, the repository, a home folder) was
deleted, even when nothing could be rendered into it afterwards.

Now an unbuilt renderer exits 1 before -Output is touched, and an existing -Output is emptied
only when it holds nothing but <scene>.png and manifest.json, which is all a run writes. A file,
a link or junction (a recursive Remove-Item on one can empty its target), a drive root, or a
folder with anything else is refused with exit 2 and left as it was.

tests/test_conformance_run_script.py runs the script from a temporary copy of the tree, with
where.exe standing in for the renderer (Windows only). With main's run.ps1, 6 of its 7 tests
fail, and the junction case empties the junction's target.

Finding: https://github.com/ItsNotRexed/Leonida/issues/9401#issuecomment-7114404825

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 18:30:31 -03:00
df6188194a tools: a native-D3D12 golden-image conformance harness for the Vulkan device
The shim reimplements D3D12 on Vulkan. runtime/test/ covers the device, resources,
views, copies, clears and barriers, but nothing checks that a *draw* produces the
same pixels as the host's D3D12. This adds the reference half of that check.

Seven deterministic scenes (clear, fullscreen, depth_order, scissor, blend, indexed),
each naming the exact pixels it must produce, so a mismatch is a coordinate rather
than 'the picture looks off'. tools/conformance/spec/scenes.h states the baseline
pipeline state every scene inherits - cull mode, topology, sample mask, viewport,
scissor convention, clip-space z range, row order - because two implementers
guessing differently produce two different images and neither is wrong on its own
terms.

native/ renders all seven with D3D12 and WIC, reads every pixel back from both the
GPU and the PNG on disk, and exits non-zero on any mismatch: 18 checks, 18 passes, on
an RTX 5070 Ti and on the AMD iGPU. compare.py (standard library only) checks a
render against the contract and diffs two renders with a heatmap.

The scenes are proven non-vacuous by scripts/negative-control.ps1: it disables the
depth test, the blend state and the scissor rect in a throwaway copy and requires
exactly depth_order, blend and scissor to fail at the pixels that name that state.
The script throws when a replacement stops matching, so a silenced edit cannot pass.

Against the shim at 2e5c0f2 the same scenes report clear OK and the five drawn scenes
BLOCKED at ID3D12Device::CreateRootSignature (E_NOTIMPL), which is the order the draw
path has to arrive in.

No game data is read, nothing is downloaded, and the harness is not part of CI: it
needs a D3D12 device, like root_signature_oracle_test.
2026-11-22 15:10:17 -05:00