Shaders: refuse side effects in whole-wave sections #2874

Open
github-bot wants to merge 4 commits from github-bot/gh-2874 into main AGit
Owner

@⁠yumaste on GitHub · 2026-11-25 22:54 UTC · original
yumaste:fix/whole-wave-side-effects → main · +134 −9 · 2 files · 4 commits · open

Summary

The whole-wave simulator reconstructs values that leave a section. Before this change, the shader translator could accept a section containing an effect such as an s_barrier or a buffer store and emit the same DXIL as if that instruction were absent.

Use the regular lowering path's side-effect classification for instructions inside the section and reject an effect with its byte offset. This includes buffer and global loads that write to LDS. Also reject structured pixel discards inside the section, since the normal discard emission would be skipped there.

#2886 preserves rounding-mode writes in whole-wave sections. A trial merge with #2771 and #2886 onto main passed. Their decoder and rounding-mode fixes both remain in the merged tree.

Validation

  • A synthetic compute regression covers both s_barrier and buffer_store_dword. Before the fix, putting either instruction inside the section produced byte-identical DXIL to omitting it. With the fix, both are rejected at the expected offset. Both still translate outside the section.
  • Follow-up at 6b906eb: regressions cover buffer/global loads into LDS and a structured discard annotation supplied directly to lowering. With #2771 and #2886 merged locally, all 37 lowering tests and the FP16 rounding regression passed under WARP. Clippy with all targets and features passed. Moving the whole-wave regressions to their own module brought the merged emit/lower.rs to 522,717 bytes, below the 524,288-byte asset-policy limit.
  • The original full victory-shader library suite with VICTORY_WARP=1 reported 299 passed, 4 failed, and 3 ignored. The same four tests failed with the same diagnostics on base commit 842b0cb: three wave32 pipeline failures and one texture gather mismatch.
  • Clippy for victory-shader with all targets and features and -D warnings passed. The staged asset policy check passed.

AI-assisted (Codex). Only synthetic fixtures were used.

