d3d12_state_sweep_test: compare the per-face stencil cases only with a host that has OPTIONS14 (TEST-STATE-SWEEP-WIN10-STENCIL) #1398

Closed
qhukz13 wants to merge 2 commits from upstream-pr/1398 into main
qhukz13 commented 2026-11-24 23:26:57 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by qhukz13 on 2026-11-24T23:26:57Z.


Claimed in the coordination issue as: TEST-STATE-SWEEP-WIN10-STENCIL (claim)

What and why

#878 added separate front and back stencil masks to the layer and 16 stencil per-face masks cases to
d3d12_state_sweep. Those cases build a pipeline state stream with D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2
(and half of them call ID3D12GraphicsCommandList8::OMSetFrontAndBackStencilRef), which need
D3D12_FEATURE_D3D12_OPTIONS14.IndependentFrontAndBackStencilRefMaskSupported. Windows 10's in-box D3D12 does not
know OPTIONS14 (CheckFeatureSupport returns E_INVALIDARG) and refuses those pipelines, so on Windows 10 all 16
cases print the host refuses the pipeline (0x80070057), the layer accepts it MISMATCH and the test fails, although
the layer behaves as intended.

The test now asks the host for OPTIONS14. Where the query fails or reports FALSE, the 16 cases still run on the
layer (a layer failure is still a MISMATCH) and are printed as not comparable on this host, with the reason; they
count as skipped. A host that reports support compares them as before. The layer is not changed.

Tested

GeForce GTX 1050 Ti, NVIDIA 582.66, Windows 10 Pro 19045, MSVC RelWithDebInfo, ctest -R "^d3d12_state_sweep$":
fails on main (16 MISMATCH), passes 3 of 3 with this branch:

stencil per-face masks same, one ref, front-facing: not comparable on this host (host runtime lacks D3D12_FEATURE_D3D12_OPTIONS14, hr 0x80070057)
...
482 cases compared with NVIDIA GeForce GTX 1050 Ti, 0 differ; 16 skipped

The test always compares with the hardware adapter behind the Vulkan device (it does not read
LEONIDA_HOST_ADAPTER), so the supported path is not exercised on this machine; on a Windows 11 host that reports
OPTIONS14 the code path is the unchanged one.

GPUs tested: NVIDIA GeForce GTX 1050 Ti, driver 582.66, Windows 10 19045. No game files.

AI-assisted: yes (Claude Code, with Antigravity for the implementation and the runs)

