startup: clear tables on root change and log dropped root constants #1737

Merged
tedin7 merged 3 commits from upstream-pr/1744 into main 2026-11-24 18:49:56 +00:00
tedin7 commented 2026-11-24 18:02:46 +00:00 (Migrated from github.com)

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


Two gaps around SetGraphicsRootSignature and SetGraphicsRoot32BitConstants in translated draws.

Changes

  • list_graphics_root (slot 34): a root signature different from the current one now also drops the bound descriptor tables (view_tables), as 61a55f63 already does for the root addresses. Setting the same signature again keeps them, so a title that rebinds the same signature does not lose its tables. Root constants on a signature change are handled in #1726 and are not repeated here.
  • list_root_constants (slot 40): a call with parameter >= 16 or offset >= 8 is logged as root constants dropped, and one whose count passes the eighth word as root constants truncated, for the first four such calls in the process. Behaviour is unchanged: the same words are stored or dropped as before.
  • New test startup_root_reset_{warp,hardware} (tests/startup_root_reset.cpp, tests/startup_root_reset_check.py): a 1D texture is drawn through a bound table with no change, with the same root signature again (table kept), after a switch to another signature and back (table gone, the shader reads zeros), and after six out-of-range slot 40 calls (table kept, exactly four log lines: three dropped, one truncated).
  • Notes in docs/startup-runtime.md and docs/experiments.md.

Verified (Windows Server 2025 + Linux)

At commit 50df4c2d04472c2c5d412626e833d8c62849ba7a:

  • Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP):
    • Debug (--preset dev): cmake --build --preset dev --target startup_stream_consumer -- -j 8 (3.53s), ctest --preset dev -R '^(startup_root_reset_warp|startup_root_cbv_warp|startup_mrt_.*_warp|startup_stream_draw_warp|startup_1d_srv_warp|stream_root_srv_warp)$' --parallel 6 --no-tests=error --output-on-failure -> 7/7 passed (6.70s, startup_root_reset_warp 3.41s).
    • Release /O2 (--preset release): cmake --build --preset release --target startup_stream_consumer -- -j 8 (1.15s), ctest --preset release -R '^(startup_root_reset_warp|startup_root_cbv_warp|startup_mrt_.*_warp|startup_stream_draw_warp|startup_1d_srv_warp|stream_root_srv_warp)$' --parallel 6 --no-tests=error --output-on-failure -> 7/7 passed (6.88s, startup_root_reset_warp 3.63s).
    • Mutation 1 (remove view_tables clear in list_graphics_root): startup_root_reset_warp FAILED on switch_root (actual kept texture pixels instead of zeros).
    • Mutation 2 (clear view_tables unconditionally on every list_graphics_root): startup_root_reset_warp FAILED on same_root (actual read zeros instead of texture pixels).
  • Linux: git diff --check, tests/docs_links_check.py, tests/bidi_controls_check.py: pass.
  • git merge-tree against origin/main, #1701, and #1726: 0 conflicts.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6588213701 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1744). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T18:02:46Z. --- Two gaps around `SetGraphicsRootSignature` and `SetGraphicsRoot32BitConstants` in translated draws. ### Changes - `list_graphics_root` (slot 34): a root signature different from the current one now also drops the bound descriptor tables (`view_tables`), as 61a55f63 already does for the root addresses. Setting the same signature again keeps them, so a title that rebinds the same signature does not lose its tables. Root constants on a signature change are handled in #1726 and are not repeated here. - `list_root_constants` (slot 40): a call with parameter >= 16 or offset >= 8 is logged as `root constants dropped`, and one whose count passes the eighth word as `root constants truncated`, for the first four such calls in the process. Behaviour is unchanged: the same words are stored or dropped as before. - New test `startup_root_reset_{warp,hardware}` (`tests/startup_root_reset.cpp`, `tests/startup_root_reset_check.py`): a 1D texture is drawn through a bound table with no change, with the same root signature again (table kept), after a switch to another signature and back (table gone, the shader reads zeros), and after six out-of-range slot 40 calls (table kept, exactly four log lines: three dropped, one truncated). - Notes in `docs/startup-runtime.md` and `docs/experiments.md`. ### Verified (Windows Server 2025 + Linux) At commit `50df4c2d04472c2c5d412626e833d8c62849ba7a`: - **Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP)**: - Debug (`--preset dev`): `cmake --build --preset dev --target startup_stream_consumer -- -j 8` (`3.53s`), `ctest --preset dev -R '^(startup_root_reset_warp|startup_root_cbv_warp|startup_mrt_.*_warp|startup_stream_draw_warp|startup_1d_srv_warp|stream_root_srv_warp)$' --parallel 6 --no-tests=error --output-on-failure` -> **7/7 passed** (`6.70s`, `startup_root_reset_warp` `3.41s`). - Release `/O2` (`--preset release`): `cmake --build --preset release --target startup_stream_consumer -- -j 8` (`1.15s`), `ctest --preset release -R '^(startup_root_reset_warp|startup_root_cbv_warp|startup_mrt_.*_warp|startup_stream_draw_warp|startup_1d_srv_warp|stream_root_srv_warp)$' --parallel 6 --no-tests=error --output-on-failure` -> **7/7 passed** (`6.88s`, `startup_root_reset_warp` `3.63s`). - Mutation 1 (remove `view_tables` clear in `list_graphics_root`): `startup_root_reset_warp` **FAILED** on `switch_root` (`actual` kept texture pixels instead of zeros). - Mutation 2 (clear `view_tables` unconditionally on every `list_graphics_root`): `startup_root_reset_warp` **FAILED** on `same_root` (`actual` read zeros instead of texture pixels). - **Linux**: `git diff --check`, `tests/docs_links_check.py`, `tests/bidi_controls_check.py`: pass. - `git merge-tree` against `origin/main`, `#1701`, and `#1726`: 0 conflicts. AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-24 19:01:15 +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:24:16Z.


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:27:01.291031Z 50df4c2 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:7140596883 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1744#issuecomment-7140596883). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T18:24:16Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"50df4c2d04472c2c5d412626e833d8c62849ba7a","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:27:01.291031Z">2026-11-24T18:27:01.291031Z</relative-time> | `50df4c2` | 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>
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!1737
No description provided.