Skip to content

Recompiler: skip VGPR scans without relative indexing - #1539

Open
philip-roy-jones wants to merge 1 commit into
xcl-dev:mainfrom
philip-roy-jones:recompiler-skip-unused-vgpr-scan
Open

philip-roy-jones wants to merge 1 commit into
xcl-dev:mainfrom
philip-roy-jones:recompiler-skip-unused-vgpr-scan

Conversation

@philip-roy-jones

@philip-roy-jones philip-roy-jones commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Part 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

  • Skip that scan when none of the five indexed opcodes is present. The regression checks all five, including a register referenced later in the shader.

Tested

  • Rebased Philip’s single commit onto green merged main 08db8020d323bf478964fcc586152cce54959cfc. The published head is 88452400fe19f2cb2a03b73ac82fb98e80cc083c. git range-diff marks 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 xcl and cargo test --locked --workspace --no-run passed on both.
  • All six focused VGPR and upstream checks passed on the head with zero skips. The repaired barrier test from Tests: check divergent block barriers in a_bridged_mask_write #2420 passed its DXIL assertion on both revisions, then skipped its wave32 dispatch on the RX 580. The release emitter produced byte-identical HLSL for all 36 fixed/indexed-register, late-read/write and wave-mode fixtures (1,949,274 bytes).
  • xcl-gpu run cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --show-output exited 101 on both revisions. The RX 580 driver (amdxc64.dll) ended the library process at 0xc0000005. 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 on gpu::dxil::lanes::ps_ballot_tests::gpu_direct_ps_masks_hold_helper_lanes_on_triangle_edges. The extra head failure was hle::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.
  • Hosted Windows built and ran .\scripts\test.ps1 --skip test_title_runs_and_game_folder_is_untouched successfully. 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 job
