fix(shader): model saveexec/wrexec, bitset, bfm, brev, quadmask, and wqm in mask_number #261

Closed
Sheffy007 wants to merge 2 commits from upstream-pr/261 into main
Sheffy007 commented 2026-11-27 05:53:15 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Sheffy007 on 2026-11-27T05:53:15Z.


Refs #258

Summary

Split into two self-contained commits (with the pixel/vertex MaskData::Host changes peeled out so this PR touches only compute mask_number forms and the Atom::Quad mask_dword fix):

  1. Compute Lower::mask_number forms (MaskData::Console):
    • Model s_*_saveexec (incoming EXEC saved in sdst, combined mask in EXEC) and s_*_wrexec (including andn1 and orn1).
    • Model s_bitset0 / s_bitset1, s_bfm, s_brev, s_quadmask, and s_wqm (Lower::wqm_word, also supported in Lower::salu on plain scalar data).
    • Keep MaskData::Host (pixel and vertex) refusing saveexec/wrexec, bitset0/1, bfm, brev, quadmask, and wqm as on main.
  2. Atom::Quad routing in Lower::mask_dword:
    • Route Atom::Quad-bearing masks through Lower::mask_number instead of falling through to Lower::atom's Atom::Quad => true derivative shortcut (which previously evaluated true on every lane and returned all-1s).

Verification

  • cargo test -p victory-hle -p victory -p victory-gpu -p victory-metal -p victory-shader -p xtask (including Metal execution value tests in split_wave_tests::mask_number_bfm_brev_bitset_wqm_saveexec_and_wrexec_run_on_the_gpu and negative tests in emit::mask_tests::pixel_and_other_width_mask_number_negatives_stay_refused)
  • cargo clippy --workspace --all-targets --target x86_64-pc-windows-gnullvm -- -D warnings
  • cargo clippy --workspace --all-targets --all-features --target x86_64-pc-windows-gnullvm -- -D warnings
  • cargo xtask policy
