shader: add a WARP readback for src_scc #2717

Merged
tedin7 merged 3 commits from upstream-pr/2725 into main 2026-11-26 05:39:50 +00:00
tedin7 commented 2026-11-26 03:51:52 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T03:51:52Z.


Part of #1723

Follows #1821.

What this unblocks: the src_scc lowering from #1821 is now checked on a real GPU path (D3D12 UAV readback vs a CPU reference).

Changes:

  • tests/startup_gfx2hlsl_src_scc_check.py: new dispatch <dxc> <offscreen_check> <warp|hardware> mode. It lowers s_cmp_eq_u32 + s_mov_b32 s3, src_scc with the real handlers and reads the result back per case (SCC=1 and SCC=0, distinct per-case data). A copy of the lowering mutated to (scc ? 0u : 1u) must read back wrong (negative control).
  • CMakeLists.txt: startup_gfx2hlsl_src_scc_dispatch_{warp,hardware}, next to the sibling s_ff1 dispatch tests.
  • .github/workflows/windows.yml: file listed with the sibling checks.
  • docs/experiments.md: command and evidence note.

Verification (Linux only, Stage-1; the Windows WARP run is left to the independent Stage-2 gate):

  • python3 -B tests/startup_gfx2hlsl_src_scc_check.py -> PASS
  • Lowering generated with the real handlers: ['scc = s1 == s2;', 's3 = (scc ? 1u : 0u);']; the negative-control mutation matches this text.
  • python3 -B tests/docs_links_check.py -> passed
  • git diff --check -> clean
  • dispatch mode not run here: no DXC on this host.
  • Independent Windows verification by @RonLogic on head f79a17e06fc4d0436ad93f675c97305e4501894e: Python check and direct dispatch mode passed on in-box WARP (driver 10.0.26100.10068) and on a physical RTX 4070 (driver 32.0.16.2124). On both: 8/8 readback cases matched, the inverted SCC mutation gave the wrong value in 8/8, and the D3D12 debug layer reported 0 errors and 0 warnings. Credit to @RonLogic.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6619113069 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2725). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T03:51:52Z. --- Part of #1723 Follows #1821. What this unblocks: the `src_scc` lowering from #1821 is now checked on a real GPU path (D3D12 UAV readback vs a CPU reference). Changes: - `tests/startup_gfx2hlsl_src_scc_check.py`: new `dispatch <dxc> <offscreen_check> <warp|hardware>` mode. It lowers `s_cmp_eq_u32` + `s_mov_b32 s3, src_scc` with the real handlers and reads the result back per case (SCC=1 and SCC=0, distinct per-case data). A copy of the lowering mutated to `(scc ? 0u : 1u)` must read back wrong (negative control). - `CMakeLists.txt`: `startup_gfx2hlsl_src_scc_dispatch_{warp,hardware}`, next to the sibling `s_ff1` dispatch tests. - `.github/workflows/windows.yml`: file listed with the sibling checks. - `docs/experiments.md`: command and evidence note. Verification (Linux only, Stage-1; the Windows WARP run is left to the independent Stage-2 gate): - `python3 -B tests/startup_gfx2hlsl_src_scc_check.py` -> PASS - Lowering generated with the real handlers: `['scc = s1 == s2;', 's3 = (scc ? 1u : 0u);']`; the negative-control mutation matches this text. - `python3 -B tests/docs_links_check.py` -> passed - `git diff --check` -> clean - `dispatch` mode not run here: no DXC on this host. - Independent Windows verification by @RonLogic on head `f79a17e06fc4d0436ad93f675c97305e4501894e`: Python check and direct `dispatch` mode passed on in-box WARP (driver 10.0.26100.10068) and on a physical RTX 4070 (driver 32.0.16.2124). On both: 8/8 readback cases matched, the inverted SCC mutation gave the wrong value in 8/8, and the D3D12 debug layer reported 0 errors and 0 warnings. Credit to @RonLogic. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 05:02:25 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:17:06Z.


Independent gate: PASS on head f79a17e06f (Linux checks, break-it sweep 166/166 unchanged, R0Y00-style checklist, hygiene).

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit f79a17e06fc4d0436ad93f675c97305e4501894e:

  • Debug (--preset dev):
    • Build (cmake --build --preset dev -- -j 2): 11.53s
    • Test (ctest --preset dev -R '^startup_gfx2hlsl_src_scc' --parallel 2 --no-tests=error --output-on-failure): 6/6 passed (startup_gfx2hlsl_src_scc_dispatch_warp 0.34s, startup_gfx2hlsl_src_scc_dispatch_hardware 0.35s, startup_gfx2hlsl_src_scc 0.14s, startup_gfx2hlsl_src_scc_join 0.15s, startup_gfx2hlsl_src_scc_join_dispatch_warp 0.26s, startup_gfx2hlsl_src_scc_join_dispatch_hardware 0.27s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release -- -j 2): 5.02s
    • Test (ctest --preset release -R '^startup_gfx2hlsl_src_scc' --parallel 2 --no-tests=error --output-on-failure): 6/6 passed (0.87s)