Focused RX 580 command
xcl-gpu run cargo test --locked -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 compute_globallycoherent_only_when_needed gpu_ps_readfirstlane_loop_on_a_primitive_edge_ends a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier --test-threads=1 --nocapture
All 67 explicit RX 580 skip names on this main and head
gpu::dxil::core_tests::s_setreg_b32_mode_bit3_does_not_underflow
gpu::dxil::geometry_tests::gpu_geometry_direct_records
gpu::dxil::graphics::tests::emitted_ms_primitive_attribute_reaches_the_pixel_shader
gpu::dxil::graphics::tests::emitted_ms_ps_draw_a_triangle
gpu::dxil::lower::saveexec_tests::gpu_direct_wave32_saveexec_and_wrexec
gpu::dxil::lower_wide::rcp_d_tests::gpu_direct_rcp_f64_and_rsq_f64_edges
gpu::dxil::module::split::tests::dispatch_chain_divergent_forward_edges_3d
gpu::dxil::module::split::tests::dispatch_chain_oversized_loop_matches_whole
gpu::dxil::module::split::tests::dispatch_chain_payload_skips_middle_piece
gpu::dxil::module::split::tests::dispatch_chain_payload_survives_reused_edge_slot
gpu::dxil::module::split::tests::dispatch_chain_wave32_live_loops
gpu::dxil::module::split::tests::dispatch_chain_wave64_live_loops_and_exchange
gpu::dxil::ops_tests::approximate_float_unary_ops_are_within_tolerance
gpu::dxil::ops_tests::bfrev_i64_of_a_uniform_product_matches_cpu
gpu::dxil::ops_tests::derivatives_in_compute_run
gpu::dxil::ops_tests::dot4_add_u8_packed_matches_cpu
gpu::dxil::ops_tests::doubles_match_cpu
gpu::dxil::ops_tests::exact_float_unary_ops_match_cpu
gpu::dxil::ops_tests::float_binary_tertiary_and_half_conversions_match_cpu
gpu::dxil::ops_tests::groupshared_barrier_and_atomics_run
gpu::dxil::ops_tests::half_precision_overloads_run
gpu::dxil::ops_tests::i1_to_i64_sign_extension_and_shift_match_cpu
gpu::dxil::ops_tests::int64_bit_ops_match_cpu
gpu::dxil::ops_tests::integer_ops_match_cpu
gpu::dxil::ops_tests::raw_and_structured_buffer_atomics_run
gpu::dxil::ops_tests::texture_ops_run
gpu::dxil::ops_tests::typed_buffer_ops_run
gpu::dxil::ops_tests::uaddc_and_usubb_match_cpu
gpu::dxil::ops_tests::uav_array_3d_stores_loads_and_texture_atomics_run
gpu::dxil::ops_tests::wave_ops_match_cpu
gpu::dxil::prelude::fclass_const_tests::gpu_direct_v_cmp_class_f32_const_mask_validates_and_matches_isa
gpu::dxil::tests::blocks_are_written_in_reverse_post_order
gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu
gpu::recomp::lower::tests::a_compute_program_agrees_with_the_hlsl_path_on_the_gpu
gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu
gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu
gpu::recomp::lower::tests::the_lowering_agrees_with_the_hlsl_path_on_the_gpu
gpu::recomp::lower::tests::the_split_form_agrees_with_the_wave64_lowering_on_the_gpu
gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu
gpu::recomp::lower_dxil::tests::a_branch_on_a_mixed_mask_matches_the_hlsl_path_on_the_gpu
gpu::recomp::lower_dxil::tests::a_bridged_instruction_may_write_to_the_entry_block
gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier
gpu::recomp::lower_dxil::tests::a_bridged_v_cmpx_keeps_the_lanes_outside_exec_out
gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu
gpu::recomp::lower_dxil::tests::a_per_lane_compute_program_runs_on_the_gpu
gpu::recomp::lower_dxil::tests::a_per_lane_program_with_four_memory_windows_runs_on_the_gpu
gpu::recomp::lower_dxil::tests::coalesced_foreign_runs_agree_on_the_gpu
gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu
gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu
gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu
gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu
gpu::recomp::lower_dxil::tests::gpu_frexp_exp_f32_denorm_per_lane
gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu
gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu
gpu::recomp::lower_dxil::tests::native_wave_branches_on_the_gpu
gpu::recomp::lower_dxil::tests::per_lane_kernels_run_on_the_gpu
gpu::recomp::lower_dxil::tests::split_wave64_dead_scc_skips_exchange_barrier
gpu::recomp::lower_dxil::tests::split_wave64_wave_branches_on_the_gpu
gpu::recomp::lower_dxil::tests::the_runtime_path_takes_the_split_form
gpu::recomp::tests::gpu_geometry_mode_es_gs_strip
gpu::recomp::tests::gpu_geometry_mode_es_gs_strip_with_branches
gpu::recomp::tests::gpu_mesh_mode_two_passes
heap_window_out_of_memory_falls_back_to_the_switch_form
hle::d3d12x::real::passthrough_mesh_stream_accepts_a_triangle_driver_blob
offline_split_compute_pipeline_is_reused_by_a_second_process
placed_title_textures_share_vram_and_preserve_pixels
shaders::tests::pso_measurement_compiles_an_exact_synthetic_record
Previous verification on `5773e5bb` against `50a9fdef`
  • Rebased head 5773e5bb08c3e230a9f2e4686db6ad261ed45cc9 against merged main at 50a9fdef81cb796b8756a31defb0648301d002ce. 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) and cargo build --locked --release -p xcl passed on both.
  • With 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-output reported 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).
  • On the software adapter, xcl-gpu run .\scripts\test.ps1 --skip test_title_runs_and_game_folder_is_untouched stopped in the library on both revisions with WARP and Windows SDK DXC 1.8.2502.11. The test gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier counted 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.
  • Hosted Windows CI ran on both revisions. Its sole library failure was the same three-versus-one group-barrier assertion at lower_dxil.rs:1155. PR job · Merged main job