<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:5521940018 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/261). Originally posted by [Sheffy007](https://github.com/Sheffy007) on 2026-11-27T05:53:15Z. --- Refs #258 ## Summary Split into two self-contained commits (with the pixel/vertex `MaskData::Host` changes peeled out so this PR touches only compute `mask_number` forms and the `Atom::Quad` `mask_dword` fix): 1. **Compute `Lower::mask_number` forms (`MaskData::Console`):** - Model `s_*_saveexec` (incoming `EXEC` saved in `sdst`, combined mask in `EXEC`) and `s_*_wrexec` (including `andn1` and `orn1`). - Model `s_bitset0` / `s_bitset1`, `s_bfm`, `s_brev`, `s_quadmask`, and `s_wqm` (`Lower::wqm_word`, also supported in `Lower::salu` on plain scalar data). - Keep `MaskData::Host` (pixel and vertex) refusing `saveexec`/`wrexec`, `bitset0/1`, `bfm`, `brev`, `quadmask`, and `wqm` as on `main`. 2. **`Atom::Quad` routing in `Lower::mask_dword`:** - Route `Atom::Quad`-bearing masks through `Lower::mask_number` instead of falling through to `Lower::atom`'s `Atom::Quad => true` derivative shortcut (which previously evaluated `true` on every lane and returned all-1s). ## Verification - `cargo test -p victory-hle -p victory -p victory-gpu -p victory-metal -p victory-shader -p xtask` (including Metal execution value tests in `split_wave_tests::mask_number_bfm_brev_bitset_wqm_saveexec_and_wrexec_run_on_the_gpu` and negative tests in `emit::mask_tests::pixel_and_other_width_mask_number_negatives_stay_refused`) - `cargo clippy --workspace --all-targets --target x86_64-pc-windows-gnullvm -- -D warnings` - `cargo clippy --workspace --all-targets --all-features --target x86_64-pc-windows-gnullvm -- -D warnings` - `cargo xtask policy`
LakshanSivakumar commented 2026-11-27 06:48:36 +00:00 (Migrated from github.com)

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


Thank you. The bit logic reads right to me (wqm_word, bfm, brev, and the andn1 and orn1 operand order), but several things need work before this can merge.

  1. The comparison by output fingerprint over the corpus (gained, regressed, changed per stage). I ask for regressed in particular, because mask_dword now sends every mask with a quad term through mask_number, and in pixel and vertex programs mask_number refuses wqm and quadmask. A program that read such a mask as data and translated through the old Atom::Quad shortcut can now be refused. Please give that count, and say whether the old accept was right.
  2. Value tests. The new tests only check that lowering succeeds. Please add Metal execution tests with expected values for s_bfm, s_brev, s_bitset0/1, s_wqm, and for s_andn1_wrexec and s_orn1_saveexec, as addr_tests does for other instructions.
  3. Negatives: s_bfm, s_brev and s_quadmask in a pixel program; s_bitset by something that is not a host lane index; a saveexec of the other width. In the Atom::Opaque arm mask_ok is true for the whole evaluation of the mask, so please add one where an inner operation is a lane-order one.
  4. The doc says the forms s_and_saveexec_b64, s_orn1_saveexec_b64, s_brev_b64 and s_wqm_b64 already lower in a wave64 compute program. The new paragraph says they now do. Please say what changed or correct the old sentence.
  5. If you can, split it: the compute forms, the pixel and vertex acceptance, and the quad change can be reviewed apart. #182 and #15 are closed; please refer to #258.

Note that #250 asked for the same comparison, and that four compute shaders translating through that path depended on the wrong accept in #256. A change that accepts more compute masks should be compared with that in mind.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7211866953 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/261#issuecomment-7211866953). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-27T06:48:36Z. --- Thank you. The bit logic reads right to me (`wqm_word`, `bfm`, `brev`, and the `andn1` and `orn1` operand order), but several things need work before this can merge. 1. The comparison by output fingerprint over the corpus (gained, regressed, changed per stage). I ask for regressed in particular, because `mask_dword` now sends every mask with a quad term through `mask_number`, and in pixel and vertex programs `mask_number` refuses `wqm` and `quadmask`. A program that read such a mask as data and translated through the old `Atom::Quad` shortcut can now be refused. Please give that count, and say whether the old accept was right. 2. Value tests. The new tests only check that lowering succeeds. Please add Metal execution tests with expected values for `s_bfm`, `s_brev`, `s_bitset0/1`, `s_wqm`, and for `s_andn1_wrexec` and `s_orn1_saveexec`, as `addr_tests` does for other instructions. 3. Negatives: `s_bfm`, `s_brev` and `s_quadmask` in a pixel program; `s_bitset` by something that is not a host lane index; a `saveexec` of the other width. In the `Atom::Opaque` arm `mask_ok` is true for the whole evaluation of the mask, so please add one where an inner operation is a lane-order one. 4. The doc says the forms `s_and_saveexec_b64`, `s_orn1_saveexec_b64`, `s_brev_b64` and `s_wqm_b64` already lower in a wave64 compute program. The new paragraph says they now do. Please say what changed or correct the old sentence. 5. If you can, split it: the compute forms, the pixel and vertex acceptance, and the quad change can be reviewed apart. #182 and #15 are closed; please refer to #258. Note that #250 asked for the same comparison, and that four compute shaders translating through that path depended on the wrong accept in #256. A change that accepts more compute masks should be compared with that in mind.
LakshanSivakumar commented 2026-11-27 08:07:57 +00:00 (Migrated from github.com)

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


Sandile-0511's corpus run (his comment in #258) gives numbers for this pull request: 2 compute shaders newly translate, none changes output, none is newly refused. That answers the regression question I asked about the quad masks for this corpus, and I thank him for it.

It also shows the other side: 347 shaders, 346 of them pixel, were refused for one reason on main and are refused for another with your change. A different message for the same refusal is not a gain; please say whether the new reason is the more useful one, and why those pixel shaders are not translated.

The rest of my review stands: tests with values, the negatives, the doc sentence, and splitting it.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7213185023 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/261#issuecomment-7213185023). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-27T08:07:57Z. --- Sandile-0511's corpus run (his comment in #258) gives numbers for this pull request: 2 compute shaders newly translate, none changes output, none is newly refused. That answers the regression question I asked about the quad masks for this corpus, and I thank him for it. It also shows the other side: 347 shaders, 346 of them pixel, were refused for one reason on main and are refused for another with your change. A different message for the same refusal is not a gain; please say whether the new reason is the more useful one, and why those pixel shaders are not translated. The rest of my review stands: tests with values, the negatives, the doc sentence, and splitting it.
LakshanSivakumar commented 2026-11-27 08:53:15 +00:00 (Migrated from github.com)

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


My own corpus run (33,625 containers, compared by output fingerprint, this branch merged onto main 2a3b03d1):

2 compute shaders gained (0ff8b47fc539e25b, 89226fcd96c31583), none lost, no output changed, no hang.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7214035790 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/261#issuecomment-7214035790). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-27T08:53:15Z. --- My own corpus run (33,625 containers, compared by output fingerprint, this branch merged onto main 2a3b03d1): 2 compute shaders gained (0ff8b47fc539e25b, 89226fcd96c31583), none lost, no output changed, no hang.
Sheffy007 commented 2026-11-27 09:35:37 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Sheffy007 on 2026-11-27T09:35:37Z.


Rebased onto main (c1b95875) and addressed all five review points plus the follow-up question on the 346 pixel refusals:

  1. Atom::Quad soundness & why 346 pixel shaders changed refusal message:
    • Was the old Atom::Quad accept right? No: Lower::atom maps Atom::Quad(_) to true as an EXEC helper-lane guard shortcut, so mask_dword's ballot evaluated true on every lane and returned 0xFFFF_FFFF regardless of which quads were set (pinned by the new s_wqm_b64 Metal test where lane 37 alone yields [0, 0x0000_00F0] rather than [u32::MAX, u32::MAX]). Both @Sandile-0511's 21,608-container sweep and your 33,625-container sweep confirm routing Atom::Quad through mask_number loses 0 shaders and changes 0 outputs while gaining 2 compute shaders (0ff8b47fc539e25b, 89226fcd96c31583).
    • Why 346 pixel shaders moved to another refusal: RPO lowering previously stopped at their entry WQM / saveexec / waterfall mask guard ("an opaque lane mask" or "a lane mask read as data"), whereas accepting those MaskData::Host guards let lowering reach each shader's actual downstream pixel blocker ("barycentrics read directly" / "the first half of an interpolation", "a cross-lane operation outside compute", or "a descriptor read only as data"). While the downstream reason is more specific about what blocks translation, none of those pixel shaders can translate until those pixel classes land — so per item 5, I split the MaskData::Host pixel/vertex acceptance out of this PR. With MaskData::Host kept as on main, those pixel refusal counts stay unchanged while the 2 compute shaders and the Atom::Quad fix land cleanly.
  2. Metal execution value tests: Added split_wave_tests::mask_number_bfm_brev_bitset_wqm_saveexec_and_wrexec_run_on_the_gpu testing concrete expected values on the GPU for:
    • s_bfm_b64 ([0xC000_0000, 0x0000_00FF] and active lanes 30..39),
    • s_brev_b64 ([0x0000_0000, 0xF800_0000]),
    • s_bitset0_b64 + s_bitset1_b64 ([0x0000_0005, 0x0000_0008]),
    • s_wqm_b64 ([0x0000_0000, 0x0000_00F0]), and
    • s_orn1_saveexec_b64 + s_andn1_wrexec_b64 ([0x0000_FF00, 0, 0x0000_FFF0, 0] and active lanes 4..15).
  3. Negative tests: Added emit::mask_tests::pixel_and_other_width_mask_number_negatives_stay_refused covering pixel s_bfm_b64 (in mask_number and written to EXEC), s_brev_b64, s_quadmask_b64, s_wqm_b64 in mask_dword, s_bitset0_b64 by a non-host-lane constant, s_andn2_wrexec_b64 in pixel mask_number, outer s_and_b64 wrapping inner lane-order s_brev_b64 / s_lshr_b64, and other-width saveexec (s_orn1_saveexec_b32 in wave64 and s_orn1_saveexec_b64 in wave32). (Writing that inner lane-order negative also caught a real bug in our split-out MaskData::Host draft where is_host_wave_mask accepted st.masks.contains_key(&lo) even when st.masks[&lo] held Atom::Opaque; fixed on our local MaskData::Host branch for when pixel blockers land.)
  4. docs/native-host.md clarification: Clarified that the earlier single-block hand tests passed because entry EXEC covered every lane (st.active held the mask, and s_wqm_b64 hit the Atom::Quad => true shortcut), whereas writing those forms under a narrowed EXEC (!st.active.contains(&lo)) entered Lower::mask_number and was refused.
  5. Split & issue references: Split into two commits (7851f87d for compute mask_number forms, efb48254 for Atom::Quad routing in mask_dword), peeled out MaskData::Host, and updated references to #258.
<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7214863949 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/261#issuecomment-7214863949). Originally posted by [Sheffy007](https://github.com/Sheffy007) on 2026-11-27T09:35:37Z. --- Rebased onto `main` (`c1b95875`) and addressed all five review points plus the follow-up question on the 346 pixel refusals: 1. **`Atom::Quad` soundness & why 346 pixel shaders changed refusal message:** - **Was the old `Atom::Quad` accept right?** No: `Lower::atom` maps `Atom::Quad(_)` to `true` as an `EXEC` helper-lane guard shortcut, so `mask_dword`'s ballot evaluated `true` on every lane and returned `0xFFFF_FFFF` regardless of which quads were set (pinned by the new `s_wqm_b64` Metal test where lane 37 alone yields `[0, 0x0000_00F0]` rather than `[u32::MAX, u32::MAX]`). Both @Sandile-0511's 21,608-container sweep and your 33,625-container sweep confirm routing `Atom::Quad` through `mask_number` loses 0 shaders and changes 0 outputs while gaining 2 compute shaders (`0ff8b47fc539e25b`, `89226fcd96c31583`). - **Why 346 pixel shaders moved to another refusal:** RPO lowering previously stopped at their entry WQM / `saveexec` / waterfall mask guard (`"an opaque lane mask"` or `"a lane mask read as data"`), whereas accepting those `MaskData::Host` guards let lowering reach each shader's actual downstream pixel blocker (`"barycentrics read directly"` / `"the first half of an interpolation"`, `"a cross-lane operation outside compute"`, or `"a descriptor read only as data"`). While the downstream reason is more specific about what blocks translation, none of those pixel shaders can translate until those pixel classes land — so per item 5, I **split the `MaskData::Host` pixel/vertex acceptance out of this PR**. With `MaskData::Host` kept as on `main`, those pixel refusal counts stay unchanged while the 2 compute shaders and the `Atom::Quad` fix land cleanly. 2. **Metal execution value tests:** Added `split_wave_tests::mask_number_bfm_brev_bitset_wqm_saveexec_and_wrexec_run_on_the_gpu` testing concrete expected values on the GPU for: - `s_bfm_b64` (`[0xC000_0000, 0x0000_00FF]` and active lanes `30..39`), - `s_brev_b64` (`[0x0000_0000, 0xF800_0000]`), - `s_bitset0_b64` + `s_bitset1_b64` (`[0x0000_0005, 0x0000_0008]`), - `s_wqm_b64` (`[0x0000_0000, 0x0000_00F0]`), and - `s_orn1_saveexec_b64` + `s_andn1_wrexec_b64` (`[0x0000_FF00, 0, 0x0000_FFF0, 0]` and active lanes `4..15`). 3. **Negative tests:** Added `emit::mask_tests::pixel_and_other_width_mask_number_negatives_stay_refused` covering pixel `s_bfm_b64` (in `mask_number` and written to `EXEC`), `s_brev_b64`, `s_quadmask_b64`, `s_wqm_b64` in `mask_dword`, `s_bitset0_b64` by a non-host-lane constant, `s_andn2_wrexec_b64` in pixel `mask_number`, outer `s_and_b64` wrapping inner lane-order `s_brev_b64` / `s_lshr_b64`, and other-width `saveexec` (`s_orn1_saveexec_b32` in wave64 and `s_orn1_saveexec_b64` in wave32). *(Writing that inner lane-order negative also caught a real bug in our split-out `MaskData::Host` draft where `is_host_wave_mask` accepted `st.masks.contains_key(&lo)` even when `st.masks[&lo]` held `Atom::Opaque`; fixed on our local `MaskData::Host` branch for when pixel blockers land.)* 4. **`docs/native-host.md` clarification:** Clarified that the earlier single-block hand tests passed because entry `EXEC` covered every lane (`st.active` held the mask, and `s_wqm_b64` hit the `Atom::Quad => true` shortcut), whereas writing those forms under a narrowed `EXEC` (`!st.active.contains(&lo)`) entered `Lower::mask_number` and was refused. 5. **Split & issue references:** Split into two commits (`7851f87d` for compute `mask_number` forms, `efb48254` for `Atom::Quad` routing in `mask_dword`), peeled out `MaskData::Host`, and updated references to `#258`.
LakshanSivakumar commented 2026-11-27 10:32:15 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T10:32:15Z.


Thank you for the five answers. Splitting the pixel and vertex acceptance out is what I asked for, and it removes my question about the 346 shaders. The value tests and the negatives are the ones I wanted, and I agree the old Atom::Quad shortcut was wrong.

My corpus run was on the earlier head, before the split, so it no longer applies to efb48254. I will run it again and post the table; I have not done it yet. It can merge if it shows no regression and no output change among the shaders that translate today.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7216002895 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/261#issuecomment-7216002895). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-27T10:32:15Z. --- Thank you for the five answers. Splitting the pixel and vertex acceptance out is what I asked for, and it removes my question about the 346 shaders. The value tests and the negatives are the ones I wanted, and I agree the old `Atom::Quad` shortcut was wrong. My corpus run was on the earlier head, before the split, so it no longer applies to efb48254. I will run it again and post the table; I have not done it yet. It can merge if it shows no regression and no output change among the shaders that translate today.
LakshanSivakumar commented 2026-11-27 11:55:22 +00:00 (Migrated from github.com)

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


I ran every shader by output on efb48254 (33,625 containers, against main c1b95875): 2 compute shaders gained, none lost, none changed, no hang, and nothing changes among the shaders the game binds in the world. That is a clean result. What is left is a game run on my side, which I have not done yet.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7217629787 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/261#issuecomment-7217629787). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-27T11:55:22Z. --- I ran every shader by output on efb48254 (33,625 containers, against main c1b95875): 2 compute shaders gained, none lost, none changed, no hang, and nothing changes among the shaders the game binds in the world. That is a clean result. What is left is a game run on my side, which I have not done yet.
Sheffy007 commented 2026-11-27 12:55:39 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Sheffy007 on 2026-11-27T12:55:39Z.


Rebased onto main (c5d7f4d0 -> 7cccf903) solely to resolve adjacent test-addition conflicts in mask_tests.rs and split_wave_tests.rs after #304 landed; lower.rs changes are unchanged from efb48254.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7218845434 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/261#issuecomment-7218845434). Originally posted by [Sheffy007](https://github.com/Sheffy007) on 2026-11-27T12:55:39Z. --- Rebased onto `main` (`c5d7f4d0` -> `7cccf903`) solely to resolve adjacent test-addition conflicts in `mask_tests.rs` and `split_wave_tests.rs` after #304 landed; `lower.rs` changes are unchanged from `efb48254`.
Olima34 commented 2026-11-27 13:06:04 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-27T13:06:04Z.


Since #304 merged (main c5d7f4d0), this branch conflicts with main in crates/victory-gpu/src/native/split_wave_tests.rs and crates/victory-shader/src/emit/mask_tests.rs, both on the tests appended at the end of each file. @Sheffy007, could you rebase it on main? Once it's rebased and CI is green, I'll run the by-output sweep and the checks on the new head and post the numbers here. The maintainer's game run is still his to do.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7219056509 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/261#issuecomment-7219056509). Originally posted by [Olima34](https://github.com/Olima34) on 2026-11-27T13:06:04Z. --- Since #304 merged (main `c5d7f4d0`), this branch conflicts with main in `crates/victory-gpu/src/native/split_wave_tests.rs` and `crates/victory-shader/src/emit/mask_tests.rs`, both on the tests appended at the end of each file. @Sheffy007, could you rebase it on main? Once it's rebased and CI is green, I'll run the by-output sweep and the checks on the new head and post the numbers here. The maintainer's game run is still his to do.
Olima34 commented 2026-11-27 13:30:00 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-27T13:30:00Z.


Check report: 7cccf903 merged onto main d35ba927, against plain d35ba927. By-output sweep with the native host's options over our boot dumps: 4,921 containers the prewarm translated plus the 4,129 refused at boot. No panics.

Correction first: my rebase request above was stale. This head was already rebased on c5d7f4d0, sorry.

Set Stage Gained Lost Changed Earlier refusal
refused at boot (4,129) compute 2 0 1 0
pixel 0 0 0 308
boot-time set (4,921) compute 2 0 1 0
pixel 0 0 0 8
both vertex 0 0 0 0
  • Gained: 0ff8b47fc539e25b and 89226fcd96c31583, the same two as your sweep on efb48254.
  • Changed: 9e5a12054881a74d translates both ways, but its DXIL differs. This is the only writer of the HDR target, which #304 made translate. A likely cause is the Atom::Quad mask now going through mask_number instead of the all-ones shortcut. That would be the intended fix, but nothing here checks the new output's values.
  • Earlier refusal (pixel): 308 shaders that main already refuses now stop at an earlier point, mostly "a lane mask holding lanes elsewhere read as data: not written by a scalar ALU instruction". Among them are 207 that main refuses as s_lshr_b32 (the v_readlane 31/63 shapes), 52 "descriptor read only as data" and 15 "barycentrics read directly". Nothing is lost today. But 169 of the 737 shaders #328 gains (on its own base) are among these 308. If this earlier refusal fires whatever #328 does, landing both would cost #328 up to 169 shaders. The combination can't be swept until #328 is rebased.

Result: no shader lost. Two points need an answer before merging: why 9e5a12054881a74d's output changes and whether the new output is right (a value test of its quad-mask shape would settle it), and whether this PR's pixel refusals interact with #328. @Sheffy007 @LakshanSivakumar

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7219551496 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/261#issuecomment-7219551496). Originally posted by [Olima34](https://github.com/Olima34) on 2026-11-27T13:30:00Z. --- Check report: `7cccf903` merged onto main `d35ba927`, against plain `d35ba927`. By-output sweep with the native host's options over our boot dumps: 4,921 containers the prewarm translated plus the 4,129 refused at boot. No panics. Correction first: my rebase request above was stale. This head was already rebased on `c5d7f4d0`, sorry. | Set | Stage | Gained | Lost | Changed | Earlier refusal | |---|---|---|---|---|---| | refused at boot (4,129) | compute | 2 | 0 | 1 | 0 | | | pixel | 0 | 0 | 0 | 308 | | boot-time set (4,921) | compute | 2 | 0 | 1 | 0 | | | pixel | 0 | 0 | 0 | 8 | | both | vertex | 0 | 0 | 0 | 0 | - **Gained:** `0ff8b47fc539e25b` and `89226fcd96c31583`, the same two as your sweep on `efb48254`. - **Changed:** `9e5a12054881a74d` translates both ways, but its DXIL differs. This is the only writer of the HDR target, which #304 made translate. A likely cause is the `Atom::Quad` mask now going through `mask_number` instead of the all-ones shortcut. That would be the intended fix, but nothing here checks the new output's values. - **Earlier refusal (pixel):** 308 shaders that main already refuses now stop at an earlier point, mostly "a lane mask holding lanes elsewhere read as data: not written by a scalar ALU instruction". Among them are 207 that main refuses as `s_lshr_b32` (the `v_readlane` 31/63 shapes), 52 "descriptor read only as data" and 15 "barycentrics read directly". Nothing is lost today. But 169 of the 737 shaders #328 gains (on its own base) are among these 308. If this earlier refusal fires whatever #328 does, landing both would cost #328 up to 169 shaders. The combination can't be swept until #328 is rebased. Result: no shader lost. Two points need an answer before merging: why `9e5a12054881a74d`'s output changes and whether the new output is right (a value test of its quad-mask shape would settle it), and whether this PR's pixel refusals interact with #328. @Sheffy007 @LakshanSivakumar
LakshanSivakumar commented 2026-11-27 13:36:29 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T13:36:29Z.


This is on main as of b639c175, merged from the head before your latest push, so GitHub still shows the PR open. Your commits are in the history under your name. Checked as part of a batch of nine PRs on main 60baf130: tests, Windows clippy, policy, a full-corpus comparison and one world run (240 s, no crash, no GPU errors, scene colour lit).

If your new head has changes beyond a rebase, please rebase it onto main so only those remain; otherwise please close this. Thank you.

One effect to know about: with this in, 4 pixel shaders that translated on main are now refused with "a lane mask holding lanes elsewhere read as data" (31fa8aba4446032e, 3ea743ba97b4f0df, 4378621137c23f1c, 902a3cd15541ada4). They come from the has_quad route in mask_dword. Main accepted them only through the Atom::Quad=true shortcut, which is the wrong accept your pixel test pins, so I kept them refused. None is bound in my world run. If you can show which of the four are a harmless wqm(exec) prologue, a follow-up that accepts exactly those would be welcome. Also 1 compute shader changed output (9e5a12054881a74d): a mask written by a saveexec and read as data is now built from console lanes.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7219708239 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/261#issuecomment-7219708239). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-27T13:36:29Z. --- This is on main as of b639c175, merged from the head before your latest push, so GitHub still shows the PR open. Your commits are in the history under your name. Checked as part of a batch of nine PRs on main 60baf130: tests, Windows clippy, policy, a full-corpus comparison and one world run (240 s, no crash, no GPU errors, scene colour lit). If your new head has changes beyond a rebase, please rebase it onto main so only those remain; otherwise please close this. Thank you. One effect to know about: with this in, 4 pixel shaders that translated on main are now refused with "a lane mask holding lanes elsewhere read as data" (31fa8aba4446032e, 3ea743ba97b4f0df, 4378621137c23f1c, 902a3cd15541ada4). They come from the `has_quad` route in `mask_dword`. Main accepted them only through the `Atom::Quad=true` shortcut, which is the wrong accept your pixel test pins, so I kept them refused. None is bound in my world run. If you can show which of the four are a harmless `wqm(exec)` prologue, a follow-up that accepts exactly those would be welcome. Also 1 compute shader changed output (9e5a12054881a74d): a mask written by a saveexec and read as data is now built from console lanes.
Sheffy007 commented 2026-11-27 13:47:15 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Sheffy007 on 2026-11-27T13:47:15Z.


Closing as landed in 8f415ed6 (b639c175); 7cccf903 had no changes beyond rebasing efb48254.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7219943632 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/261#issuecomment-7219943632). Originally posted by [Sheffy007](https://github.com/Sheffy007) on 2026-11-27T13:47:15Z. --- Closing as landed in `8f415ed6` (`b639c175`); `7cccf903` had no changes beyond rebasing `efb48254`.

Pull request closed

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
LakshanSivakumar/Native-Victory-macOS!261
No description provided.