Repository navigation
Shaders: read a VALU opcode's name without a heap vector - #1834
slatefield wants to merge 1 commit into
Conversation
valu_dwords split the name into a Vec of pieces for every VALU instruction only to ask whether it is v_cvt_<dst>_<src>, and fields() runs once per instruction. Peek at the five pieces in place (and take the last one with rsplit for the fallback) instead. The fields walk is 8.9-9.3% faster on 12k-24k instruction programs; with the members() change the IR build is 5.0% faster.
|
NVIDIA run: RTX 3070 8 GB, driver 616.56, plus WARP, Windows 11, debug, AI-assisted (Claude Code). Synthetic tests only. |
|
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. 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). |
catminou4
left a comment
There was a problem hiding this comment.
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.
Translation speed (compile-storm CPU): Marvisak#1623 inline instruction words (decode -18..-45%), Marvisak#1834 VALU names without heap vector, Marvisak#1833 live-set bit walk, Marvisak#1802 relative shift bounds, Marvisak#1824 dx.op declarations once. Per-draw/per-list CPU: Marvisak#1825 view-stride table once per list, Marvisak#1826 object names only where logged, Marvisak#1800 capped-heap log spam once per 64Ki. Tooling: Marvisak#1809 list pipeline keys without cache init. Locking: Marvisak#1680 pipeline library loads without the global mutex. Held: Marvisak#1819 (2^20->2^14 loop bound) breaks transcendental convergence tests (sin/cos/exp/sqrt) — accuracy-lowering, rejected per policy.
|
Automated triage for the maintainers. Merge candidate. 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 |
Offline measurement on a retail dumpResult: no count change against I merged head 3f20c55 onto 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). |
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.