All 78 tests that printed SKIPPED on the RX 580 (both revisions)
a_placed_texture_gets_the_pages_of_a_level_with_its_texels
gpu::dxil::core_tests::s_setreg_b32_mode_bit3_does_not_underflow
gpu::dxil::geometry_tests::gpu_geometry_direct_records
gpu::dxil::graphics::tests::emitted_ms_primitive_attribute_reaches_the_pixel_shader
gpu::dxil::graphics::tests::emitted_ms_ps_draw_a_triangle
gpu::dxil::lower_wide::rcp_d_tests::gpu_direct_rcp_f64_and_rsq_f64_edges
gpu::dxil::module::split::tests::dispatch_chain_divergent_forward_edges_3d
gpu::dxil::module::split::tests::dispatch_chain_oversized_loop_matches_whole
gpu::dxil::module::split::tests::dispatch_chain_payload_skips_middle_piece
gpu::dxil::module::split::tests::dispatch_chain_payload_survives_reused_edge_slot
gpu::dxil::module::split::tests::dispatch_chain_wave32_live_loops
gpu::dxil::module::split::tests::dispatch_chain_wave64_live_loops_and_exchange
gpu::dxil::ops_tests::approximate_float_unary_ops_are_within_tolerance
gpu::dxil::ops_tests::derivatives_in_compute_run
gpu::dxil::ops_tests::doubles_match_cpu
gpu::dxil::ops_tests::exact_float_unary_ops_match_cpu
gpu::dxil::ops_tests::float_binary_tertiary_and_half_conversions_match_cpu
gpu::dxil::ops_tests::groupshared_barrier_and_atomics_run
gpu::dxil::ops_tests::half_precision_overloads_run
gpu::dxil::ops_tests::int64_bit_ops_match_cpu
gpu::dxil::ops_tests::integer_ops_match_cpu
gpu::dxil::ops_tests::raw_and_structured_buffer_atomics_run
gpu::dxil::ops_tests::texture_ops_run
gpu::dxil::ops_tests::typed_buffer_ops_run
gpu::dxil::ops_tests::uaddc_and_usubb_match_cpu
gpu::dxil::ops_tests::uav_array_3d_stores_loads_and_texture_atomics_run
gpu::dxil::ops_tests::wave_ops_match_cpu
gpu::dxil::tests::blocks_are_written_in_reverse_post_order
gpu::recomp::heap_window_tests::gpu_raw_window_view_reaches_its_top
gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu
gpu::recomp::lower::tests::a_compute_program_agrees_with_the_hlsl_path_on_the_gpu
gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu
gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu
gpu::recomp::lower::tests::the_lowering_agrees_with_the_hlsl_path_on_the_gpu
gpu::recomp::lower::tests::the_split_form_agrees_with_the_wave64_lowering_on_the_gpu
gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu
gpu::recomp::lower_dxil::tests::a_branch_on_a_mixed_mask_matches_the_hlsl_path_on_the_gpu
gpu::recomp::lower_dxil::tests::a_bridged_instruction_may_write_to_the_entry_block
gpu::recomp::lower_dxil::tests::a_bridged_v_cmpx_keeps_the_lanes_outside_exec_out
gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu
gpu::recomp::lower_dxil::tests::a_per_lane_compute_program_runs_on_the_gpu
gpu::recomp::lower_dxil::tests::a_per_lane_program_with_four_memory_windows_runs_on_the_gpu
gpu::recomp::lower_dxil::tests::coalesced_foreign_runs_agree_on_the_gpu
gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu
gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu
gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu
gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu
gpu::recomp::lower_dxil::tests::gpu_frexp_exp_f32_denorm_per_lane
gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu
gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu
gpu::recomp::lower_dxil::tests::native_wave_branches_on_the_gpu
gpu::recomp::lower_dxil::tests::per_lane_kernels_run_on_the_gpu
gpu::recomp::lower_dxil::tests::split_wave64_dead_scc_skips_exchange_barrier
gpu::recomp::lower_dxil::tests::split_wave64_wave_branches_on_the_gpu
gpu::recomp::lower_dxil::tests::the_runtime_path_takes_the_split_form
gpu::recomp::tests::gpu_geometry_mode_es_gs_strip
gpu::recomp::tests::gpu_geometry_mode_es_gs_strip_with_branches
gpu::recomp::tests::gpu_mesh_mode_two_passes
gpu::texture::tests::gpu_console_textures_upload_every_mip_and_slice
gpu::texture::tests::gpu_large_mixed_upload_keeps_tight_staging_and_exact_pixels
gpu::texture::tests::gpu_upload_batches_reuse_the_queues_upload_buffer
heap_window_out_of_memory_falls_back_to_the_switch_form
hle::d3d12x::alloc_pool::tests::a_recording_outlives_the_reset_of_the_titles_allocator
hle::d3d12x::alloc_pool::tests::a_resubmit_while_the_previous_submit_runs_is_noticed
hle::d3d12x::bind::tests::execute_indirect_reads_the_arguments_written_before_it
hle::d3d12x::console_heap::tests::the_shaders_t_sharp_index_bound_fits_the_shared_heap
hle::d3d12x::device_x::tests::gpu_depth_buffer_created_for_unordered_access_is_placed
hle::d3d12x::late_release::tests::a_held_resource_goes_when_the_queue_is_past_its_batch
hle::d3d12x::list_x::tests::a_new_list_takes_no_copy_scratch_of_an_earlier_one
hle::d3d12x::list_x::tests::a_reset_while_the_last_submit_runs_records_on_another_pc_list
hle::d3d12x::list_x::tests::an_internal_wait_is_listed_until_its_fence_reaches_the_value
hle::d3d12x::list_x::tests::copy_scratch_budget_counts_resources_until_gpu_completion
hle::d3d12x::real::console_format_query_tests::gpu_placed_console_depth_target_with_clear_value
hle::d3d12x::shader_cache_session::tests::rejected_create_shader_cache_session_falls_back_to_working_in_memory_session
placed_title_textures_share_vram_and_preserve_pixels
shaders::pipeline_cap_tests::stale_blob_cannot_bypass_the_offline_pipeline_cap
shaders::tests::pso_measurement_compiles_an_exact_synthetic_record
test_title_draws_with_a_root_signature_under_the_debug_layer
Measurements and independent reports from the original PR revision
  • ab24c38aa5db171c10a697d5292a78852f93b18d against main at 9e3831e. 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.
  • Release recomp::translate on 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 cold console_to_dxil_in builds 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 --nocapture reported 4 passed, 0 failed, 0 ignored, 0 skipped. The new regression failed with the unconditional scan on b7aa9f3.
  • cargo build --workspace succeeded on both. cargo test --workspace --no-fail-fast -- --test-threads=4 lost 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).
  • The Windows CI command .\scripts\test.ps1 --skip test_title_runs_and_game_folder_is_untouched passed 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.
  • MatyEjsr tested ab24c38 on an RTX 3090 and checked the five relative-indexing opcodes and the two uses of max_vgpr. Independent RTX 3090 test report
  • nnonno91 tested ab24c38 on 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 report
  • DavidM1911 tested a local merge with upstream main on an RTX 3060 Ti. The library suite passed single-threaded. They saw the same intermittent parallel failure on unmodified main. The report gives no merge SHA or test name. RTX 3060 Ti report

