Skip to content

Recompiler: flatten direct DXIL root-UAV loads for compute - #2368

Merged
ivall merged 1 commit into
xcl-dev:mainfrom
coolpersonnn:direct-dxil-flat-loads
Nov 25, 2026
Merged

ivall merged 1 commit into
xcl-dev:mainfrom
coolpersonnn:direct-dxil-flat-loads

Conversation

@coolpersonnn

@coolpersonnn coolpersonnn commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Part of #2088. Replace per-load switch i32 CFGs across the 4 root-UAV memory windows (u2..u5) in direct DXIL (XCL_DIRECT_DXIL=1, XCL_HEAP_WINDOWS=0) with branchless straight-line rawBufferLoad + select on non-graphics stages (self.gfx.is_none()).

In direct DXIL root-UAV mode, every scalar, buffer, or flat load previously branched through with_mem_many_tys, emitting a per-load 5-arm switch and merge phi nodes. Compute shaders with hundreds or thousands of loads grew thousands of basic blocks, driving multi-minute cold NVIDIA driver compiles and multi-gigabyte driver commit spikes. Flattening read-only loads resolves the effective window w_eff = sel(guard, w, n) once, compares w_eff == k across windows 0..n, reads offset 0 on unselected windows/lanes, and selects the result — preserving #1693 out-of-range (0) and inactive-lane (0) semantics while issuing only valid offset-0 reads on bound windows.

Scope and relationship to other work

What is in it

  • crates/xcl/src/gpu/dxil/lower_mem.rs: add with_mem_raw_loads and mem_ld_chunks, routing direct DXIL read-only raw loads (mem_ld, mem_ld_n, ld_raw_guarded, ld_raw_u32_guarded, s_buffer_load, s_load, single-component BufKind::FormatLoad) through branchless offset-0 loads + select when self.heap_mem.is_none() && self.gfx.is_none().
  • crates/xcl/src/hle/d3d12x/bind.rs: filter v != 0 when populating u2..u5 so an unpopulated (0, 0) UMA_BUFFER slot falls back to first.
  • crates/xcl/src/gpu/recomp/runner.rs: bind root UAVs u2..u5 in dispatch_with (previously only u2 was bound).
  • crates/xcl/src/gpu/dxil/core_tests.rs: add raw_loads_in_root_windows_are_branchless (IR shape across wave32, split-wave64, native-wave64, heap windows, stores/atomics, and PS exclusion) and raw_loads_in_root_windows_respect_exec_and_bounds (GPU readback over 4 windows, offset-0 canaries, window bounds, hi == 0 -> w0, 64-bit carry across windows, masked EXEC, and unaligned format loads).

Tested

  • Host / toolchain: Windows 11 build 26300, AMD Ryzen 9 9950X3D, 93.6 GiB usable RAM, NVIDIA GeForce RTX 5090 32 GB (driver 621.01), Rust 1.100.0 MSVC, Windows SDK DXC/DXIL 1.8.2502.11.
  • Full retail shaders.rpf direct-DXIL scan & validation (3f4495a -> 58bb1f5, split enabled for wave64 on RTX 5090, 4 root UAV windows): 2,682 / 2,682 unique compute records translated directly (0 HLSL fallbacks, 0 DXIL validation errors across all emitted pieces), modifying 2,635 compute records.
  • Retail shaders.rpf cold CreateComputePipelineState benchmarks on RTX 5090 (3f4495a -> 58bb1f5, release builds, 3 paired interleaved trials per record, isolated XCL_DXIL_CACHE, fresh per-run .exe copies, distinct unused root-constant layout keys ShaderRegister=6, Num32BitValues=1..39; immediate same-layout warm replays took 0.82–15.80 ms; 0 errors, 0 timeouts, 0 device removals):
