Recompiler: skip VGPR scans without relative indexing #1539
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!1539
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1539"
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?
@philip-roy-jones on GitHub · 2026-11-24 17:24 UTC · original
philip-roy-jones:recompiler-skip-unused-vgpr-scan→main· +25 −9 · 3 files · 1 commits · openPart of #1269. Only vector moves and swaps indexed through M0 need the highest VGPR number used by a shader. The translator was enumerating every register operand to find it, including for the 48 of 54 sampled programs that used only fixed vector registers.
What is in it
Tested
08db8020d323bf478964fcc586152cce54959cfc. The published head is88452400fe19f2cb2a03b73ac82fb98e80cc083c.git range-diffmarks the old and new patches equivalent. Windows 11 Pro 25H2 (26200.9974), Ryzen 7 7700X, Radeon RX 580 (31.0.21925.1001), Rust 1.100.0 MSVC, DXC/validator 1.9.2609.5.cargo build --locked --workspace,cargo build --locked --release -p xclandcargo test --locked --workspace --no-runpassed on both.xcl-gpu run cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --show-outputexited 101 on both revisions. The RX 580 driver (amdxc64.dll) ended the library process at0xc0000005. The remaining workspace targets ran, and the full library inventory was rerun in matching four-thread batches with the crashing case isolated. Main totaled 1,342 passed, 86 failed, 47 ignored, 1 process crash and the PR 1,342 passed, 87 failed, 47 ignored, 1 process crash. 67 distinct explicit skips are included in each pass total. Both crashed ongpu::dxil::lanes::ps_ballot_tests::gpu_direct_ps_masks_hold_helper_lanes_on_triangle_edges. The extra head failure washle::d3d12x::list_x::tests::a_dispatch_with_a_pipeline_still_building_waits_at_the_submit(407 command-list segments, expected 421). It passed in three isolated runs and three repeats of its original four-thread test group on each revision..\scripts\test.ps1 --skip test_title_runs_and_game_folder_is_untouchedsuccessfully. Main reported 1,428 passed and the PR 1,429 passed, each with 0 failed, 47 ignored, 1 filtered and 211 distinct explicit skip names. PR job · Main jobFocused RX 580 command
All 67 explicit RX 580 skip names on this main and head
Previous verification on `5773e5bb` against `
50a9fdef`5773e5bb08c3e230a9f2e4686db6ad261ed45cc9against mergedmainat50a9fdef81cb796b8756a31defb0648301d002ce. Windows 11 Pro 25H2 build 26200.9974, Ryzen 7 7700X, Radeon RX 580 (31.0.21925.1001), Rust 1.100.0 MSVC, DXC/validator 1.9.2609.5.cargo build --locked --workspace(debug) andcargo build --locked --release -p xclpassed on both.xcl-gpu run cargo test --locked -p xcl --lib -- <filters> --test-threads=1 --nocapture, the four original VGPR tests and two upstream tests (compute_globallycoherent_only_when_needed,gpu_ps_readfirstlane_loop_on_a_primitive_edge_ends) all passed on RX 580, zero skipped. Release builds emitted byte-identical HLSL for 36 fixtures covering fixed registers, all five indexed opcodes, late high reads and writes, and native wave32, native wave64 and split wave64 (1,930,662 bytes).xcl-gpu run cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --show-outputreported 1,170 passed, 119 failed, 46 ignored on main and 1,171 passed, 119 failed, 46 ignored on the head. Both returned 101 with the same 119 failures and 78 distinct RX 580/runtime skips included in the pass totals. 110 failures on each revision reported device suspension (0x887A0005).xcl-gpu run .\scripts\test.ps1 --skip test_title_runs_and_game_folder_is_untouchedstopped in the library on both revisions with WARP and Windows SDK DXC 1.8.2502.11. The testgpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barriercounted three group barriers and expected one. Main reported 1,219 passed and the head 1,220 passed, with one failure and 26 ignored on each.lower_dxil.rs:1155. PR job · Merged main jobAll 78 tests that printed SKIPPED on the RX 580 (both revisions)
Measurements and independent reports from the original PR revision
ab24c38aa5db171c10a697d5292a78852f93b18dagainstmainat9e3831e. Radeon RX 580 (31.0.21925.1001), Ryzen 7 7700X, Windows 11 Pro 26200.9974, Rust 1.100.0 MSVC and DXC 1.9.2609.5.recomp::translateon 54 retail VS/PS/CS programs (28,379 instructions, four memory windows). Median time per batch went from 86.63 to 83.84 ms (3.2% less). Each build ran 36 timed batches across four processes, after warmup. Selection used the first six distinct, translatable programs per stage in each native-code size band of 64–511, 512–4095 and 4096–16383 bytes. A separate allocator-counting build recorded 29,369 fewer allocations/reallocations per batch. All 7,571,624 HLSL bytes matched, including on the six programs using relative indexing. Six coldconsole_to_dxil_inbuilds also produced byte-identical DXIL. Timing covers RDNA2-to-HLSL translation.cargo test -p xcl --lib -- relative_vgpr_limit_is_only_needed_for_indexed_vector_registers v_swaprel_b32_uses_the_m0_relative_switch gpu_v_swaprel_b32 gpu_packed_math_dots_movrel --test-threads=1 --nocapturereported 4 passed, 0 failed, 0 ignored, 0 skipped. The new regression failed with the unconditional scan onb7aa9f3.cargo build --workspacesucceeded on both.cargo test --workspace --no-fail-fast -- --test-threads=4lost the library test process on both. Running the remaining cases completed the inventory. Main reported 754 passing, the PR 755. Both had 21 failures, 1 process crash and 41 ignored. The same 22 cases were unsuccessful, and three reported passes on each were hardware skips (two mesh, one heap windows)..\scripts\test.ps1 --skip test_title_runs_and_game_folder_is_untouchedpassed locally with WARP and Windows SDK DXC 1.8.2502.11. It reported 776 passed (215 explicit skips), 0 failed, 41 ignored and 1 filtered.ab24c38on an RTX 3090 and checked the five relative-indexing opcodes and the two uses ofmax_vgpr. Independent RTX 3090 test reportab24c38on AMD integrated graphics. Cargo reported 777 passes (one hardware skip), 0 failures and 41 ignored. All 18 native-wave64 dispatches produced the expected register values. AMD test reportmainon an RTX 3060 Ti. The library suite passed single-threaded. They saw the same intermittent parallel failure on unmodifiedmain. The report gives no merge SHA or test name. RTX 3060 Ti reportRegression run
xcl-gpu run .\scripts\smoke.ps1 -Game <retail folder> -Title Retail -Seconds 60 -Xcl .\target\release\xcl.exe -OutDir <run directory>. All 60-second runs used the source-built offline release loader, the same title and RX 580, fresh title data, no input and the HLSL path. Both arms setXCL_DXC_THREADS=1and disabled async PSOs, PSO preload, the translated-shader cache and the PSO disk cache.The first pair ran the head first from matching copies of the previous 1,044-entry DXIL cache. Main showed 448 frames at 11,057 MB peak and the head showed 14 at 10,662 MB, with 0/0 device removals and 0/0 crashes (main/head). A main-first repeat reset both arms to the same initial cache. Main showed 381 frames at 10,945 MB and the head showed 58 at 10,724 MB, with 0/0 removals and 0/0 crashes. The head fell below 80% of main’s frames in both orders from this seed. The cause of the startup delay remains open.
Both revised builds populated new cache entries during the first pair. The blocks below use two byte-verified copies of main’s resulting 1,928-entry cache. All 823 entries newly produced by both first runs matched byte for byte.
Main
PR head
Previous smoke on `
50a9fdef` and `5773e5bb`, including the default-worker memory and device failuresxcl-gpu run .\scripts\smoke.ps1 -Game <retail folder> -Title Retail -Seconds 60 -Xcl .\target\release\xcl.exe. All runs used clean release builds, the RX 580, no network or input, fresh title data, and the HLSL path withXCL_ASYNC_PSO=0,XCL_PSO_PRELOAD=0,XCL_TRANSLATED_CACHE=0andXCL_PSO_DISK_CACHE=0.With the default compiler worker count and 952 identical initial DXIL cache entries, main showed 1,636 frames at 16,597 MB peak and head showed 1,651 at 22,980 MB. Both exited cleanly, but the head exceeded the 125% memory limit. All 74 new cache entries produced by both runs matched byte for byte. Repeating in reverse order from identical copies of their combined 1,044-entry cache produced the same driver error (
0x887a0020) on both revisions, at 46.6 s on the head and 59.0 s on main.The runs below started from that same 1,044-entry cache with
XCL_DXC_THREADS=1on both revisions to limit concurrent compiler work.Main
PR head
Not tested
XCL_SAMPLE_*variables were unset for the workspace suite. The retail translation timings above were measured on the original revision.AI use
gpt-6.2-astra) at maximum reasoning effort (max) to write the change and regression test, run the comparisons and prepare this PR.gpt-6.2-astra) resolved the rebase, reviewed the full diff on Philip’s behalf, ran the checks and updated the description. The dispatch did not expose its reasoning effort.gpt-6.2-astra) at maximum reasoning effort (max), rebased the existing commit after #2420, reviewed the full diff on Philip’s behalf, ran the comparisons and updated the evidence.@MatyEjsr on GitHub · 2026-11-24 17:45 UTC · original
Verified PR #1539 at head
ab24c38aa5db171c10a697d5292a78852f93b18d(base9e3831e) on SM 6.6 NVIDIA hardware to provide a clean full-GPU workspace test run.Tested
stable-x86_64-pc-windows-msvc), debug build, DXCdxcompiler 1.9.2602.17 (21d28f72)/dxil 1.9.2602.17(Windows SDK 10.0.26100.0).cargo build --workspace -j 8: passed in 6.08s (no new warnings).cargo test --workspace -j 8 -- --test-threads=8: 774 executed passed, 3SKIPPED(777 reportedokby cargo), 0 failed, 41 ignored (xcllib finished in 13.94s).SKIPPED gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64SKIPPED gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64SKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windowscargo test -p xcl --lib -- relative_vgpr_limit_is_only_needed_for_indexed_vector_registers v_swaprel_b32_uses_the_m0_relative_switch gpu_v_swaprel_b32 gpu_packed_math_dots_movrel --test-threads=1 --nocapture: 4 passed, 0 failed, 0 ignored, 0SKIPPED(0.25s).Em::max_vgprhas no consumers outsideEm::movrelandEm::swaprel, andrelative_vgpr_limitmatches all fiveV_*REL*instructions inrdna2_spec.rs(V_MOVRELD_B32,V_MOVRELS_B32,V_MOVRELSD_B32,V_MOVRELSD_2_B32,V_SWAPREL_B32).Not tested
XCL_SAMPLE_*tests (unset).AI use
max_vgprconsumers, ran the workspace build and GPU test suite on RTX 3090, and drafted this verification report.@nnonno91 on GitHub · 2026-11-24 18:20 UTC · original
Independent native-wave64 AMD check of
ab24c38aa5db171c10a697d5292a78852f93b18d.Tested
cargo build --workspace --lockedpassed.cargo test --locked -p xcl --lib -- relative_vgpr_limit_is_only_needed_for_indexed_vector_registers v_swaprel_b32 gpu_packed_math_dots_movrel --test-threads=1 --nocapturepassed all four tests with zero skips.cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --show-outputreported 777 passed, 0 failed, and 41 ignored. One reported GPU skip (heap_window_out_of_memory_falls_back_to_the_switch_form, no heap windows). The bundled title passed.cargo test --locked -p xcl --test relative_vgpr_probe -- --exact indexed_registers_preserve_high_operands --nocapture --test-threads=1, generated a fixedV_MOV_B32control plus all five indexed move/swap variants. Every program referencedv61after the instruction under test. All 18 HLSL pairs matched byte for byte on base9e3831e1f570d3646e53ab753b19ec07eb8f1485and the PR across wave32, native wave64 and split wave64.M0settings. The checks compared the written registers against expected values on all 64 lanes, including indexed reads, writes, and swaps targetingv61. All 18 dispatches matched.Not tested
Retail shaders, retail title runs, release builds, and translation timings. The output comparison used six synthetic programs.
AI use
OpenAI Codex (GPT-6 family, exact variant unavailable) wrote the temporary probe, ran the checks, and drafted this report.
@DavidM1911 on GitHub · 2026-11-24 19:12 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@DavidM1911 on GitHub · 2026-11-26 05:40 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: 1 failure under parallel scheduling; clean on--test-threads=1rerun (1305 passed, 0 failed, 27 ignored, 81s). Intermittent single-test flake — tracked in #1978.Thanks!
— Devin
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.