Regression 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 set XCL_DXC_THREADS=1 and 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

xcl-smoke v1
commit: 08db8020d323bf478964fcc586152cce54959cfc
gpu: Radeon RX 580 Series
title: Retail
seconds: 60
exit: 0x0
frames shown: 1494 (PresentX 1494)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 11318 MB

PR head

xcl-smoke v1
commit: 88452400fe19f2cb2a03b73ac82fb98e80cc083c
gpu: Radeon RX 580 Series
title: Retail
seconds: 60
exit: 0x0
frames shown: 1541 (PresentX 1541)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 11314 MB
Previous smoke on `50a9fdef` and `5773e5bb`, including the default-worker memory and device failures

xcl-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 with XCL_ASYNC_PSO=0, XCL_PSO_PRELOAD=0, XCL_TRANSLATED_CACHE=0 and XCL_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=1 on both revisions to limit concurrent compiler work.

Main

xcl-smoke v1
commit: 50a9fdef81cb796b8756a31defb0648301d002ce
gpu: Radeon RX 580 Series
title: Retail
seconds: 60
exit: 0x0
frames shown: 1597 (PresentX 1597)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 11602 MB

PR head

xcl-smoke v1
commit: 5773e5bb08c3e230a9f2e4686db6ad261ed45cc9
gpu: Radeon RX 580 Series
title: Retail
seconds: 60
exit: 0x0
frames shown: 1592 (PresentX 1592)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 11600 MB

Not tested

  • Our local runs did not cover gameplay, asynchronous pipeline creation or hardware mesh execution. Optional XCL_SAMPLE_* variables were unset for the workspace suite. The retail translation timings above were measured on the original revision.
  • The current retail runs cover startup and presentation. They do not identify a retail invocation of one of the five indexed opcodes. The repaired barrier’s wave32 hardware assertions were skipped locally. The original 54-program timing was not repeated on this revision.