Retail record hash Pieces Base (3f4495a) PR (58bb1f5) Speedup Peak commit (MiB) Switches Blocks
219287eb2f6021fe 1 -> 1 227,034.2 ms 64,683.4 ms 3.51x (-71.5%) 3,189.5 -> 2,023.5 2,359 -> 216 18,449 -> 7,734
95cc13288a27a96e 1 -> 1 128,884.4 ms 51,497.4 ms 2.50x (-60.0%) 3,017.4 -> 1,770.9 2,452 -> 187 23,516 -> 12,191
73fb752d7f62c3a5 1 -> 1 43,076.5 ms 33,432.3 ms 1.29x (-22.4%) 1,914.2 -> 1,776.0 1,235 -> 20 17,386 -> 11,311
dca1b25b44878018 14 -> 15 11,533.4 ms 7,893.2 ms 1.46x (-31.6%) 804.3 -> 827.2 1,822 -> 54 10,977 -> 2,098
84eee477d68b6fdf 11 -> 12 9,039.8 ms 6,081.4 ms 1.49x (-32.7%) 813.8 -> 761.7 1,294 -> 11 7,993 -> 1,536
620491641aa9bad6 1 -> 1 5,714.2 ms 2,492.0 ms 2.29x (-56.4%) 793.8 -> 726.7 388 -> 0 2,554 -> 614
56c0cd3b82a00c6e 1 -> 1 5,196.7 ms 3,545.8 ms 1.47x (-31.8%) 1,140.5 -> 851.3 306 -> 67 2,252 -> 1,057
4585e350d1b864e3 6 -> 7 3,605.3 ms 2,865.5 ms 1.26x (-20.5%) 751.9 -> 710.3 707 -> 134 4,050 -> 1,164
715d367152768991 1 -> 1 4,284.4 ms 3,181.1 ms 1.35x (-25.8%) 794.8 -> 752.7 538 -> 274 3,654 -> 2,334
a4c70d5842b40e13 1 -> 1 1,677.1 ms 1,525.0 ms 1.10x (-9.1%) 652.6 -> 644.6 251 -> 226 2,842 -> 2,717
2099a37cbf86d155 1 -> 1 1,339.7 ms 855.2 ms 1.57x (-36.2%) 617.4 -> 594.0 329 -> 164 2,051 -> 1,226
30a7bbba88b255cc 1 -> 1 1,319.1 ms 870.7 ms 1.52x (-34.0%) 630.9 -> 600.6 216 -> 0 1,393 -> 313
777348c43857fdd2 1 -> 1 324.5 ms 333.3 ms 0.97x (+2.7%) 546.8 -> 543.4 55 -> 0 378 -> 103
  • Synthetic RTX 5090 GPU dispatch timing on 3f4495a -> 58bb1f5 (3 paired interleaved trials, 128 root-window loads/lane across 4 windows, 128 groups x 128 timed dispatches after 8 warmups, 100% readback dwords verified, 0 device removals):
    • uniform wave32: 10.560 -> 3.296 us (3.20x faster)
    • uniform split-wave64: 9.696 -> 5.280 us (1.84x faster)
    • mixed wave32: 22.608 -> 4.832 us (4.68x faster)
    • mixed split-wave64: 21.408 -> 6.688 us (3.20x faster)
  • Workspace & focused checks on 58bb1f5 (with an isolated fresh XCL_DXIL_CACHE):
    • XCL_ADAPTER=5090 cargo build --workspace --locked --offline -j 8: passed.
    • XCL_ADAPTER=5090 XCL_SAMPLE_RPF=$RetailPack:
      • cargo test -p xcl --lib --locked --offline -j 8 gpu_retail -- --nocapture: 1 passed, 0 failed, 0 ignored.
      • cargo test -p xcl --lib --locked --offline -j 8 raw_loads_in_root_windows -- --nocapture: 2 passed, 0 failed, 0 ignored, 0 SKIPPED.
      • cargo test -p xcl --lib --locked --offline -j 8 compute_globallycoherent_only_when_needed -- --nocapture and gpu_compute_coherent_and_cached_loads -- --nocapture: 1 passed, 0 failed each (0 SKIPPED).
      • cargo test --workspace --locked --offline -j 8 --no-fail-fast -- --test-threads=4 --nocapture: 1,273 passed, 4 failed, 46 ignored, 26 SKIPPED notices across 23 test binaries (xcl --lib: 1,204 passed, 4 failed, 26 ignored; the 4 failures are pre-existing RTX 5090 gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3 seeds 70, 545, 1019, 1507 hitting CreateComputePipelineState: 0x8007000E, identical to clean main).
    • XCL_ADAPTER=warp cargo test -p xcl --lib --locked --offline -j 8 -- --test-threads=4 --nocapture: 1,208 passed, 0 failed, 26 ignored, 322 SKIPPED notices.

