Shaders: read a VALU opcode's name without a heap vector #1834
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!1834
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1834"
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?
@slatefield on GitHub · 2026-11-24 23:08 UTC · original
slatefield:shader/valu-name-no-alloc→main· +17 −6 · 1 files · 1 commits · openvalu_dwordsdidname.split('_').collect::<Vec<&str>>()for every VALU instruction just to checkparts.len() == 4 && parts[1] == "cvt", andfields()runs once per instruction.now it peeks at the five tokens in place and only takes the last one with
rsplitin the fallback arm. no alloc, same results.measured on the isolated
fields()loop: -8.9% at 12.1k instructions, -9.3% at 24.2k. stacked with the members() one, ir::build -5.0%. 118 lib tests pass.outside what #1623/#1180/#1757 change.
@upipibi on GitHub · 2026-11-24 23:15 UTC · original
NVIDIA run: RTX 3070 8 GB, driver 616.56, plus WARP, Windows 11, debug,
3f20c55(onmain70564ae).cargo test -p victory-shader --locked: 206 passed, 3 failed, 2 ignored. The 3 are #1744's NVIDIA heap-cap failures onmain, so there are no new failures.AI-assisted (Claude Code). Synthetic tests only.
@dcastell1 on GitHub · 2026-11-24 23:41 UTC · original
Verified on native Windows (no Wine): NVIDIA GeForce RTX 5090 (driver 621.24), Windows 11 10.0.26300, Rust 1.98.1, MSVC 14.44.35207, debug build.
main@ffe310ebaseline on this box: 342 passed, 0 failed, 6 ignored.Same count as the baseline: reading a VALU opcode's name without a heap allocation is exercised by existing coverage and nothing regresses.
Tree restored afterwards; no game data. AI-assisted (opencode).
@Marvisak on GitHub · 2026-11-25 06:32 UTC · original
Automated triage for the maintainers.
Merge candidate.
valu_dwordsincrates/victory-shader/src/gfx10/fields.rsused to collectname.split('_')into aVecfor every VALU instruction decoded. It now matches the first five pieces of the iterator directly. I checked that it is equivalent.(Some(_), Some("cvt"), Some(dst), Some(src), None)is exactly the oldparts.len() == 4 && parts[1] == "cvt". The fallbackrsplit('_').next()is the oldparts.last(), and the explicit arms above are unchanged. This removes a heap allocation from the decode path, with no behaviour change.As with #1833, a translation-time measurement would show the saving, but the change is safe either way.
CI: no check runs on the head commit.
Generated by Claude Code
@sinan-cmyk on GitHub · 2026-11-25 12:19 UTC · original
Offline measurement on a retail dump
Result: no count change against
main.I merged head
3f20c559ontomain940d32f(clean merge) and ranvictory translate --validate --listonshaders.rpf(1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result withmainprogram by program (25,889 programs). Validated: 23,918 onmain, 23,918 with this PR.No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right.
No shader names or data are included, per the asset policy. AI-assisted (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.