AI use

  • OpenAI Codex used GPT-6.2 Astra (gpt-6.2-astra) at maximum reasoning effort (max) to write the change and regression test, run the comparisons and prepare this PR.
  • OpenAI Codex in Orca with GPT-6.2 Astra (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.
  • OpenAI Codex in Orca, GPT-6.2 Astra (gpt-6.2-astra) at maximum reasoning effort (max), rebased the existing commit after Tests: check divergent block barriers in a_bridged_mask_write #2420, reviewed the full diff on Philip’s behalf, ran the comparisons and updated the evidence.

@MatyEjsr

MatyEjsr commented Nov 24, 2026 •

Copy link
Copy Markdown

Updated NVIDIA check for the new head 88452400fe19f2cb2a03b73ac82fb98e80cc083c (base 08db802). It replaces my earlier report on ab24c38. git range-diff shows the same patch; only the hunk context in recomp/mod.rs moved. The earlier report raised no defects, so there was nothing to re-check. Reports by others on ab24c38: nnonno91 ran the four targeted tests with zero skips on native-wave64 AMD hardware; DavidM1911 saw one intermittent failure under parallel scheduling on the new head, clean at --test-threads=1 and tracked in #1978. I saw no such failure at 8 threads. I did not re-run the AMD check on this head; the patch is the same per range-diff.

Tested

  • Windows 11 Pro for Workstations (26200), Ryzen 7 7800X3D, RTX 3090 24 GB (driver 617.42), 31.4 GB RAM, Rust 1.100.0 MSVC, DXC 1.9.2602.17, Developer Mode on. Tests on a debug build.
  • Head, cargo test --workspace -j 8 -- --test-threads=8: 1430 passed, 0 failed, 47 ignored. The xcl lib alone: 1305 passed, 0 failed, 27 ignored.
  • Head merged locally into current main 8b957bec (no conflicts), same command: 1447 passed, 0 failed, 47 ignored. The lib alone: 1319 passed, 0 failed, 27 ignored. No flaky failures at 8 threads in either run.
  • SKIPPED, not counted as coverage (17 distinct tests, the same on both trees):
    • 14 wave64 GPU tests, reason no wave64: dispatch_chain_native_wave64_builds_whole, four recomp::lower GPU comparisons, seven recomp::lower_dxil program tests, gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware.
    • heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows.
    • Two debug-layer tests: e2e the title under the debug layer (no d3d12SDKLayers.dll) and uploads_start_from_each_subresources_state (no D3D12 debug layer).
  • 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 gpu_scalar_relative_moves movrel --test-threads=1: 6 passed, 0 failed, 0 SKIPPED.
  • Code check: Em::max_vgpr is still read only by Em::movrel and Em::swaprel, on this head, on current main and on nvidia-dev, so merging brings in no new reader. relative_vgpr_limit matches all five V_MOVREL* / V_SWAPREL_B32 opcodes in rdna2_spec.rs.
  • Duplicates: no candidates on the campaign board. The change is not on main or nvidia-dev, and the PR also merges cleanly into nvidia-dev (merge only, not built).

Regression run (RTX 3090, clean release builds of the PR's base and head, 60 s on the same retail title, shared DXIL cache)

Base

xcl-smoke v1
commit: 08db8020d323bf478964fcc586152cce54959cfc
gpu: NVIDIA GeForce RTX 3090
title: c1cc91a4
seconds: 60
exit: 0x0
frames shown: 1590 (PresentX 1590)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13967 MB

PR head

xcl-smoke v1
commit: 88452400fe19f2cb2a03b73ac82fb98e80cc083c
gpu: NVIDIA GeForce RTX 3090
title: c1cc91a4
seconds: 60
exit: 0x0
frames shown: 1572 (PresentX 1572)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13987 MB

Frames -1.1% and peak commit +0.1%, one run each. Both trees drew only with translated pipelines (0 skipped).

Not tested

  • AMD or native wave64 hardware (the wave64 tests above SKIPPED here), the heap-window OOM fallback, the debug-layer tests, translation-time timing, gameplay after the first 60 s, tests on the nvidia-dev merge, and XCL_SAMPLE_* tests (unset). The smoke run does not show whether the retail title uses any of the five indexed opcodes.

AI use

  • Antigravity (agy) with claude-opus-5-5-high: compared the old and new patches, re-checked the max_vgpr readers on the head, main and nvidia-dev, ran the builds, the test suites and the paired smoke runs on the RTX 3090, and wrote this report. Audited by claude-sonnet-5-5-medium, which checked the live PR head, state and mergeability and the feedback since my earlier report.

@nnonno91

Copy link
Copy Markdown

Independent native-wave64 AMD check of ab24c38aa5db171c10a697d5292a78852f93b18d.

Tested

  • Windows 11 25H2 (26200.9974), Ryzen 7 9800X3D, AMD Radeon(TM) Graphics (32.0.21042.62), Rust 1.100.0 MSVC, DXC 1.8.2502.11, debug.
  • cargo build --workspace --locked passed. 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 --nocapture passed all four tests with zero skips.
  • cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --show-output reported 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.
  • A temporary integration test, cargo test --locked -p xcl --test relative_vgpr_probe -- --exact indexed_registers_preserve_high_operands --nocapture --test-threads=1, generated a fixed V_MOV_B32 control plus all five indexed move/swap variants. Every program referenced v61 after the instruction under test. All 18 HLSL pairs matched byte for byte on base 9e3831e1f570d3646e53ab753b19ec07eb8f1485 and the PR across wave32, native wave64 and split wave64.
  • On the PR’s native wave64 output, the six programs each ran with three M0 settings. The checks compared the written registers against expected values on all 64 lanes, including indexed reads, writes, and swaps targeting v61. 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

Copy link
Copy Markdown
Contributor

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 unmodified main.)

Thanks!

Only M0-indexed vector moves and swaps need the register bound for their switch. Skip the operand scan for other programs. The regression covers all five indexed vector opcodes and a register referenced later in the program.

Assisted-by: Codex (GPT-6)
@philip-roy-jones
philip-roy-jones force-pushed the recompiler-skip-unused-vgpr-scan branch from 5773e5b to 8845240 Compare November 25, 2026 23:28
@DavidM1911

Copy link
Copy Markdown
Contributor

Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

Thanks!

— Devin

@upipibi

upipibi commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Tested head 88452400fe19f2cb2a03b73ac82fb98e80cc083c, merge-base 08db8020d323bf478964fcc586152cce54959cfc, RTX 3070 (Ampere) driver 616.56, Windows 11, rustc 1.100.0

  • cargo test -p xcl --lib -- relative_vgpr_limit_is_only_needed_for_indexed_vector_registers v_swaprel_b32 gpu_packed_math_dots_movrel --test-threads=1 --nocapture, 3 runs on head: 4 passed, 0 failed (each run), 0 skips.
  • Negative control: the PR's tests.rs hunk (the new test) applied alone to the merge-base does not compile: error[E0425]: cannot find function relative_vgpr_limitin modulesuper`` (the function is added by the PR). Without the hunk, the other 3 tests on the merge-base: 3 passed, 0 failed.
  • cargo test -p xcl --lib -- --test-threads=4: head 1305 passed, 0 failed, 27 ignored; merge-base 1304 passed, 0 failed, 27 ignored.
  • SKIPPED lines (25, identical on both): 21 "no wave64" (RTX 3070 has 32-lane waves only), 3 refused f16/conversion fixtures (gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426), 1 driver-cache test needing Windows Developer Mode.

Not tested: retail title.

AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted).