Rebased workspace verification on the same RTX 5090 (driver 621.01), Windows 11 build 26300, Rust 1.100.0 MSVC, DXC 1.8.2502.11. The original offline benchmarks above retain their measured revisions.

  • cargo build --workspace --locked --offline -j 8 passed on both revisions.
  • cargo test --workspace --locked --offline -j 8 --no-fail-fast -- --test-threads=4 with XCL_ADAPTER=5090, XCL_DIRECT_DXIL=1, XCL_HEAP_WINDOWS=0 and separate DXIL caches reported 1,341 passed, 6 failed, 46 ignored, 26 SKIPPED notices on 3ceb550 and 1,343 passed, 6 failed, 46 ignored, 26 SKIPPED notices on c685e12 across 24 test result blocks.
  • Both revisions reproduced the same six failures. Four DXIL fuzz tests hit CreateComputePipelineState 0x8007000E on seeds 70, 545, 1019, and 1507. The bridged-mask barrier assertion and offline_compute_pipeline_is_reused_by_a_second_process also failed on both revisions.
  • The upstream packed-dot IR test passed on both revisions. The two root-window tests passed on the rebased head.
Rebased head GPU skips
  • SKIPPED gpu::dxil::kernel::dispatch_chain_native_wave64_builds_whole: no wave64
  • SKIPPED gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu: no wave64
  • SKIPPED gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu: no wave64
  • SKIPPED gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu: no wave64
  • SKIPPED gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu: no wave64
  • SKIPPED gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu: no wave64
  • SKIPPED gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu: const_mask, wave64: no wave64
  • SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))
  • SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave64: no wave64
  • SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 arithmetic, wave64: no wave64
  • SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave32, per-lane form: refused
  • SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave64: no wave64
  • SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 compares, wave64: no wave64
  • SKIPPED gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu: f64, wave64: no wave64
  • SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))
  • SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave64: no wave64
  • SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer arithmetic, wave64: no wave64
  • SKIPPED gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu: mask_ff0_flbit, wave64: no wave64
  • SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 rounding, wave64: no wave64
  • SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer carries, wave64: no wave64
  • SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 transcendentals, wave64: no wave64
  • SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 three-source, wave64: no wave64
  • SKIPPED gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64
  • SKIPPED gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64
  • SKIPPED shaders::tests::pso_measurement_compiles_an_exact_synthetic_record: cannot disable the driver cache (Windows Developer Mode is required): The application requested an operation that depends on an SDK component that is missing
  • SKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows

Regression run

Release builds from both clean commits used cargo build -p xcl --release --locked --offline -j 8. Both ran ./scripts/smoke.ps1 -Game $RetailTitleFolder -Seconds 60 -Xcl $ReleaseExe -OutDir $SmokeOut with XCL_ADAPTER=5090, XCL_DIRECT_DXIL=1, XCL_HEAP_WINDOWS=0, XCL_PSO_TRACE=1, and XCL_FRAME_DUMP=300. Each run started with separate empty XCL_DATA_ROOT and XCL_DXIL_CACHE directories. All three paired sampled frames matched byte-for-byte by SHA-256.

Clean main

xcl-smoke v1
commit: 3ceb5507a05355719ff1d7b5c29bc52aff142000
gpu: NVIDIA GeForce RTX 5090
title: a93b40d7
seconds: 60
exit: 0x0
frames shown: 850 (PresentX 850)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14982 MB

Clean head

xcl-smoke v1
commit: c685e122620243cb6d2083ebba922abb32e7f2c5
gpu: NVIDIA GeForce RTX 5090
title: a93b40d7
seconds: 60
exit: 0x0
frames shown: 841 (PresentX 841)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14972 MB

Not tested

  • First-playable latency and in-game steady-state retail GPU frame times beyond the 60 s smoke window (synthetic GPU timing verified 1.84x–4.68x speedup on 128-load root-window compute dispatches).
  • XCL_HEAP_WINDOWS=1 (unchanged by this PR).
  • AMD and Intel GPUs on 58bb1f5 (earlier Radeon iGPU check passed 2/0 on raw_loads_in_root_windows before excluding graphics stages and rebasing onto 3f4495a).
  • macOS and Linux (not built or tested).

AI use

T3 Code (Antigravity harness, gemini-pro-orchestrator-neon) designed and implemented the direct DXIL flattening and tests, extended the offline pack benchmark harness, ran the tests, retail cold PSO benchmarks, and paired 60 s smoke runs, and drafted this description.