Checklist

  • Based on current main and merges cleanly.
  • One topic.
  • No game data, keys or decryption (CONTRIBUTING.md).
  • A new translator rule is in the contract table of docs/design.md. (Test only.)

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5482072135 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1398). Originally posted by [qhukz13](https://github.com/qhukz13) on 2026-11-24T23:26:57Z. --- Claimed in the coordination issue as: TEST-STATE-SWEEP-WIN10-STENCIL ([claim](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7147410103)) ### What and why #878 added separate front and back stencil masks to the layer and 16 `stencil per-face masks` cases to `d3d12_state_sweep`. Those cases build a pipeline state stream with `D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2` (and half of them call `ID3D12GraphicsCommandList8::OMSetFrontAndBackStencilRef`), which need `D3D12_FEATURE_D3D12_OPTIONS14.IndependentFrontAndBackStencilRefMaskSupported`. Windows 10's in-box D3D12 does not know `OPTIONS14` (`CheckFeatureSupport` returns `E_INVALIDARG`) and refuses those pipelines, so on Windows 10 all 16 cases print `the host refuses the pipeline (0x80070057), the layer accepts it MISMATCH` and the test fails, although the layer behaves as intended. The test now asks the host for `OPTIONS14`. Where the query fails or reports `FALSE`, the 16 cases still run on the layer (a layer failure is still a `MISMATCH`) and are printed as not comparable on this host, with the reason; they count as skipped. A host that reports support compares them as before. The layer is not changed. ### Tested GeForce GTX 1050 Ti, NVIDIA 582.66, Windows 10 Pro 19045, MSVC RelWithDebInfo, `ctest -R "^d3d12_state_sweep$"`: fails on `main` (16 `MISMATCH`), passes 3 of 3 with this branch: ``` stencil per-face masks same, one ref, front-facing: not comparable on this host (host runtime lacks D3D12_FEATURE_D3D12_OPTIONS14, hr 0x80070057) ... 482 cases compared with NVIDIA GeForce GTX 1050 Ti, 0 differ; 16 skipped ``` The test always compares with the hardware adapter behind the Vulkan device (it does not read `LEONIDA_HOST_ADAPTER`), so the supported path is not exercised on this machine; on a Windows 11 host that reports `OPTIONS14` the code path is the unchanged one. GPUs tested: NVIDIA GeForce GTX 1050 Ti, driver 582.66, Windows 10 19045. No game files. AI-assisted: yes (Claude Code, with Antigravity for the implementation and the runs) ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic. - [x] No game data, keys or decryption (CONTRIBUTING.md). - [ ] A new translator rule is in the contract table of `docs/design.md`. (Test only.) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
PierreEbele commented 2026-11-25 15:22:31 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T15:22:31Z.


Reviewed feb22b48: test-only change; on a host without OPTIONS14 (or reporting IndependentFrontAndBackStencilRefMaskSupported = FALSE) the 16 DEPTH_STENCIL2 cases still run on the layer but count as "not comparable" instead of MISMATCH. I could not run the test here (Windows-only sweep test; no GPU), so this is a code-reading review: the shims implement DEPTH_STENCIL2 per-face masks and ID3D12GraphicsCommandList8::OMSetFrontAndBackStencilRef, and the file is unchanged on main since the base. Nits: FALSE-reporting hosts also skip the identical-mask/single-ref cases, and a post-pipeline layer failure prints "pipeline 0x00000000".

AI-assisted review.

Recommendation: Merge

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7166743162 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1398#issuecomment-7166743162). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-25T15:22:31Z. --- Reviewed feb22b48: test-only change; on a host without OPTIONS14 (or reporting IndependentFrontAndBackStencilRefMaskSupported = FALSE) the 16 DEPTH_STENCIL2 cases still run on the layer but count as "not comparable" instead of MISMATCH. I could not run the test here (Windows-only sweep test; no GPU), so this is a code-reading review: the shims implement DEPTH_STENCIL2 per-face masks and ID3D12GraphicsCommandList8::OMSetFrontAndBackStencilRef, and the file is unchanged on main since the base. Nits: FALSE-reporting hosts also skip the identical-mask/single-ref cases, and a post-pipeline layer failure prints "pipeline 0x00000000". AI-assisted review. **Recommendation:** Merge
qhukz13 commented 2026-11-25 19:24:45 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by qhukz13 on 2026-11-25T19:24:45Z.


Thanks for the review. Both nits are addressed in 8da0d91fc:

  • A host that knows OPTIONS14 but reports IndependentFrontAndBackStencilRefMaskSupported = FALSE now skips only the 14 cases that need independent faces (differing front/back masks, or OMSetFrontAndBackStencilRef). The two identical-mask single-ref DEPTH_STENCIL2 cases are compared with the host again. A host without OPTIONS14 at all still skips all 16. Non-stream cases are unaffected (their front/back fields keep the defaults).
  • run() records the failing step and its HRESULT for every call, so a layer failure prints e.g. the layer failed (CreateCommittedResource(depth) 0x8007000e) instead of pipeline 0x00000000.

Run on Windows 10 Pro 19045, GTX 1050 Ti, NVIDIA 582.66, MSVC RelWithDebInfo: d3d12_state_sweep passes 3/3 plain and 3/3 with LEONIDA_VK_VALIDATION=1 (no validation messages): 482 cases compared with the host, 0 differ, 16 skipped as not comparable (this host's runtime lacks OPTIONS14, 0x80070057). The FALSE-reporting branch is not reachable on this host, so it is checked by reading only.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7172258384 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1398#issuecomment-7172258384). Originally posted by [qhukz13](https://github.com/qhukz13) on 2026-11-25T19:24:45Z. --- Thanks for the review. Both nits are addressed in 8da0d91fc: - A host that knows OPTIONS14 but reports `IndependentFrontAndBackStencilRefMaskSupported = FALSE` now skips only the 14 cases that need independent faces (differing front/back masks, or `OMSetFrontAndBackStencilRef`). The two identical-mask single-ref `DEPTH_STENCIL2` cases are compared with the host again. A host without OPTIONS14 at all still skips all 16. Non-stream cases are unaffected (their front/back fields keep the defaults). - `run()` records the failing step and its HRESULT for every call, so a layer failure prints e.g. `the layer failed (CreateCommittedResource(depth) 0x8007000e)` instead of `pipeline 0x00000000`. Run on Windows 10 Pro 19045, GTX 1050 Ti, NVIDIA 582.66, MSVC RelWithDebInfo: `d3d12_state_sweep` passes 3/3 plain and 3/3 with `LEONIDA_VK_VALIDATION=1` (no validation messages): 482 cases compared with the host, 0 differ, 16 skipped as not comparable (this host's runtime lacks OPTIONS14, `0x80070057`). The FALSE-reporting branch is not reachable on this host, so it is checked by reading only.
OreoFR commented 2026-11-28 21:50:01 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:50:01Z.


Verified by OreoFR

  • Base: main c1ecf04ed + PR head 8da0d91fc; green run in a merge package of 12 PRs, no new ctest failure vs main
  • Test: ctest -R ^d3d12_state_sweep$
  • Red on main: OK
  • Green with the PR: OK
  • Verdict: NO RED (test-only PR; the RTX 4070 has OPTIONS14, the skip without OPTIONS14 is not exercised)
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246306865 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1398#issuecomment-7246306865). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-28T21:50:01Z. --- **Verified by OreoFR** - Base: main `c1ecf04ed` + PR head `8da0d91fc`; green run in a merge package of 12 PRs, no new ctest failure vs main - Test: `ctest -R ^d3d12_state_sweep$` - Red on main: OK - Green with the PR: OK - Verdict: NO RED (test-only PR; the RTX 4070 has OPTIONS14, the skip without OPTIONS14 is not exercised) - Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11 AI-assisted (Claude Code, Claude Opus 5.5).
zmasi commented 2026-11-29 02:08:51 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T02:08:51Z.


Windows 11 + RTX 3090 Verification (8da0d91fcf merged with main 791899f652) — PASS

  • Environment: Windows 11 (10.0.26200), MSVC 19.44.35207 (/O2 /MD /EHsc /std:c++20 /W4 /permissive- /utf-8), NVIDIA GeForce RTX 3090 (610.88, OPTIONS14.IndependentFrontAndBackStencilRefMaskSupported = 1) + VK_LAYER_KHRONOS_validation 1.4.363.1 (LEONIDA_VK_VALIDATION=1, LEONIDA_SWEEP_VS_SPV and LEONIDA_SWEEP_PS_SPV enabled).
  • Merge & Hygiene: Clean git merge-tree onto main (791899f652) (0 conflicts); python -I scripts/check_no_game_data.py rc=0; 0 new /W4 warnings.
  • Native OPTIONS14 Host Run:
    • d3d12_state_sweep_test.exe passes with rc=0: 498 cases compared with NVIDIA GeForce RTX 3090, 0 differ; 0 skipped, 0 VUID- validation errors.
  • Red -> Green (simulated Windows 10 pre-OPTIONS14 host: OPTIONS14 -> E_INVALIDARG, DEPTH_STENCIL2 stream PSO -> E_INVALIDARG, ID3D12GraphicsCommandList8 -> E_NOINTERFACE):
    • Red (main d3d12_state_sweep_test.cpp): fails with rc=1 (498 cases compared with NVIDIA GeForce RTX 3090, 16 differ; 0 skipped — 16 MISMATCH failures).
    • Green (8da0d91fcf + main 791899f652): still executes run(ours.p, ...) across all 16 DEPTH_STENCIL2 / two-ref stencil cases (mine.ok == true, 0 VUID- errors), logs not comparable on this host (host runtime lacks D3D12_FEATURE_D3D12_OPTIONS14, hr 0x80070057), and exits rc=0 (482 cases compared with NVIDIA GeForce RTX 3090, 0 differ; 16 skipped).

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7249239417 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1398#issuecomment-7249239417). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-29T02:08:51Z. --- ### Windows 11 + RTX 3090 Verification (`8da0d91fcf` merged with `main` `791899f652`) — PASS - **Environment**: Windows 11 (`10.0.26200`), MSVC `19.44.35207` (`/O2 /MD /EHsc /std:c++20 /W4 /permissive- /utf-8`), **NVIDIA GeForce RTX 3090** (`610.88`, `OPTIONS14.IndependentFrontAndBackStencilRefMaskSupported = 1`) + `VK_LAYER_KHRONOS_validation` `1.4.363.1` (`LEONIDA_VK_VALIDATION=1`, `LEONIDA_SWEEP_VS_SPV` and `LEONIDA_SWEEP_PS_SPV` enabled). - **Merge & Hygiene**: Clean `git merge-tree` onto `main` (`791899f652`) (`0` conflicts); `python -I scripts/check_no_game_data.py` `rc=0`; `0` new `/W4` warnings. - **Native `OPTIONS14` Host Run**: - `d3d12_state_sweep_test.exe` passes with `rc=0`: **`498 cases compared with NVIDIA GeForce RTX 3090, 0 differ; 0 skipped`**, `0` `VUID-` validation errors. - **Red -> Green (simulated Windows 10 pre-`OPTIONS14` host: `OPTIONS14 -> E_INVALIDARG`, `DEPTH_STENCIL2` stream PSO `-> E_INVALIDARG`, `ID3D12GraphicsCommandList8 -> E_NOINTERFACE`)**: - **Red (`main` `d3d12_state_sweep_test.cpp`)**: fails with `rc=1` (`498 cases compared with NVIDIA GeForce RTX 3090, 16 differ; 0 skipped` — `16` `MISMATCH` failures). - **Green (`8da0d91fcf` + `main` `791899f652`)**: still executes `run(ours.p, ...)` across all `16` `DEPTH_STENCIL2` / two-ref stencil cases (`mine.ok == true`, `0` `VUID-` errors), logs `not comparable on this host (host runtime lacks D3D12_FEATURE_D3D12_OPTIONS14, hr 0x80070057)`, and exits `rc=0` (**`482 cases compared with NVIDIA GeForce RTX 3090, 0 differ; 16 skipped`**). AI-assisted.
Tauwni commented 2026-11-29 13:07:51 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Tauwni on 2026-11-29T13:07:51Z.


AMD complement on Windows 10, the host this PR targets (no OPTIONS14 / independent front-back stencil in the in-box runtime). The runs above are the author's and NVIDIA ones.

Radeon RX 9060 XT (RDNA4), driver 32.0.23033.1002, Windows 10 Pro 22H2 19045.7846, in-box d3d12.dll, MSVC 14.44 RelWithDebInfo. Head 8da0d91fc merged (no commit) into current main 3535eb5c4, merges cleanly. MEASURED, 3 runs each, ctest -R "^d3d12_state_sweep$":

  • main 3535eb5c4: fails 3/3. First lines: stencil per-face masks same, one ref, front-facing: the host refuses the pipeline (0x80070057), the layer accepts it MISMATCH, then the back-facing and two-ref cases.
  • main + 8da0d91fc: passes 3/3.

The same red and green held on the older main b6bf3aa0b. MEASURED, 3 runs each.

Verdict: READY. Conclusive A/B on Windows 10 with an AMD host, test-only change.

Not checked by a second agent or human yet. AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7256310810 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1398#issuecomment-7256310810). Originally posted by [Tauwni](https://github.com/Tauwni) on 2026-11-29T13:07:51Z. --- AMD complement on Windows 10, the host this PR targets (no OPTIONS14 / independent front-back stencil in the in-box runtime). The runs above are the author's and NVIDIA ones. Radeon RX 9060 XT (RDNA4), driver 32.0.23033.1002, Windows 10 Pro 22H2 19045.7846, in-box `d3d12.dll`, MSVC 14.44 RelWithDebInfo. Head `8da0d91fc` merged (no commit) into current `main` `3535eb5c4`, merges cleanly. MEASURED, 3 runs each, `ctest -R "^d3d12_state_sweep$"`: - `main` `3535eb5c4`: fails 3/3. First lines: `stencil per-face masks same, one ref, front-facing: the host refuses the pipeline (0x80070057), the layer accepts it MISMATCH`, then the back-facing and two-ref cases. - `main` + `8da0d91fc`: passes 3/3. The same red and green held on the older `main` `b6bf3aa0b`. MEASURED, 3 runs each. Verdict: READY. Conclusive A/B on Windows 10 with an AMD host, test-only change. Not checked by a second agent or human yet. AI-assisted: yes (Claude Code).
aslan2142 commented 2026-12-01 16:35:32 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T16:35:32Z.


Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7317860120 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1398#issuecomment-7317860120). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T16:35:32Z. --- Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!1398
No description provided.