startup: record SetGraphicsRoot32BitConstant (slot 38) #1719

Closed
tedin7 wants to merge 6 commits from upstream-pr/1726 into main
tedin7 commented 2026-11-24 17:53:41 +00:00 (Migrated from github.com)

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


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 61a55f63. 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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6588052170 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1726). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T17:53:41Z. --- 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 61a55f63. 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.
upstream-sync changed title from [PR #1726] startup: record SetGraphicsRoot32BitConstant (slot 38) for translated draws to [PR #1726] startup: record SetGraphicsRoot32BitConstant (slot 38) 2026-11-24 19:01:06 +00:00
chatgpt-codex-connector[bot commented 2026-11-24 19:01:40 +00:00 (Migrated from github.com)

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


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7140626955 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1726#issuecomment-7140626955). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T18:25:32Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"d251d8fbb6b2ead97aea77a9a9facf7f0d3d3b98","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-24T18:28:41.149412Z">2026-11-24T18:28:41.149412Z</relative-time> | `d251d8f` | 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-25 14:04:15 +00:00
tedin7 commented 2026-11-25 14:05:13 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T13:51:19Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7164387779 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1726#issuecomment-7164387779). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T13:51:19Z. --- 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.

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
R0Y00/Xbox2Windows!1719
No description provided.