Codex in T3 Code (gpt-6.2-sol) resolved the rebase, ran the workspace and smoke comparisons on the new commits, and updated the report.

@bielfreedom

Copy link
Copy Markdown

AMD Windows driver timing for #2368: on the RX 9070 XT, AMD's CreateComputePipelineState is 1.86× faster over 26 large retail compute programs, and peak memory halves. CS_RaytracingResolve (84eee477d68b6fdf) builds in 20 s instead of 60 s. This is the largest direct-DXIL driver-time gain I've measured on this card.

Setup

  • GPU: RX 9070 XT 16 GB (RDNA4, native wave64), AMD driver 32.0.32029.2010.
  • CPU and memory: Ryzen 7 7700 (16 threads), 32 GB RAM, Windows 11, release.
  • Builds:
    • this PR's parent 3f4495a;
    • this PR at 58bb1f5.
  • Both builds carry a local patch that logs per-program DXIL size, record hash (fnv64) and per-CreateComputePipelineState time.

Method

  • XCL_DIRECT_DXIL=1, XCL_HEAP_WINDOWS=0 (the root windows this PR changes), XCL_PIPELINE_THREADS=1.
  • XCL_PSO_DISK_CACHE=0 and a fresh exe name per run, because the AMD driver cache is keyed on the exe file name.
  • 26 retail compute programs, 6 KB to 1.0 MB of direct DXIL. They include 84eee477d68b6fdf and 620491641aa9bad6, the two AMD-slow programs from [OFFICIAL] Looking for PRs with shaders optimization #1269.
  • 2 rounds, interleaved.
  • The machine was in light desktop use, so the base rounds vary by 15 %. The gap is far larger than that.

Census (all 2,689 retail compute programs, translation only): 2,641 change. 2,639 grow and 2 shrink, for +1.3 % of DXIL in total.

26 programs (means of 2 rounds; all 104 builds succeeded, 0 refused)

3f4495a #2368 change
direct DXIL, total 8,237,092 B 8,327,520 B +1.1 %
driver, sum (r1 / r2) 331.4 / 383.9 s 188.9 / 196.4 s ×0.54 (1.86× faster)
driver run, process peak private 4.07–4.08 GB 2.17 GB −47 %

The gain grows with program size:

program DXIL base → PR driver base → PR faster
84eee477d68b6fdf CS_RaytracingResolve 950,632 → 960,972 B 60.2 → 19.9 s 3.0×
ed2f8fa2e996c6a6 867,128 → 875,488 B 62.6 → 19.1 s 3.3×
b3618a0fd76af79c 843,808 → 852,492 B 56.8 → 28.1 s 2.0×
c6f8ee0f53ed5709 789,504 → 797,452 B 52.2 → 32.2 s 1.6×
d8435f454a510270 734,976 → 743,544 B 45.4 → 27.2 s 1.7×
6d1e4583f8129771 643,692 → 648,196 B 11.6 → 9.1 s 1.3×
7c08ec6429245b8e 553,880 → 559,208 B 10.0 → 7.7 s 1.3×
620491641aa9bad6 375,440 → 379,108 B 19.9 → 16.9 s 1.2×
4 programs of 280–370 KB +1 % 20.1 → 15.9 s 1.3×
14 programs under 230 KB +1 to +4 % 18.5 → 16.8 s 1.1×
  • No program got measurably slower. The worst ratio is ×1.08, on a 0.1 s program.

Read / inference

Tests on this card (XCL_REQUIRE_GPU=1, XCL_ADAPTER=9070)

  • cargo test --release -p xcl --lib -- raw_loads_in_root_windows --test-threads=1: 2 passed, 0 failed, no SKIPPED notice.
  • That includes raw_loads_in_root_windows_respect_exec_and_bounds on native wave64.

Not tested

AI use: Claude Code (Claude Opus 5.5) ran the census, measurements and tests and drafted this. Counts and timings only, no game data.

@coolpersonnn
coolpersonnn marked this pull request as ready for review November 25, 2026 18:03
@Aniseto

Aniseto commented Nov 25, 2026

Copy link
Copy Markdown

Ran the two new root-UAV load tests at 58bb1f5:

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC/DXIL 1.9.2609.5, debug build.

XCL_ADAPTER=nvidia cargo test -p xcl --lib raw_loads_in_root_windows -- --test-threads=1 --nocapture
2 passed; 0 failed; 0 ignored; 1232 filtered out      (exit 0)

