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

Open
github-bot wants to merge 2 commits from github-bot/gh-1398 into main AGit
Owner

@⁠qhukz13 on GitHub · 2026-11-24 23:26 UTC · original
qhukz13:cont/state-sweep-win10 → main · +90 −30 · 1 files · 2 commits · open

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

**@⁠qhukz13** on GitHub · 2026-11-24 23:26 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1398) `qhukz13:cont/state-sweep-win10` → `main` · +90 −30 · 1 files · 2 commits · open Claimed in the coordination issue as: TEST-STATE-SWEEP-WIN10-STENCIL ([claim](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14)) ### 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)
The 16 stencil per-face masks cases build a pipeline state stream with
D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2 (and half also call
ID3D12GraphicsCommandList8::OMSetFrontAndBackStencilRef), which require
D3D12_FEATURE_D3D12_OPTIONS14::IndependentFrontAndBackStencilRefMaskSupported.

On older in-box host runtimes such as Windows 10 (build 19045),
CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS14) fails with E_INVALIDARG
(0x80070057) and the host refuses those pipelines with E_INVALIDARG while
the layer accepts them on purpose. Query OPTIONS14 on the host device and,
when the query fails or reports FALSE, still run the cases on the layer and
report them as not comparable on this host instead of a MISMATCH. Hosts
that report support are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Address review nits on PR #1398:
- When CheckFeatureSupport(OPTIONS14) succeeds with IndependentFrontAndBackStencilRefMaskSupported == FALSE, only skip the 14 per-face cases that actually use differing front/back masks or OMSetFrontAndBackStencilRef (back_ref >= 0). The 2 identical-mask single-ref DEPTH_STENCIL2 cases ('same, one ref', front/back-facing) remain compared against the host. When OPTIONS14 itself fails, all 16 DEPTH_STENCIL2 cases stay skipped.
- Record failed_step and failed_hr in Result for every failing call in run(), and print them instead of always printing 'pipeline 0x00000000' when a post-pipeline step fails.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:50:00 +00:00
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 15:22 UTC · original

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

**@⁠PierreEbele** on GitHub · 2026-11-25 15:22 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1398#issuecomment-7166743162) 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
Author
Owner

@⁠qhukz13 on GitHub · 2026-11-25 19:24 UTC · original

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.

**@⁠qhukz13** on GitHub · 2026-11-25 19:24 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1398#issuecomment-7172258384) 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.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1398/head:github-bot/gh-1398'
git switch 'github-bot/gh-1398'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1398'
git switch 'github-bot/gh-1398'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1398'
git switch 'github-bot/gh-1398'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1398'
git switch 'main'
git merge --squash 'github-bot/gh-1398'
git switch 'main'
git merge --ff-only 'github-bot/gh-1398'
git switch 'main'
git merge 'github-bot/gh-1398'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.