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

Closed
opened 2026-11-27 15:54:20 +00:00 by github-bot · 8 comments
Owner

@⁠SimSalabimse on GitHub · 2026-11-27 15:44 UTC · original

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)

Pull request details or commits were not available from GitHub; kept as an issue.

**@⁠SimSalabimse** on GitHub · 2026-11-27 15:44 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3109) ## 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) *Pull request details or commits were not available from GitHub; kept as an issue.*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 15:54:20 +00:00
Author
Owner

@⁠SimSalabimse on GitHub · 2026-11-27 22:49 UTC · original

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

**@⁠SimSalabimse** on GitHub · 2026-11-27 22:49 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3109#issuecomment-7229653538) 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
Author
Owner

@⁠JohnConnorNPC on GitHub · 2026-11-28 07:34 UTC · original

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.

**@⁠JohnConnorNPC** on GitHub · 2026-11-28 07:34 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3109#issuecomment-7236031290) 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.
Author
Owner

@⁠SimSalabimse on GitHub · 2026-11-28 10:52 UTC · original

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

**@⁠SimSalabimse** on GitHub · 2026-11-28 10:52 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3109#issuecomment-7238179928) 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
Author
Owner

@⁠SimSalabimse on GitHub · 2026-11-28 20:34 UTC · original

@⁠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

**@⁠SimSalabimse** on GitHub · 2026-11-28 20:34 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3109#issuecomment-7245385832) @⁠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
Author
Owner

@⁠Leyukaka on GitHub · 2026-11-29 00:16 UTC · original

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.

**@⁠Leyukaka** on GitHub · 2026-11-29 00:16 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3109#issuecomment-7247996653) 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.
Author
Owner

@⁠SimSalabimse on GitHub · 2026-11-29 00:37 UTC · original

@⁠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

**@⁠SimSalabimse** on GitHub · 2026-11-29 00:37 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3109#issuecomment-7248237688) @⁠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
Author
Owner

@⁠SimSalabimse on GitHub · 2026-11-29 12:54 UTC · original

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

**@⁠SimSalabimse** on GitHub · 2026-11-29 12:54 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3109#issuecomment-7256143909) 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
Author
Owner

@⁠JohnConnorNPC on GitHub · 2026-11-29 12:55 UTC · original

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 #3451), its compute manifests aren't loaded, so it affects -Translate runs only.

AI-assisted.

**@⁠JohnConnorNPC** on GitHub · 2026-11-29 12:55 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3109#issuecomment-7256161970) 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 #3451), its compute manifests aren't loaded, so it affects `-Translate` runs only. AI-assisted.
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/R0Y00--Xbox2Windows#3109
No description provided.