Commit Graph

9 Commits

Author SHA1 Message Date
44db548844 Merge pull request #2340 from kirigayakazima/fix/conformance-verify-and-failure-log-safety
conformance: harden verify.ps1 and failure-log.cmd path safety
2026-11-28 16:11:41 +01:00
9964a7a8d3 Merge pull request #2337 from kirigayakazima/fix/conformance-run-ps1-exit
conformance run.ps1: propagate exit status and guard blank or root output
2026-11-28 16:11:17 +01:00
a888851de1 Merge pull request #1848 from kirigayakazima/fix/conformance-negative-control-safety
conformance: check cmake configure status, guard NativeCommandError and clean scratch in negative-control.ps1
2026-11-28 16:03:33 +01:00
240186034b conformance: harden verify.ps1 and failure-log.cmd path safety 2026-11-26 22:08:03 +08:00
6873202cfb conformance run.ps1: propagate exit status and guard blank or root output 2026-11-26 22:04:57 +08:00
914e7f51da conformance: check cmake configure status, guard NativeCommandError and clean scratch in negative-control.ps1 2026-11-25 21:04:40 +08:00
0506f2f8bb conformance build.ps1: find Visual Studio's CMake and name no Visual Studio version
The script took CMake from PATH or C:/Program Files/CMake only, so it failed on
a Visual Studio Build Tools install, which includes its own. It also always
asked for Visual Studio 2022. Look for CMake as scripts/build_runtime.ps1 does
and leave the generator to CMake.

The CMake lookup was found by evilclanker9000.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 19:34:42 +07: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