Recompiler: format instruction operands without a temporary vector #1602
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1602
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1602"
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?
@pmilewsskiedu-gif on GitHub · 2026-11-24 18:08 UTC · original
pmilewsskiedu-gif:perf/format-operand-1269→main· +7 −4 · 1 files · 1 commits · openPart of #1269.
rdna2::formatformats every decoded instruction for disassembly and HLSL source comments. It previously collected all displayed operands into a temporaryVec<String>and joined them. This patch appends each operand directly to the existing output string, avoiding that vector allocation while preserving formatting and operand order.What is in it
crates/xcl/src/gpu/rdna2.rs: replace the temporary operand vector and join with direct appends; one small function, no new dependencies.Tested
cargo test -p xcl --lib gpu::rdna2::tests -- --test-threads=4: 9 passed, 0 failed, including LLVM gfx10 disassembly corpus.cargo build --workspacethencargo test --workspace -- --test-threads=4: 776 passed, 0 failed, 41 ignored. Three GPU tests explicitly SKIPPED for unavailable native wave64 (2) or heap windows (1).xcl shaders <local pack> --recomp --top 0): 26,698 shader programs and 44,422,713 decoded instructions. Main9e3831e: 118.4/117.4 s; PR5a976f8: 112.7/112.1 s (4.7% lower mean CLI scan time). Both translate all programs, zero errors, report 9,665.7 MB generated HLSL, with identical aggregate output except timing. Time does not measure DXC or driver pipeline compilation.Additional ABBA scan (Nov 24, follow-up)
--recomp --top 0full-pack scans on the same baseline/patch commits, alternating base / patch / patch / base: main 113.322 / 115.626 s; PR 116.163 / 112.008 s wall time. Each completed 26,698 programs, zero errors and the same aggregate outputs. Means: 114.474 vs 114.086 s (0.34% lower), smaller than run-to-run variation. This does not reliably reproduce the initial 4.7% result; treat the translation-speed benefit as uncertain until further controlled measurements.Regression run
The following latest matched pair uses the same temporary
xcl.exepath, working directory, title, and 60-second window, swapping the two release binaries sequentially and verifying SHA-256 after copying each. The repository's checker can compare these two directly. The other observed smoke results, including less favorable results, are disclosed in the table below.All other 60-second smoke runs (same title, RTX 4060 Ti; all exited 0 with zero crashes and device removals):
Executable location and cache state appear to matter substantially: the unmodified main also enters high-memory and stalled-presentation states when run from the shared location. Even under the same path, results vary strongly in both directions. The most recent matched pair meets the repository's 80% frame / 125% commit thresholds but does not establish a title runtime FPS or memory gain. The measured benefit is shader-translation scan speed.
Not tested
AMD/Intel GPUs, prolonged gameplay, controlled cold driver-cache comparisons, byte-by-byte HLSL comparison of all retail programs (decoder/disassembler corpus and full aggregate translation checks passed). Root cause of the high-memory title states is not established.
AI use
ChatGPT (GPT-6) through Chat On Steroids Core implemented the change, ran tests, full-pack scans and smoke comparisons, and wrote this description.
@DavidM1911 on GitHub · 2026-11-24 20:21 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored. (Intermittent 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
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.