Skip to content

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

Merged
R0Y00 merged 2 commits into
R0Y00:mainfrom
tedin7:x2w-frontier-slot24-stencil
Nov 24, 2026
Merged

R0Y00 merged 2 commits into
R0Y00:mainfrom
tedin7:x2w-frontier-slot24-stencil

Conversation

@tedin7

@tedin7 tedin7 commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

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.

@tedin7
tedin7 force-pushed the x2w-frontier-slot24-stencil branch from f735fbf to 1c3777c Compare November 24, 2026 18:57
@tedin7
tedin7 marked this pull request as ready for review November 24, 2026 19:00
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
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.

@R0Y00

R0Y00 commented Nov 24, 2026

Copy link
Copy Markdown
Owner

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants