Shaders: model v_permlane16_b32 in whole-wave sections #98
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!98
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-98"
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?
@tedin7 on GitHub · 2026-11-24 00:28 UTC · original
tedin7:vic-permlane16→main· +58 −7 · 1 files · 1 commits · openWhat
Why
Tested
Linux x86_64 only, synthetic code words (assembled with llvm-mc gfx1030), no game files:
Not run: Windows runtime, any GPU, the HLSL diff tests.
Not touched: console_lanes in lower.rs does not list v_permlane* (it lists ds_swizzle, permute, v_mbcnt, v_readlane, DPP). Left alone to keep this to one change.
@DaviTostes on GitHub · 2026-11-24 00:36 UTC · original
Tested
f468457stacked on #39 on Arch Linux x86_64, rustc 1.98.1: pass.cargo test --workspace: 155 passed, 0 failed, 3 ignored; merge with #39 clean.#[test]for the whole-wavev_permlane16_b32section modelling, included in that run.AI-assisted (DeepSeek V4.1 Flash coding agent).
@lordon1a on GitHub · 2026-11-24 00:51 UTC · original
Verified
f468457a1on Windows 11 (x86_64-pc-windows-gnullvm,rustc 1.100.0, applied cleanly tomain@4c0bb89): pass.cargo xtask policy: 151 files okcargo test -p victory-shader -- --skip v_med3_f32_matches_rdna2_with_nan: 69 passed, 0 failed.AI-assisted.
@zed6000 on GitHub · 2026-11-24 17:44 UTC · original
Measured on real data. I merged this PR onto main
ffe310eand ranvictory translate --validate --listovershaders.rpffrom a retail 1.0.2.1 dump, then compared the result with main program by program. This is part of the offline benchmark in #1247.29 compute programs that translate and validate on main stop translating with this PR. All 29 now fail with:
That reason covers 5 programs on main and 51 with this PR. The PR gains no programs on this data.
The unit tests pass, as the earlier comments say. The failure shows up only on the title's own code: the new modelling makes the whole-wave simulation refuse sections that it accepted before. Shader names and code are not included, per the asset policy. I can check a revised version against the same data.
@zed6000 on GitHub · 2026-11-24 23:05 UTC · original
Follow-up on main's new head
70564ae, with the same method (victory translate --validate --listonshaders.rpf1.0.2.1, dxil.dll 1.8.2502, compared program by program). Merged onto70564ae, this PR stops 44 compute programs that validate there from translating. That is up from 29 onffe310e. All 44 now fail with:It gains no programs. As noted on #1247, the losses disappear in
integ/nextonly where this change was hand-merged with #439'semit/wave.rs. On top of #223, #233 and #320 alone, the losses remain. Offline counts only; no program names or data.@Marvisak on GitHub · 2026-11-25 00:24 UTC · original · edited 2026-11-25 01:16 UTC
Automated triage for the maintainers.
Needs rebase. This pull request conflicts with
main(conflicting:crates/victory-shader/src/emit/wave.rs). It will be reviewed once it is rebased onto the currentmain.Generated by Claude Code
@zed6000 on GitHub · 2026-11-25 00:24 UTC · original
For the maintainers, alongside the triage above: the head it reviewed (
f468457) is the head I measured offline, and it loses programs on the title's shaders. Merged onto70564aeand compared program by program (victory translate --validate --list,shaders.rpf1.0.2.1, dxil.dll 1.8.2502), 44 compute programs that validate on70564aestop translating. Onffe310eit was 29. They all fail with "a whole-wave section step the simulation does not follow", and the PR gains no programs.The triage's behaviour note is the likely cause:
v_permlanex16_b32now gives an unknown result when EXEC is not full. Sections the simulation followed before therefore become unknown and are refused. The unit test only covers the full-EXEC case, so it passes. Keeping the previousv_permlanex16_b32behaviour for partial EXEC, and addingv_permlane16_b32only alongside it, may keep the new opcode without the losses. That's a guess from the note; I haven't tested it. Details are in the comments above and in #1247.@zed6000 on GitHub · 2026-11-25 00:30 UTC · original
Tested the guess above: it holds. On
70564ae+ this PR, I changed one line inemit/wave.rs, so that the full-EXEC condition applies only to the newly modelledv_permlane16_b32andv_permlanex16_b32keeps main's behaviour:Result, program by program over
shaders.rpf(1.0.2.1, dxil.dll 1.8.2502):70564ae70564ae+ this PR as is70564ae+ this PR + the line abovepermlane16_reads_the_lanes_own_rowstill passes, as do the otherwavetests, on an RX 7900 XTX.The PR's reasoning, that
fi/bound_ctrldecide what an inactive lane reads, may well be right for both opcodes. If so, the stricter rule forv_permlanex16_b32is a separate change from addingv_permlane16_b32, and it costs 44 programs on this title. It might be better split out, perhaps decoding the opsel bits instead of refusing outright. Offline counts only; no program names or data.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.