Skip to content

d3d12x: accelerate sparse UMA window chunk scanning - #1058

Open
UnkwnDev wants to merge 1 commit into
xcl-dev:mainfrom
UnkwnDev:arc-uma-scan
Open

UnkwnDev wants to merge 1 commit into
xcl-dev:mainfrom
UnkwnDev:arc-uma-scan

Conversation

@UnkwnDev

@UnkwnDev UnkwnDev commented Nov 24, 2026 •

Copy link
Copy Markdown

This pull request accelerates the sparse UMA window chunk scanner:

In crates/xcl/src/hle/d3d12x/sparse.rs, scan_page and read_chunk_words scanned 64-byte chunks with scalar 64-bit integer arithmetic and unaligned reads. We optimize read_chunk_words with an aligned pointer cast for page-aligned allocations, enabling 256-bit vector loads. In scan_page, we add an 8-word zero reduction test so unchanged zero chunks across mapped sparse windows bypass the 5-multiplication hash computation entirely, eliminating CPU sync latency during command list execution.

Originally part of #985, split into its own single-purpose PR per CONTRIBUTING.md.

Tested

  • Hardware: Intel Arc A770 (16GB, Driver 32.0.101.9175), AMD Ryzen 7 5700X, 32 GB RAM, Windows 11 Pro, MSVC 14.44.35207
  • Full workspace test suite: cargo test --workspace (672 passed, 0 failed, 21 ignored in lib; 13/13 console_dlls_e2e passed; 3/3 console_shaders passed; 1/1 disasm_e2e passed; 3/3 e2e passed; 1/1 sparse_reinit passed; 1/1 texture_states passed; 6/6 xg_oracle passed)
  • hle::d3d12x::sparse::tests: 13 passed, 0 failed, 1 ignored, verifying scan_page_lazy_alloc_and_coalesce and dirty chunk detection.

Regression run
main (e74dda2):

xcl-smoke v1
commit: e74dda2d4b5c28a81cfa971d14bc417a6be966aa
gpu: AMD Radeon RX 9070 XT
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1660 (PresentX 1660)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14862 MB

PR (dbcaee7):

xcl-smoke v1
commit: dbcaee766a1d9e0d9c1f9894c63eaf29dc843046
gpu: AMD Radeon RX 9070 XT
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1665 (PresentX 1665)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14860 MB

Not tested

  • RDNA3 / older RDNA1 GPUs, Linux/Wine

AI use

  • Claude Code and Antigravity assisted in profiling sparse chunk scan overhead and validating 8-word reduction behavior.

@futurepro62

futurepro62 commented Nov 24, 2026 •

Copy link
Copy Markdown

Full-suite run, since this PR has no test report yet. Tested exact head dbcaee7 (on its base e74dda2).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 727 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • No new #[test] functions in the diff.
  • Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 727 passed, 0 failed, 41 ignored, no skips.

Not tested

  • A release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.

@thaqiart139-alt

Copy link
Copy Markdown

Test report for this PR's head dbcaee7, merged into main 689f2db (no conflicts), on AMD RDNA2 with native 64-lane waves and on a 32-lane NVIDIA card.

Tested

  • GPUs: AMD Radeon(TM) Graphics, the RDNA2 iGPU of a Ryzen 7 7800X3D (native wave64, driver 32.0.21045.29003), and NVIDIA GeForce RTX 5070 (driver 32.0.16.2101), chosen with XCL_ADAPTER.
  • System: 32 GB, Windows 11 Home build 26300, Rust 1.100.0, debug, DXC 1.9.2602.17.
  • cargo test --workspace --no-fail-fast -- --test-threads=4:
main 689f2db with this PR
RTX 5070 971 passed, 4 failed, 45 ignored 971 passed, 4 failed, 45 ignored
Radeon iGPU 974 passed, 1 failed, 45 ignored 974 passed, 1 failed, 45 ignored
SKIPPED tests (the same on main and with this PR)
  • RTX 5070:
    • no wave64:
      • gpu::recomp::lower::tests: a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu
      • gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu, and the wave64 cases of its f16 / f32 / f64 / integer_programs_on_the_gpu
      • gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware
    • the wave32 per-lane cases of lower_dxil's f16 arithmetic, f16 packed and f32 conversions: refused ("its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's")
    • heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows)
    • pso_measurement_compiles_an_exact_synthetic_record (Windows Developer Mode is off)
  • Radeon iGPU:
    • no mesh shaders: gpu::dxil::geometry_tests::gpu_geometry_direct_records, emitted_ms_primitive_attribute_reaches_the_pixel_shader, emitted_ms_ps_draw_a_triangle, gpu_geometry_mode_es_gs_strip, gpu_geometry_mode_es_gs_strip_with_branches, gpu_mesh_mode_two_passes
    • the wave32 and wave64 per-lane cases of lower_dxil's f16 arithmetic, f16 packed and f32 conversions: refused, as above
    • heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows)
    • pso_measurement_compiles_an_exact_synthetic_record (Developer Mode is off)

Not tested

  • a title run, RDNA1 / RDNA3; other GPUs; Linux / Wine.

AI use

  • Claude Code (Claude Opus 5.5) ran the builds and tests and wrote this report.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants