Repository navigation
Recompiler: reuse a native compute lane's ballot predicate - #2061
philip-roy-jones wants to merge 1 commit into
Conversation
A lane testing its own bit of a comparison mask in the same block already has the boolean the ballot would return. Use that predicate when the console lane is the hardware lane index. Keep mask words available to scalar and cross-lane consumers. Drop an unused ballot when the entry's lane-index call already keeps the WaveOps feature live. On two compute records from the world-load trace this removes 122 of 408 ballot calls. Part of xcl-dev#1269. Assisted-by: OpenAI Codex (GPT-6.2 Astra at maximum reasoning effort)
|
Covered the native-wave32 execution gap on RTX3090. Both author fixtures pass on exact Tested — Windows10 Home19045, Ryzen7800X3D, RTX3090 driver591.74, Rust/Cargo1.98.1MSVC, DXC/DXIL1.8.2502.11, debug. Each revision: 2 passed /0 failed /0 ignored /0 skipped. The wave32 test actually dispatches both variants and checks all32 output words each, including lanes excluded by the earlier EXEC mask after EXEC is restored. The separate unused-ballot feature-flag fixture validates too.
Runtime sources are unchanged. I copied your tests to the parent and added identical adapter/count/size diagnostics to both. A test-only Not tested — native64 in this run, full workspace, retail smoke, compilation-time or GPU-throughput gains, other cross-lane patterns beyond these fixtures. The native64 case was not selected or counted as coverage. These results fill the reported wave32 gap without claiming the broader suite or retail requirements are satisfied. AI use — Codex (GPT-6) prepared the parent comparison/diagnostics, ran and verified the native tests, and wrote this report. No runtime edit, commit/push or competing PR. |
Arc A770 compatibility for XCL PR #2061Tested the clean, detached PR head TestedWindows 11 Enterprise Evaluation build 26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust 1.100.0
The checked-in tests assert these counts from disassembly and compare each dispatched lane with the fixture’s expected value. The wave32 dispatches checked 64 output words total. Libtest counted 3 passed, 0 failed, 0 ignored, including 1 hardware execution skip ( Prebuild took 70.72 s wall time. The paired ballot checks took 0.20 s in libtest and 0.305 s wall time inside the Arc mutex. The standalone validation took 0.01 s in libtest and 0.036 s wall time. These are test durations. CommandsProcess-local settings for the run and its prebuild: $env:TEMP = 'L:/XclTooling/pr2061'
$env:TMP = 'L:/XclTooling/pr2061'
$env:CARGO_TARGET_DIR = 'L:/XclTooling/pr1512-tiling-edges-fddfa267/target'
$env:CARGO_INCREMENTAL = '0'
$env:CARGO_PROFILE_DEV_DEBUG = '0'
$env:CARGO_PROFILE_TEST_DEBUG = '0'
$env:XCL_ADAPTER = 'A770'
$env:XCL_DXC_DIR = "$env:LOCALAPPDATA/XclTooling/dxc-1.9.2609/bin/x64"Prebuild and validation ran outside the Arc mutex. The GPU command ran the prebuilt binary through the shared lock script. Commands below omit timing and log redirection. & "$env:USERPROFILE/.cargo/bin/cargo.exe" test --locked -p xcl --lib --no-run -j 2
$testExe = 'L:/XclTooling/pr1512-tiling-edges-fddfa267/target/debug/build/xcl/97fdf2b9ff8e1482/out/xcl-97fdf2b9ff8e1482.exe'
& $testExe gpu::dxil::core_tests::unused_ballot_as_the_only_wave_op_validates --exact --nocapture --test-threads=1
& powershell.exe -NoProfile -ExecutionPolicy RemoteSigned -Command {
$testExe = 'L:/XclTooling/pr1512-tiling-edges-fddfa267/target/debug/build/xcl/97fdf2b9ff8e1482/out/xcl-97fdf2b9ff8e1482.exe'
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test {
& $testExe gpu::dxil::core_tests::ballot_own_bit_wave --nocapture --test-threads=1
}
}The first validator invocation was interrupted by Windows PowerShell treating the DXC informational stderr line as terminating. The rerun completed with exit 0. The first GPU invocation was blocked by the default Logs on Not testedNative wave64 runtime output, other GPU vendors, the parent revision, the rest of the workspace suite, retail smoke, and performance. AI useT3 Code / Codex ( |
|
A run with vkd3d-proton as the host D3D12. The DXIL goes through dxil-spirv and then the NVIDIA Vulkan driver, a different compiler from a native-Windows run: this PR's 3 new tests pass (1 skipped: no wave64). Tested
Not tested
AI use
|
|
Linux/RADV + Wine GPU test report on PR Tested
Not tested
AI use
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
AMD RDNA4 offline numbers for #2061: direct DXIL −1.9 %, AMD driver time unchanged (+0.9 %, within noise). Measured on the direct route over 24 retail compute programs; 0 refused. Setup
Method
Totals (round 1 / round 2)
Per program
Read / inference
Not tested
AI use: Claude Code (Claude Opus 5.5) ran the measurement and drafted this. Counts and timings only, no game data. |
The direct compute translator reuses the input to a wave ballot when a lane tests its own bit in the same block. Two shaders from the retail world-loading trace went from 408 ballot calls to 286. Part of #1269. World-loading trace
What is in it
gpu/dxil/lower.rscaches the predicate, including incoming EXEC, only for native compute lanes indexed byWaveGetLaneIndex. Scalar and cross-lane reads still use the mask words.module/opt.rscan discard a dead ballot if the entry's lane-index instruction retains the WaveOps feature flag.Tested
c00f3fcfce59and head147d054fcaa0. GPU work ran throughxcl-gpu run.cargo build --locked --workspaceandcargo build --locked --release -p xclpassed.cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --show-outputon RX 580 gave 1,013 passed, 106 failed, 46 ignored, 66 distinct tests reported SKIPPED. Parent gave 1,010 passed, 106 failed, 46 ignored, 65 distinct tests reported SKIPPED. The same 106 tests failed by name, most reporting a suspended device. Rust's pass counts include tests reporting SKIPPED. The three new tests passed the harness. Both wave widths validated, wave64 ran on hardware, and the wave32 execution was skipped.6e148dbd563de2052e0055c25f49848ac5696074df0b1cbcMedian driver build time rose on one shader and fell on two. These are first-use measurements because the RX 580 rejected the request to disable its implicit cache. Time to enter the world remains unmeasured.
Reproduction, additional measurements and GPU skips
The two other records in the five-shader total were
06ac9019d1c01f0e(93 to 75 ballots) and95cc13288a27a96e(143 to 87). Count call sites by disassembling the dumped.direct.dxilwithdxc -dumpbinand counting lines containing bothcalland@dx.op.waveActiveBallot(.The first two records in the table are the trace pair (four trials per revision). The third is a 520-case record previously measured on this GPU (three trials per revision). Alternate arm order and use a new executable name per first call. Time
CreateComputePipelineStateon validated direct DXIL using XCL's ABI root signature, the record's static samplers and no cached PSO blob.ShaderCacheControlreturned0x887A002D. Regenerate each container withxcl shaders <pack> --direct --hash <record> --split 0 --windows 4 --timeout 60 --validate --dump <dir>.xcl shaders <pack> --direct --sample 256 --seed 1269 --threads 1 --windows 4 --split 0 --max-bytes 16384 --timeout 60 --validate --jsonvalidated 219 programs on each revision. The other 37 exceeded the input-size cap. Repeating with--split 1gave the same counts.On the 3.91 MB wave32 record
95cc13288a27a96e, CPU translation medians were 669 / 816 ms in the unrestricted run and 839 / 727 ms when pinned to one logical CPU (16 and 30 measurements per revision respectively). The order reversed between setups.The WARP run of the same test command with
--skip test_title_runs_and_game_folder_is_untouchedgave 1,118 passed, 0 failed, 46 ignored, 168 distinct tests reported SKIPPED, one filtered out. The following RX 580 tests reported SKIPPED on the head.Regression run
scripts/smoke.ps1 -Game <folder> -Title Retail -Seconds 60 -Xcl <release xcl.exe>on each clean revision. Both started with identical copies of 737 precompiled DXIL files,XCL_DIRECT_DXIL=1,XCL_ASYNC_PSO=0,XCL_PSO_PRELOAD=0,XCL_TRANSLATED_CACHE=0andXCL_PSO_DISK_CACHE=0. New DXC compilations were 0 / 0.In the earlier separately warmed runs, main reached 959 frames and 23140 MB, head 1497 frames and 33040 MB. Main still needed 23 DXC compilations and head needed zero. Empty-cache starts with asynchronous PSOs ended early on both revisions with
0xc0000409.Not tested
Native wave32 execution, NVIDIA, and time to enter the world. The retail record benchmarks built the pipelines without dispatching them with title inputs. The smoke reached presentation. It did not establish whether the title dispatched either traced record.
AI use
OpenAI Codex, GPT-6.2 Astra at maximum reasoning effort, wrote the change and tests, ran the measurements, and drafted the report. I reviewed the diff.