startup: pass OMSetStencilRef (slot 24) to the desktop list #1780

Merged
tedin7 merged 2 commits from upstream-pr/1787 into main 2026-11-24 19:18:03 +00:00
tedin7 commented 2026-11-24 18:40:53 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T18:40:53Z.


Adds the missing command-list slot 24, OMSetStencilRef, in the style of slots 21 to 23. On main slot 24 has no handler, so it falls through to the x2w-noop stand-in and the reference never reaches the desktop list.

Changes

  • list_stencil_ref(reference) in src/startup_stubs/d3d12_xs_device.cpp calls OMSetStencilRef on the desktop list while it is recording, and does nothing on a closed list. Installed as list_typed[24] in render mode, next to slot 23.
  • tests/startup_stream_depth.cpp and tests/startup_stream_depth_check.py add four cases on a D24_UNORM_S8_UINT view with a stencil-only EQUAL pipeline: stored 0x5A with reference 0x5A (all 16 pixels drawn), stored 0x5A with reference 0x5B (none), stored 0 with reference 0 and stored 0xFF with reference 0xFF (all drawn). Reference 0 is the list's default, so the 0x5A and 0xFF cases are the ones that prove the call was forwarded. A call on the already closed list is made after the first case. The harness now takes four more output paths (19 arguments instead of 15) and the existing cases are unchanged.
  • Notes in docs/startup-runtime.md and docs/experiments.md.

The slot number is the desktop one (the ABI notes call it NAMED, not observed in a title log).

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP)

At commit 1c3777c0cfa990cff57317e31f0a3c63f9940b17:

  • Debug (--preset dev):
    • cmake --build --preset dev --target d3d12_xs_shim startup_stream_depth d3d12x_graphics_list_check -- -j 8 (19.85s)
    • ctest --preset dev -R '^(startup_stream_depth_warp|d3d12x_graphics_list_warp|startup_stubs)$' --parallel 6 --no-tests=error --output-on-failure: 3/3 passed (d3d12x_graphics_list_warp 0.06s, startup_stubs 0.48s, startup_stream_depth_warp 3.33s)
  • Release /O2 (--preset release):
    • cmake --build --preset release --target d3d12_xs_shim startup_stream_depth d3d12x_graphics_list_check -- -j 8 (36.34s)
    • ctest --preset release -R '^(startup_stream_depth_warp|d3d12x_graphics_list_warp|startup_stubs)$' --parallel 6 --no-tests=error --output-on-failure: 3/3 passed (d3d12x_graphics_list_warp 0.06s, startup_stubs 0.53s, startup_stream_depth_warp 3.03s)
  • Mutations killed on WARP (--preset dev, startup_stream_depth_warp):
    1. Removing list_typed[24] = reinterpret_cast<ListTyped>(&list_stencil_ref); in src/startup_stubs/d3d12_xs_device.cpp: killed (AssertionError: stencil ref equal 0x5A: 0000ffff..., all pixels remained clear blue).
    2. Forwarding 0 instead of reference in list_stencil_ref: killed (AssertionError: stencil ref equal 0x5A: 0000ffff...).

Verified on Linux

  • git diff --check origin/main...HEAD, tests/docs_links_check.py, tests/bidi_controls_check.py: pass.