@Decodere

Copy link
Copy Markdown
Contributor

Independent desktop NVIDIA verification of PR #1539 at head 88452400fe19f2cb2a03b73ac82fb98e80cc083c (1 commit; exact parent & merge-base: 08db8020d323bf478964fcc586152cce54959cfc, pre-#2555 ancestor of main).

Environment

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12, Wave32-only Ada), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6C / 12T), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200 (Developer Mode off)
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC 1.9.2609.5, --release

Targeted release tests & build (88452400)

Command Result
cargo test --release -p xcl --lib relative_vgpr_limit_is_only_needed_for_indexed_vector_registers -- --nocapture (3 consecutive runs) 1 passed; 0 failed; 0 ignored; 1331 filtered out × 3 (0.00s × 3)
cargo test --release -p xcl --lib gpu::recomp::emit:: (3 consecutive runs) 4 passed; 0 failed; 0 ignored; 1328 filtered out × 3 (0.24s, 0.23s, 0.23s, 0 skipped)
cargo test --release -p xcl --lib gpu::recomp:: -- --test-threads=4 (3 consecutive runs) 399 passed; 0 failed; 20 ignored; 913 filtered out × 3 (6.40s, 6.41s, 6.65s; 376 executed on RTX 4060 + 23 expected Wave32-only/env skips)
cargo build --release -p xcl Clean build (1m 07s, exit 0, 0 new warnings)

