[bug] v_readfirstlane_b32 ignores EXEC on a split wave: each half reads its own first host lane #254

Open
opened 2026-11-27 05:31:38 +00:00 by LakshanSivakumar · 10 comments
LakshanSivakumar commented 2026-11-27 05:31:38 +00:00 (Migrated from github.com)
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T05:31:38Z.


What is wrong

On wave64 programs that we run as two 32-lane host waves, the plain v_readfirstlane_b32 arm returns the value of the first host lane of each half. It ignores EXEC. The console returns the value of the first lane that is active in the 64-lane EXEC, and every lane sees that same value.

The translator accepts the shape, so this is a wrong result, not a refusal.

Repro (synthetic program, our own assembly, no title code)

  • v1 = lane index
  • s_mov_b64 exec, <lanes 8 and 9>
  • v_readfirstlane_b32 s12, v1

Expected: every lane reads 8. On Metal: lanes 0-31 read 0, lanes 32-63 read 32. It also reads 0 when only lane 8 writes v1 = 77 inside a branch.

Where

crates/victory-shader/src/emit/lower.rs, the plain "v_readfirstlane_b32" arm (around line 9098 on main 2a3b03d1). It lowers to "first running host thread". The lockstep arm (lockstep_first_lane) does it right, and the doc comment in halves.rs already admits the limit.

Why it matters

It is in the tail of all six culling compute shaders that fill the indirect mesh records (see the black-world issue). There, every wave reads an old count of 0, so waves write their visible-instance entries over each other. It does not explain the zero counts, but it will corrupt the lists as soon as counts are non-zero.

What a fix needs

  • The value of the first lane active in the console's 64-lane EXEC, in both halves, or a refusal where that cannot be done soundly.
  • A check of the neighbouring arms for the same mistake (v_readlane, other users of the first-lane helper).
  • A GPU test that fails before the fix.
  • A full-corpus comparison by output fingerprint: many shaders should change output; we need the count per stage and how many become refused.

Work on this has started on our side; a second pair of eyes on the design, or a PR, is welcome.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:6640628203 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/254). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-27T05:31:38Z. --- **What is wrong** On wave64 programs that we run as two 32-lane host waves, the plain `v_readfirstlane_b32` arm returns the value of the first *host* lane of each half. It ignores EXEC. The console returns the value of the first lane that is active in the 64-lane EXEC, and every lane sees that same value. The translator accepts the shape, so this is a wrong result, not a refusal. **Repro (synthetic program, our own assembly, no title code)** - `v1 = lane index` - `s_mov_b64 exec, <lanes 8 and 9>` - `v_readfirstlane_b32 s12, v1` Expected: every lane reads 8. On Metal: lanes 0-31 read 0, lanes 32-63 read 32. It also reads 0 when only lane 8 writes `v1 = 77` inside a branch. **Where** `crates/victory-shader/src/emit/lower.rs`, the plain `"v_readfirstlane_b32"` arm (around line 9098 on main 2a3b03d1). It lowers to "first running host thread". The lockstep arm (`lockstep_first_lane`) does it right, and the doc comment in `halves.rs` already admits the limit. **Why it matters** It is in the tail of all six culling compute shaders that fill the indirect mesh records (see the black-world issue). There, every wave reads an old count of 0, so waves write their visible-instance entries over each other. It does not explain the zero counts, but it will corrupt the lists as soon as counts are non-zero. **What a fix needs** - The value of the first lane active in the console's 64-lane EXEC, in both halves, or a refusal where that cannot be done soundly. - A check of the neighbouring arms for the same mistake (`v_readlane`, other users of the first-lane helper). - A GPU test that fails before the fix. - A full-corpus comparison by output fingerprint: many shaders should change output; we need the count per stage and how many become refused. Work on this has started on our side; a second pair of eyes on the design, or a PR, is welcome.
evan-kolberg commented 2026-11-27 05:44:39 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by evan-kolberg on 2026-11-27T05:44:39Z.


Thanks for the generated repro. While reviewing #254 with Codex, I found an empty-EXEC corner case in the lockstep selector on 2a3b03d1. It selects lane 31 because FirstbitLo(0) gives 0xffffffff, and adding 32 wraps that to 31. RDNA 2 specifies reading the VGPR value from lane 0 when EXEC is empty. Stock selector · RDNA 2 ISA, VOP1 opcode 2 · FirstbitLo behavior

A generated CPU test evaluated the actual emitted index. Lower-only, upper-only and both-halves masks selected 8, 40 and 31 with and without the change. Checking the high word before selecting the upper result made empty EXEC select 0 instead of 31. This covers lockstep index selection. The ordinary split-wave path and hardware broadcast remain separate, as does #258’s zero-count investigation.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7210907026 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/254#issuecomment-7210907026). Originally posted by [evan-kolberg](https://github.com/evan-kolberg) on 2026-11-27T05:44:39Z. --- Thanks for the generated repro. While reviewing #254 with Codex, I found an empty-EXEC corner case in the lockstep selector on `2a3b03d1`. It selects lane 31 because `FirstbitLo(0)` gives `0xffffffff`, and adding 32 wraps that to 31. RDNA 2 specifies reading the VGPR value from lane 0 when EXEC is empty. [Stock selector](https://github.com/LakshanSivakumar/Native-Victory-macOS/blob/2a3b03d1cd637a1131bc11dc7dcb1cd16f0fc6a3/crates/victory-shader/src/emit/lower/halves.rs#L165-L185) · [RDNA 2 ISA, VOP1 opcode 2](https://docs.amd.com/api/khub/documents/Et~wpu9g~Ffl7d9q0QZ~Og/content) · [FirstbitLo behavior](https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/firstbitlow) A generated CPU test evaluated the actual emitted index. Lower-only, upper-only and both-halves masks selected 8, 40 and 31 with and without the change. Checking the high word before selecting the upper result made empty EXEC select 0 instead of 31. This covers lockstep index selection. The ordinary split-wave path and hardware broadcast remain separate, as does #258’s zero-count investigation.
marcus-4 commented 2026-11-27 06:06:41 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by marcus-4 on 2026-11-27T06:06:41Z.


A fix for this, in case it helps or saves you time: marcus-4:fix/readfirstlane-split-wave, two commits on main 2a3b03d1. Happy to open a PR, or to leave it as a reference if your branch is further along.

What it does (Lower::split_first_lane, lower/halves.rs; v_readfirstlane_b32 of a wave64 program split into two host waves):

  1. A value proven the same in every lane of the console wave keeps the per-half read, which is then exact. The proof is Lower::wave_uniform, conservative:

    • constants, and SGPR inputs;
    • scalar instructions and scalar joins of uniform values. With the halves on, a mask read as a number is the console's 64 bits in both halves.
    • first lane reads, except waterfall reads;
    • whole-wave section results;
    • VALU work of uniform values with no DPP and no mask operand, made under the read's own EXEC or the entry EXEC. The read of the destination's old value is skipped: only lanes outside EXEC keep it.

    Without this, every first lane read of a uniform value in divergent code would be refused.

  2. Otherwise, where both halves arrive (exchange_site): the lowest bit of EXEC, read across the halves with wide_read_lane. An EXEC narrowed by a scalar move leaves every thread running, so your repro takes this route.

  3. Otherwise it is refused ("a first lane read across the two host waves of a console wave, in divergent code"), so a one-wave group retries in lockstep.

A first lane read of a VGPR now turns on console_lanes and the halves. Waterfall reads and reads of a VGPR just moved from a scalar or constant are left out, which keeps mask_tests::a_wave64_mask_joined_with_data_at_a_uniform_loop_is_its_number translating.

The second commit fixes the empty-EXEC case @evan-kolberg found: the selector uses the high word only when it is not 0, so an empty EXEC reads lane 0.

Tests (split_wave_tests, Metal, groups of two console waves, which lockstep does not take):

