Shader opt test: neg_uav_load_between_reads mislabelled negative (test fails on .30.03, CI doesn't run it) #4562

Closed
opened 2026-11-30 22:26:44 +00:00 by gbmrrr · 3 comments
gbmrrr commented 2026-11-30 22:26:44 +00:00 (Migrated from github.com)
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by gbmrrr on 2026-11-30T22:26:44Z.


Summary

The test case neg_uav_load_between_reads in split_lds_wave32_read_after_read_barrier_coalescing_and_parity declared itself a "negative" — expecting both BARRIERS and ALL masks to keep the unoptimised barrier pattern BWBRBRBWBR. Measurement on hardware (RTX 5070 Ti) and WARP shows:

Mask Pattern Notes
0 (unopt) BWBRBRBWBR baseline
BARRIERS BWBRBRBWBR no change — needs LOADS/LICM/FACTS to hoist loads
ALL (DEFAULT) BWBRRBWBR one barrier removed, read-after-read eliminated
dispatch result [t ^ 32, t, t + 25] identical to unoptimised

The UAV buffer_load_dword reads memory the block's LDS does not alias, so it invalidates nothing and the barrier between the two LDS reads is a redundant read-after-read pair. BARRIERS alone cannot prove the loads are loop-invariant without the preceding passes (LOADS, LICM, FACTS); only the combined ALL mask reaches the optimised pattern.

Fix (already in local commit 33542969)

  • Renamed case to uav_load_between_reads (not a negative)
  • Corrected the doc to explain the pass dependency
  • Adjusted the pattern check to accept BARRIERS == unopt while requiring ALL == opt_pat for this case

All 536 shader tests now pass (was 535 passed, 1 failed). The upstream .30.03 tag has the same bug.

Bonus: CI doesn't run the test suite

The workflows that ran on .30.03 are only spam, title-labels, game-requests — no test workflow executes. That's why this deterministic failure (3/3 runs) wasn't caught.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:6707597950 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/4562). Originally posted by [gbmrrr](https://github.com/gbmrrr) on 2026-11-30T22:26:44Z. --- ## Summary The test case `neg_uav_load_between_reads` in `split_lds_wave32_read_after_read_barrier_coalescing_and_parity` declared itself a "negative" — expecting both `BARRIERS` and `ALL` masks to keep the unoptimised barrier pattern `BWBRBRBWBR`. Measurement on hardware (RTX 5070 Ti) and WARP shows: | Mask | Pattern | Notes | |------|---------|-------| | 0 (unopt) | `BWBRBRBWBR` | baseline | | BARRIERS | `BWBRBRBWBR` | **no change** — needs LOADS/LICM/FACTS to hoist loads | | ALL (DEFAULT) | `BWBRRBWBR` | one barrier removed, read-after-read eliminated | | dispatch result | `[t ^ 32, t, t + 25]` | **identical to unoptimised** | The UAV `buffer_load_dword` reads memory the block's LDS does not alias, so it invalidates nothing and the barrier between the two LDS reads is a redundant read-after-read pair. `BARRIERS` alone cannot prove the loads are loop-invariant without the preceding passes (`LOADS`, `LICM`, `FACTS`); only the combined `ALL` mask reaches the optimised pattern. ## Fix (already in local commit 33542969) - Renamed case to `uav_load_between_reads` (not a negative) - Corrected the doc to explain the pass dependency - Adjusted the pattern check to accept `BARRIERS == unopt` while requiring `ALL == opt_pat` for this case All 536 shader tests now pass (was 535 passed, 1 failed). The upstream `.30.03` tag has the same bug. ## Bonus: CI doesn't run the test suite The workflows that ran on `.30.03` are only `spam`, `title-labels`, `game-requests` — no test workflow executes. That's why this deterministic failure (3/3 runs) wasn't caught.
github-actions[bot] commented 2026-11-30 22:26:54 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by github-actions[bot] on 2026-11-30T22:26:54Z.


Please attach both logs from the run that went wrong. Without them we can only guess. Paste %LOCALAPPDATA% into the address bar of File Explorer to get there.

  1. The play log, in %LOCALAPPDATA%\victory\logs\: the newest victory-nvidia-play-<date>-<time>-<number>.log (from victory.exe) or victory-nvidia-<date>-<time>.log (from the script launcher). The window shows its path at the start, on the line Log: ....
  2. The crash log: %LOCALAPPDATA%\VIctory\data\7952987A\crashes.log, and, if there is one from that run, the newest victory-<date>-<time>-<number>.crash.log in %LOCALAPPDATA%\VIctory\data\7952987A\temp\.

Also say which GPU, Windows version (10 or 11)

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7293859235 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/4562#issuecomment-7293859235). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-30T22:26:54Z. --- Please attach both logs from the run that went wrong. Without them we can only guess. Paste `%LOCALAPPDATA%` into the address bar of File Explorer to get there. 1. The play log, in `%LOCALAPPDATA%\victory\logs\`: the newest `victory-nvidia-play-<date>-<time>-<number>.log` (from `victory.exe`) or `victory-nvidia-<date>-<time>.log` (from the script launcher). The window shows its path at the start, on the line `Log: ...`. 2. The crash log: `%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log`, and, if there is one from that run, the newest `victory-<date>-<time>-<number>.crash.log` in `%LOCALAPPDATA%\VIctory\data\7952987A\temp\`. Also say which GPU, Windows version (10 or 11)
gbmrrr commented 2026-11-30 23:13:03 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by gbmrrr on 2026-11-30T23:13:03Z.


Correction, and the logs

First, a correction to the last paragraph of my report. I wrote "CI doesn't run the test suite". That is wrong as stated. .github/workflows/ci.yml exists in v2026.11.30.03 and does run it:

on:
  push:
  pull_request:
...
runs-on: windows-latest
  cargo clippy --workspace --all-targets --locked -- -D warnings
  cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
  run: cargo test --workspace --locked

The accurate statement is narrower: push: there has no tags: filter, so a tag push runs only spam, needs-logs, title-labels and game-requests. v2026.11.30.03 was tagged without the suite ever running against it, which is how it shipped with a red victory-shader test. Branch pushes and PRs are covered; releases are not.

The failure is deterministic, not a flake

Three consecutive isolated runs, same assertion every time:

$ cargo test --release --locked -p victory-shader --lib \
    split_lds_wave32_read_after_read_barrier_coalescing_and_parity

running 1 test
test emit::bitcode::opt::tests::hw_tests::split_lds_wave32_read_after_read_barrier_coalescing_and_parity ... FAILED

adjacent_rar: opt=0 `BWBRBRBWBR` -> BARRIERS `BWBRRBWBR`, ALL `BWBRRBWBR`
pure_alu_between_reads: opt=0 `BWBRBRBWBR` -> BARRIERS `BWBRRBWBR`, ALL `BWBRRBWBR`
rar_before_ret: opt=0 `BWBRBR` -> BARRIERS `BWBRR`, ALL `BWBRR`
neg_write_between_reads: opt=0 `BWBRBWBR` -> BARRIERS `BWBRBWBR`, ALL `BWBRBWBR`
neg_atomic_between_reads: opt=0 `BWBRBABR` -> BARRIERS `BWBRBABR`, ALL `BWBRBABR`

thread '...' panicked at crates\victory-shader\src\emit\bitcode\opt.rs:7742:21:
assertion `left == right` failed: neg_uav_load_between_reads mask=BARRIERS pattern
  left: "BWBRBRBWBR"
 right: "BWBRRBWBR"

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 545 filtered out; finished in 0.60s

test result: FAILED. 0 passed; 1 failed on every run, 0.60s, no timing involved.

Machine

GPU: NVIDIA GeForce RTX 5070 Ti, driver 621.40
Windows: 11 Home Single Language, build 26300, 26H2
Rust: 1.98.1, x86_64-pc-windows-msvc

The eprintln! lines above are from the test's own output, so the hardware path (hw) and WARP both reached the pattern dump. The failure is in the pattern comparison, before any dispatch:

assert_eq!(pb, opt_pat, "{label} mask=BARRIERS pattern");

What the numbers say the fix is

neg_uav_load_between_reads expects BWBRBRBWBR for both masks, treating it as a case the pass must not touch. But:

mask pattern
0 (unopt) BWBRBRBWBR
BARRIERS BWBRBRBWBR (unchanged)
ALL (DEFAULT) BWBRRBWBR (one barrier fewer)

BARRIERS alone leaves it alone; only ALL - which brings LOADS, LICM and FACTS - reaches the shorter pattern. So the case is not a negative at all: a UAV buffer_load_dword reads memory the block's LDS does not alias, so it invalidates nothing, and the barrier between the two LDS reads is exactly the redundant read-after-read pair BARRIERS is meant to remove. BARRIERS cannot see it alone because the loads have to be hoisted first.

The other five cases in the same test behave, so this is one wrong expectation in the table, not a broken pass. Locally I renamed the case to uav_load_between_reads, corrected the note, and made the check accept BARRIERS == unopt while still requiring ALL == opt_pat for this case. 536 passed; 0 failed afterwards.

Crash log

None. %LOCALAPPDATA%\VIctory\data\7952987A\crashes.log does not exist and there is no *.crash.log under temp\ - this is a test failure, not a crash.

Full play log available on request; it is 4.6 MB and not relevant to this one.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7294852709 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/4562#issuecomment-7294852709). Originally posted by [gbmrrr](https://github.com/gbmrrr) on 2026-11-30T23:13:03Z. --- ## Correction, and the logs First, a correction to the last paragraph of my report. I wrote "CI doesn't run the test suite". That is wrong as stated. `.github/workflows/ci.yml` exists in `v2026.11.30.03` and does run it: ```yaml on: push: pull_request: ... runs-on: windows-latest cargo clippy --workspace --all-targets --locked -- -D warnings cargo clippy --workspace --all-targets --all-features --locked -- -D warnings run: cargo test --workspace --locked ``` The accurate statement is narrower: `push:` there has **no `tags:` filter**, so a tag push runs only `spam`, `needs-logs`, `title-labels` and `game-requests`. `v2026.11.30.03` was tagged without the suite ever running against it, which is how it shipped with a red `victory-shader` test. Branch pushes and PRs are covered; releases are not. ## The failure is deterministic, not a flake Three consecutive isolated runs, same assertion every time: ``` $ cargo test --release --locked -p victory-shader --lib \ split_lds_wave32_read_after_read_barrier_coalescing_and_parity running 1 test test emit::bitcode::opt::tests::hw_tests::split_lds_wave32_read_after_read_barrier_coalescing_and_parity ... FAILED adjacent_rar: opt=0 `BWBRBRBWBR` -> BARRIERS `BWBRRBWBR`, ALL `BWBRRBWBR` pure_alu_between_reads: opt=0 `BWBRBRBWBR` -> BARRIERS `BWBRRBWBR`, ALL `BWBRRBWBR` rar_before_ret: opt=0 `BWBRBR` -> BARRIERS `BWBRR`, ALL `BWBRR` neg_write_between_reads: opt=0 `BWBRBWBR` -> BARRIERS `BWBRBWBR`, ALL `BWBRBWBR` neg_atomic_between_reads: opt=0 `BWBRBABR` -> BARRIERS `BWBRBABR`, ALL `BWBRBABR` thread '...' panicked at crates\victory-shader\src\emit\bitcode\opt.rs:7742:21: assertion `left == right` failed: neg_uav_load_between_reads mask=BARRIERS pattern left: "BWBRBRBWBR" right: "BWBRRBWBR" test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 545 filtered out; finished in 0.60s ``` `test result: FAILED. 0 passed; 1 failed` on every run, `0.60s`, no timing involved. ## Machine **GPU:** NVIDIA GeForce RTX 5070 Ti, driver 621.40 **Windows:** 11 Home Single Language, build 26300, 26H2 **Rust:** 1.98.1, `x86_64-pc-windows-msvc` The `eprintln!` lines above are from the test's own output, so the hardware path (`hw`) and WARP both reached the pattern dump. The failure is in the pattern comparison, before any dispatch: ```rust assert_eq!(pb, opt_pat, "{label} mask=BARRIERS pattern"); ``` ## What the numbers say the fix is `neg_uav_load_between_reads` expects `BWBRBRBWBR` for both masks, treating it as a case the pass must not touch. But: | mask | pattern | |---|---| | 0 (unopt) | `BWBRBRBWBR` | | BARRIERS | `BWBRBRBWBR` (unchanged) | | ALL (DEFAULT) | `BWBRRBWBR` (one barrier fewer) | `BARRIERS` alone leaves it alone; only `ALL` - which brings `LOADS`, `LICM` and `FACTS` - reaches the shorter pattern. So the case is not a negative at all: a UAV `buffer_load_dword` reads memory the block's LDS does not alias, so it invalidates nothing, and the barrier between the two LDS reads is exactly the redundant read-after-read pair `BARRIERS` is meant to remove. `BARRIERS` cannot see it alone because the loads have to be hoisted first. The other five cases in the same test behave, so this is one wrong expectation in the table, not a broken pass. Locally I renamed the case to `uav_load_between_reads`, corrected the note, and made the check accept `BARRIERS == unopt` while still requiring `ALL == opt_pat` for this case. `536 passed; 0 failed` afterwards. ## Crash log None. `%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log` does not exist and there is no `*.crash.log` under `temp\` - this is a test failure, not a crash. Full play log available on request; it is 4.6 MB and not relevant to this one.
gbmrrr commented 2026-12-01 00:00:58 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by gbmrrr on 2026-12-01T00:00:58Z.


Resolved upstream already — closing this one myself rather than leaving it open with a needs-logs label, because it never needed a run log: it is a unit-test expectation, and %LOCALAPPDATA%\VIctory\data\7952987A\crashes.log does not exist here in any case.

Fixed by 6060bc47 ("Shader tests: the split-LDS UAV-load negative reads its load", Lyrnc). That commit's diagnosis is better than the one in my report, and I want to say so plainly:

I said BARRIERS alone could not reach the pattern because it needs LOADS/LICM/FACTS to hoist the loads first. That was wrong. The real cause is that the case loads v8 and never reads it, so DEAD — which runs inside optimise's rounds, not under the BARRIERS flag — drops the dead load on round one, and round two then correctly sees two adjacent reads and removes the barrier. Without the load the case is adjacent_rar, which the same test already expects to become BWBRRBWBR.

So my local fix was the weaker one: I relaxed the assertion to accept BARRIERS == unopt while requiring ALL == opt_pat, which would have frozen a test that no longer tested what its name says. 6060bc47 keeps the case honest by making the load live (v6 = v8 + v6 before the store), which is the correct repair. Dropping my version.

The one part of my report that still stands: the tag v2026.11.30.03 shipped with this failing because push: in ci.yml has no tags: filter. Branch and PR runs do execute the suite.

Thanks — and sorry for the extra round trip on a test that was already understood.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7295819907 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/4562#issuecomment-7295819907). Originally posted by [gbmrrr](https://github.com/gbmrrr) on 2026-12-01T00:00:58Z. --- Resolved upstream already — closing this one myself rather than leaving it open with a `needs-logs` label, because it never needed a run log: it is a unit-test expectation, and `%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log` does not exist here in any case. Fixed by `6060bc47` ("Shader tests: the split-LDS UAV-load negative reads its load", Lyrnc). That commit's diagnosis is better than the one in my report, and I want to say so plainly: I said `BARRIERS` alone could not reach the pattern because it needs `LOADS`/`LICM`/`FACTS` to hoist the loads first. That was wrong. The real cause is that the case loads `v8` and never reads it, so `DEAD` — which runs inside `optimise`'s rounds, not under the `BARRIERS` flag — drops the dead load on round one, and round two then correctly sees two adjacent reads and removes the barrier. Without the load the case *is* `adjacent_rar`, which the same test already expects to become `BWBRRBWBR`. So my local fix was the weaker one: I relaxed the assertion to accept `BARRIERS == unopt` while requiring `ALL == opt_pat`, which would have frozen a test that no longer tested what its name says. `6060bc47` keeps the case honest by making the load live (`v6 = v8 + v6` before the store), which is the correct repair. Dropping my version. The one part of my report that still stands: the tag `v2026.11.30.03` shipped with this failing because `push:` in `ci.yml` has no `tags:` filter. Branch and PR runs do execute the suite. Thanks — and sorry for the extra round trip on a test that was already understood.
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
trustno1-coder/VIctory-NVIDIA#4562
No description provided.