**@⁠yumaste** on GitHub · 2026-11-25 22:54 UTC · [original](https://github.com/Marvisak/VIctory/pull/2874) `yumaste:fix/whole-wave-side-effects` → `main` · +134 −9 · 2 files · 4 commits · open ## Summary The whole-wave simulator reconstructs values that leave a section. Before this change, the shader translator could accept a section containing an effect such as an `s_barrier` or a buffer store and emit the same DXIL as if that instruction were absent. Use the regular lowering path's side-effect classification for instructions inside the section and reject an effect with its byte offset. This includes buffer and global loads that write to LDS. Also reject structured pixel discards inside the section, since the normal discard emission would be skipped there. #2886 preserves rounding-mode writes in whole-wave sections. A trial merge with #2771 and #2886 onto `main` passed. Their decoder and rounding-mode fixes both remain in the merged tree. ## Validation - A synthetic compute regression covers both `s_barrier` and `buffer_store_dword`. Before the fix, putting either instruction inside the section produced byte-identical DXIL to omitting it. With the fix, both are rejected at the expected offset. Both still translate outside the section. - Follow-up at `6b906eb`: regressions cover buffer/global loads into LDS and a structured discard annotation supplied directly to lowering. With #2771 and #2886 merged locally, all 37 lowering tests and the FP16 rounding regression passed under WARP. Clippy with all targets and features passed. Moving the whole-wave regressions to their own module brought the merged `emit/lower.rs` to 522,717 bytes, below the 524,288-byte asset-policy limit. - The original full `victory-shader` library suite with `VICTORY_WARP=1` reported 299 passed, 4 failed, and 3 ignored. The same four tests failed with the same diagnostics on base commit `842b0cb`: three wave32 pipeline failures and one texture gather mismatch. - Clippy for `victory-shader` with all targets and features and `-D warnings` passed. The staged asset policy check passed. AI-assisted (Codex). Only synthetic fixtures were used.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:16:27 +00:00
Author
Owner

@⁠cloph-dsp on GitHub · 2026-11-25 23:04 UTC · original

Local verification on Windows / rustc 1.100.0 / MSVC, no game data, no GPU, no clippy/rustup.

  • cargo test --locked -p victory-shader emit::lower::tests::whole_wave_sections_reject_side_effects --quiet -> 1 passed, 305 filtered out.
  • cargo test --locked -p victory-shader emit::lower::tests --quiet -> 34 passed, 0 failed.
  • git diff --check against merge-base 842b0cb clean; the PR changes 1 file, +51/-12 (crates/victory-shader/src/emit/lower.rs).
  • Negative control: the new test name is absent from the merge-base, so the coverage is new here.
  • Only synthetic instruction fixtures were used.

This is independent local verification, not a formal approval.

AI-assisted (Hy4 flash).

**@⁠cloph-dsp** on GitHub · 2026-11-25 23:04 UTC · [original](https://github.com/Marvisak/VIctory/pull/2874#issuecomment-7177124435) Local verification on Windows / rustc 1.100.0 / MSVC, no game data, no GPU, no clippy/rustup. - `cargo test --locked -p victory-shader emit::lower::tests::whole_wave_sections_reject_side_effects --quiet` -> 1 passed, 305 filtered out. - `cargo test --locked -p victory-shader emit::lower::tests --quiet` -> 34 passed, 0 failed. - `git diff --check` against merge-base `842b0cb` clean; the PR changes 1 file, +51/-12 (`crates/victory-shader/src/emit/lower.rs`). - Negative control: the new test name is absent from the merge-base, so the coverage is new here. - Only synthetic instruction fixtures were used. This is independent local verification, not a formal approval. AI-assisted (Hy4 flash).
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-25 23:04 UTC · original

Reviewed and verified 854cc9e4 on Windows 11 (RTX 5090 + WARP + dxil.dll) against main (842b0cb):

  • Extracting has_side_effect(inst) and checking has_side_effect(inst) || self.x.st.discards.contains_key(&(b, i)) in section_inst cleanly rejects exports, non-global_load_* flat/global/scratch ops, store/atomic ops, s_barrier, non-read/swizzle/permute DS ops, and structured pixel discards with the exact instruction byte offset.
  • Local checks: emit::lower::tests 34/34 passed (including whole_wave_sections_reject_side_effects), section tests 5/5 passed on RTX 5090 + WARP, cargo clippy --locked -p victory-shader --all-targets -- -D warnings 0 warnings, cargo xtask policy (191 files ok).
  • Two minor notes:
    1. crates/victory-shader/src/emit/lower.rs is at 521,946 bytes (2,342 bytes below the 512 KiB xtask policy limit).
    2. Future-proofing edge cases (unlikely to enter sections today): Fields::Buffer { lds: true, .. } (buffer_load_* lds) and s_sendmsg*/s_setreg_* aren't matched by has_side_effect.
**@⁠fuzeofficlal** on GitHub · 2026-11-25 23:04 UTC · [original](https://github.com/Marvisak/VIctory/pull/2874#issuecomment-7177125232) Reviewed and verified `854cc9e4` on Windows 11 (RTX 5090 + WARP + `dxil.dll`) against `main` (`842b0cb`): - Extracting `has_side_effect(inst)` and checking `has_side_effect(inst) || self.x.st.discards.contains_key(&(b, i))` in `section_inst` cleanly rejects exports, non-`global_load_*` flat/global/scratch ops, store/atomic ops, `s_barrier`, non-read/swizzle/permute DS ops, and structured pixel discards with the exact instruction byte offset. - Local checks: `emit::lower::tests` 34/34 passed (including `whole_wave_sections_reject_side_effects`), `section` tests 5/5 passed on RTX 5090 + WARP, `cargo clippy --locked -p victory-shader --all-targets -- -D warnings` 0 warnings, `cargo xtask policy` (`191 files ok`). - Two minor notes: 1. `crates/victory-shader/src/emit/lower.rs` is at `521,946` bytes (`2,342` bytes below the 512 KiB `xtask policy` limit). 2. Future-proofing edge cases (unlikely to enter sections today): `Fields::Buffer { lds: true, .. }` (`buffer_load_* lds`) and `s_sendmsg*`/`s_setreg_*` aren't matched by `has_side_effect`.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-26 04:25 UTC · original

Automated triage for the maintainers.

Merge candidate. Side-effect classification in emit/lower.rs moves into has_side_effect, and section_inst uses it to refuse an effect or structured discard inside a whole-wave section. Before, stores, LDS writes, exports or s_barrier inside such a span were silently dropped, so failing the shader is the correct outcome. The test checks that s_barrier and buffer_store_dword translate outside a section and are refused inside one.

CI: passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-26 04:25 UTC · [original](https://github.com/Marvisak/VIctory/pull/2874#issuecomment-7182588473) <!-- victory-triage v1 head=854cc9e415146205ec66008d80ddbcd94c8ed496 verdict=merge-candidate at=2026-11-26T04:25:45Z --> Automated triage for the maintainers. **Merge candidate.** Side-effect classification in `emit/lower.rs` moves into `has_side_effect`, and `section_inst` uses it to refuse an effect or structured discard inside a whole-wave section. Before, stores, LDS writes, exports or `s_barrier` inside such a span were silently dropped, so failing the shader is the correct outcome. The test checks that `s_barrier` and `buffer_store_dword` translate outside a section and are refused inside one. CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠AwsAli05 on GitHub · 2026-11-25 23:06 UTC · original · reviewed

The focused whole-wave test passed on Windows at 854cc9e. I checked that barriers and stores are still accepted outside a simulated section, while both return the explicit byte-offset refusal inside it.

st.discards is a separate condition from has_side_effect. A structured pixel discard case would cover that branch, since removing it would leave the current barrier and store test green.

AI-assisted review and test.

**@⁠AwsAli05** on GitHub · 2026-11-25 23:06 UTC · [original](https://github.com/Marvisak/VIctory/pull/2874#pullrequestreview-6066206922) · **reviewed** The focused whole-wave test passed on Windows at `854cc9e`. I checked that barriers and stores are still accepted outside a simulated section, while both return the explicit byte-offset refusal inside it. `st.discards` is a separate condition from `has_side_effect`. A structured pixel discard case would cover that branch, since removing it would leave the current barrier and store test green. AI-assisted review and test.
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 23:36 UTC · original · reviewed

Correct conservative boundary: whole-wave simulation can only reconstruct side-effect-free sections — a store/atomic/barrier would execute once in simulation instead of per real lane, and a discard changes which lanes the wave ops reason about. Refusing via the unsupported path is the right failure mode. The has_side_effect table looks right (exp, flat non-global-load, ds non-read/swizzle/permute). LGTM.

**@⁠kotekompotek** on GitHub · 2026-11-25 23:36 UTC · [original](https://github.com/Marvisak/VIctory/pull/2874#pullrequestreview-6066488338) · **reviewed** Correct conservative boundary: whole-wave simulation can only reconstruct side-effect-free sections — a store/atomic/barrier would execute once in simulation instead of per real lane, and a discard changes which lanes the wave ops reason about. Refusing via the unsupported path is the right failure mode. The has_side_effect table looks right (exp, flat non-global-load, ds non-read/swizzle/permute). LGTM.
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-26 10:09 UTC · original · approved these changes

Verified against origin/main (63bcca4):

  • cargo test -p victory-shader --lib emit::lower::tests:: -- --test-threads=1: 34/34 passed (including whole_wave_sections_reject_side_effects).
  • cargo clippy -p victory-shader --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Cleanly refuses side-effecting instructions inside whole-wave sections.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-26 10:09 UTC · [original](https://github.com/Marvisak/VIctory/pull/2874#pullrequestreview-6072133442) · **approved these changes** Verified against `origin/main` (`63bcca4`): - `cargo test -p victory-shader --lib emit::lower::tests:: -- --test-threads=1`: 34/34 passed (including `whole_wave_sections_reject_side_effects`). - `cargo clippy -p victory-shader --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Cleanly refuses side-effecting instructions inside whole-wave sections. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 10:46 UTC · original · requested changes

Refusing s_barrier, buffer_store_dword, and structured st.discards inside whole-wave sections closes a real silent-omission bug, and git merge-tree against 63bcca43 is clean (emit/lower.rs = 521,946 bytes).

Two gaps remain in has_side_effect / section handling (emit/lower.rs:480-491, 1388-1396):

  1. LDS-writing loads (Fields::Buffer { lds: true, .. }, gfx10/fields.rs:343): buffer_load_* with lds set writes to LDS without matching "store" or "atomic", so it is still silently skipped inside a section.
  2. Rounding-mode updates (s_round_mode / s_setreg* to HW_REG_MODE): section_inst neither refuses them nor calls round16_after, so a same-block conversion after EXEC is restored uses the stale rounding mode (tracked separately in #2886 if preserved rather than refused).

Please cover the lds flag (and either reject or preserve rounding-mode updates), and add regression coverage for lds-load and st.discards.

Verified locally on Windows 11 x64 (RTX 5090 + WARP + dxil.dll, 854cc9e4):

  • cargo run --locked -p xtask -- policy: passed (191 files ok)
  • cargo clippy -p victory-shader --all-targets --locked -- -D warnings (default and --all-features): clean
  • emit::lower::tests: 34 passed, 0 failed
  • section -- --test-threads=1 (RTX 5090 and VICTORY_WARP=1): 5 passed, 0 failed on both
**@⁠fuzeofficlal** on GitHub · 2026-11-26 10:46 UTC · [original](https://github.com/Marvisak/VIctory/pull/2874#pullrequestreview-6072736630) · **requested changes** Refusing `s_barrier`, `buffer_store_dword`, and structured `st.discards` inside whole-wave sections closes a real silent-omission bug, and `git merge-tree` against `63bcca43` is clean (`emit/lower.rs` = `521,946` bytes). Two gaps remain in `has_side_effect` / section handling (`emit/lower.rs:480-491, 1388-1396`): 1. **LDS-writing loads (`Fields::Buffer { lds: true, .. }`, `gfx10/fields.rs:343`)**: `buffer_load_*` with `lds` set writes to LDS without matching `"store"` or `"atomic"`, so it is still silently skipped inside a section. 2. **Rounding-mode updates (`s_round_mode` / `s_setreg*` to `HW_REG_MODE`)**: `section_inst` neither refuses them nor calls `round16_after`, so a same-block conversion after `EXEC` is restored uses the stale rounding mode (tracked separately in #2886 if preserved rather than refused). Please cover the `lds` flag (and either reject or preserve rounding-mode updates), and add regression coverage for `lds`-load and `st.discards`. Verified locally on Windows 11 x64 (RTX 5090 + WARP + `dxil.dll`, `854cc9e4`): - `cargo run --locked -p xtask -- policy`: passed (`191 files ok`) - `cargo clippy -p victory-shader --all-targets --locked -- -D warnings` (default and `--all-features`): clean - `emit::lower::tests`: 34 passed, 0 failed - `section -- --test-threads=1` (RTX 5090 and `VICTORY_WARP=1`): 5 passed, 0 failed on both
Author
Owner

@⁠yumaste on GitHub · 2026-11-26 12:33 UTC · original

Follow-up to the requested changes in c9d1fcf. Loads with the LDS flag now count as side effects, and focused regression coverage exercises both the LDS-writing load and the structured discard path. Both tests fail when their corresponding guard is removed.

#2886 preserves rounding-mode writes. The two branches now merge together cleanly, so #2886 can land first and #2874 picks up the round-mode behavior on main.

**@⁠yumaste** on GitHub · 2026-11-26 12:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/2874#issuecomment-7192150013) Follow-up to the requested changes in `c9d1fcf`. Loads with the LDS flag now count as side effects, and focused regression coverage exercises both the LDS-writing load and the structured discard path. Both tests fail when their corresponding guard is removed. #2886 preserves rounding-mode writes. The two branches now merge together cleanly, so #2886 can land first and #2874 picks up the round-mode behavior on `main`.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 12:58 UTC · original · requested changes

The updated tests close both gaps from the earlier review: an LDS-writing buffer load (Fields::Buffer { lds: true, .. }) and a structured-program discard inside a whole-wave section, with the check now running before every simulated instruction in lower_block (crates/victory-shader/src/emit/lower.rs:1384-1392).

Two items still need attention before landing alongside sibling fixes:

  1. has_side_effect at crates/victory-shader/src/emit/lower.rs:483 still excludes all global_load_* instructions without checking Fields::Flat { lds: true, .. }, so a global_load_* ... lds inside a whole-wave section can still be skipped and directly conflicts with #2771.
  2. In-memory integration onto origin/main (63bcca43) keeping the shared predicate and both regressions produces a 524,348-byte emit/lower.rs (#2874 + #2771, 60 bytes over xtask's 524,288-byte limit), or 524,437 bytes (+149 bytes over) when also retaining #2886's per-instruction mode16 rounding-mode update (emit/lower.rs:1382-1395). Please carry Fields::Flat { lds: true, .. } into has_side_effect (and keep #2886's rounding-mode update when integrating) while moving tests out of lower.rs or trimming enough bytes to stay under the 512 KiB cap.

Local verification on c9d1fcfb22e6: xtask policy (191 files ok; lower.rs standalone = 523,549 bytes), cargo clippy -p victory-shader --all-targets / --all-features, emit::lower::tests (35 passed), and section tests (6 passed on both RTX 5090 and VICTORY_WARP=1).

**@⁠fuzeofficlal** on GitHub · 2026-11-26 12:58 UTC · [original](https://github.com/Marvisak/VIctory/pull/2874#pullrequestreview-6074518329) · **requested changes** The updated tests close both gaps from the earlier review: an LDS-writing buffer load (`Fields::Buffer { lds: true, .. }`) and a structured-program discard inside a whole-wave section, with the check now running before every simulated instruction in `lower_block` (`crates/victory-shader/src/emit/lower.rs:1384-1392`). Two items still need attention before landing alongside sibling fixes: 1. `has_side_effect` at `crates/victory-shader/src/emit/lower.rs:483` still excludes all `global_load_*` instructions without checking `Fields::Flat { lds: true, .. }`, so a `global_load_* ... lds` inside a whole-wave section can still be skipped and directly conflicts with `#2771`. 2. In-memory integration onto `origin/main` (`63bcca43`) keeping the shared predicate and both regressions produces a `524,348`-byte `emit/lower.rs` (`#2874 + #2771`, 60 bytes over `xtask`'s `524,288`-byte limit), or `524,437` bytes (+149 bytes over) when also retaining `#2886`'s per-instruction `mode16` rounding-mode update (`emit/lower.rs:1382-1395`). Please carry `Fields::Flat { lds: true, .. }` into `has_side_effect` (and keep `#2886`'s rounding-mode update when integrating) while moving tests out of `lower.rs` or trimming enough bytes to stay under the 512 KiB cap. Local verification on `c9d1fcfb22e6`: `xtask policy` (`191 files ok`; `lower.rs` standalone = `523,549` bytes), `cargo clippy -p victory-shader --all-targets` / `--all-features`, `emit::lower::tests` (`35 passed`), and `section` tests (`6 passed` on both RTX 5090 and `VICTORY_WARP=1`).
Author
Owner

@⁠yumaste on GitHub · 2026-11-26 13:44 UTC · original

Addressed in 6b906eb. Whole-wave lowering now rejects global_load_dword ... lds at its instruction byte offset, with a synthetic regression. The whole-wave effect tests now live in lower/whole_wave_effect_tests.rs.

I merged this branch, #2771 and #2886 onto main (63bcca4) locally without conflict. The combined lower.rs is 522,717 bytes. Under WARP the 37 lowering tests and the rounding-mode regression passed, along with all-targets/all-features Clippy and asset policy.

**@⁠yumaste** on GitHub · 2026-11-26 13:44 UTC · [original](https://github.com/Marvisak/VIctory/pull/2874#issuecomment-7193761231) Addressed in `6b906eb`. Whole-wave lowering now rejects `global_load_dword ... lds` at its instruction byte offset, with a synthetic regression. The whole-wave effect tests now live in `lower/whole_wave_effect_tests.rs`. I merged this branch, #2771 and #2886 onto `main` (`63bcca4`) locally without conflict. The combined `lower.rs` is 522,717 bytes. Under WARP the 37 lowering tests and the rounding-mode regression passed, along with all-targets/all-features Clippy and asset policy.
Author
Owner

@⁠AurumCarlos on GitHub · 2026-11-26 14:08 UTC · original · reviewed

On 6b906eb: refusing global_load_* … lds in whole-wave sections makes sense (it writes LDS once per simulated wave instead of per lane, like the buffer form), and moving the tests into lower/whole_wave_effect_tests.rs keeps lower.rs down.

One maintainability point. The new effect in the instruction lowering is has_side_effect minus the Flat { lds: true } arm, written out a second time:

let effect = matches!(inst.fields, Fields::Exp { .. })
    || matches!(inst.fields, Fields::Flat { .. }) && !name.starts_with("global_load_")
    || name.contains("store")
    || has_atomic_barrier_or_lds_effect(inst);

I assume the difference is on purpose: outside a section, a global LDS load that fails to lower should still mark its results missing instead of refusing the program, as on main. But nothing says so, and the next arm someone adds to has_side_effect will silently not reach this copy. Writing it as has_side_effect(inst) && !matches!(inst.fields, Fields::Flat { lds: true, .. }), with a one-line comment on why the LDS form is excluded here, would keep the two from drifting apart.

**@⁠AurumCarlos** on GitHub · 2026-11-26 14:08 UTC · [original](https://github.com/Marvisak/VIctory/pull/2874#pullrequestreview-6075518524) · **reviewed** On `6b906eb`: refusing `global_load_* … lds` in whole-wave sections makes sense (it writes LDS once per simulated wave instead of per lane, like the buffer form), and moving the tests into `lower/whole_wave_effect_tests.rs` keeps `lower.rs` down. One maintainability point. The new `effect` in the instruction lowering is `has_side_effect` minus the `Flat { lds: true }` arm, written out a second time: ```rust let effect = matches!(inst.fields, Fields::Exp { .. }) || matches!(inst.fields, Fields::Flat { .. }) && !name.starts_with("global_load_") || name.contains("store") || has_atomic_barrier_or_lds_effect(inst); ``` I assume the difference is on purpose: outside a section, a global LDS load that fails to lower should still mark its results missing instead of refusing the program, as on `main`. But nothing says so, and the next arm someone adds to `has_side_effect` will silently not reach this copy. Writing it as `has_side_effect(inst) && !matches!(inst.fields, Fields::Flat { lds: true, .. })`, with a one-line comment on why the LDS form is excluded here, would keep the two from drifting apart.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 14:15 UTC · original · approved these changes

Both items from the previous review are cleanly resolved:

  • has_side_effect (emit/lower.rs:480-498) now explicitly checks matches!(inst.fields, Fields::Flat { lds: true, .. }) so GLOBAL-to-LDS is rejected inside whole-wave sections at the exact instruction offset (16), covered by whole_wave_sections_reject_global_loads_into_lds.
  • Splitting the new tests into whole_wave_effect_tests.rs brings emit/lower.rs down to 521,821 B (2,467 B under the 512 KiB policy cap), and a clean 3-way merge with #2771 (26006ae4) produces 522,628 B (1,660 B under the cap, zero conflicts).

Note for maintainers: outside whole-wave sections, ordinary lowering of GLOBAL-to-LDS still depends on #2771 landing alongside this PR.

Local verification at 6b906eb9 (and merged onto origin/main 63bcca43 at 88e9b6a5): xtask policy passed (192 files ok), cargo clippy -p victory-shader --all-targets (default and --all-features) passed with 0 warnings, emit::lower:: passed (36/36), and section tests passed on both RTX 5090 and VICTORY_WARP=1 (7/7). Approving.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 14:15 UTC · [original](https://github.com/Marvisak/VIctory/pull/2874#pullrequestreview-6075628557) · **approved these changes** Both items from the previous review are cleanly resolved: - `has_side_effect` (`emit/lower.rs:480-498`) now explicitly checks `matches!(inst.fields, Fields::Flat { lds: true, .. })` so GLOBAL-to-LDS is rejected inside whole-wave sections at the exact instruction offset (`16`), covered by `whole_wave_sections_reject_global_loads_into_lds`. - Splitting the new tests into `whole_wave_effect_tests.rs` brings `emit/lower.rs` down to **`521,821 B`** (2,467 B under the 512 KiB policy cap), and a clean 3-way merge with #2771 (`26006ae4`) produces **`522,628 B`** (1,660 B under the cap, zero conflicts). Note for maintainers: outside whole-wave sections, ordinary lowering of GLOBAL-to-LDS still depends on #2771 landing alongside this PR. Local verification at `6b906eb9` (and merged onto `origin/main` `63bcca43` at `88e9b6a5`): `xtask policy` passed (`192 files ok`), `cargo clippy -p victory-shader --all-targets` (`default` and `--all-features`) passed with 0 warnings, `emit::lower::` passed (`36/36`), and `section` tests passed on both RTX 5090 and `VICTORY_WARP=1` (`7/7`). Approving.
Author
Owner

@⁠yumaste on GitHub · 2026-11-26 14:22 UTC · original

I documented why the whole-wave classifier has its own rule for global LDS loads and named it accordingly in ea146a8. I tried refactoring the ordinary error predicate to share more of the expression, but that changed the same hunk as #2771 and made the trial merge conflict. This head still merges cleanly with both #2771 and #2886. The shared helper still covers atomic, barrier and LDS-buffer effects. Under WARP, all 36 lowering tests passed, and all-target/all-feature Clippy passed.

**@⁠yumaste** on GitHub · 2026-11-26 14:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/2874#issuecomment-7194728965) I documented why the whole-wave classifier has its own rule for global LDS loads and named it accordingly in `ea146a8`. I tried refactoring the ordinary error predicate to share more of the expression, but that changed the same hunk as #2771 and made the trial merge conflict. This head still merges cleanly with both #2771 and #2886. The shared helper still covers atomic, barrier and LDS-buffer effects. Under WARP, all 36 lowering tests passed, and all-target/all-feature Clippy passed.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2874/head:github-bot/gh-2874'
git switch 'github-bot/gh-2874'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2874'
git switch 'github-bot/gh-2874'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2874'
git switch 'github-bot/gh-2874'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2874'
git switch 'main'
git merge --squash 'github-bot/gh-2874'
git switch 'main'
git merge --ff-only 'github-bot/gh-2874'
git switch 'main'
git merge 'github-bot/gh-2874'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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/Marvisak--VIctory!2874
No description provided.