main branch
every lane on lanes 32-63 read 32 0 in every lane
EXEC = lanes 8 and 9 (your repro) 0 8 in every lane
a branch lanes 40 and up skip lanes 32-39 read 32 fast path refuses; lockstep reads 0
EXEC empty 31 0
a user SGPR moved to a VGPR, under a narrowed EXEC right still read per half, not refused

wave32_tests::a_branch_on_a_first_lane_read_is_not_uniform_across_the_halves now expects the read's own exchange (4 barriers). split_scc is unchanged: it still counts an SCC made from a first lane read as split, which mesh programs' per-half read needs. Behind such a branch nothing exchanges, which is now only conservative for compute.

M1 Pro, macOS 27.2.1, Xcode 27.2, MSC 4.0.3:

  • arm64 workspace: 938 passed, 0 failed
  • --target x86_64-apple-darwin -p victory-hle -p victory-loader -p victory: 381 passed, 0 failed
  • clippy (gnullvm, -D warnings) and xtask policy: clean

Not done: the corpus comparison by output fingerprint (no shader corpus here), so how many programs change or become refused per stage is unmeasured; and no game run.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7211225777 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/254#issuecomment-7211225777). Originally posted by [marcus-4](https://github.com/marcus-4) on 2026-11-27T06:06:41Z. --- A fix for this, in case it helps or saves you time: [`marcus-4:fix/readfirstlane-split-wave`](https://github.com/LakshanSivakumar/Native-Victory-macOS/compare/main...marcus-4:Native-Victory-macOS:fix/readfirstlane-split-wave), two commits on main `2a3b03d1`. Happy to open a PR, or to leave it as a reference if your branch is further along. **What it does** (`Lower::split_first_lane`, `lower/halves.rs`; `v_readfirstlane_b32` of a wave64 program split into two host waves): 1. **A value proven the same in every lane of the console wave** keeps the per-half read, which is then exact. The proof is `Lower::wave_uniform`, conservative: - constants, and SGPR inputs; - scalar instructions and scalar joins of uniform values. With the halves on, a mask read as a number is the console's 64 bits in both halves. - first lane reads, except waterfall reads; - whole-wave section results; - VALU work of uniform values with no DPP and no mask operand, made under the read's own EXEC or the entry EXEC. The read of the destination's old value is skipped: only lanes outside EXEC keep it. Without this, every first lane read of a uniform value in divergent code would be refused. 2. **Otherwise, where both halves arrive** (`exchange_site`): the lowest bit of EXEC, read across the halves with `wide_read_lane`. An EXEC narrowed by a scalar move leaves every thread running, so your repro takes this route. 3. **Otherwise it is refused** ("a first lane read across the two host waves of a console wave, in divergent code"), so a one-wave group retries in lockstep. A first lane read of a VGPR now turns on `console_lanes` and the halves. Waterfall reads and reads of a VGPR just moved from a scalar or constant are left out, which keeps `mask_tests::a_wave64_mask_joined_with_data_at_a_uniform_loop_is_its_number` translating. The second commit fixes the empty-EXEC case @evan-kolberg found: the selector uses the high word only when it is not 0, so an empty EXEC reads lane 0. **Tests** (`split_wave_tests`, Metal, groups of two console waves, which lockstep does not take): | | main | branch | |---|---|---| | every lane on | lanes 32-63 read 32 | 0 in every lane | | EXEC = lanes 8 and 9 (your repro) | 0 | 8 in every lane | | a branch lanes 40 and up skip | lanes 32-39 read 32 | fast path refuses; lockstep reads 0 | | EXEC empty | 31 | 0 | | a user SGPR moved to a VGPR, under a narrowed EXEC | right | still read per half, not refused | `wave32_tests::a_branch_on_a_first_lane_read_is_not_uniform_across_the_halves` now expects the read's own exchange (4 barriers). `split_scc` is unchanged: it still counts an SCC made from a first lane read as split, which mesh programs' per-half read needs. Behind such a branch nothing exchanges, which is now only conservative for compute. M1 Pro, macOS 27.2.1, Xcode 27.2, MSC 4.0.3: - arm64 workspace: 938 passed, 0 failed - `--target x86_64-apple-darwin -p victory-hle -p victory-loader -p victory`: 381 passed, 0 failed - clippy (gnullvm, `-D warnings`) and `xtask policy`: clean **Not done:** the corpus comparison by output fingerprint (no shader corpus here), so how many programs change or become refused per stage is unmeasured; and no game run.
4TheDoctor commented 2026-11-27 06:25:10 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by 4TheDoctor on 2026-11-27T06:25:10Z.