Both raw_loads_in_root_windows_are_branchless and raw_loads_in_root_windows_respect_exec_and_bounds pass here; the second one does GPU readback across the four windows, so the EXEC/bounds and canary checks ran on the real adapter.

What this adds: the author's hardware results are all on an RTX 5090 32 GB with Windows SDK DXC/DXIL 1.8.2502.11. This adds a second Blackwell part (16 GB) with DXC/DXIL 1.9.2609.5, and the thread has no test report from another machine yet.

Not tested: the retail shader-pack cold PSO benchmarks, the synthetic dispatch timings, a paired 60 s smoke run, XCL_HEAP_WINDOWS=1, AMD and Intel GPUs, Wine, release profile, title data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

@emirduran707

Copy link
Copy Markdown
Contributor

Independent AMD RDNA4 (native wave64) test report on exact head 58bb1f5a5d10732516dce40619f7509e8a4c4d43 (clean detached checkout, no local changes).

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17; tests debug, smoke release.
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1275 passed, 2 failed, 46 ignored; 8 SKIPPED (6 in lower_dxil::tests::{f16,f32}_programs_on_the_gpu refused by per-lane form; heap_window_out_of_memory_falls_back_to_the_switch_form; pso_measurement_compiles_an_exact_synthetic_record). All native wave64 GPU tests ran and passed.
    • Both PR tests passed (no skips): gpu::dxil::core_tests::raw_loads_in_root_windows_are_branchless and raw_loads_in_root_windows_respect_exec_and_bounds.
    • The 2 failures (gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 seed 722 and fuzz_validate_and_gpu_3 seed 1599) are pre-existing on unmodified main on this GPU.

Regression run (60 s retail-title smoke, XCL_NETWORK=0, release)

xcl-smoke v1
commit: 58bb1f5a5d10732516dce40619f7509e8a4c4d43
gpu: AMD Radeon RX 9060 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1620 (PresentX 1621)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13922 MB

(Matched main 68a284a baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)

Not tested

  • D3D12 debug layer; Intel GPUs.

AI use

  • Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.

In direct DXIL root-UAV window mode (`XCL_DIRECT_DXIL=1`, `XCL_HEAP_WINDOWS=0`),
every scalar/buffer/flat read previously went through `with_mem_many_tys`,
emitting a per-load `switch i32` + guard CFG and `phi` nodes over all
4 root-UAV windows (`u2..u5`). Compute shaders with hundreds of loads grew
thousands of basic blocks, triggering multi-second to multi-minute cold
NVIDIA driver compiles and high compiler commit memory.

Replace multi-window direct DXIL read-only raw loads on non-graphics stages
(`self.gfx.is_none()`, `self.heap_mem.is_none()`) with branchless straight-line
loads via `with_mem_raw_loads`:
- Resolve the effective window `w_eff = sel(guard, w, n)` once and compare
  `w_eff == k` across windows `0..n`, reading offset `0` on unselected
  windows/lanes and merging with `select`.
- Preserve `xcl-dev#1693` semantics: out-of-range window indices and inactive lanes
  select `0` while emitting only valid offset-0 reads on bound windows.
- Ensure `bind.rs` (`u2..u5`, filtering `v != 0`) and `runner::dispatch_with`
  always bind valid non-null buffers for all 4 root-UAV window slots.
- Exclude graphics stages (`VS`/`PS`, `self.gfx.is_some()`), where flattening
  root-UAV loads regressed straight-line PS cold NVIDIA compile time by 5.64x
  (1,632 -> 9,203 ms on `0829441`).
- Keep stores/atomics (`xcl-dev#2288`), `bvh_intersect`, `XCL_HEAP_WINDOWS`
  (`xcl-dev#1695`), and HLSL emission (`xcl-dev#1380`/`xcl-dev#2191`) unchanged.

Measured on RTX 5090 (driver 621.01, Windows 11, release) against `3f4495a`
(including PR xcl-dev#2346 non-coherent compute windows, 3 paired interleaved
trials per spec with cold root-signature keys and fresh exe copies):
- `cs-500-raw-w32` (non-coherent / coherent): 5,133 -> 1,748 ms (2.94x) /
  5,129 -> 1,751 ms (2.93x); peak commit 309 -> 191 MiB
- `cs-1000-raw-w32` (non-coherent / coherent): 19,742 -> 5,156 ms (3.83x) /
  19,767 -> 5,132 ms (3.85x); peak commit 993 -> 259 MiB (-73.9%)
