Whole-wave sections: v_permlanex16 reads a disabled lane only with fetch-inactive (was taken as a wave OR) #296
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!296
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-296"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@sharan104 on GitHub · 2026-11-26 14:45 UTC · original
sharan104:fix/wave-emit→main· +48 −2 · 1 files · 1 commits · openemit/wave.rssimulatemodels whole-wave sections (the scan and reduce code compilers emit) to recognise their results as wave-wide operations. Itsv_permlanex16_b32arm gave every lane the value of the lane it picks, whatever EXEC held. The hardware differs when the source lane is disabled and fetch-inactive (OP_SEL[0]) is off: the lane gets 0 if bound-control (OP_SEL[1]) is set, and otherwise keeps its old value. The general lowering outside sections already does this (lower.rs, the permlane arm). DPP inside a section is refused under a partial EXEC, but the permlane had no such check, so one opcode family was checked and the other wasn't (the same kind of slip as #286).How it shows: set EXEC to
0xffff0000inside the section, then run the permlane. The upper row then reads the disabled lower row. Av_readlaneof lane 31 was taken asShape::Active(Or, …)and lowered as a wave OR over every host lane. On the console, lane 31 holds its oldv2OR'd with the upper row: a miscompile. The compiler pattern I know (LLVM's DPP scans) runs the permlane with the full EXEC, so this is shown with a synthetic program.Fix: a lane reads its source only when that source is enabled or fetch-inactive is set. Otherwise it's 0 with bound-control, or its old value.
Test:
a_permlane_from_disabled_lanes_reads_them_only_with_fetch_inactive(synthetic wave32):op_sel:[1,0](fetch-inactive), the result is still recognised as the whole wave's OR.Before the fix it failed (
Some(Active(Or, ..))whereNonewas expected). After it, the test passes, 10 runs out of 10.Results:
cargo test -p victory-shader --locked: 303 passed, 0 failed, 4 ignored.-D warningsis clean, with and without--all-features.No open or closed PR touches
wave.rs. The open wave64 PRs (#184, #173, #152, #109) only change the wave64 test and program files.🤖 Generated with Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.