Paired quiet 60 s retail smoke (title: 29640639)

Exact parent & merge-base (08db8020d323bf478964fcc586152cce54959cfc, cached baseline on the same machine):

xcl-smoke v1
commit: 08db8020d323bf478964fcc586152cce54959cfc
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1588 (PresentX 1588)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14000 MB

PR #1539 (88452400fe19f2cb2a03b73ac82fb98e80cc083c):

xcl-smoke v1
commit: 88452400fe19f2cb2a03b73ac82fb98e80cc083c
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1633 (PresentX 1633)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14011 MB

Runtime log observations (xcl.log)

  • 9223 log lines, 0 [ERROR] / device-removal / panic lines.
  • Final draw/memory telemetry in log: 19639 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample 14011 MB committed by the process; video memory 6115 MB local, 4683 MB non-local.

Limits of coverage

  • Skipping VGPR scans when no relative vector-register indexing is present was verified via relative_vgpr_limit_is_only_needed_for_indexed_vector_registers (3/3), gpu::recomp::emit:: (4/4 × 3), and gpu::recomp:: (376 executed + 23 expected Wave32-only/env skips × 3 on desktop RTX 4060).
  • The 60 s retail smoke ran with warm shader caches on title: 29640639 and confirms zero runtime regression rather than benchmarking cold shader-recompilation time (frame-count delta vs. cached parent reflects single-run startup variance, not this PR).

AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).

@ClosetPie107

Copy link
Copy Markdown

Independent test report under Wine/Proton (not native Windows) for head 88452400.

Setup

  • AMD Radeon RX 9070 (RDNA4, RADV GFX1201, Mesa 26.3.1, wave64), Ryzen 5 9600X, CachyOS Linux 7.3.5
  • Proton Experimental experimental-11.0-20261112, vkd3d-proton master ec207194 with a local patch dropping the lpVtbl checks in d3d12_command_allocator_from_iface / d3d12_command_list_from_iface, DXC 1.9.2609.5, Rust 1.96.0, x86_64-pc-windows-gnu
  • Head merged onto main 83b00818, test commit 0ff567b5

Tests (debug, XCL_REQUIRE_GPU=wave64, --test-threads=1)

Retail title, 300 s (release, every run from a copy of the same warm-cache snapshot; XCL_DIRECT_DXIL=1 XCL_PREPARE=1 XCL_PSO_PRELOAD=1 XCL_PSO_WAIT_MS=50 XCL_TEXTURE_LEVEL_PAGES=1 XCL_COHERENT_MB=1024 VKD3D_CONFIG=ignore_shared_fence, A pressed every 10 s)

  • 4 runs: 2 clean (exit 0, 2,192 and 1,845 presents). 2 crashed at ~150 s with 0xc0000005 in ucrtbase.dll+0x171d9 (a copy), writing at 0x2c49e2740 / 0x2c4bba840 on a title thread, right after the CreateShaderResourceView(RAYTRACING_ACCELERATION_STRUCTURE) … writing empty BVH descriptor warnings, with the same registers in both.
  • main, 4 runs: all clean (1,892–2,122 presents). But I had the same crash (same offset, a write, right after the same BVH warnings) yesterday on a tree without this PR (af2cecc4), so it is not new with this PR. Four runs cannot say whether it happens more often with it; I'm mentioning it in case someone sees it again.

Not tested

  • Native Windows, NVIDIA/Intel, wave32 GPUs
  • Whether the emitted HLSL is byte-identical here

AI use

  • Claude Code (Claude Opus 5.5) wrote the test scripts, ran the tests and runs on this machine and wrote this report.

@oni-swr

oni-swr commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Running a native Windows AMD check of head 88452400 (RX 7800 XT, RDNA3, native wave64): workspace tests plus a bounded base-vs-head smoke pair; report here in a few hours.
AI use: the run and the report are done with Claude Code (Claude Sonnet 5.5).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

goal:world-load Bears on the retail title getting past world loading

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants