Skip to content

startup: record SetGraphicsRoot32BitConstant (slot 38) - #1726

Closed
tedin7 wants to merge 6 commits into
R0Y00:mainfrom
tedin7:x2w-frontier-b2-slot38
Closed

tedin7 wants to merge 6 commits into
R0Y00:mainfrom
tedin7:x2w-frontier-b2-slot38

Conversation

@tedin7

@tedin7 tedin7 commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Records the command-list call SetGraphicsRoot32BitConstant (console slot 38, desktop 34 + 4) so a translated shader can read a single root constant word. Slot 38 is DERIVED from the desktop order plus the console shift; it has not been seen in a title log.

Changes

  • list_root_constant(parameter, value, offset) in src/startup_stubs/d3d12_draw.inl stores one word in the per-list table that slot 40 already fills. A null list, parameter >= 16, or offset >= 8 is dropped. Nothing is forwarded to the desktop list.
  • list_graphics_root (slot 34) now also clears the stored root constants when the root signature changes, next to the root addresses cleared by 61a55f6. Setting the same root signature again keeps them. This applies to slot 40 too.
  • tests/startup_mrt_check.py gets eleven cases (set, overwrite, offset 3 read at offset 3 and at offset 0, preserving offset 0 written through slot 40 while writing offset 3 through slot 38, corner (15, 7), four out-of-range calls, same root, switched root, and no call). They run in the existing startup_mrt_{fxc,dxc}_{warp,hardware} tests, driven by draw_root_constant in tests/startup_root_cbv.cpp and alternate root creation in tests/startup_stream_setup.cpp. No change to CMakeLists.txt.
  • docs/startup-runtime.md and docs/experiments.md describe the slot and its synthetic coverage.

Verified

At commit d251d8fbb6b2ead97aea77a9a9facf7f0d3d3b98:

  • Linux:
    • git diff --check, python3 -B -m py_compile tests/startup_mrt_check.py, python3 -B tests/docs_links_check.py (17 files, 367 links), python3 -B tests/bidi_controls_check.py (1304 files): pass.
  • Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP):
    • Debug (--preset dev): cmake --build --preset dev --target startup_stream_consumer -- -j 8 (25.06s); ctest --preset dev -R '^(startup_mrt_|startup_root_cbv_|startup_stream_draw_)' --parallel 6 --no-tests=error --output-on-failure: 8/8 passed (10.70s: startup_mrt_fxc_warp, startup_mrt_dxc_warp, startup_mrt_fxc_hardware, startup_mrt_dxc_hardware, startup_root_cbv_warp, startup_root_cbv_hardware, startup_stream_draw_warp, startup_stream_draw_hardware).
    • Release /O2 (--preset release): cmake --build --preset release --target startup_stream_consumer -- -j 8 (41.25s); ctest --preset release -R '^(startup_mrt_|startup_root_cbv_|startup_stream_draw_)' --parallel 6 --no-tests=error --output-on-failure: 8/8 passed (9.69s).
  • Mutation checks on Windows Server 2025 (Debug, startup_mrt_dxc_warp):
    1. Mutating list_root_constant to ignore offset (constants[parameter][0] = value): startup_mrt_dxc_warp failed on ('offset3', '0 3', '01000000020000000100c07f01000080', '01008000020080000100407f01008080') (exit 1).
    2. Removing std::fill_n(&pass.constants[0][0], 16 * 8, 0u) in list_graphics_root: startup_mrt_dxc_warp failed on ('switch_root', '0 0', '01008000020080000100407f01008080', '01000000020000000100c07f01000080') (exit 1).

Not verified

  • No title log has confirmed slot 38; the slot number is derived from the desktop order plus the console shift and tested with synthetic streams only.
  • No llvm-mc step: this change has no shader assembly.

AI-assisted; commands listed were executed locally.

@tedin7 tedin7 changed the title startup: record SetGraphicsRoot32BitConstant (slot 38) for translated draws startup: record SetGraphicsRoot32BitConstant (slot 38) Nov 24, 2026
@tedin7
tedin7 marked this pull request as ready for review November 24, 2026 18:25
@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-24T18:28:41.149412Z d251d8f 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.

@tedin7
tedin7 force-pushed the x2w-frontier-b2-slot38 branch from ec40f9d to b8885ac Compare November 25, 2026 08:27
@tedin7

tedin7 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator Author

Closing this PR for now to keep the Windows test queue short. Nothing is wrong with it and the branch stays as it is.

We will reopen it once the queue is clear, re-run the Win2025 WARP checks at its head, and post the result here.

AI-assisted; commands listed were executed locally.

@tedin7 tedin7 closed this Nov 25, 2026
tedin7 pushed a commit to tedin7/Xbox2Windows that referenced this pull request Nov 26, 2026
…tream_draw.cpp kept as in tester-loop)"

This reverts commit 365b333, reversing
changes made to 269ef36.
tedin7 pushed a commit to tedin7/Xbox2Windows that referenced this pull request Nov 26, 2026
…tream_draw.cpp kept as in tester-loop)"

This reverts commit 365b333, reversing
changes made to 269ef36.
tedin7 pushed a commit to tedin7/Xbox2Windows that referenced this pull request Nov 26, 2026
tedin7 pushed a commit to tedin7/Xbox2Windows that referenced this pull request Nov 26, 2026
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.

1 participant