shader: keep an accumulated lane mask live at a compute execz exit #3109

Merged
SimSalabimse merged 7 commits from upstream-pr/3109 into main 2026-12-02 23:32:21 +00:00
SimSalabimse commented 2026-11-27 15:44:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-27T15:44:57Z.


Change

A straight compute lane-exhaustion exit can keep one accumulated lane mask live in the staying span. The pair is s_and_b32 sA, sA, exec_lo then s_or_b32 sB, sB, sA. The exit branch jumps over it, so a lane that leaves keeps its own bit of sB. sA must be dead at the exit, and every later read of sB must be per lane. Refs #2645 (T4). This builds on #2900: the scalar run before the EXEC restore, the single-wave32 bound (x * y * z <= 32), the 32-thread edge, and the pre-guard ANDN2 save proof stay as merged.

The counted loop with a backward latch and a second saved mask stays refused.

An AND that rewrites an already tracked carried mask ends that word's old definition and starts a new tracked definition at the same destination. A repeated carry (ACCUM_REPEAT_*) and a longer chain that rewrites the tracked word (ACCUM_REWRITE_*) stay refused.

Verification

All results below are for commit ede53dce485b1028f78287026eb8a89a258bdd5a, rebased onto main 77d1ba4d63ba31abaf4ca3635d4159189a423201.

Windows test PC (MSVC, --preset dev, -j 1). The command was:

ctest --preset dev --no-tests=error -j 1 -R '^startup_gfx2hlsl_compute_' -E 'startup_audio_(output|pacing|provider)' --output-on-failure

It passed 71 of 71 with ctest exit 0.

Linux, agent-reported at this head:

  • python3 -B tests/startup_gfx2hlsl_compute_check.py: exit 0. ACCUM_REPEAT_* and ACCUM_REWRITE_* stay branch out of the block. Restoring the old carry rule accepts both and makes the check fail.
  • python3 -B tests/startup_tools_lint_check.py tools/startup: exit 0.
  • Python Linux check list: exit 0, 262 checks passed.

CI on this commit succeeded for Build and test on Windows, Assemble and translate gfx1013 fixtures, and Run platform-independent Python checks on Linux.

Evidence and follow-up

ACCUM_SOURCE in tests/startup_gfx2hlsl_compute_check.py is a hand-written gfx1013 program. ACCUM_WORDS is the recorded encoding; binary llvm-mc-15 reassembles it. The host check compares a wave trace with one-lane traces. ACCUM_REPEAT_* and ACCUM_REWRITE_* are recorded the same way. The fixture does not cover the #2645 counted loop.

