Shaders: name the instruction that ended a whole-wave section #2365
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2365
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2365/head"
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?
@Calvix2k on GitHub · 2026-11-25 11:57 UTC · original
Calvix2k:codex/shader-wave-section-step→main· +73 −8 · 2 files · 2 commits · closed without mergingA whole-wave section (
s_or_saveexec -1 … s_and_saveexec, the console's way of running one operation with every lane active) is simulated lane by lane to know what its wave operations mean once the host runs them. The simulation followsEXECwhen it is set to a constant (s_mov_b*), and stops at anything else; every value read after that point is refused withwhich names nothing, so each case had to be found by hand — three compute shaders of this title (the once-per-frame post-processing passes) are stuck behind it.
What this does
wave::Sectionrecords the instruction that ended the simulation (ended: Option<&'static str>), andLower::section_instuses it as the reason a shapeless value is refused. The message becomes the instruction name —s_and_b32or whatever it was — which is the one thing a reader needs before teaching the simulation that step.No behaviour changes: the same programs translate and fail as before, with a better reason.
Verification
victory translate --listovershaders.rpf(26,503 containers): same program set, the reasons now name the instruction.cargo test -p victory-shader --lib: 247 passed, 0 failed, 3 ignored; clippy-D warningsclean.@welisonzika14-jpg on GitHub · 2026-11-25 12:25 UTC · original
First run on NVIDIA hardware here, as far as I can see. RTX 5070 (Blackwell, driver 621.24), Ryzen 7 5700X, Windows 11, Rust 1.98.1 MSVC, no game files. Head
c3435ecmerged ontomain940d32f,cargo test -p victory-gpu -p victory-shader --lib --no-fail-fast.The PR adds no test that runs here, so this only shows it breaks nothing. The rest is the same as
mainon this card: the 5 known NVIDIA failures from #1744 (2 view heap cap tests invictory-gpu, 3 invictory-shader), nothing new.One run, unit tests only, title not run.
Written with AI help (Claude/Kiro); the numbers are from runs on my machine.
@Marvisak on GitHub · 2026-11-25 14:49 UTC · original · edited 2026-11-25 16:47 UTC
Automated triage for the maintainers.
Merge candidate.
When a whole-wave section leaves a value with no shape, the shader translator now names the step that caused it.
simulateincrates/victory-shader/src/emit/wave.rsreturns the step that stopped the simulation, andsectionsrecords the last writer of each unshaped value.Lower::section_instinlower.rsputs these in the refusal instead of the generic reason.Changed since the last review (new head
1c94500, rebased onto67e8ae1): the reason keeps its category.section_stepbuilds "a whole-wave section step: ", made once per name and cached, so the table can only be as large as the opcode set. Atranslate --listline can no longer be mistaken for a bare unlowered instruction. The new testa_section_step_keeps_its_categorypins the reason for ans_not_b32EXEC write. It also merges cleanly with #2382, which edits the samesimulate.On your reply: confirmed, that was the change asked for.
CI:
checkpassing.Generated by Claude Code
@Calvix2k on GitHub · 2026-11-25 16:17 UTC · original
The category is back in the reason, in
1c94500(rebased ontomain 67e8ae1):wave::section_stepturns the step's name into "a whole-wave section step: ", made once per name (the names are static, so the table is bounded by the opcode set).Section::endedandSection::reasonsstore that form, so neither path can be mistaken for a bare "instruction not lowered" again.a_section_step_keeps_its_categorybuilds a section whose EXEC write iss_not_b32and pins"a whole-wave section step: s_not_b32". It fails on the old form, which stored the bare name. Local wave tests 7/7 and clippy clean; the rest of the shader suite's GPU cases need SM 6.6 and run in CI.@Marvisak on GitHub · 2026-11-25 22:08 UTC · original
Automated triage for the maintainers, second look (a review against current
main, with builds and tests where they could change the verdict).Closing in favour of #2344, which does the same job with fixed classes for every kind of step. Here the per-value reasons are attached only to values that never leave the section, which nothing reads, so the only step ever named is an EXEC write that stopped the simulation, and values that were already unknown before it are attributed to it.
If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.
Pull request closed