Marking Ready. @MasterDomino @R0Y00 this is the WARP readback follow-up for #1821; please review.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7182459351 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2725#issuecomment-7182459351). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:17:06Z. --- Independent gate: PASS on head f79a17e06fc4d0436ad93f675c97305e4501894e (Linux checks, break-it sweep 166/166 unchanged, R0Y00-style checklist, hygiene). Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `f79a17e06fc4d0436ad93f675c97305e4501894e`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev -- -j 2`): `11.53s` - Test (`ctest --preset dev -R '^startup_gfx2hlsl_src_scc' --parallel 2 --no-tests=error --output-on-failure`): **6/6 passed** (`startup_gfx2hlsl_src_scc_dispatch_warp` `0.34s`, `startup_gfx2hlsl_src_scc_dispatch_hardware` `0.35s`, `startup_gfx2hlsl_src_scc` `0.14s`, `startup_gfx2hlsl_src_scc_join` `0.15s`, `startup_gfx2hlsl_src_scc_join_dispatch_warp` `0.26s`, `startup_gfx2hlsl_src_scc_join_dispatch_hardware` `0.27s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release -- -j 2`): `5.02s` - Test (`ctest --preset release -R '^startup_gfx2hlsl_src_scc' --parallel 2 --no-tests=error --output-on-failure`): **6/6 passed** (`0.87s`) Marking Ready. @MasterDomino @R0Y00 this is the WARP readback follow-up for #1821; please review. AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-26 05:02:25 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T04:17: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-26T04:19:40.705347Z f79a17e 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:7182461757 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2725#issuecomment-7182461757). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-26T04:17:16Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"f79a17e06fc4d0436ad93f675c97305e4501894e","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-26T04:19:40.705347Z">2026-11-26T04:19:40.705347Z</relative-time> | `f79a17e` | 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>
RonLogic commented 2026-11-26 05:02:25 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RonLogic on 2026-11-26T04:23:37Z.


Independent Windows verification of f79a17e06fc4d0436ad93f675c97305e4501894e: the Python check and direct dispatch mode passed on in-box WARP (driver 10.0.26100.10068) and on a physical RTX 4070 (32.0.16.2124). On both, all eight readback cases matched, the inverted SCC mutation produced the wrong value in all eight, and the D3D12 debug layer reported zero errors and warnings. I used the Release offscreen_check from #2728 after verifying the runner's native sources were identical between the two heads. git diff --check also passed.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7182555049 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2725#issuecomment-7182555049). Originally posted by [RonLogic](https://github.com/RonLogic) on 2026-11-26T04:23:37Z. --- Independent Windows verification of `f79a17e06fc4d0436ad93f675c97305e4501894e`: the Python check and direct `dispatch` mode passed on in-box WARP (driver `10.0.26100.10068`) and on a physical RTX 4070 (`32.0.16.2124`). On both, all eight readback cases matched, the inverted SCC mutation produced the wrong value in all eight, and the D3D12 debug layer reported zero errors and warnings. I used the Release `offscreen_check` from #2728 after verifying the runner's native sources were identical between the two heads. `git diff --check` also passed.
upstream-sync closed this pull request 2026-11-26 06:01:56 +00:00
R0Y00 commented 2026-11-26 06:01:56 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T05:39:43Z.

Review: APPROVED


Reviewed the test and its registration. On Windows 11 build 26200, the Python controls passed and the exact head and its composition with main 651577a0 each read back 8/8 expected SCC results on WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656. The inverted-SCC control mismatched all eight inputs on each adapter. The debug layer reported zero errors and warnings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6069075163 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2725#pullrequestreview-6069075163). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T05:39:43Z. **Review:** APPROVED --- Reviewed the test and its registration. On Windows 11 build 26200, the Python controls passed and the exact head and its composition with main 651577a0 each read back 8/8 expected SCC results on WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656. The inverted-SCC control mismatched all eight inputs on each adapter. The debug layer reported zero errors and warnings.
tedin7 commented 2026-11-26 06:02:06 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T05:11:41Z.


Thanks @RonLogic for the independent run on f79a17e06: 8/8 readback on WARP and on the RTX 4070, mutation caught 8/8, 0 debug layer errors. Adding this to the Verification block.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7183264793 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2725#issuecomment-7183264793). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T05:11:41Z. --- Thanks @RonLogic for the independent run on `f79a17e06`: 8/8 readback on WARP and on the RTX 4070, mutation caught 8/8, 0 debug layer errors. Adding this to the Verification block. AI-assisted; commands listed were executed locally.
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!2717
No description provided.