- `cs-1000-raw-w64` (split wave64): 19,709 -> 5,171 ms (3.81x); peak 994 -> 259 MiB
- `cs-1000-w32` (mixed w/ 33% FormatLoad, non-coherent / coherent):
  49,431 -> 17,977 ms (2.75x) / 49,944 -> 18,058 ms (2.77x); peak 1.34 GiB -> 464 MiB
- Synthetic GPU dispatch (128 loads/lane, uniform & mixed, w32 & split w64):
  1.84x to 4.68x faster (3.296-6.688 us vs 9.696-22.608 us), 100% readback match.

Assisted-by: T3 Code (gemini-pro-orchestrator-neon)
Assisted-by: Codex in T3 Code (gpt-6.2-sol)
@thiagocalile

Copy link
Copy Markdown

Independent test and smoke report for head 58bb1f5a5d10732516dce40619f7509e8a4c4d43 on an AMD Radeon RX 6600 (8 GB VRAM, RDNA2, native wave64).

Tested

  • Hardware: AMD Radeon RX 6600 (8146 MiB VRAM, RDNA2, native wave64 + mesh shaders, driver 32.0.21045.29003, XCL_ADAPTER=radeon), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (10.0.26200.0), Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.8.2502.11.
  • XCL_ADAPTER=radeon XCL_DIRECT_DXIL=0 cargo test --no-fail-fast -p xcl --lib -- gpu_ --test-threads=1: 147 passed, 1 failed, 1 ignored (0 skipped).
    • Failed: gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1
  • XCL_ADAPTER=radeon XCL_DIRECT_DXIL=1 cargo test --no-fail-fast -p xcl --lib -- gpu_ --test-threads=1: 147 passed, 1 failed, 1 ignored (0 skipped).
    • Failed: gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1

Regression run (scripts/smoke.ps1, release builds, XCL_ADAPTER=radeon)

main (50a9fde):

xcl-smoke v1
commit: 50a9fdef81cb796b8756a31defb0648301d002ce
gpu: AMD Radeon RX 6600
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 1501 (PresentX 1501)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 11951 MB

PR #2368 (58bb1f5):

xcl-smoke v1
commit: 58bb1f5a5d10732516dce40619f7509e8a4c4d43
gpu: AMD Radeon RX 6600
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 1496 (PresentX 1497)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 12745 MB

Not tested: NVIDIA/Intel GPUs, Linux/Wine, or world load past the 60 s smoke window.

AI use: Antigravity (Gemini 4 Neon) ran the builds, tests, and smoke runs and drafted this report; the account owner reviewed and approved posting.

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

Thanks!

@SlopTart

Copy link
Copy Markdown

Tested: current PR head merged onto current origin/main (clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target x86_64-pc-windows-gnu run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).
suite: 145/3 = the three known baseline failures on this lane (fuzz_validate_and_gpu_2 seed 1003, gpu_nonfused_mad_and_mac_prevent_fma_contraction, gpu_depth_buffer_created_for_unordered_access_is_placed). Targeted run of the new raw-load root-window tests: 2 passed.

Not tested: retail titles (no title data on this lane, counts only).

AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.

@thehollowedone

Copy link
Copy Markdown

Independent RTX 3080 Ti check on clean c685e12, whose parent is 3ceb550. Windows 11 build 26300, NVIDIA 621.35, Ryzen 7 9800X3D, Rust 1.99.1 MSVC, SDK DXC/DXIL 1.8.2502.11. Offline Cargo; XCL_ADAPTER=RTX 3080 Ti XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=0 XCL_NETWORK=0; no sample data.

Tested

  • cargo build --offline --locked --workspace --jobs 6 passed.
  • cargo test --offline --locked -p xcl --lib raw_loads_in_root_windows --jobs 6 -- --test-threads=1 --nocapture, with XCL_D3D12_DEBUG=1: 2 passed, 0 failed, 0 ignored, 0 skipped. The GPU readback test checked active and masked lanes, bounds, four root windows, the offset-zero canaries, and the cross-window carry.
  • cargo test --offline --locked --workspace --no-fail-fast --jobs 6 -- --test-threads=4 --nocapture, with the debug-layer override unset: 1,347 passed, 2 failed, 46 ignored, including 26 runtime skip notices. The failures were a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier and offline_compute_pipeline_is_reused_by_a_second_process.
  • After an offline workspace build of the exact parent, both failing tests reproduced there with the same environment: the barrier test 0 passed, 1 failed at the same assertion, and the offline pipeline test 0 passed, 1 failed at the same Option::unwrap() site. I did not run the parent's full suite.

