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

Manually merged
github merged 3 commits from gh-pr/1744/head into gh-pr/1744/base 2026-11-26 23:30:23 +00:00
Owner

@⁠tedin7 on GitHub · 2026-11-24 18:02 UTC · original
tedin7:x2w-frontier-p08-rootsig → main · +168 −0 · 8 files · 3 commits · merged 2026-11-24 18:49 UTC

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.

**@⁠tedin7** on GitHub · 2026-11-24 18:02 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1744) `tedin7:x2w-frontier-p08-rootsig` → `main` · +168 −0 · 8 files · 3 commits · merged 2026-11-24 18:49 UTC 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:30:21 +00:00
github manually merged commit 50df4c2d04 into gh-pr/1744/base 2026-11-26 23:30:23 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-24 18:24 UTC · original · edited 2026-11-24 18:27 UTC

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.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-24 18:24 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1744#issuecomment-7140596883) · edited 2026-11-24 18:27 UTC <!-- 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>
This discussion has been locked. Commenting is limited to contributors.
No description provided.