The same bug is in pragyaangaur/VIctory-macOS's copy of the translator, which shares this code's history. I checked it on main c8e4f326, on an M3 Max under D3DMetal (the Wine route), with a GPU test in its halves_tests. The program is synthetic and hand-encoded, a group of 64, and has the branch shape the console compiler emits:

v_lshrrev_b32 v3, 1, v0
v_cmp_eq_u32 vcc, 4, v3          ; lanes 8 and 9
s_and_saveexec_b64 s[0:1], vcc
v_readfirstlane_b32 s12, v0      ; the console: 8
s_mov_b64 exec, s[0:1]
v_mov_b32 v2, s12                ; stored per lane
  • Branch on lanes 8 and 9: the console gives 8 in every lane; there it is 0 in all 64 lanes. Lanes 40 and 41 (v_cmp_eq_u32 vcc, 20, v3): 40 expected, 0 in all 64.
  • EXEC written directly (s_mov_b32 exec_lo/exec_hi) is refused there ("a lane mask holding lanes elsewhere read as data"), so only the branch form gives a wrong answer.
  • Its v_readfirstlane_b32 arm goes through halves::first_lane_across, which exchanges the halves. With no active mask passed it takes the lower half's lane 0, so the result is 0 everywhere rather than your 0 / 32 split. Same root cause: EXEC isn't consulted.

Reported there as pragyaangaur/VIctory-macOS#512, pointing at marcus-4's branch here. If it helps your test suite, the branch form (lanes 8, 9 and 40, 41) is a cheap case that fails before a fix and covers both halves.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7211509451 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/254#issuecomment-7211509451). Originally posted by [4TheDoctor](https://github.com/4TheDoctor) on 2026-11-27T06:25:10Z. --- The same bug is in pragyaangaur/VIctory-macOS's copy of the translator, which shares this code's history. I checked it on main `c8e4f326`, on an M3 Max under D3DMetal (the Wine route), with a GPU test in its `halves_tests`. The program is synthetic and hand-encoded, a group of 64, and has the branch shape the console compiler emits: ``` v_lshrrev_b32 v3, 1, v0 v_cmp_eq_u32 vcc, 4, v3 ; lanes 8 and 9 s_and_saveexec_b64 s[0:1], vcc v_readfirstlane_b32 s12, v0 ; the console: 8 s_mov_b64 exec, s[0:1] v_mov_b32 v2, s12 ; stored per lane ``` - Branch on lanes 8 and 9: the console gives 8 in every lane; there it is **0 in all 64 lanes**. Lanes 40 and 41 (`v_cmp_eq_u32 vcc, 20, v3`): 40 expected, **0** in all 64. - EXEC written directly (`s_mov_b32 exec_lo/exec_hi`) is refused there ("a lane mask holding lanes elsewhere read as data"), so only the branch form gives a wrong answer. - Its `v_readfirstlane_b32` arm goes through `halves::first_lane_across`, which exchanges the halves. With no active mask passed it takes the lower half's lane 0, so the result is 0 everywhere rather than your 0 / 32 split. Same root cause: EXEC isn't consulted. Reported there as [pragyaangaur/VIctory-macOS#512](https://github.com/pragyaangaur/VIctory-macOS/issues/512), pointing at marcus-4's branch here. If it helps your test suite, the branch form (lanes 8, 9 and 40, 41) is a cheap case that fails before a fix and covers both halves.
LakshanSivakumar commented 2026-11-27 06:48:21 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T06:48:21Z.


