shader: add a WARP readback for src_scc #2725

Manually merged
github merged 3 commits from gh-pr/2725/head into gh-pr/2725/base 2026-11-27 01:18:29 +00:00
Owner

@⁠tedin7 on GitHub · 2026-11-26 03:51 UTC · original
tedin7:test/src-scc-warp-readback → main · +121 −0 · 4 files · 3 commits · merged 2026-11-26 05:39 UTC

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** on GitHub · 2026-11-26 03:51 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2725) `tedin7:test/src-scc-warp-readback` → `main` · +121 −0 · 4 files · 3 commits · merged 2026-11-26 05:39 UTC 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:18:26 +00:00
github manually merged commit f79a17e06f into gh-pr/2725/base 2026-11-27 01:18:29 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-26 04:17 UTC · original

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.

**@⁠tedin7** on GitHub · 2026-11-26 04:17 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2725#issuecomment-7182459351) 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.
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-26 04:17 UTC · original · edited 2026-11-26 04:19 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-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.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-26 04:17 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2725#issuecomment-7182461757) · edited 2026-11-26 04:19 UTC <!-- 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>
Author
Owner

@⁠RonLogic on GitHub · 2026-11-26 04:23 UTC · original

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.

**@⁠RonLogic** on GitHub · 2026-11-26 04:23 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2725#issuecomment-7182555049) 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.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-26 05:11 UTC · original

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.

**@⁠tedin7** on GitHub · 2026-11-26 05:11 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2725#issuecomment-7183264793) 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.
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-26 05:39 UTC · original · approved these changes

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.

**@⁠R0Y00** on GitHub · 2026-11-26 05:39 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2725#pullrequestreview-6069075163) · **approved these changes** 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.
This discussion has been locked. Commenting is limited to contributors.
No description provided.