Shaders: read a VALU opcode's name without a heap vector #1832
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from Marvisak/VIctory. Originally posted by slatefield on 2026-11-24T23:08:50Z.
valu_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.
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T23:52:14Z.
Review: APPROVED
Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (
70564ae), cargo test -p victory-shader --locked → 118 passed, 0 failed. GPU execution tests are #[cfg(all(test, windows))] and run only on Windows.VALU opcode name read without a heap vector: removes an allocation from opcode-name lookup — small perf fix.
Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-24T23:15:23Z.
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.
Imported from Marvisak/VIctory. Originally posted by dcastell1 on 2026-11-24T23:41:59Z.
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).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T06:32:54Z.
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
upstream-sync referenced this pull request2026-11-25 09:06:13 +00:00
Imported from Marvisak/VIctory. Originally posted by sinan-cmyk on 2026-11-25T12:19:18Z.
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).
upstream-sync referenced this pull request2026-11-25 13:03:01 +00:00
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T19:29:50Z.
Review: APPROVED
Verified locally merged onto
origin/main(63bcca43, Windows 11 x64, Rust 1.98.1 MSVC):cargo test --locked -p victory-shader --lib gfx10::— 16 passed, 0 failedcargo clippy --locked -p victory-shader --all-targets -- -D warnings(default and--all-features) — 0 warningsrustfmt --edition 2024 --check crates/victory-shader/src/gfx10/fields.rs— cleancargo xtask policy— ok (191 files ok)Review notes
valu_dwordsacross all 465 VALU opcodes ingfx10/opcodes.rsas well as >5-segment and malformed edge inputs: matching 4-segment_cvt_via 5.next()calls and falling back toname.rsplit('_').next()reproduces the priorVec<&str>behavior without heap allocation.Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-27T00:08:59Z.
Review: APPROVED
LGTM — verified on Windows against
origin/main(63bcca4).gfx10::fieldstests.cargo test -p victory-shader --lib gfx10::fields:: -- --test-threads=1: all passed.cargo clippy -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.