Not tested: retail smoke, cold NVIDIA driver compile time, AMD/Intel, or full title output. This report does not establish merge readiness. AI-assisted. Codex (GPT-6, exact variant unavailable) ran the checks and drafted this report.

@upipibi

upipibi commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

NVIDIA test report for c685e12 (head as is, base 3ceb550), for #1607 and #2088. RTX 3070 8 GB (Ampere, 32-lane waves), driver 616.56, Windows 11, debug, after cargo build --workspace:

  • cargo test --workspace --no-fail-fast -- --test-threads=4 --skip hle::xaudio2 --skip gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier: 1339 passed, 0 failed, 46 ignored. The end-to-end title tests pass.
  • Skipped a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier: this head's base has that test but not its fix (Tests: check divergent block barriers in a_bridged_mask_write #2420, merged 18:45Z), so it fails on main at that base too. The PR doesn't touch it.
  • Skipped hle::xaudio2, because its tests fail or hang on this machine on main too. The PR doesn't touch it.
  • SKIPPED lines: 26: 21 no wave64 on this card, 3 f16/f32 forms the per-lane path refuses, 1 no heap windows, and 1 PSO measurement that needs Developer Mode to turn the driver cache off.

AI-assisted (Claude Code, Claude Opus 5.5). Synthetic tests only; no title run.

raylitebull added a commit that referenced this pull request Nov 25, 2026
Port #2368's Lw::with_mem_raw_loads and mem_ld_chunks into Direct DXIL lowering so non-graphics stages running in root-UAV form (in_switch_form fallback or XCL_HEAP_WINDOWS=0) emit straight-line branchless loads reading offset 0 on unselected windows / inactive lanes and merging via select, eliminating per-load switch CFGs and handle PHIs.

Includes regression tests in core_tests.rs covering branchless root-UAV loads, exec/OOB semantics, and branchless Direct DXIL PS heap-flat loads.

Assisted-by: Antigravity (Gemini 4 Neon High)
raylitebull added a commit that referenced this pull request Nov 25, 2026
Fall back to windows[0] when uma_window_vas() entries 1..3 are zero so branchless Direct DXIL root-UAV loads (6ea50d1) and prelude indirect passes never bind a null root UAV.

Assisted-by: Antigravity (Gemini 4 Neon High)
@ivall

ivall commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

Closing and reopening at once, only to get a CI run on today's main: the failed one ran on a main from before #2420, which fixed a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier. Nothing is wanted from the author. (Claude Code, Claude Opus 5.5, on the maintainer's behalf.)

@ivall ivall closed this Nov 25, 2026
@ivall ivall reopened this Nov 25, 2026
@ivall ivall closed this Nov 25, 2026
@ivall ivall reopened this Nov 25, 2026
@ivall
ivall merged commit 6d12f58 into xcl-dev:main Nov 25, 2026
4 of 7 checks passed
@ivall

ivall commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

Merging: direct-DXIL compute loads from the root memory windows become straight-line loads and selects. Stores, atomics, graphics stages and heap windows keep their form. The cold-compile gain is measured by others above: 1.86 times over 26 large programs on AMD RDNA4, about half the peak memory (bielfreedom), and the RTX 5090 table in the description. I did not repeat those.

Tested on AMD RDNA4 (native wave64), Windows, DXC 1.8.2502.11, debug, main e0d93c8 with #2097 (d5c2781) and #2368 (c685e12) merged locally, against main e0d93c8. Whole suite: 1423 passed, 2 failed, 46 ignored, 7 SKIPPED (main: 1419 / 2 / 46, 7 SKIPPED). With XCL_DIRECT_DXIL=1, cargo test -p xcl --lib -- gpu:: hle::d3d12x: 953 passed, 2 failed, 24 ignored (main: 949 / 2 / 24). The two failures are fuzz_validate_and_gpu_1 and _3 on both. Both new tests ran here without a skip. Not tested here: a title run with XCL_DIRECT_DXIL=1.

AI use: Claude Code (Claude Opus 5.5) read the diff and the thread, ran the tests and wrote this on the maintainer's behalf.

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.

10 participants