Not verified

  • startup_stream_depth_hardware was not run (the test VM only has D3D12 WARP).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6588876973 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1787). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T18:40:53Z. --- Adds the missing command-list slot 24, `OMSetStencilRef`, in the style of slots 21 to 23. On `main` slot 24 has no handler, so it falls through to the `x2w-noop` stand-in and the reference never reaches the desktop list. ### Changes - `list_stencil_ref(reference)` in `src/startup_stubs/d3d12_xs_device.cpp` calls `OMSetStencilRef` on the desktop list while it is recording, and does nothing on a closed list. Installed as `list_typed[24]` in render mode, next to slot 23. - `tests/startup_stream_depth.cpp` and `tests/startup_stream_depth_check.py` add four cases on a `D24_UNORM_S8_UINT` view with a stencil-only `EQUAL` pipeline: stored 0x5A with reference 0x5A (all 16 pixels drawn), stored 0x5A with reference 0x5B (none), stored 0 with reference 0 and stored 0xFF with reference 0xFF (all drawn). Reference 0 is the list's default, so the 0x5A and 0xFF cases are the ones that prove the call was forwarded. A call on the already closed list is made after the first case. The harness now takes four more output paths (19 arguments instead of 15) and the existing cases are unchanged. - Notes in `docs/startup-runtime.md` and `docs/experiments.md`. The slot number is the desktop one (the ABI notes call it NAMED, not observed in a title log). ### Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) At commit `1c3777c0cfa990cff57317e31f0a3c63f9940b17`: - **Debug (`--preset dev`)**: - `cmake --build --preset dev --target d3d12_xs_shim startup_stream_depth d3d12x_graphics_list_check -- -j 8` (`19.85s`) - `ctest --preset dev -R '^(startup_stream_depth_warp|d3d12x_graphics_list_warp|startup_stubs)$' --parallel 6 --no-tests=error --output-on-failure`: **3/3 passed** (`d3d12x_graphics_list_warp` `0.06s`, `startup_stubs` `0.48s`, `startup_stream_depth_warp` `3.33s`) - **Release `/O2` (`--preset release`)**: - `cmake --build --preset release --target d3d12_xs_shim startup_stream_depth d3d12x_graphics_list_check -- -j 8` (`36.34s`) - `ctest --preset release -R '^(startup_stream_depth_warp|d3d12x_graphics_list_warp|startup_stubs)$' --parallel 6 --no-tests=error --output-on-failure`: **3/3 passed** (`d3d12x_graphics_list_warp` `0.06s`, `startup_stubs` `0.53s`, `startup_stream_depth_warp` `3.03s`) - **Mutations killed on WARP (`--preset dev`, `startup_stream_depth_warp`)**: 1. Removing `list_typed[24] = reinterpret_cast<ListTyped>(&list_stencil_ref);` in `src/startup_stubs/d3d12_xs_device.cpp`: **killed** (`AssertionError: stencil ref equal 0x5A: 0000ffff...`, all pixels remained clear blue). 2. Forwarding `0` instead of `reference` in `list_stencil_ref`: **killed** (`AssertionError: stencil ref equal 0x5A: 0000ffff...`). ### Verified on Linux - `git diff --check origin/main...HEAD`, `tests/docs_links_check.py`, `tests/bidi_controls_check.py`: pass. ### Not verified - `startup_stream_depth_hardware` was not run (the test VM only has D3D12 WARP). AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-24 19:01:44 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T19:00:11Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T19:02:12.619754Z 1c3777c Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7141452946 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1787#issuecomment-7141452946). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T19:00:11Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"1c3777c0cfa990cff57317e31f0a3c63f9940b17","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-24T19:02:12.619754Z">2026-11-24T19:02:12.619754Z</relative-time> | `1c3777c` | Draft marked ready | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
upstream-sync closed this pull request 2026-11-24 20:00:35 +00:00
R0Y00 commented 2026-11-24 20:01:16 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T19:14:46Z.


Independent Release initially failed on both WARP and RTX with debug message 821 because a texture created with optimized stencil clear 0 was cleared to 0x5A or 0xFF. I pushed the fixture fix: each case creates its DSV with the clear it will use. The same draws, references and closed-list control remain in place, and the strict debug-output check passes. Both backends passed 2/2.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7141815166 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1787#issuecomment-7141815166). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T19:14:46Z. --- Independent Release initially failed on both WARP and RTX with debug message 821 because a texture created with optimized stencil clear 0 was cleared to 0x5A or 0xFF. I pushed the fixture fix: each case creates its DSV with the clear it will use. The same draws, references and closed-list control remain in place, and the strict debug-output check passes. Both backends passed 2/2.
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
R0Y00/Xbox2Windows!1780
No description provided.