Thank you for the empty-EXEC case and for evaluating the emitted index rather than only reading it.

marcus-4 has a branch for this issue (fix/readfirstlane-split-wave, linked in the comment below yours). Its second commit handles empty EXEC by reading lane 0. Could you run your generated test against that commit? Then we have one answer for the selector and not two.

The ordinary split-wave path and the hardware broadcast stay with that branch, and the zero counts stay in #258.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7211863003 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/254#issuecomment-7211863003). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-27T06:48:21Z. --- Thank you for the empty-EXEC case and for evaluating the emitted index rather than only reading it. marcus-4 has a branch for this issue (`fix/readfirstlane-split-wave`, linked in the comment below yours). Its second commit handles empty EXEC by reading lane 0. Could you run your generated test against that commit? Then we have one answer for the selector and not two. The ordinary split-wave path and the hardware broadcast stay with that branch, and the zero counts stay in #258.
LakshanSivakumar commented 2026-11-27 06:48:22 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T06:48:22Z.


Thank you for the branch and the table. Yes please, open it as a pull request against main.

For the pull request:

  • A change like this needs the corpus comparison by output fingerprint (gained, regressed, changed per stage). You have no corpus. Say so in the text; the comparison has to be run by someone who has one before it merges.
  • Lower::wave_uniform is the part that can accept wrongly. Please add negatives: a value that looks uniform but differs per lane (VALU work of lane-varying input made under a narrowed EXEC and read after EXEC widens), and a first lane read of a value carried out of a divergent loop (#257).
  • #253 asks whether a uniform-looking branch can hold an SCC that comes from v_readfirstlane and differs between the two host halves. Please say in the pull request how your change affects that question.
  • 4TheDoctor's form in the comment below (branch on lanes 8 and 9, and on lanes 40 and 41) is a cheap extra case that covers both halves.
<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7211863396 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/254#issuecomment-7211863396). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-27T06:48:22Z. --- Thank you for the branch and the table. Yes please, open it as a pull request against main. For the pull request: - A change like this needs the corpus comparison by output fingerprint (gained, regressed, changed per stage). You have no corpus. Say so in the text; the comparison has to be run by someone who has one before it merges. - `Lower::wave_uniform` is the part that can accept wrongly. Please add negatives: a value that looks uniform but differs per lane (VALU work of lane-varying input made under a narrowed EXEC and read after EXEC widens), and a first lane read of a value carried out of a divergent loop (#257). - #253 asks whether a uniform-looking branch can hold an SCC that comes from `v_readfirstlane` and differs between the two host halves. Please say in the pull request how your change affects that question. - 4TheDoctor's form in the comment below (branch on lanes 8 and 9, and on lanes 40 and 41) is a cheap extra case that covers both halves.
Sandile-0511 commented 2026-11-27 07:20:22 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Sandile-0511 on 2026-11-27T07:20:22Z.


The branch proposed above had no corpus comparison, so here is one, by output fingerprint as the issue asks.

Method. 21,608 containers (every shader the title registered in a run that reached the prologue world; 2,232 of them bound from the first world frame on), translated with emit::translate_with and the native host's options, compared by outcome and by a fingerprint of the output. Branch fix/readfirstlane-split-wave at 1d8fbb4 against main 2a3b03d1.

Compute Pixel Vertex
Output changed (translates before and after) 351 (127 in the world) 0 0
Translated on main, refused on the branch 32 (14 in the world) 0 0
Refused on both, for another reason now 20 (10 in the world) 0 0
Newly translated 0 0 0

The 32 newly refused:

  • 27 with the branch's own refusal, "a first lane read across the two host waves of a console wave, in divergent code" (the outcome after the lockstep retry inside emit). The 14 bound in the world frame: 10e0fca4b7654380 270113640b5b1b16 394ca16944415931 4db97d2b4966329f 67e290ca8506de9b 7a4db0f35278deed 7df5467e5cf1a7d5 94c051820454d80a 9829383e53a675af b00825313cb610e3 d44aa4cdbfb7d229 d6a9a11ff71e32fc d8f399520433d6cf e7a20acb516d4013.
  • 4 with "a lane-mask join of an untracked mask: a value the translation could not make" (3d4d03e134620340 614095132867d1a0 6aa4ca1eaf496f54 82c9d44f01942818) and 1 with "a lane mask holding lanes elsewhere read as data: a scalar operation not modelled" (10a21c93a949a4c5). None of the five was refused on main, so these look like a side effect of turning on the console lanes and the halves for a first lane read.

The cullers. 5833c0c20c5bec9b, b30937e9de066fa9 and ff826810673a0198 translate on main and on the branch, with new output. The other three are refused on both, for the cross-lane reason #253 lifts.

Not checked yet: whether the 351 changed outputs differ only at first lane reads, and whether the 27 refusals are forced or could be narrowed. I am looking at both and will add what I find.

AI-assisted: sweeps and summary done with Claude Code on my own machine; I reviewed the text.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7212375139 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/254#issuecomment-7212375139). Originally posted by [Sandile-0511](https://github.com/Sandile-0511) on 2026-11-27T07:20:22Z. --- The branch proposed above had no corpus comparison, so here is one, by output fingerprint as the issue asks. **Method.** 21,608 containers (every shader the title registered in a run that reached the prologue world; 2,232 of them bound from the first world frame on), translated with `emit::translate_with` and the native host's options, compared by outcome and by a fingerprint of the output. Branch `fix/readfirstlane-split-wave` at `1d8fbb4` against main `2a3b03d1`. | | Compute | Pixel | Vertex | |---|---|---|---| | Output changed (translates before and after) | 351 (127 in the world) | 0 | 0 | | Translated on main, refused on the branch | 32 (14 in the world) | 0 | 0 | | Refused on both, for another reason now | 20 (10 in the world) | 0 | 0 | | Newly translated | 0 | 0 | 0 | **The 32 newly refused:** - 27 with the branch's own refusal, "a first lane read across the two host waves of a console wave, in divergent code" (the outcome after the lockstep retry inside `emit`). The 14 bound in the world frame: `10e0fca4b7654380` `270113640b5b1b16` `394ca16944415931` `4db97d2b4966329f` `67e290ca8506de9b` `7a4db0f35278deed` `7df5467e5cf1a7d5` `94c051820454d80a` `9829383e53a675af` `b00825313cb610e3` `d44aa4cdbfb7d229` `d6a9a11ff71e32fc` `d8f399520433d6cf` `e7a20acb516d4013`. - 4 with "a lane-mask join of an untracked mask: a value the translation could not make" (`3d4d03e134620340` `614095132867d1a0` `6aa4ca1eaf496f54` `82c9d44f01942818`) and 1 with "a lane mask holding lanes elsewhere read as data: a scalar operation not modelled" (`10a21c93a949a4c5`). None of the five was refused on main, so these look like a side effect of turning on the console lanes and the halves for a first lane read. **The cullers.** `5833c0c20c5bec9b`, `b30937e9de066fa9` and `ff826810673a0198` translate on main and on the branch, with new output. The other three are refused on both, for the cross-lane reason #253 lifts. **Not checked yet:** whether the 351 changed outputs differ only at first lane reads, and whether the 27 refusals are forced or could be narrowed. I am looking at both and will add what I find. *AI-assisted: sweeps and summary done with Claude Code on my own machine; I reviewed the text.*
LakshanSivakumar commented 2026-11-27 08:07:52 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T08:07:52Z.


Thank you for running this, with the table. It is the comparison by output I asked marcus-4 for, and you have made it for them.

What it says to me: the branch does not gain a single shader, it changes 351 outputs, and it turns 32 shaders that translate today into refusals, 14 of them bound in the world frame. A refusal is not a wrong accept, but 14 world shaders dropped is not a fix for a black world. Five of the 32 are refused for reasons that have nothing to do with the first lane read, which you describe as a side effect of turning on the console lanes and halves.

Please add what you find on the 351 (only at the first lane reads, or elsewhere) and on whether the 27 own refusals can be narrowed. marcus-4, when you open the pull request, please put these numbers in the text and answer them.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7213183700 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/254#issuecomment-7213183700). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-27T08:07:52Z. --- Thank you for running this, with the table. It is the comparison by output I asked marcus-4 for, and you have made it for them. What it says to me: the branch does not gain a single shader, it changes 351 outputs, and it turns 32 shaders that translate today into refusals, 14 of them bound in the world frame. A refusal is not a wrong accept, but 14 world shaders dropped is not a fix for a black world. Five of the 32 are refused for reasons that have nothing to do with the first lane read, which you describe as a side effect of turning on the console lanes and halves. Please add what you find on the 351 (only at the first lane reads, or elsewhere) and on whether the 27 own refusals can be narrowed. marcus-4, when you open the pull request, please put these numbers in the text and answer them.
evan-kolberg commented 2026-11-27 08:31:15 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by evan-kolberg on 2026-11-27T08:31:15Z.


I used Codex to rerun the same generated four-mask CPU test on Marcus’s second commit, 1d8fbb434aa6b5a94e9a346801fb25202f96e2e6, as Lakshan requested. The fixture calls the lockstep selector and evaluates the emitted index on the CPU. The only local additions were the fixture and its evaluator.

Generated EXEC Expected lane Emitted lane
8 and 9 8 8
40 and 41 40 40
31 and 32 31 31
Empty 0 0

All four matched on arm64 macOS with Rust 1.98.1. Thanks to Marcus for the fix and Lakshan for requesting the independent check. The result is limited to these generated lockstep indices. Hardware broadcast and the wider corpus regressions are outside this check.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7213625598 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/254#issuecomment-7213625598). Originally posted by [evan-kolberg](https://github.com/evan-kolberg) on 2026-11-27T08:31:15Z. --- I used Codex to rerun the same generated four-mask CPU test on [Marcus’s second commit, `1d8fbb434aa6b5a94e9a346801fb25202f96e2e6`](https://github.com/marcus-4/Native-Victory-macOS/commit/1d8fbb434aa6b5a94e9a346801fb25202f96e2e6), as [Lakshan requested](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/254#issuecomment-7211863003). The fixture calls the lockstep selector and evaluates the emitted index on the CPU. The only local additions were the fixture and its evaluator. | Generated EXEC | Expected lane | Emitted lane | |---|---:|---:| | 8 and 9 | 8 | 8 | | 40 and 41 | 40 | 40 | | 31 and 32 | 31 | 31 | | Empty | 0 | 0 | All four matched on arm64 macOS with Rust 1.98.1. Thanks to Marcus for the fix and Lakshan for requesting the independent check. The result is limited to these generated lockstep indices. Hardware broadcast and the [wider corpus regressions](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/254#issuecomment-7213183700) are outside this check.
brainbudt commented 2026-11-27 10:01:28 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by brainbudt on 2026-11-27T10:01:28Z.


/claim

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7215382322 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/254#issuecomment-7215382322). Originally posted by [brainbudt](https://github.com/brainbudt) on 2026-11-27T10:01:28Z. --- /claim
github-actions[bot] commented 2026-11-27 10:01:39 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T10:01:39Z.


Claimed by @brainbudt. Open a draft pull request with Refs #254 in its description within 24 hours, or the claim expires.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7215386205 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/254#issuecomment-7215386205). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-27T10:01:39Z. --- Claimed by @brainbudt. Open a draft pull request with `Refs #254` in its description within 24 hours, or the claim expires.
Sign in to join this conversation.
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
LakshanSivakumar/Native-Victory-macOS#254
No description provided.