docs/experiments.md has the T4 section after the #2900 T3 section.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted (Cursor)

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5529354058 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3109). Originally posted by [SimSalabimse](https://github.com/SimSalabimse) on 2026-11-27T15:44:57Z. --- ## Change A straight compute lane-exhaustion exit can keep one accumulated lane mask live in the staying span. The pair is `s_and_b32 sA, sA, exec_lo` then `s_or_b32 sB, sB, sA`. The exit branch jumps over it, so a lane that leaves keeps its own bit of `sB`. `sA` must be dead at the exit, and every later read of `sB` must be per lane. Refs #2645 (T4). This builds on #2900: the scalar run before the EXEC restore, the single-wave32 bound (`x * y * z <= 32`), the 32-thread edge, and the pre-guard ANDN2 save proof stay as merged. The counted loop with a backward latch and a second saved mask stays refused. An AND that rewrites an already tracked carried mask ends that word's old definition and starts a new tracked definition at the same destination. A repeated carry (`ACCUM_REPEAT_*`) and a longer chain that rewrites the tracked word (`ACCUM_REWRITE_*`) stay refused. ## Verification All results below are for commit `ede53dce485b1028f78287026eb8a89a258bdd5a`, rebased onto main `77d1ba4d63ba31abaf4ca3635d4159189a423201`. Windows test PC (MSVC, `--preset dev`, `-j 1`). The command was: ```powershell ctest --preset dev --no-tests=error -j 1 -R '^startup_gfx2hlsl_compute_' -E 'startup_audio_(output|pacing|provider)' --output-on-failure ``` It passed 71 of 71 with ctest exit 0. Linux, agent-reported at this head: - `python3 -B tests/startup_gfx2hlsl_compute_check.py`: exit 0. `ACCUM_REPEAT_*` and `ACCUM_REWRITE_*` stay `branch out of the block`. Restoring the old carry rule accepts both and makes the check fail. - `python3 -B tests/startup_tools_lint_check.py tools/startup`: exit 0. - Python Linux check list: exit 0, 262 checks passed. CI on this commit succeeded for `Build and test on Windows`, `Assemble and translate gfx1013 fixtures`, and `Run platform-independent Python checks on Linux`. ## Evidence and follow-up `ACCUM_SOURCE` in `tests/startup_gfx2hlsl_compute_check.py` is a hand-written gfx1013 program. `ACCUM_WORDS` is the recorded encoding; `binary llvm-mc-15` reassembles it. The host check compares a wave trace with one-lane traces. `ACCUM_REPEAT_*` and `ACCUM_REWRITE_*` are recorded the same way. The fixture does not cover the #2645 counted loop. `docs/experiments.md` has the T4 section after the #2900 T3 section. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed. - [x] I did not include game files, dumps, distribution links or secrets. AI-assisted (Cursor)
R0Y00 commented 2026-11-27 15:58:04 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T15:58:04Z.

Review: CHANGES_REQUESTED


execz_accumulated_mask accepts s_and_b32 sX, sB, exec_lo via per_lane_read without checking the SCC value produced by that AND. The destination is a lane mask, but SCC observes whether the entire masked word is nonzero.

Reproduced on 85e96f29 integrated over main 811c4ceb (tree 5285d53c9020224d717e962fbe61e35c9ae60178). In the existing 8-lane ACCUM_WORDS fixture replace only 050001d5050d6a00 with 1a7e1b8781801c851c020a7e. This changes the post-restore consumer to s_and_b32 s27, s26, exec_lo, s_cselect_b32 s28, 1, 0, v_mov_b32 v5, s28. translate('O', code=code).hlsl_cs() accepts it and emits s27 = (s26 & exec) & 1; scc = s27 != 0;, then broadcasts SCC into the stored scalar. The fixture's wave trace gives s26=0xf8 and restored exec_lo=0xff, so the wave-wide SCC is true for all 8 lanes. The singleton translation sees SCC false for lanes 0–2, giving 0 there rather than 1.

Please refuse this SCC-live use or prove SCC dead before accepting an AND-derived lane mask, and add the replacement as a negative control. The existing Python compute fixture and startup lint both passed on the same integration; this is a new control.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6090679369 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3109#pullrequestreview-6090679369). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-27T15:58:04Z. **Review:** CHANGES_REQUESTED --- `execz_accumulated_mask` accepts `s_and_b32 sX, sB, exec_lo` via `per_lane_read` without checking the SCC value produced by that AND. The destination is a lane mask, but SCC observes whether the entire masked word is nonzero. Reproduced on `85e96f29` integrated over `main` `811c4ceb` (tree `5285d53c9020224d717e962fbe61e35c9ae60178`). In the existing 8-lane `ACCUM_WORDS` fixture replace only `050001d5050d6a00` with `1a7e1b8781801c851c020a7e`. This changes the post-restore consumer to `s_and_b32 s27, s26, exec_lo`, `s_cselect_b32 s28, 1, 0`, `v_mov_b32 v5, s28`. `translate('O', code=code).hlsl_cs()` accepts it and emits `s27 = (s26 & exec) & 1; scc = s27 != 0;`, then broadcasts SCC into the stored scalar. The fixture's wave trace gives `s26=0xf8` and restored `exec_lo=0xff`, so the wave-wide SCC is true for all 8 lanes. The singleton translation sees SCC false for lanes 0–2, giving 0 there rather than 1. Please refuse this SCC-live use or prove SCC dead before accepting an AND-derived lane mask, and add the replacement as a negative control. The existing Python compute fixture and startup lint both passed on the same integration; this is a new control.
pigalot commented 2026-11-27 22:44:36 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-27T22:44:36Z.

Review: APPROVED


Reviewed 4f53dc60 merged over current main e9d1d6a0. The merge is clean (tree 50a726cb) and git diff --cached --check is clean.

R0Y00's finding on 85e96f29 is addressed. The SCC-live s_and_b32 sX, sB, exec_lo is now refused. With R0Y00's replacement words (1a7e1b8781801c851c020a7e for 050001d5050d6a00 in ACCUM_WORDS), translate('O', code=...).hlsl_cs() refuses with "s_cbranch_scc0 inside a block s_cbranch_execz skips per lane: branch out of the block". The new accum_scc_dead checks the must-write set of the reading instruction (effects[at][1]). It accepts the read only when no successor has SCC live-in.

What I traced.

  • The AND's destination: s27 is still treated as a lane mask after the AND. I checked this with local word replacements in the same fixture:

    • s_and_b32 s27, s26, exec_lo then s_cmp_lg_u32 s27, 0 is refused ("reads lane mask s27 as numeric data").
    • v_mov_b32 v5, s27 is refused ("data operand s27 is a lane mask").
    • s_mov_b32 s28, s27 then v_mov_b32 v5, s28 is refused ("data operand s28 is a lane mask").

    So the whole-word value cannot leak through the destination either.

  • s_and_saveexec_b32: the check runs on every read of the accumulated mask, so it also covers s_and_saveexec_b32, which sets SCC from the new EXEC.

    • s_and_saveexec_b32 s28, s26 then s_cselect_b32 s29, 1, 0 (1a3c9cbe81801d851d020a7e) is refused.
    • With accum_scc_dead forced to True, it is accepted, so this refusal comes from the new check.
    • The same saveexec followed by s_cmp_eq_u32 s4, s4 is accepted.

What I ran.

  • ctest --test-dir out/build/<preset> --no-tests=error -j 8 -R '^startup_gfx2hlsl_compute_' -E 'startup_audio': 69/69 pass in dev and in release.
  • python -B tests/startup_gfx2hlsl_compute_check.py: exit 0. python -B tests/startup_tools_lint_check.py tools/startup: PASS.
  • I did not run the llvm-mc reassembly locally. CI's Assemble and translate gfx1013 fixtures passes on 4f53dc60.

Mutants of the fix in tools/startup/gfx2hlsl.py, each run against tests/startup_gfx2hlsl_compute_check.py:

Mutant Result
accum_scc_dead call removed (negative control) killed
SCC liveness read at the AND itself instead of its successors killed
always refuse when the read writes SCC killed (the dead-SCC ACCUM_AND_WORDS case)
SCC looked up in may-writes instead of must-writes survives (equivalent here)
check applied to s_and_b32 only survives

Restored afterwards; git diff --quiet is clean.

Non-blocking.

  1. The saveexec form is not pinned. No control covers it, so narrowing the check back to s_and_b32 would pass. Adding the saveexec words above as a second negative control would pin it.
  2. The PR body is out of date. Its Verification section still names commit 85e96f29 on 7a12818c, before the SCC fix.

Verdict: approve on 4f53dc60. R0Y00's changes-requested review on 85e96f29 still stands, so I am not merging this. It needs R0Y00's re-review.

Environment: NVIDIA GeForce RTX 5090 driver 32.0.16.1088; Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; DXC 1.9.2602.17; Python 3.12.10; host-only translator checks, no GPU work.
CI: Build and test on Windows, Assemble and translate gfx1013 fixtures and Run platform-independent Python checks on Linux pass on 4f53dc60.

This reply was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6094039742 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3109#pullrequestreview-6094039742). Originally posted by [pigalot](https://github.com/pigalot) on 2026-11-27T22:44:36Z. **Review:** APPROVED --- Reviewed `4f53dc60` merged over current `main` `e9d1d6a0`. The merge is clean (tree `50a726cb`) and `git diff --cached --check` is clean. **R0Y00's finding on `85e96f29` is addressed.** The SCC-live `s_and_b32 sX, sB, exec_lo` is now refused. With R0Y00's replacement words (`1a7e1b8781801c851c020a7e` for `050001d5050d6a00` in `ACCUM_WORDS`), `translate('O', code=...).hlsl_cs()` refuses with "s_cbranch_scc0 inside a block s_cbranch_execz skips per lane: branch out of the block". The new `accum_scc_dead` checks the must-write set of the reading instruction (`effects[at][1]`). It accepts the read only when no successor has SCC live-in. **What I traced.** - **The AND's destination:** `s27` is still treated as a lane mask after the AND. I checked this with local word replacements in the same fixture: - `s_and_b32 s27, s26, exec_lo` then `s_cmp_lg_u32 s27, 0` is refused ("reads lane mask s27 as numeric data"). - `v_mov_b32 v5, s27` is refused ("data operand s27 is a lane mask"). - `s_mov_b32 s28, s27` then `v_mov_b32 v5, s28` is refused ("data operand s28 is a lane mask"). So the whole-word value cannot leak through the destination either. - **`s_and_saveexec_b32`:** the check runs on every read of the accumulated mask, so it also covers `s_and_saveexec_b32`, which sets SCC from the new EXEC. - `s_and_saveexec_b32 s28, s26` then `s_cselect_b32 s29, 1, 0` (`1a3c9cbe81801d851d020a7e`) is refused. - With `accum_scc_dead` forced to `True`, it is accepted, so this refusal comes from the new check. - The same saveexec followed by `s_cmp_eq_u32 s4, s4` is accepted. **What I ran.** - `ctest --test-dir out/build/<preset> --no-tests=error -j 8 -R '^startup_gfx2hlsl_compute_' -E 'startup_audio'`: 69/69 pass in `dev` and in `release`. - `python -B tests/startup_gfx2hlsl_compute_check.py`: exit 0. `python -B tests/startup_tools_lint_check.py tools/startup`: PASS. - I did not run the `llvm-mc` reassembly locally. CI's `Assemble and translate gfx1013 fixtures` passes on `4f53dc60`. **Mutants** of the fix in `tools/startup/gfx2hlsl.py`, each run against `tests/startup_gfx2hlsl_compute_check.py`: | Mutant | Result | |---|---| | `accum_scc_dead` call removed (negative control) | killed | | SCC liveness read at the AND itself instead of its successors | killed | | always refuse when the read writes SCC | killed (the dead-SCC `ACCUM_AND_WORDS` case) | | SCC looked up in may-writes instead of must-writes | survives (equivalent here) | | check applied to `s_and_b32` only | **survives** | Restored afterwards; `git diff --quiet` is clean. **Non-blocking.** 1. **The saveexec form is not pinned.** No control covers it, so narrowing the check back to `s_and_b32` would pass. Adding the saveexec words above as a second negative control would pin it. 2. **The PR body is out of date.** Its Verification section still names commit `85e96f29` on `7a12818c`, before the SCC fix. **Verdict:** approve on `4f53dc60`. R0Y00's changes-requested review on `85e96f29` still stands, so I am not merging this. It needs R0Y00's re-review. Environment: NVIDIA GeForce RTX 5090 driver 32.0.16.1088; Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; DXC 1.9.2602.17; Python 3.12.10; host-only translator checks, no GPU work. CI: `Build and test on Windows`, `Assemble and translate gfx1013 fixtures` and `Run platform-independent Python checks on Linux` pass on `4f53dc60`. This reply was AI-assisted.
SimSalabimse commented 2026-11-27 22:49:59 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-27T22:49:59Z.


The AND of the accumulated mask with exec is a per-lane read only when nothing reads the SCC it sets. That SCC is the whole word, so a later s_cselect of it stays refused. Added a source program that kills the SCC with a compare and then uses the AND result in v_cndmask, plus the s_cselect program as a negative control. Dropping the dead-SCC check makes that refusal fail.

Linux: the python-linux list exited 0 (245 checks), startup tools lint exited 0, and the compute gfx2hlsl check exited 0. Windows test PC: startup_gfx2hlsl_compute_controls passed twice, startup_gfx2hlsl_compute_ 69/69 passed, exit 0.

AI-Assisted

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7229653538 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3109#issuecomment-7229653538). Originally posted by [SimSalabimse](https://github.com/SimSalabimse) on 2026-11-27T22:49:59Z. --- The AND of the accumulated mask with exec is a per-lane read only when nothing reads the SCC it sets. That SCC is the whole word, so a later s_cselect of it stays refused. Added a source program that kills the SCC with a compare and then uses the AND result in v_cndmask, plus the s_cselect program as a negative control. Dropping the dead-SCC check makes that refusal fail. Linux: the python-linux list exited 0 (245 checks), startup tools lint exited 0, and the compute gfx2hlsl check exited 0. Windows test PC: startup_gfx2hlsl_compute_controls passed twice, startup_gfx2hlsl_compute_ 69/69 passed, exit 0. AI-Assisted
JohnConnorNPC commented 2026-11-28 07:34:52 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-28T07:34:52Z.


Thanks for the update on 4f53dc60. R0Y00's SCC request is met: ACCUM_SCC_WORDS carries their exact replacement (1a7e1b8781801c851c020a7e) and the test asserts it is refused. Their review is still CHANGES_REQUESTED on 85e96f29, so it needs a re-review from R0Y00. Before that, could you add a control for each of the two new refusals that has none? Mutant runs were on copies of tools/startup/gfx2hlsl.py, restored by hash.

  1. sA dead at the exit. Replacing if kept in live_in[target] or accum not in live_in[target]: with if accum not in live_in[target]: leaves python3 -B tests/startup_gfx2hlsl_compute_check.py green (rc=0). Under that mutant, words 050001d5050d6a00 + 80039abe + 050001d5050d6600 (v_cndmask … s26; s_mov_b32 s26, 0; v_cndmask_b32 v5, v5, v6, s25) in the ACCUM fixture are accepted as accum=[('s25', 's26')]; unmutated they are refused (accum=[False]). That would make a good ACCUM refusal control.
  2. saveexec SCC (pigalot's item 1). Narrowing the SCC test in accum_scc_dead to s_and_b32 only also leaves the suite green, and the tests never use the direct form (git show 4f53dc60:tests/startup_gfx2hlsl_compute_check.py | grep -c 1a3c9cbe → 0). 1a3c9cbe 1c03febe 81801d85 1d020a7e (s_and_saveexec_b32 s28, s26; s_mov_b32 exec_lo, s28; s_cselect_b32 s29, 1, 0; v_mov_b32 v5, s29) is refused on the head today, so it can go in as a second ACCUM_SCC control.

Smaller points:

  • The branch conflicts with main c3204a9c in one file (git merge-tree --write-tree --name-only c3204a9c 4f53dc60 → tests/startup_gfx2hlsl_compute_check.py). Main's check_execz_mask_subset and your check_execz_accumulated_mask were added at the same spot. Keeping both resolves it, and the compute check passes on that merge.
  • The body's Verification section still names 85e96f29, not 4f53dc60.
  • docs/experiments.md leaves dispatch readback to ctest -R '^startup_gfx2hlsl_compute_', but no dispatch case uses ACCUM (grep -cE "CASES\[[^]]*\] *=.*(ACCUM|EXIT_RUN)" → 0). That run doesn't exercise this fixture, so please say so in the docs or add ACCUM as a case.

This comment was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7236031290 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3109#issuecomment-7236031290). Originally posted by [JohnConnorNPC](https://github.com/JohnConnorNPC) on 2026-11-28T07:34:52Z. --- Thanks for the update on `4f53dc60`. R0Y00's SCC request is met: `ACCUM_SCC_WORDS` carries their exact replacement (`1a7e1b8781801c851c020a7e`) and the test asserts it is refused. Their review is still CHANGES_REQUESTED on `85e96f29`, so it needs a re-review from R0Y00. Before that, could you add a control for each of the two new refusals that has none? Mutant runs were on copies of `tools/startup/gfx2hlsl.py`, restored by hash. 1. **sA dead at the exit.** Replacing `if kept in live_in[target] or accum not in live_in[target]:` with `if accum not in live_in[target]:` leaves `python3 -B tests/startup_gfx2hlsl_compute_check.py` green (rc=0). Under that mutant, words `050001d5050d6a00` + `80039abe` + `050001d5050d6600` (`v_cndmask … s26; s_mov_b32 s26, 0; v_cndmask_b32 v5, v5, v6, s25`) in the ACCUM fixture are accepted as `accum=[('s25', 's26')]`; unmutated they are refused (`accum=[False]`). That would make a good ACCUM refusal control. 2. **saveexec SCC (pigalot's item 1).** Narrowing the SCC test in `accum_scc_dead` to `s_and_b32` only also leaves the suite green, and the tests never use the direct form (`git show 4f53dc60:tests/startup_gfx2hlsl_compute_check.py | grep -c 1a3c9cbe` → 0). `1a3c9cbe` `1c03febe` `81801d85` `1d020a7e` (`s_and_saveexec_b32 s28, s26; s_mov_b32 exec_lo, s28; s_cselect_b32 s29, 1, 0; v_mov_b32 v5, s29`) is refused on the head today, so it can go in as a second ACCUM_SCC control. Smaller points: - The branch conflicts with `main` `c3204a9c` in one file (`git merge-tree --write-tree --name-only c3204a9c 4f53dc60` → `tests/startup_gfx2hlsl_compute_check.py`). Main's `check_execz_mask_subset` and your `check_execz_accumulated_mask` were added at the same spot. Keeping both resolves it, and the compute check passes on that merge. - The body's Verification section still names `85e96f29`, not `4f53dc60`. - docs/experiments.md leaves dispatch readback to `ctest -R '^startup_gfx2hlsl_compute_'`, but no dispatch case uses ACCUM (`grep -cE "CASES\[[^]]*\] *=.*(ACCUM|EXIT_RUN)"` → 0). That run doesn't exercise this fixture, so please say so in the docs or add ACCUM as a case. This comment was AI-assisted.
SimSalabimse commented 2026-11-28 10:52:39 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-28T10:52:39Z.


Retested fc2341e2af on the Windows test PC (NVIDIA, 32-lane waves).

ctest --preset dev --no-tests=error -j 1 -R '^startup_gfx2hlsl_compute_controls$' -E "startup_audio_output|startup_audio_pacing|startup_audio_provider"

That passed twice, 1/1 each time, exit 0.

ctest --preset dev --no-tests=error -j 1 -R startup_gfx2hlsl_ -E "startup_audio_output|startup_audio_pacing|startup_audio_provider"

387/387 passed, exit 0.

Both of JohnConnorNPC's described mutants fail the new ACCUM_KEPT_* and ACCUM_SAVEEXEC_* controls on the Linux run.

AI-Assisted

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7238179928 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3109#issuecomment-7238179928). Originally posted by [SimSalabimse](https://github.com/SimSalabimse) on 2026-11-28T10:52:39Z. --- Retested fc2341e2af022efb926e59239109cdd9c7457a8f on the Windows test PC (NVIDIA, 32-lane waves). ctest --preset dev --no-tests=error -j 1 -R '^startup_gfx2hlsl_compute_controls$' -E "startup_audio_output|startup_audio_pacing|startup_audio_provider" That passed twice, 1/1 each time, exit 0. ctest --preset dev --no-tests=error -j 1 -R startup_gfx2hlsl_ -E "startup_audio_output|startup_audio_pacing|startup_audio_provider" 387/387 passed, exit 0. Both of JohnConnorNPC's described mutants fail the new ACCUM_KEPT_* and ACCUM_SAVEEXEC_* controls on the Linux run. AI-Assisted
pigalot commented 2026-11-28 11:08:22 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-28T11:08:22Z.

Review: APPROVED


Retested fc2341e2 merged over current main 7e5c378d. The merge is clean (tree 100400ae) and git diff --cached --check is clean. This follows my approval on 4f53dc60.

What changed since 4f53dc60. A merge of main (6afd4163) and one commit (fc2341e2) that adds two refusal controls, a docstring note and a docs paragraph. The translator's logic is unchanged.

  • I checked the merge with git show --remerge-diff 6afd4163. The one conflict was in tests/startup_gfx2hlsl_compute_check.py, where check_execz_accumulated_mask and main's check_execz_mask_subset were added at the same spot. Both are kept whole.

Earlier points.

  • Saveexec SCC form not pinned (my item 1, JohnConnorNPC's item 2): addressed. ACCUM_SAVEEXEC_WORDS (1a3c9cbe1c03febe81801d851d020a7e) is refused. Narrowing accum_scc_dead to s_and_b32 now fails the check at that control (line 1441).
  • sA dead at the exit not pinned (JohnConnorNPC's item 1): addressed. ACCUM_KEPT_WORDS is refused. Dropping kept in live_in[target] now fails the check at that control (line 1437).
  • Docs pointed at a dispatch-only ctest (JohnConnorNPC): addressed. docs/experiments.md now names startup_gfx2hlsl_compute_controls and says none of these programs is a dispatch case.
  • Conflict with main (JohnConnorNPC): addressed by 6afd4163.
  • PR body out of date (my item 2): not addressed. Its Verification section still names 85e96f29. Non-blocking.
  • R0Y00's SCC-live AND finding on 85e96f29 stays addressed: ACCUM_SCC_WORDS is still refused, and removing the accum_scc_dead call fails the check.

What I ran.

  • python -B tests/startup_gfx2hlsl_compute_check.py: exit 0. python -B tests/startup_tools_lint_check.py tools/startup: PASS.
  • Built dev and release, then ctest --test-dir out/build/<preset> --no-tests=error -j 6 -R '^startup_gfx2hlsl_compute_' -E 'startup_audio|_hardware$': 37/37 pass in each, no skips.
  • I did not run the _hardware dispatch tests this time, because no dispatch case uses these programs. I did not run the llvm-mc reassembly locally; CI's Assemble and translate gfx1013 fixtures passes on fc2341e2.

Mutants of tools/startup/gfx2hlsl.py, each run against tests/startup_gfx2hlsl_compute_check.py:

Mutant Result
"sA dead at the exit" test dropped killed (ACCUM_KEPT)
SCC check applied to s_and_b32 only killed (ACCUM_SAVEEXEC)
accum_scc_dead call removed killed
SCC liveness read at the AND itself instead of its successors killed
always refuse when the read writes SCC killed (ACCUM_AND_WORDS)
per-lane test dropped from the walk killed (whole-word read)
"sB live at the exit" test dropped survives
read of sA in the walk no longer refused survives
walk does not stop at a write of sB survives
SCC looked up in may-writes instead of must-writes survives (equivalent here)

Restored afterwards; git diff --quiet is clean.

Non-blocking.

  1. Three walk conditions are unpinned. None of the three surviving non-equivalent mutants makes the translator accept a wrong program as far as I can see:

    • Without the "sB live" test, a pair whose sB is never read is accepted.
    • Without the sA-read test, a read of sA after the exit is still caught by the liveness test at the exit.
    • Without the stop at a write of sB, the walk only refuses more.

    So these are coverage notes, not defects.

  2. The trace asserts for the two new controls repeat earlier ones. The trace(...) lines before ACCUM_KEPT and ACCUM_SAVEEXEC are the same model calls as for ACCUM_READ_S25 and ACCUM_SCC. They do not model the new words (the s_mov_b32 s26, 0, or the saveexec and restore). The refusals themselves are real, as the mutants show.

  3. The PR body's Verification section still names 85e96f29.

Verdict: approve on fc2341e2. R0Y00's changes-requested review on 85e96f29 still stands, so I am not merging this. It needs R0Y00's re-review.

Environment: Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; Python 3.12.10; host-only translator checks and WARP, no hardware GPU tests.
CI: Build and test on Windows, Assemble and translate gfx1013 fixtures and Run platform-independent Python checks on Linux pass on fc2341e2.

This reply was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6097393045 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3109#pullrequestreview-6097393045). Originally posted by [pigalot](https://github.com/pigalot) on 2026-11-28T11:08:22Z. **Review:** APPROVED --- Retested `fc2341e2` merged over current `main` `7e5c378d`. The merge is clean (tree `100400ae`) and `git diff --cached --check` is clean. This follows my approval on `4f53dc60`. **What changed since `4f53dc60`.** A merge of `main` (`6afd4163`) and one commit (`fc2341e2`) that adds two refusal controls, a docstring note and a docs paragraph. The translator's logic is unchanged. - I checked the merge with `git show --remerge-diff 6afd4163`. The one conflict was in `tests/startup_gfx2hlsl_compute_check.py`, where `check_execz_accumulated_mask` and main's `check_execz_mask_subset` were added at the same spot. Both are kept whole. **Earlier points.** - **Saveexec SCC form not pinned (my item 1, JohnConnorNPC's item 2): addressed.** `ACCUM_SAVEEXEC_WORDS` (`1a3c9cbe1c03febe81801d851d020a7e`) is refused. Narrowing `accum_scc_dead` to `s_and_b32` now fails the check at that control (line 1441). - **sA dead at the exit not pinned (JohnConnorNPC's item 1): addressed.** `ACCUM_KEPT_WORDS` is refused. Dropping `kept in live_in[target]` now fails the check at that control (line 1437). - **Docs pointed at a dispatch-only ctest (JohnConnorNPC): addressed.** `docs/experiments.md` now names `startup_gfx2hlsl_compute_controls` and says none of these programs is a dispatch case. - **Conflict with `main` (JohnConnorNPC): addressed** by `6afd4163`. - **PR body out of date (my item 2): not addressed.** Its Verification section still names `85e96f29`. Non-blocking. - R0Y00's SCC-live AND finding on `85e96f29` stays addressed: `ACCUM_SCC_WORDS` is still refused, and removing the `accum_scc_dead` call fails the check. **What I ran.** - `python -B tests/startup_gfx2hlsl_compute_check.py`: exit 0. `python -B tests/startup_tools_lint_check.py tools/startup`: PASS. - Built `dev` and `release`, then `ctest --test-dir out/build/<preset> --no-tests=error -j 6 -R '^startup_gfx2hlsl_compute_' -E 'startup_audio|_hardware$'`: 37/37 pass in each, no skips. - I did not run the `_hardware` dispatch tests this time, because no dispatch case uses these programs. I did not run the `llvm-mc` reassembly locally; CI's `Assemble and translate gfx1013 fixtures` passes on `fc2341e2`. **Mutants** of `tools/startup/gfx2hlsl.py`, each run against `tests/startup_gfx2hlsl_compute_check.py`: | Mutant | Result | |---|---| | "sA dead at the exit" test dropped | killed (`ACCUM_KEPT`) | | SCC check applied to `s_and_b32` only | killed (`ACCUM_SAVEEXEC`) | | `accum_scc_dead` call removed | killed | | SCC liveness read at the AND itself instead of its successors | killed | | always refuse when the read writes SCC | killed (`ACCUM_AND_WORDS`) | | per-lane test dropped from the walk | killed (whole-word read) | | "sB live at the exit" test dropped | survives | | read of sA in the walk no longer refused | survives | | walk does not stop at a write of sB | survives | | SCC looked up in may-writes instead of must-writes | survives (equivalent here) | Restored afterwards; `git diff --quiet` is clean. **Non-blocking.** 1. **Three walk conditions are unpinned.** None of the three surviving non-equivalent mutants makes the translator accept a wrong program as far as I can see: - Without the "sB live" test, a pair whose sB is never read is accepted. - Without the sA-read test, a read of sA after the exit is still caught by the liveness test at the exit. - Without the stop at a write of sB, the walk only refuses more. So these are coverage notes, not defects. 2. **The trace asserts for the two new controls repeat earlier ones.** The `trace(...)` lines before `ACCUM_KEPT` and `ACCUM_SAVEEXEC` are the same model calls as for `ACCUM_READ_S25` and `ACCUM_SCC`. They do not model the new words (the `s_mov_b32 s26, 0`, or the saveexec and restore). The refusals themselves are real, as the mutants show. 3. **The PR body's Verification section still names `85e96f29`.** **Verdict:** approve on `fc2341e2`. R0Y00's changes-requested review on `85e96f29` still stands, so I am not merging this. It needs R0Y00's re-review. Environment: Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; Python 3.12.10; host-only translator checks and WARP, no hardware GPU tests. CI: `Build and test on Windows`, `Assemble and translate gfx1013 fixtures` and `Run platform-independent Python checks on Linux` pass on `fc2341e2`. This reply was AI-assisted.
SimSalabimse commented 2026-11-28 20:34:30 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-28T20:34:30Z.


@R0Y00 Both of your requests are in, and the branch is rebased onto current main (head 2c6dd7a1).

  • SCC-live AND: accum_scc_dead in 3d205071 only treats s_and_b32 sX, sB, exec_lo as a per-lane read when no later instruction still has SCC live. Your s_cselect replacement stays refused.
  • Negative control: in the same commit, ACCUM_SCC_WORDS is your replacement (1a7e1b8781801c851c020a7e), and the compute check asserts that it is refused. Forcing the dead-SCC check to pass makes that assertion fail.

Linux: tools lint exited 0, and python-linux passed 258/258.
Windows test PC: startup_gfx2hlsl_compute_ 71/71 passed at 2c6dd7a1, ctest exit 0.

AI-Assisted

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7245385832 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3109#issuecomment-7245385832). Originally posted by [SimSalabimse](https://github.com/SimSalabimse) on 2026-11-28T20:34:30Z. --- @R0Y00 Both of your requests are in, and the branch is rebased onto current main (head `2c6dd7a1`). - **SCC-live AND:** `accum_scc_dead` in `3d205071` only treats `s_and_b32 sX, sB, exec_lo` as a per-lane read when no later instruction still has SCC live. Your `s_cselect` replacement stays refused. - **Negative control:** in the same commit, `ACCUM_SCC_WORDS` is your replacement (`1a7e1b8781801c851c020a7e`), and the compute check asserts that it is refused. Forcing the dead-SCC check to pass makes that assertion fail. Linux: tools lint exited 0, and python-linux passed 258/258. Windows test PC: `startup_gfx2hlsl_compute_` 71/71 passed at `2c6dd7a1`, ctest exit 0. AI-Assisted
Leyukaka commented 2026-11-29 00:16:21 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T00:16:21Z.


Review of 2c6dd7a1, diff only, against main 51472392. The three touched files are unchanged on main since 0614f68c (git diff --stat 0614f68c 51472392 on them is empty), and git merge-tree --write-tree merges cleanly.

The sA/sB proof holds for one pair: a leaving lane skips the pair, so its bit of sB matches, and its bit of sA differs, which kept in live_in[target] refuses. SCC of the pair is dead at the exit because main already requires that.

  1. A second pair is not caught by any test. tools/startup/gfx2hlsl.py:3446: changing if (pair is None and base == 's_and_b32' to if (base == 's_and_b32' leaves the suite green, because no fixture has two pairs. Under that change the second pair overwrites pair, and the first pair's sA liveness and sB reads are never checked. A control: start s27 as an entry EXEC copy and s28 as 0, add s_and_b32 s27, s27, exec_lo; s_or_b32 s28, s28, s27 after the first pair, and after the restore read s28 with v_cndmask_b32 v5, v5, v6, s28, then v_cndmask_b32 v5, v5, v6, s25. Under the change the s25 read is not checked and the words are accepted; lane 0 stores 9 in the wave and 1 in the model. It must stay branch out of the block.

  2. The walk does not follow the AND's destination. At :3471-3476 only reads of sA and sB are checked. A copy of sB through s_and_b32 sX, sB, exec_lo can carry the whole word to an SCC that accum_scc_dead never sees. Please add this control: in ACCUM_WORDS replace 050001d5050d6a00 with s_and_b32 s27, s26, exec_lo; s_and_b32 s28, s27, exec_lo; s_cselect_b32 s29, 1, 0; v_mov_b32 v5, s29 (1a7e1b87 1b7e1c87 81801d85 1d020a7e, written from the fixture's encodings, not assembled). The first AND's SCC is dead, since the second AND overwrites it. The second AND reads s27, not s26, so its SCC is not checked. The wave's SCC is true, so all 8 lanes store 1, while the singletons give [0, 0, 0, 1, 1, 1, 1, 1]. The PR's own test shows ACCUM_SCC_WORDS translates once accum_scc_dead is forced to True, so nothing after the walk is shown to refuse the s_cselect path. If it translates, follow sX in the walk as sB is followed.

Verdict on 2c6dd7a1: comment. Items 1 and 2 need a control each, and item 2 may need a code change.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7247996653 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3109#issuecomment-7247996653). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-29T00:16:21Z. --- Review of `2c6dd7a1`, diff only, against `main` `51472392`. The three touched files are unchanged on `main` since `0614f68c` (`git diff --stat 0614f68c 51472392` on them is empty), and `git merge-tree --write-tree` merges cleanly. The sA/sB proof holds for one pair: a leaving lane skips the pair, so its bit of sB matches, and its bit of sA differs, which `kept in live_in[target]` refuses. SCC of the pair is dead at the exit because main already requires that. 1. **A second pair is not caught by any test.** `tools/startup/gfx2hlsl.py:3446`: changing `if (pair is None and base == 's_and_b32'` to `if (base == 's_and_b32'` leaves the suite green, because no fixture has two pairs. Under that change the second pair overwrites `pair`, and the first pair's sA liveness and sB reads are never checked. A control: start s27 as an entry EXEC copy and s28 as 0, add `s_and_b32 s27, s27, exec_lo; s_or_b32 s28, s28, s27` after the first pair, and after the restore read s28 with `v_cndmask_b32 v5, v5, v6, s28`, then `v_cndmask_b32 v5, v5, v6, s25`. Under the change the s25 read is not checked and the words are accepted; lane 0 stores 9 in the wave and 1 in the model. It must stay `branch out of the block`. 2. **The walk does not follow the AND's destination.** At `:3471-3476` only reads of sA and sB are checked. A copy of sB through `s_and_b32 sX, sB, exec_lo` can carry the whole word to an SCC that `accum_scc_dead` never sees. Please add this control: in `ACCUM_WORDS` replace `050001d5050d6a00` with `s_and_b32 s27, s26, exec_lo; s_and_b32 s28, s27, exec_lo; s_cselect_b32 s29, 1, 0; v_mov_b32 v5, s29` (`1a7e1b87 1b7e1c87 81801d85 1d020a7e`, written from the fixture's encodings, not assembled). The first AND's SCC is dead, since the second AND overwrites it. The second AND reads s27, not s26, so its SCC is not checked. The wave's SCC is true, so all 8 lanes store 1, while the singletons give `[0, 0, 0, 1, 1, 1, 1, 1]`. The PR's own test shows `ACCUM_SCC_WORDS` translates once `accum_scc_dead` is forced to `True`, so nothing after the walk is shown to refuse the s_cselect path. If it translates, follow sX in the walk as sB is followed. Verdict on `2c6dd7a1`: comment. Items 1 and 2 need a control each, and item 2 may need a code change.
SimSalabimse commented 2026-11-29 00:37:11 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-29T00:37:11Z.


@Leyukaka Both controls are in (head 6e0bdf25, rebased onto main 51472392).

  • Second pair: a second pair in the staying span stays branch out of the block. The new program (ACCUM_SECOND_*) starts s27 as an entry EXEC copy and s28 as 0, puts s_and_b32 s27, s27, exec_lo; s_or_b32 s28, s28, s27 after the first pair, then selects with s28 and s25. Lane 0 is 9 in the wave and 1 in the model. Dropping pair is None accepts those words, and the compute check exits 1 there.
  • Chained AND: this one was translating. The walk now follows the AND destination the same way it follows sB (accum_carried). Your words decode as s_and_b32 s27, s26, exec_lo; s_and_b32 s28, s27, exec_lo; s_cselect_b32 s29, 1, 0; v_mov_b32 v5, s29 (ACCUM_CARRY_*), and that program stays refused. Turning the follow off accepts it, and the check fails on that assertion.

Linux: tools lint exited 0, and python-linux passed 259/259.
Windows test PC: startup_gfx2hlsl_compute_ 71/71 passed at 6e0bdf25, ctest exit 0.

AI-Assisted

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7248237688 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3109#issuecomment-7248237688). Originally posted by [SimSalabimse](https://github.com/SimSalabimse) on 2026-11-29T00:37:11Z. --- @Leyukaka Both controls are in (head `6e0bdf25`, rebased onto main `51472392`). - **Second pair:** a second pair in the staying span stays `branch out of the block`. The new program (`ACCUM_SECOND_*`) starts s27 as an entry EXEC copy and s28 as 0, puts `s_and_b32 s27, s27, exec_lo; s_or_b32 s28, s28, s27` after the first pair, then selects with s28 and s25. Lane 0 is 9 in the wave and 1 in the model. Dropping `pair is None` accepts those words, and the compute check exits 1 there. - **Chained AND:** this one was translating. The walk now follows the AND destination the same way it follows sB (`accum_carried`). Your words decode as `s_and_b32 s27, s26, exec_lo; s_and_b32 s28, s27, exec_lo; s_cselect_b32 s29, 1, 0; v_mov_b32 v5, s29` (`ACCUM_CARRY_*`), and that program stays refused. Turning the follow off accepts it, and the check fails on that assertion. Linux: tools lint exited 0, and python-linux passed 259/259. Windows test PC: `startup_gfx2hlsl_compute_` 71/71 passed at `6e0bdf25`, ctest exit 0. AI-Assisted
Leyukaka commented 2026-11-29 01:04:53 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T01:04:53Z.

Review: APPROVED


Review of 6e0bdf25, diff only, against main 212d4b5f. git range-diff against 2c6dd7a1 shows the first three commits unchanged (=) and one new commit, 6e0bdf25. The three touched files are unchanged on main from 51472392 to 212d4b5f, and git merge-tree --write-tree merges cleanly.

  1. Second pair: addressed. ACCUM_SECOND_WORDS (tests/startup_gfx2hlsl_compute_check.py:554-558) is the requested program, and :1469 requires branch out of the block. I checked the new dwords against the fixture's own encodings. If pair is None is dropped, the second pair overwrites pair with (s27, s28). s27 is dead at the exit and s28 is live there, and the v_cndmask of s25 reads neither, so, by reading, the words would then be accepted and :1469 would fail. I did not run this mutation. Without the mutation, the second s_and_b32 reaches vector_span and is refused.

  2. Chained AND: addressed, with a code change. accum_carried (tools/startup/gfx2hlsl.py:3506) adds sX from s_and_b32 sX, sW, exec_lo to the tracked set when sW is tracked. The walk now applies per_lane_read and accum_scc_dead to every tracked word. ACCUM_CARRY_WORDS is 1a7e1b87 1b7e1c87 81801d85 1d020a7e, and it is refused at :1473. :1475-1486 stubs accum_carried to None and requires that the words are then accepted, so the refusal depends on following the destination.

pigalot's approvals are on 4f53dc60 and fc2341e2, and R0Y00's changes request is on 85e96f29. Neither covers the walk change in 6e0bdf25. ACCUM_SCC_WORDS is still refused at this head.

Basis: reading of the diff, and CI on 6e0bdf25: Build and test on Windows, Assemble and translate gfx1013 fixtures (which asserts both new word strings against llvm-mc, :2788-2789) and Run platform-independent Python checks on Linux pass. I ran nothing locally.

Verdict on 6e0bdf25: approve.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6100836174 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3109#pullrequestreview-6100836174). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-29T01:04:53Z. **Review:** APPROVED --- Review of `6e0bdf25`, diff only, against `main` `212d4b5f`. `git range-diff` against `2c6dd7a1` shows the first three commits unchanged (`=`) and one new commit, `6e0bdf25`. The three touched files are unchanged on `main` from `51472392` to `212d4b5f`, and `git merge-tree --write-tree` merges cleanly. 1. **Second pair: addressed.** `ACCUM_SECOND_WORDS` (`tests/startup_gfx2hlsl_compute_check.py:554-558`) is the requested program, and `:1469` requires `branch out of the block`. I checked the new dwords against the fixture's own encodings. If `pair is None` is dropped, the second pair overwrites `pair` with `(s27, s28)`. s27 is dead at the exit and s28 is live there, and the `v_cndmask` of s25 reads neither, so, by reading, the words would then be accepted and `:1469` would fail. I did not run this mutation. Without the mutation, the second `s_and_b32` reaches `vector_span` and is refused. 2. **Chained AND: addressed, with a code change.** `accum_carried` (`tools/startup/gfx2hlsl.py:3506`) adds sX from `s_and_b32 sX, sW, exec_lo` to the tracked set when sW is tracked. The walk now applies `per_lane_read` and `accum_scc_dead` to every tracked word. `ACCUM_CARRY_WORDS` is `1a7e1b87 1b7e1c87 81801d85 1d020a7e`, and it is refused at `:1473`. `:1475-1486` stubs `accum_carried` to `None` and requires that the words are then accepted, so the refusal depends on following the destination. pigalot's approvals are on `4f53dc60` and `fc2341e2`, and R0Y00's changes request is on `85e96f29`. Neither covers the walk change in `6e0bdf25`. `ACCUM_SCC_WORDS` is still refused at this head. Basis: reading of the diff, and CI on `6e0bdf25`: `Build and test on Windows`, `Assemble and translate gfx1013 fixtures` (which asserts both new word strings against llvm-mc, `:2788-2789`) and `Run platform-independent Python checks on Linux` pass. I ran nothing locally. Verdict on `6e0bdf25`: approve.
pigalot commented 2026-11-29 07:19:06 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-29T07:19:06Z.

Review: CHANGES_REQUESTED


Retested 6e0bdf25 merged over current main 212d4b5f. The merge is clean (tree c79dafd0) and git diff --cached --check is clean. The branch was rebased since my approval on fc2341e2; the one new commit is 6e0bdf25, which adds the one-pair control (ACCUM_SECOND_*), the walk that follows an AND's destination (accum_carried) and its control (ACCUM_CARRY_*).

Blocking: a carried mask is dropped when the same AND is repeated.

  • Input: in ACCUM_WORDS, replace 050001d5050d6a00 with 1a7e1b87 1a7e1b87 1b7e1c87 81801d85 1d020a7e. That is ACCUM_CARRY_WORDS with its first dword repeated:
    s_and_b32 s27, s26, exec_lo; s_and_b32 s27, s26, exec_lo; s_and_b32 s28, s27, exec_lo; s_cselect_b32 s29, 1, 0; v_mov_b32 v5, s29.
  • Observed: translate('O', code=words).hlsl_cs() accepts it and emits s28 = (s27 & exec) & 1; scc = s28 != 0; s29 = scc ? 0x00000001u : 0x00000000u; if (exec & 1) v5 = s29;.
  • Expected: branch out of the block, as for ACCUM_CARRY_WORDS. The values are the ones the test already models for that control: trace(lanes, observe='scc') is [1] * 8 and singletons(lanes, observe='scc') is [0, 0, 0, 1, 1, 1, 1, 1].
  • Cause, as I read it: at the second AND, s27 is already tracked, so accum_carried returns None (if ops[0] in tracked). Then nxt -= (tracked & writes) removes s27, because the AND writes it. From there on s27 is not tracked, although it holds s26's lane bits again, so the third AND's SCC is never checked.
  • The same happens through a longer chain: 1a7e1b87 1b7e1c87 1c7e1b87 1b7e1d87 81801e85 1e020a7e (s27 = s26 & exec; s28 = s27 & exec; s27 = s28 & exec; s29 = s27 & exec; s_cselect_b32 s30, 1, 0; v_mov_b32 v5, s30) is also accepted.
  • Direction (tried locally, not a full review of it): drop the ops[0] in tracked return in accum_carried and build the next set as set(tracked) - writes, then add the carried word. With that, both programs above are refused with the PR's reason and python -B tests/startup_gfx2hlsl_compute_check.py still exits 0. The in-place s_and_b32 sX, sX, exec_lo of a tracked word followed by s_cselect_b32 is refused with or without that change (I checked 1a7e1b87 1b7e1b87 81801d85 1d020a7e, and 1a7e1a87 81801d85 1d020a7e on s26). Please add the first program as a control.

Leyukaka's two points on 2c6dd7a1 are addressed for the programs they named.

  • Second pair: ACCUM_SECOND_WORDS is refused. Dropping pair is None fails the check there (line 1469).
  • Chained AND: ACCUM_CARRY_WORDS is refused. Returning None from accum_carried, checking SCC only for sB, or stopping the walk at the carrying AND each fails the check there (line 1473).

Leyukaka approved 6e0bdf25 from a reading of the diff; the program above is not one of theirs.

R0Y00's SCC-live AND finding on 85e96f29 stays addressed: ACCUM_SCC_WORDS is still refused, and forcing accum_scc_dead to True fails the check (line 1445).

What I ran.

  • python -B tests/startup_gfx2hlsl_compute_check.py: exit 0. python -B tests/startup_tools_lint_check.py tools/startup: PASS.
  • Built dev and release, then ctest --test-dir out/build/<preset> --no-tests=error -j 6 -R '^startup_gfx2hlsl_compute_' -E 'startup_audio|_hardware$': 37/37 pass in each, no skips.
  • I did not run the _hardware dispatch tests, because no dispatch case uses these programs. I did not run the llvm-mc reassembly locally; CI's Assemble and translate gfx1013 fixtures passes on 6e0bdf25. The words in this review are written from the fixture's own encodings, not assembled.
  • Other programs I tried at this head, both refused: the carry chain with the AND operands swapped (7e1a1b87 7e1b1c87 81801d85 1d020a7e), and a whole-word v_mov_b32 v5, s27 of a carried word (1a7e1b87 040406bf 1b020a7e).
  • A local title startup run of 6e0bdf25 merged onto main 212d4b5f passed: judged no worse than the main baseline.

Mutants of tools/startup/gfx2hlsl.py, each run against tests/startup_gfx2hlsl_compute_check.py:

Mutant Result
pair is None dropped (second pair adopted) killed (ACCUM_SECOND)
accum_carried always returns None killed (ACCUM_CARRY)
SCC check applied to sB only, not to carried words killed (ACCUM_CARRY)
walk stops at the carrying AND instead of adding sX killed (ACCUM_CARRY)
"sA dead at the exit" test dropped killed (ACCUM_KEPT)
accum_scc_dead always True killed (ACCUM_SCC)
per-lane test applied to sB only, not to carried words survives
a write never ends a tracked mask survives
carry taken from any AND with exec_lo, source not checked survives
"sB live at the exit" test dropped survives
read of sA in the walk no longer refused survives
ops[0] in tracked return dropped from accum_carried survives
visited set keyed by instruction only survives (equivalent here)
exec_lo no longer required in accum_carried survives (equivalent here)

Restored afterwards; git diff --quiet is clean.

Notes on the survivors:

  • Per-lane test on sB only: with it, the whole-word v_mov_b32 of a carried word above is still refused, so this is a coverage note.
  • Write never ends a mask, carry from any AND: these only refuse more.
  • sB live, read of sA: unchanged from my review of fc2341e2; neither accepts a wrong program as far as I can see.
  • ops[0] in tracked return: it survives because the write removal drops the word either way; with only this return dropped, the two programs in the blocking finding are still accepted. This is the blocking finding above.
  • Equivalent here: the instructions after the pair are straight-line in every shape execz_scalar_exit accepts, so each is visited once; and an AND of a tracked word without exec_lo is already refused by per_lane_read.

Non-blocking.

  1. The trace asserts for the two new controls repeat earlier ones. They are the same model calls as for ACCUM_READ_S25 and ACCUM_SCC; they do not model the second pair or the second AND.
  2. The PR body's Verification section still names 85e96f29.
  3. Not from this PR: s_and_saveexec_b32 s28, s26, then s_cmp_eq_u32 s4, s4, then s_and_b32 s29, s21, exec_lo and s_cselect_b32 of that SCC is accepted (1a3c9cbe 040406bf 157e1d87 81801e85 1c03febe 1e020a7e). The same program without the pair, with a fresh v_cmp_gt_u32 vcc_lo, 3, v0 in place of s26, is accepted too, so the SCC of an AND with a narrowed EXEC is read per lane with or without this PR. I am not asking for it here.

Verdict: request changes on 6e0bdf25, for the repeated-AND program above. This supersedes my approval on fc2341e2. R0Y00's changes-requested review on 85e96f29 also still stands.

Environment: Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; Python 3.12.10; host-only translator checks and WARP, no hardware GPU tests.
CI: Build and test on Windows, Assemble and translate gfx1013 fixtures and Run platform-independent Python checks on Linux pass on 6e0bdf25.

This reply was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6101882573 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3109#pullrequestreview-6101882573). Originally posted by [pigalot](https://github.com/pigalot) on 2026-11-29T07:19:06Z. **Review:** CHANGES_REQUESTED --- Retested `6e0bdf25` merged over current `main` `212d4b5f`. The merge is clean (tree `c79dafd0`) and `git diff --cached --check` is clean. The branch was rebased since my approval on `fc2341e2`; the one new commit is `6e0bdf25`, which adds the one-pair control (`ACCUM_SECOND_*`), the walk that follows an AND's destination (`accum_carried`) and its control (`ACCUM_CARRY_*`). **Blocking: a carried mask is dropped when the same AND is repeated.** - **Input:** in `ACCUM_WORDS`, replace `050001d5050d6a00` with `1a7e1b87 1a7e1b87 1b7e1c87 81801d85 1d020a7e`. That is `ACCUM_CARRY_WORDS` with its first dword repeated: `s_and_b32 s27, s26, exec_lo; s_and_b32 s27, s26, exec_lo; s_and_b32 s28, s27, exec_lo; s_cselect_b32 s29, 1, 0; v_mov_b32 v5, s29`. - **Observed:** `translate('O', code=words).hlsl_cs()` accepts it and emits `s28 = (s27 & exec) & 1; scc = s28 != 0; s29 = scc ? 0x00000001u : 0x00000000u; if (exec & 1) v5 = s29;`. - **Expected:** `branch out of the block`, as for `ACCUM_CARRY_WORDS`. The values are the ones the test already models for that control: `trace(lanes, observe='scc')` is `[1] * 8` and `singletons(lanes, observe='scc')` is `[0, 0, 0, 1, 1, 1, 1, 1]`. - **Cause, as I read it:** at the second AND, s27 is already tracked, so `accum_carried` returns `None` (`if ops[0] in tracked`). Then `nxt -= (tracked & writes)` removes s27, because the AND writes it. From there on s27 is not tracked, although it holds s26's lane bits again, so the third AND's SCC is never checked. - The same happens through a longer chain: `1a7e1b87 1b7e1c87 1c7e1b87 1b7e1d87 81801e85 1e020a7e` (`s27 = s26 & exec; s28 = s27 & exec; s27 = s28 & exec; s29 = s27 & exec; s_cselect_b32 s30, 1, 0; v_mov_b32 v5, s30`) is also accepted. - **Direction (tried locally, not a full review of it):** drop the `ops[0] in tracked` return in `accum_carried` and build the next set as `set(tracked) - writes`, then add the carried word. With that, both programs above are refused with the PR's reason and `python -B tests/startup_gfx2hlsl_compute_check.py` still exits 0. The in-place `s_and_b32 sX, sX, exec_lo` of a tracked word followed by `s_cselect_b32` is refused with or without that change (I checked `1a7e1b87 1b7e1b87 81801d85 1d020a7e`, and `1a7e1a87 81801d85 1d020a7e` on s26). Please add the first program as a control. **Leyukaka's two points on `2c6dd7a1` are addressed** for the programs they named. - **Second pair:** `ACCUM_SECOND_WORDS` is refused. Dropping `pair is None` fails the check there (line 1469). - **Chained AND:** `ACCUM_CARRY_WORDS` is refused. Returning `None` from `accum_carried`, checking SCC only for sB, or stopping the walk at the carrying AND each fails the check there (line 1473). Leyukaka approved `6e0bdf25` from a reading of the diff; the program above is not one of theirs. R0Y00's SCC-live AND finding on `85e96f29` stays addressed: `ACCUM_SCC_WORDS` is still refused, and forcing `accum_scc_dead` to `True` fails the check (line 1445). **What I ran.** - `python -B tests/startup_gfx2hlsl_compute_check.py`: exit 0. `python -B tests/startup_tools_lint_check.py tools/startup`: PASS. - Built `dev` and `release`, then `ctest --test-dir out/build/<preset> --no-tests=error -j 6 -R '^startup_gfx2hlsl_compute_' -E 'startup_audio|_hardware$'`: 37/37 pass in each, no skips. - I did not run the `_hardware` dispatch tests, because no dispatch case uses these programs. I did not run the `llvm-mc` reassembly locally; CI's `Assemble and translate gfx1013 fixtures` passes on `6e0bdf25`. The words in this review are written from the fixture's own encodings, not assembled. - Other programs I tried at this head, both refused: the carry chain with the AND operands swapped (`7e1a1b87 7e1b1c87 81801d85 1d020a7e`), and a whole-word `v_mov_b32 v5, s27` of a carried word (`1a7e1b87 040406bf 1b020a7e`). - A local title startup run of `6e0bdf25` merged onto `main` `212d4b5f` passed: judged no worse than the `main` baseline. **Mutants** of `tools/startup/gfx2hlsl.py`, each run against `tests/startup_gfx2hlsl_compute_check.py`: | Mutant | Result | |---|---| | `pair is None` dropped (second pair adopted) | killed (`ACCUM_SECOND`) | | `accum_carried` always returns `None` | killed (`ACCUM_CARRY`) | | SCC check applied to sB only, not to carried words | killed (`ACCUM_CARRY`) | | walk stops at the carrying AND instead of adding sX | killed (`ACCUM_CARRY`) | | "sA dead at the exit" test dropped | killed (`ACCUM_KEPT`) | | `accum_scc_dead` always `True` | killed (`ACCUM_SCC`) | | per-lane test applied to sB only, not to carried words | survives | | a write never ends a tracked mask | survives | | carry taken from any AND with `exec_lo`, source not checked | survives | | "sB live at the exit" test dropped | survives | | read of sA in the walk no longer refused | survives | | `ops[0] in tracked` return dropped from `accum_carried` | survives | | visited set keyed by instruction only | survives (equivalent here) | | `exec_lo` no longer required in `accum_carried` | survives (equivalent here) | Restored afterwards; `git diff --quiet` is clean. Notes on the survivors: - **Per-lane test on sB only:** with it, the whole-word `v_mov_b32` of a carried word above is still refused, so this is a coverage note. - **Write never ends a mask, carry from any AND:** these only refuse more. - **sB live, read of sA:** unchanged from my review of `fc2341e2`; neither accepts a wrong program as far as I can see. - **`ops[0] in tracked` return:** it survives because the write removal drops the word either way; with only this return dropped, the two programs in the blocking finding are still accepted. This is the blocking finding above. - **Equivalent here:** the instructions after the pair are straight-line in every shape `execz_scalar_exit` accepts, so each is visited once; and an AND of a tracked word without `exec_lo` is already refused by `per_lane_read`. **Non-blocking.** 1. **The trace asserts for the two new controls repeat earlier ones.** They are the same model calls as for `ACCUM_READ_S25` and `ACCUM_SCC`; they do not model the second pair or the second AND. 2. **The PR body's Verification section still names `85e96f29`.** 3. **Not from this PR:** `s_and_saveexec_b32 s28, s26`, then `s_cmp_eq_u32 s4, s4`, then `s_and_b32 s29, s21, exec_lo` and `s_cselect_b32` of that SCC is accepted (`1a3c9cbe 040406bf 157e1d87 81801e85 1c03febe 1e020a7e`). The same program without the pair, with a fresh `v_cmp_gt_u32 vcc_lo, 3, v0` in place of s26, is accepted too, so the SCC of an AND with a narrowed EXEC is read per lane with or without this PR. I am not asking for it here. **Verdict:** request changes on `6e0bdf25`, for the repeated-AND program above. This supersedes my approval on `fc2341e2`. R0Y00's changes-requested review on `85e96f29` also still stands. Environment: Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; Python 3.12.10; host-only translator checks and WARP, no hardware GPU tests. CI: `Build and test on Windows`, `Assemble and translate gfx1013 fixtures` and `Run platform-independent Python checks on Linux` pass on `6e0bdf25`. This reply was AI-assisted.
Leyukaka commented 2026-11-29 07:32:41 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T07:32:41Z.

Review: CHANGES_REQUESTED


Withdrawing my approval of 6e0bdf25: the repeated-AND program in the review above gets past the walk in execz_accumulated_mask at this head. Read of tools/startup/gfx2hlsl.py only, nothing run.

With tracked = {s26}:

  • 1st s_and_b32 s27, s26, exec_lo: accum_carried returns s27, so tracked = {s26, s27}.
  • 2nd, identical: accum_carried returns None because s27 is already tracked (:3517), then nxt -= (tracked & writes) (:3486) removes s27.
  • s_and_b32 s28, s27, exec_lo: s27 is not tracked, so the per-lane read check (:3477) and the SCC check (:3479) do not apply, and s28 is not carried (:3523).
  • The following s_cselect_b32 reads that SCC unchecked.

I did not check the fix suggested in that review.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6101919793 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3109#pullrequestreview-6101919793). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-29T07:32:41Z. **Review:** CHANGES_REQUESTED --- Withdrawing my approval of `6e0bdf25`: the repeated-AND program in the review above gets past the walk in `execz_accumulated_mask` at this head. Read of `tools/startup/gfx2hlsl.py` only, nothing run. With `tracked = {s26}`: - 1st `s_and_b32 s27, s26, exec_lo`: `accum_carried` returns s27, so `tracked = {s26, s27}`. - 2nd, identical: `accum_carried` returns `None` because s27 is already tracked (`:3517`), then `nxt -= (tracked & writes)` (`:3486`) removes s27. - `s_and_b32 s28, s27, exec_lo`: s27 is not tracked, so the per-lane read check (`:3477`) and the SCC check (`:3479`) do not apply, and s28 is not carried (`:3523`). - The following `s_cselect_b32` reads that SCC unchecked. I did not check the fix suggested in that review.
SimSalabimse commented 2026-11-29 12:54:04 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-29T12:54:04Z.


Fixed at ede53dce485b1028f78287026eb8a89a258bdd5a. An AND that rewrites an already tracked lane mask now ends the old definition and starts a new tracked definition at that destination, so a later AND's SCC stays inside the refusal. That covers the repeated carry into s27 (ACCUM_REPEAT_*, the first dword of ACCUM_CARRY_WORDS repeated) and the longer chain that rewrites s27 from s28 then carries it into s29 (ACCUM_REWRITE_*). Restoring the old rule that returns None when the destination is already tracked accepts both, and the check then fails. The earlier accumulated-mask controls are unchanged. The branch is rebased onto main 77d1ba4d.

Windows test PC (MSVC, --preset dev, -j 1), at that head:

  • ctest --preset dev --no-tests=error -j 1 -R '^startup_gfx2hlsl_compute_' -E 'startup_audio_(output|pacing|provider)': 71/71 passed, exit 0. startup_gfx2hlsl_compute_controls ran the execz refusals, including the two new programs. The other 70 are the warp, hardware, spill and mask-spill cases, including the expected-fail controls.

Not done in this head: the trace asserts for the new controls still repeat the earlier model calls. The in-place s_and_b32 sX, sX, exec_lo programs from the review are not added as named controls.

AI-Assisted

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7256143909 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3109#issuecomment-7256143909). Originally posted by [SimSalabimse](https://github.com/SimSalabimse) on 2026-11-29T12:54:04Z. --- Fixed at `ede53dce485b1028f78287026eb8a89a258bdd5a`. An AND that rewrites an already tracked lane mask now ends the old definition and starts a new tracked definition at that destination, so a later AND's SCC stays inside the refusal. That covers the repeated carry into s27 (`ACCUM_REPEAT_*`, the first dword of `ACCUM_CARRY_WORDS` repeated) and the longer chain that rewrites s27 from s28 then carries it into s29 (`ACCUM_REWRITE_*`). Restoring the old rule that returns `None` when the destination is already tracked accepts both, and the check then fails. The earlier accumulated-mask controls are unchanged. The branch is rebased onto main `77d1ba4d`. Windows test PC (MSVC, `--preset dev`, `-j 1`), at that head: - `ctest --preset dev --no-tests=error -j 1 -R '^startup_gfx2hlsl_compute_' -E 'startup_audio_(output|pacing|provider)'`: 71/71 passed, exit 0. `startup_gfx2hlsl_compute_controls` ran the execz refusals, including the two new programs. The other 70 are the warp, hardware, spill and mask-spill cases, including the expected-fail controls. Not done in this head: the trace asserts for the new controls still repeat the earlier model calls. The in-place `s_and_b32 sX, sX, exec_lo` programs from the review are not added as named controls. AI-Assisted
JohnConnorNPC commented 2026-11-29 12:55:35 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T12:55:35Z.


Review of ede53dce (merge-base = main 77d1ba4d). Verdict: no MUST from me. Merging is blocked only by the recorded change requests: pigalot and Leyukaka on 6e0bdf25, and R0Y00 on 85e96f29. Each needs its author's re-review.

pigalot's blocking finding (a repeated AND drops a carried mask) is fixed the way pigalot suggested. accum_carried no longer returns None for an already tracked destination, and the walk builds nxt = set(tracked) - writes before adding the carry. What I ran, Linux, Python 3.13:

  • Head. python -B tests/startup_gfx2hlsl_compute_check.py → exit 0.
  • Negative control. The same check with tools/startup/gfx2hlsl.py from ede53dce~1 → exit 1 at AssertionError: accepted, expected a refusal naming 's_cbranch_scc0 inside a block s_cbranch_execz skips per lane: branch out of the block'. So the new ACCUM_REPEAT/ACCUM_REWRITE controls pin the fix, and the in-test no_recarry stub covers the same ground.
  • Extra probes. I replaced 050001d5050d6a00 in ACCUM_WORDS with each of these, and all are refused with that reason:
    • a whole-word copy s_mov_b32 s27, s26, then s_and_b32 s28, s27, exec_lo; s_cselect_b32 s29, 1, 0; v_mov_b32 v5, s29;
    • an in-place s_and_b32 s27, s27, exec_lo of a carried word, then s_cselect;
    • pigalot's repeated-AND program.
  • Assembly. Both new word strings are asserted against llvm-mc (assemble(llvm_mc, ACCUM_REPEAT_SOURCE) == ACCUM_REPEAT_WORDS, and the same for REWRITE), and CI's fixture job passes on this head.

The change is gfx2hlsl-only. With X2W_NATIVE_SHADERS_ONLY=1 (the launcher default since #3449), its compute manifests aren't loaded, so it affects -Translate runs only.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7256161970 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3109#issuecomment-7256161970). Originally posted by [JohnConnorNPC](https://github.com/JohnConnorNPC) on 2026-11-29T12:55:35Z. --- Review of `ede53dce` (merge-base = main `77d1ba4d`). **Verdict: no MUST from me. Merging is blocked only by the recorded change requests**: pigalot and Leyukaka on `6e0bdf25`, and R0Y00 on `85e96f29`. Each needs its author's re-review. pigalot's blocking finding (a repeated AND drops a carried mask) is fixed the way pigalot suggested. `accum_carried` no longer returns `None` for an already tracked destination, and the walk builds `nxt = set(tracked) - writes` before adding the carry. What I ran, Linux, Python 3.13: - **Head.** `python -B tests/startup_gfx2hlsl_compute_check.py` → exit 0. - **Negative control.** The same check with `tools/startup/gfx2hlsl.py` from `ede53dce~1` → exit 1 at `AssertionError: accepted, expected a refusal naming 's_cbranch_scc0 inside a block s_cbranch_execz skips per lane: branch out of the block'`. So the new `ACCUM_REPEAT`/`ACCUM_REWRITE` controls pin the fix, and the in-test `no_recarry` stub covers the same ground. - **Extra probes.** I replaced `050001d5050d6a00` in `ACCUM_WORDS` with each of these, and all are refused with that reason: - a whole-word copy `s_mov_b32 s27, s26`, then `s_and_b32 s28, s27, exec_lo; s_cselect_b32 s29, 1, 0; v_mov_b32 v5, s29`; - an in-place `s_and_b32 s27, s27, exec_lo` of a carried word, then `s_cselect`; - pigalot's repeated-AND program. - **Assembly.** Both new word strings are asserted against llvm-mc (`assemble(llvm_mc, ACCUM_REPEAT_SOURCE) == ACCUM_REPEAT_WORDS`, and the same for `REWRITE`), and CI's fixture job passes on this head. The change is gfx2hlsl-only. With `X2W_NATIVE_SHADERS_ONLY=1` (the launcher default since #3449), its compute manifests aren't loaded, so it affects `-Translate` runs only. AI-assisted.
pigalot commented 2026-11-29 13:03:16 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-29T13:03:16Z.

Review: APPROVED


Retested ede53dce merged over main 77d1ba4d. The merge is clean (tree 52d8d667) and git diff --cached --check is clean. git range-diff against 6e0bdf25 shows the first four commits unchanged and one new commit, ede53dce.

My blocking finding on 6e0bdf25 is addressed. A carried mask is no longer dropped when an AND rewrites it.

  • The walk now builds the next set as set(tracked) - writes and then adds the carried word, and accum_carried no longer returns None for a destination that is already tracked. A rewritten word is therefore tracked again from the AND on.
  • Repeated AND (1a7e1b87 1a7e1b87 1b7e1c87 81801d85 1d020a7e): refused with branch out of the block. It is in the test as ACCUM_REPEAT_WORDS.
  • Longer chain (1a7e1b87 1b7e1c87 1c7e1b87 1b7e1d87 81801e85 1e020a7e): refused. It is in the test as ACCUM_REWRITE_WORDS.
  • The test also stubs the old rule (a tracked destination is not carried) and requires that both programs are then accepted, so the two refusals depend on this change.

Leyukaka's changes request on 6e0bdf25 names the same repeated-AND program, which is refused at this head. R0Y00's SCC-live AND finding on 85e96f29 stays addressed: ACCUM_SCC_WORDS is still refused, and forcing accum_scc_dead to True fails the check.

What I ran.

  • python -B tests/startup_gfx2hlsl_compute_check.py: exit 0. python -B tests/startup_tools_lint_check.py tools/startup: PASS.
  • Built dev and release, then ctest --test-dir out/build/<preset> --no-tests=error -j 6 -R '^startup_gfx2hlsl_compute_' -E 'startup_audio|_hardware$': 37/37 pass in each, no skips.
  • I did not run the _hardware dispatch tests, because no dispatch case uses these programs. I did not run the llvm-mc reassembly locally; CI's Assemble and translate gfx1013 fixtures passes on ede53dce. The words below are written from the fixture's own encodings, not assembled.
  • Other replacements for 050001d5050d6a00 in ACCUM_WORDS that I tried at this head, all refused:
    • the AND three times, then the carry and s_cselect_b32 (1a7e1b87 1a7e1b87 1a7e1b87 1b7e1c87 81801d85 1d020a7e);
    • the repeated AND with the operands swapped (7e1a1b87 7e1a1b87 7e1b1c87 81801d85 1d020a7e);
    • an in-place s_and_b32 s27, s27, exec_lo of the carried word, then s_cselect_b32 (1a7e1b87 1b7e1b87 81801d85 1d020a7e), and the same with a further carry into s28 (1a7e1b87 1b7e1b87 1b7e1c87 81801d85 1d020a7e);
    • the in-place AND on s26 itself (1a7e1a87 81801d85 1d020a7e);
    • a whole-word v_mov_b32 v5, s27 after the repeat (1a7e1b87 1a7e1b87 040406bf 1b020a7e) and after a rewrite of s27 from s28 (1a7e1b87 1b7e1c87 1c7e1b87 040406bf 1b020a7e).
  • Still accepted, as intended: the AND, a compare that kills SCC, then v_cndmask_b32 on s27 (1a7e1b87 040406bf 050001d5 050d6e00), and the same with the AND repeated.
  • A local title startup run of ede53dce passed: judged no worse than the main baseline.

Mutants of tools/startup/gfx2hlsl.py, each run against tests/startup_gfx2hlsl_compute_check.py:

Mutant Result
old order: add the carried word, then drop tracked writes killed (ACCUM_REPEAT, line 1514)
accum_carried returns None for a tracked destination killed (line 1514)
carried word added only when not already tracked killed (line 1514)
a write never ends a tracked mask killed (line 1528)
carried word never added killed (ACCUM_CARRY, line 1498)
accum_carried always returns None killed (line 1498)
SCC check applied to sB only killed (line 1498)
accum_scc_dead always True killed (ACCUM_SCC, line 1470)
pair is None dropped killed (ACCUM_SECOND, line 1494)
"sA dead at the exit" test dropped killed (ACCUM_KEPT, line 1487)
per-lane test applied to sB only survives
carry taken from any AND with exec_lo, source not checked survives
"sB live at the exit" test dropped survives
read of sA in the walk no longer refused survives
visited set keyed by instruction only survives (equivalent here)
exec_lo no longer required in accum_carried survives (equivalent here)

Restored afterwards; git diff --quiet is clean.

Notes on the survivors, all unchanged from my review of 6e0bdf25:

  • Per-lane test on sB only: a whole-word v_mov_b32 of a carried word is still refused with it, so this is a coverage note.
  • Carry from any AND: it only refuses more.
  • sB live, read of sA: neither accepts a wrong program as far as I can see.
  • Equivalent here: the instructions after the pair are straight-line in every shape execz_scalar_exit accepts, and an AND of a tracked word without exec_lo is already refused by per_lane_read.
  • "A write never ends a tracked mask" is killed only by the test's own stub check (the old rule then no longer accepts the two controls), not by a wrongly accepted program; that mutant only refuses more.

Non-blocking.

  1. The two new controls have no trace assert of their own. They share the values of ACCUM_CARRY (trace(lanes, observe='scc') == [1] * 8, singletons [0, 0, 0, 1, 1, 1, 1, 1]), because a repeated AND with the same EXEC gives the same word.
  2. The PR body's Verification section still names 85e96f29.

Verdict: approve ede53dce. This supersedes my changes-requested review on 6e0bdf25. The changes requests from R0Y00 (on 85e96f29) and Leyukaka (on 6e0bdf25) are still open on the PR; I am not merging it.

Environment: Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; Python 3.12.10; host-only translator checks and WARP, no hardware GPU tests.
CI: Build and test on Windows, Assemble and translate gfx1013 fixtures and Run platform-independent Python checks on Linux pass on ede53dce.

This reply was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6102988934 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3109#pullrequestreview-6102988934). Originally posted by [pigalot](https://github.com/pigalot) on 2026-11-29T13:03:16Z. **Review:** APPROVED --- Retested `ede53dce` merged over `main` `77d1ba4d`. The merge is clean (tree `52d8d667`) and `git diff --cached --check` is clean. `git range-diff` against `6e0bdf25` shows the first four commits unchanged and one new commit, `ede53dce`. **My blocking finding on `6e0bdf25` is addressed.** A carried mask is no longer dropped when an AND rewrites it. - The walk now builds the next set as `set(tracked) - writes` and then adds the carried word, and `accum_carried` no longer returns `None` for a destination that is already tracked. A rewritten word is therefore tracked again from the AND on. - **Repeated AND** (`1a7e1b87 1a7e1b87 1b7e1c87 81801d85 1d020a7e`): refused with `branch out of the block`. It is in the test as `ACCUM_REPEAT_WORDS`. - **Longer chain** (`1a7e1b87 1b7e1c87 1c7e1b87 1b7e1d87 81801e85 1e020a7e`): refused. It is in the test as `ACCUM_REWRITE_WORDS`. - The test also stubs the old rule (a tracked destination is not carried) and requires that both programs are then accepted, so the two refusals depend on this change. Leyukaka's changes request on `6e0bdf25` names the same repeated-AND program, which is refused at this head. R0Y00's SCC-live AND finding on `85e96f29` stays addressed: `ACCUM_SCC_WORDS` is still refused, and forcing `accum_scc_dead` to `True` fails the check. **What I ran.** - `python -B tests/startup_gfx2hlsl_compute_check.py`: exit 0. `python -B tests/startup_tools_lint_check.py tools/startup`: PASS. - Built `dev` and `release`, then `ctest --test-dir out/build/<preset> --no-tests=error -j 6 -R '^startup_gfx2hlsl_compute_' -E 'startup_audio|_hardware$'`: 37/37 pass in each, no skips. - I did not run the `_hardware` dispatch tests, because no dispatch case uses these programs. I did not run the `llvm-mc` reassembly locally; CI's `Assemble and translate gfx1013 fixtures` passes on `ede53dce`. The words below are written from the fixture's own encodings, not assembled. - Other replacements for `050001d5050d6a00` in `ACCUM_WORDS` that I tried at this head, all refused: - the AND three times, then the carry and `s_cselect_b32` (`1a7e1b87 1a7e1b87 1a7e1b87 1b7e1c87 81801d85 1d020a7e`); - the repeated AND with the operands swapped (`7e1a1b87 7e1a1b87 7e1b1c87 81801d85 1d020a7e`); - an in-place `s_and_b32 s27, s27, exec_lo` of the carried word, then `s_cselect_b32` (`1a7e1b87 1b7e1b87 81801d85 1d020a7e`), and the same with a further carry into s28 (`1a7e1b87 1b7e1b87 1b7e1c87 81801d85 1d020a7e`); - the in-place AND on s26 itself (`1a7e1a87 81801d85 1d020a7e`); - a whole-word `v_mov_b32 v5, s27` after the repeat (`1a7e1b87 1a7e1b87 040406bf 1b020a7e`) and after a rewrite of s27 from s28 (`1a7e1b87 1b7e1c87 1c7e1b87 040406bf 1b020a7e`). - Still accepted, as intended: the AND, a compare that kills SCC, then `v_cndmask_b32` on s27 (`1a7e1b87 040406bf 050001d5 050d6e00`), and the same with the AND repeated. - A local title startup run of `ede53dce` passed: judged no worse than the `main` baseline. **Mutants** of `tools/startup/gfx2hlsl.py`, each run against `tests/startup_gfx2hlsl_compute_check.py`: | Mutant | Result | |---|---| | old order: add the carried word, then drop tracked writes | killed (`ACCUM_REPEAT`, line 1514) | | `accum_carried` returns `None` for a tracked destination | killed (line 1514) | | carried word added only when not already tracked | killed (line 1514) | | a write never ends a tracked mask | killed (line 1528) | | carried word never added | killed (`ACCUM_CARRY`, line 1498) | | `accum_carried` always returns `None` | killed (line 1498) | | SCC check applied to sB only | killed (line 1498) | | `accum_scc_dead` always `True` | killed (`ACCUM_SCC`, line 1470) | | `pair is None` dropped | killed (`ACCUM_SECOND`, line 1494) | | "sA dead at the exit" test dropped | killed (`ACCUM_KEPT`, line 1487) | | per-lane test applied to sB only | survives | | carry taken from any AND with `exec_lo`, source not checked | survives | | "sB live at the exit" test dropped | survives | | read of sA in the walk no longer refused | survives | | visited set keyed by instruction only | survives (equivalent here) | | `exec_lo` no longer required in `accum_carried` | survives (equivalent here) | Restored afterwards; `git diff --quiet` is clean. Notes on the survivors, all unchanged from my review of `6e0bdf25`: - **Per-lane test on sB only:** a whole-word `v_mov_b32` of a carried word is still refused with it, so this is a coverage note. - **Carry from any AND:** it only refuses more. - **sB live, read of sA:** neither accepts a wrong program as far as I can see. - **Equivalent here:** the instructions after the pair are straight-line in every shape `execz_scalar_exit` accepts, and an AND of a tracked word without `exec_lo` is already refused by `per_lane_read`. - "A write never ends a tracked mask" is killed only by the test's own stub check (the old rule then no longer accepts the two controls), not by a wrongly accepted program; that mutant only refuses more. **Non-blocking.** 1. **The two new controls have no trace assert of their own.** They share the values of `ACCUM_CARRY` (`trace(lanes, observe='scc') == [1] * 8`, singletons `[0, 0, 0, 1, 1, 1, 1, 1]`), because a repeated AND with the same EXEC gives the same word. 2. **The PR body's Verification section still names `85e96f29`.** **Verdict:** approve `ede53dce`. This supersedes my changes-requested review on `6e0bdf25`. The changes requests from R0Y00 (on `85e96f29`) and Leyukaka (on `6e0bdf25`) are still open on the PR; I am not merging it. Environment: Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; Python 3.12.10; host-only translator checks and WARP, no hardware GPU tests. CI: `Build and test on Windows`, `Assemble and translate gfx1013 fixtures` and `Run platform-independent Python checks on Linux` pass on `ede53dce`. This reply was AI-assisted.
Leyukaka commented 2026-11-29 13:37:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T13:37:57Z.

Review: APPROVED


Review of ede53dce, diff only. git range-diff against 6e0bdf25 shows the first four commits unchanged and one new commit. The three touched files are unchanged on main from 77d1ba4d to 17b662a2, and git merge-tree --write-tree merges cleanly.

Asked on 6e0bdf25: the repeated s_and_b32 s27, s26, exec_lo dropped s27 from the tracked set, so the SCC of the following s_and_b32 s28, s27, exec_lo was read unchecked.

Fixed in tools/startup/gfx2hlsl.py:

  • accum_carried (:3506) no longer returns None when the destination is already tracked; the only source test left is :3522.
  • The walk builds nxt = set(tracked) - writes (:3484) and then adds the carried word (:3485-3486), so a rewritten word is tracked again from that AND on.

With tracked = {s26}: the first AND gives {s26, s27}; the second removes s27 as a write and adds it back as the carry; the third AND reads tracked s27, its SCC is live at the s_cselect_b32, and accum_scc_dead (:3479) refuses. The new next set always contains the old one, so this commit can only refuse more than 6e0bdf25 did.

Tests, tests/startup_gfx2hlsl_compute_check.py:

  • ACCUM_REPEAT_WORDS (:579) is the program from the changes request; ACCUM_REWRITE_WORDS (:592) is the longer chain. Both must be refused (:1513-1514).
  • :1516-1530 stubs the old rule (a tracked destination is not carried) and requires that both are then accepted, so the refusals depend on this change.
  • :2836-2837 assert both word strings against llvm-mc. I checked the new dwords against the fixture's own encodings.

NIT, optional: the comment at gfx2hlsl.py:3467 still says "An AND into a fresh sX adds sX"; the destination no longer has to be fresh.

Basis: reading of the diff, and CI on ede53dce: Build and test on Windows, Assemble and translate gfx1013 fixtures and Run platform-independent Python checks on Linux pass. I ran nothing locally.

Verdict on ede53dce: approve. This replaces my changes request on 6e0bdf25. R0Y00's changes request on 85e96f29 is still open.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6103113660 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3109#pullrequestreview-6103113660). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-29T13:37:57Z. **Review:** APPROVED --- Review of `ede53dce`, diff only. `git range-diff` against `6e0bdf25` shows the first four commits unchanged and one new commit. The three touched files are unchanged on `main` from `77d1ba4d` to `17b662a2`, and `git merge-tree --write-tree` merges cleanly. **Asked on `6e0bdf25`:** the repeated `s_and_b32 s27, s26, exec_lo` dropped s27 from the tracked set, so the SCC of the following `s_and_b32 s28, s27, exec_lo` was read unchecked. **Fixed in `tools/startup/gfx2hlsl.py`:** - `accum_carried` (`:3506`) no longer returns `None` when the destination is already tracked; the only source test left is `:3522`. - The walk builds `nxt = set(tracked) - writes` (`:3484`) and then adds the carried word (`:3485-3486`), so a rewritten word is tracked again from that AND on. With `tracked = {s26}`: the first AND gives `{s26, s27}`; the second removes s27 as a write and adds it back as the carry; the third AND reads tracked s27, its SCC is live at the `s_cselect_b32`, and `accum_scc_dead` (`:3479`) refuses. The new next set always contains the old one, so this commit can only refuse more than `6e0bdf25` did. **Tests, `tests/startup_gfx2hlsl_compute_check.py`:** - `ACCUM_REPEAT_WORDS` (`:579`) is the program from the changes request; `ACCUM_REWRITE_WORDS` (`:592`) is the longer chain. Both must be refused (`:1513-1514`). - `:1516-1530` stubs the old rule (a tracked destination is not carried) and requires that both are then accepted, so the refusals depend on this change. - `:2836-2837` assert both word strings against llvm-mc. I checked the new dwords against the fixture's own encodings. NIT, optional: the comment at `gfx2hlsl.py:3467` still says "An AND into a fresh sX adds sX"; the destination no longer has to be fresh. Basis: reading of the diff, and CI on `ede53dce`: `Build and test on Windows`, `Assemble and translate gfx1013 fixtures` and `Run platform-independent Python checks on Linux` pass. I ran nothing locally. Verdict on `ede53dce`: approve. This replaces my changes request on `6e0bdf25`. R0Y00's changes request on `85e96f29` is still open.
R0Y00 commented 2026-12-02 23:25:11 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-02T23:25:11Z.

Review: APPROVED


Re-reviewed 4ce0542f on current main c42b7ce3; the merge is clean. My SCC-live finding is resolved. The walk refuses a whole-mask SCC read, follows the destination of a lane-preserving AND, and re-adds the carried word after its earlier definition is overwritten. The Windows Python compute fixture, startup lint, and docs-link check passed. LLVM 15 llvm-mc independently reassembled the fixture words, including SCC, second pair, chained AND, repeated AND, and rewritten-mask controls. Replacing only the accum_scc_dead liveness condition with return True makes ACCUM_SCC_WORDS translate and fails the expected refusal. Restoring the check passes. This approves the current head and supersedes my change request on 85e96f29.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6160872401 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3109#pullrequestreview-6160872401). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-02T23:25:11Z. **Review:** APPROVED --- Re-reviewed `4ce0542f` on current `main` `c42b7ce3`; the merge is clean. My SCC-live finding is resolved. The walk refuses a whole-mask SCC read, follows the destination of a lane-preserving AND, and re-adds the carried word after its earlier definition is overwritten. The Windows Python compute fixture, startup lint, and docs-link check passed. LLVM 15 `llvm-mc` independently reassembled the fixture words, including SCC, second pair, chained AND, repeated AND, and rewritten-mask controls. Replacing only the `accum_scc_dead` liveness condition with `return True` makes `ACCUM_SCC_WORDS` translate and fails the expected refusal. Restoring the check passes. This approves the current head and supersedes my change request on `85e96f29`.
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!3109
No description provided.