Recompiler: reuse a native compute lane's ballot predicate #2061
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!2061
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2061"
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-25 02:23 UTC · original
philip-roy-jones:dxil-native-ballot-bit→main· +91 −2 · 5 files · 1 commits · openThe 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.
@WebIdentity1 on GitHub · 2026-11-25 02:31 UTC · original · edited 2026-11-25 02:33 UTC
Covered the native-wave32 execution gap on RTX3090. Both author fixtures pass on exact
147d054fcaa0109bd476e41706362a46fa824e63and parentc00f3fcfce59bb4dfd3a1f96bbc84c60e765b538, with the expected reduction in ballot calls and unchanged CPU-checked GPU results.Tested — Windows10 Home19045, Ryzen7800X3D, RTX3090 driver591.74, Rust/Cargo1.98.1MSVC, DXC/DXIL1.8.2502.11, debug.
XCL_ADAPTER=3090; native32, not split-wave64. The actual adapter was printed.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
XCL_PROBE_PREOPTmarker makes the parent's static-count assertion require2; the head keeps your0/1 expectations. The GPU oracle and validation are unchanged. Both317-file manifests matched before/after and locally, and XCL recompiled both sources.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.
@JJAutoCompare on GitHub · 2026-11-25 02:43 UTC · original
Arc A770 compatibility for XCL PR #2061
Tested the clean, detached PR head
147d054fcaa0109bd476e41706362a46fa824e63on 2026-11-25. GitHub showed the PR open andrefs/pull/2061/headmatched before and after testing. The PR conversation includes a separate RTX 3090 test in progress. PR #2061Tested
Windows 11 Enterprise Evaluation build 26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust 1.100.0
x86_64-pc-windows-msvc, DXC and DXIL validator 1.9.2609.5. The Rust test binary used the unoptimized profile with debug info disabled.waveActiveBallotcall countsballot_own_bit_wave321on even lanes 0 through 20 and0elsewhere. The whole-mask check matched all 32 words, with0x00155555on those same lanes and0x00000000elsewhere.ballot_own_bit_wave64SKIPPED ...: no wave64after the validation and count assertions. No native wave64 dispatch or lane readback.unused_ballot_as_the_only_wave_op_validatesThe 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 (
ballot_own_bit_wave64). There were two native wave32 fixture dispatches and zero native wave64 fixture dispatches.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.
Commands
Process-local settings for the run and its prebuild:
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.
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
Restrictedpolicy before the lock script loaded. The successful retry usedRemoteSignedin the child PowerShell process only. Machine and user execution policy settings were left alone.Logs on
L:/XclTooling/pr2061:prebuild-20261125-033404-462.log,validation-20261125-033548-878.log, andarc-20261125-033558-430.log. Earlier attempts remain alongside them.Not tested
Native wave64 runtime output, other GPU vendors, the parent revision, the rest of the workspace suite, retail smoke, and performance.
AI use
T3 Code / Codex (
gpt-6.2-sol) verified the PR head, ran the checked-in tests, and prepared this report.@JoaoPauluu on GitHub · 2026-11-25 03:14 UTC · original
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
x86_64-pc-windows-gnu.147d054as it is (merge base withmainc00f3fc), no uncommitted changes. The lib test binary runs under Wine, one test per process.ballot_own_bit_wave32: ok, not skippedballot_own_bit_wave64: ok, SKIPPED (no wave64: this GPU has 32-lane waves only)unused_ballot_as_the_only_wave_op_validates: ok, not skippedNot tested
AI use
@SzczepanGrela on GitHub · 2026-11-25 04:41 UTC · original
Linux/RADV + Wine GPU test report on PR
#2061head147d054(clean local merge8a4181contoorigin/maincbc296a,rustc 1.97.1, zero compiler warnings).Tested
7.3.0-5-cachyos), AMD Radeon RX 9070 (RADV GFX1201, device0x7550, native wave64, Mesa26.2.5-arch3.1, Vulkan1.4.354),GE-Proton11-12(wine-11.0 (Staging),vkd3d-proton v3.1-1-g8293130eb), DXC1.9.2602.17(21d28f72). Cross-builtx86_64-pc-windows-gnurelease (--lib, 38.92 s) withXCL_REQUIRE_GPU=wave64 XCL_NETWORK=0.ballot_own_bit --test-threads=1(default env): 2 passed, 0 failed (0.08 s); bothgpu::dxil::core_tests::ballot_own_bit_wave32andgpu::dxil::core_tests::ballot_own_bit_wave64passed with zeroSKIPPEDlines.gpu::dxil::core_tests::unused_ballot_as_the_only_wave_op_validates(--exact): 1 passed, 0 failed (0.00 s).XCL_SPLIT_WAVE64=1: 2 passed, 0 failed (0.08 s) + 1 passed, 0 failed (0.00 s), zero skips.gpu::dxil::core_tests --test-threads=1(default env): 18 passed, 0 failed, 1 ignored (0.31 s;dump_dxc_loweringignored), vsorigin/maincbc296a15 passed, 0 failed, 1 ignored (0.35 s; +3 passed, 0 regressions).gpu::dxil --skip ops_tests::integer_ops_match_cpu --skip ops_tests::uaddc_and_usubb_match_cpu --test-threads=1: 122 passed, 1 failed, 3 ignored (2.45 s), vsorigin/maincbc296a119 passed, 1 failed, 3 ignored (3.26 s). Both runs failed identically ongpu::dxil::fuzz_tests::fuzz_validate_and_gpu_2(crates/xcl/src/gpu/dxil/fuzz_tests.rs:1171:21,seed 1003: res[713] = 0x1, CPU 0x0).gpu::recomp::tests::gpu_ --test-threads=1 --skip gpu_sparse_vram_descriptors_buffers_and_xmem --skip gpu_uma_import_check_at_init --skip gpu_unified_memory_arena:origin/maincbc296a99 passed, 1 failed, 1 ignored (4.50 s); identical failuregpu_nonfused_mad_and_mac_prevent_fma_contractionand ignoredgpu_arena_partial_commit_probe.XCL_DIRECT_DXIL=1: 96 passed, 4 failed, 1 ignored (2.12 s), vsorigin/maincbc296a96 passed, 4 failed, 1 ignored (2.12 s); identical 4 failures (gpu_f64_math_random,gpu_f64_roots,gpu_image_get_resinfo_1d_array,gpu_nonfused_mad_and_mac_prevent_fma_contraction).XCL_DIRECT_DXIL=all: 96 passed, 4 failed, 1 ignored (2.12 s), vsorigin/maincbc296a96 passed, 4 failed, 1 ignored (2.48 s); identical 4 failures.XCL_SPLIT_WAVE64=1: 89 passed, 11 failed, 1 ignored (4.71 s), matchingorigin/maincbc296arun 2 (89 passed, 11 failed, 1 ignored, 4.83 s) on the exact same 11 failing tests (includinggpu_grouped_loads_bounds_and_inactive_lanesfailing atcrates/xcl/src/gpu/recomp/tests.rs:1507:48withsplit wave64: the halves ended with different SGPRs (lower / upper): s127: 0x0 / 0xffff, whilegpu_split_wave64_masks_read_whole_after_partial_writespassed). A 5-runXCL_SPLIT_WAVE64=1check on unmodifiedorigin/maincbc296ashowed pre-existing variance betweengpu_grouped_loads_bounds_and_inactive_lanes(3 passed, 2 failed withs127: 0x0 / 0xffff) andgpu_split_wave64_masks_read_whole_after_partial_writes(1 failed withs0: 0x20 / 0x28, s21: 0x0 / 0xff, 4 passed).Not tested
scripts/smoke.ps1, integration test binaries, and--libmodules outsidegpu::dxilandgpu::recomp::tests::gpu_(no retail title files locally).gpu::dxil::ops_tests::integer_ops_match_cpuanduaddc_and_usubb_match_cpu(skipped: pre-existingvkd3d-proton v3.1/libvulkan_radeon.soabort exit 3).gpu_sparse_vram_descriptors_buffers_and_xmem,gpu_uma_import_check_at_init, andgpu_unified_memory_arena(skipped: pre-existing Wine in-process COM vtable swap).AI use
@DavidM1911 on GitHub · 2026-11-25 04:55 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
@bielfreedom on GitHub · 2026-11-25 05:49 UTC · original
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
cbc296a;cbc296a+ this PR147d054, merged cleanly.CreateComputePipelineStatetime.Method
XCL_DIRECT_DXIL=1,XCL_HEAP_WINDOWS=0,XCL_PIPELINE_THREADS=1.XCL_PSO_DISK_CACHE=0, with a fresh exe name per phase (the AMD driver cache is keyed on it).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.
@zhouzhidong3-hash on GitHub · 2026-11-25 12:47 UTC · original
Independent NVIDIA native-wave32 coverage for #2061 at
147d054fcaa0109bd476e41706362a46fa824e63.Source provenance: GitHub's commit-keyed zipball, extracted unchanged. Git fetch repeatedly failed/stalled, so this is an archive build, not a detached Git checkout. All five files changed by the PR matched the blob SHA values from the GitHub files API (README, core_tests.rs, lower.rs, module.rs, module/opt.rs). SHA256 of the archive is 077dfdf497883551a1627aecaf1b53b1eef67fda52f1e4cf00c8ec750c09e47c. Source hashes checked before/after execution were unchanged.
Windows 10 x64, i7-12700KF, NVIDIA GeForce RTX 5070 driver 591.86, Rust/Cargo 1.100.0 MSVC debug, DXC/DXIL 1.8.2502.11, local Agility SDK. Explicit XCL_ADAPTER=5070. Used the unchanged upstream tests, which call the Direct DXIL compute translator explicitly.
cargo test --locked -p xcl --lib ballot_ -- --test-threads=1 --nocaptureHarness result: 3 passed, 0 failed, 0 ignored, 1093 filtered out, 0.48 seconds. One explicit GPU runtime skip is included among those passes:
ballot_own_bit_wave32: translated/validated both the own-bit and whole-mask compute variants, checked ballot call counts (0 and 1 respectively), dispatched both variants on native wave32, and checked 32 output words per variant. Passed.ballot_own_bit_wave64: both translation/validation and ballot-count checks executed, but GPU execution was SKIPPED (no wave64). No native-wave64 coverage claimed.unused_ballot_as_the_only_wave_op_validates: validates the container after dead-ballot removal. Passed; this is a validation check, not an additional GPU dispatch.This adds the NVIDIA/native-wave32 execution missing from the description. No parent control, broader cross-lane cases, whole workspace, Release, retail shader pack, game run, or performance measurement. It establishes focused fixture correctness on this adapter, not a world-loading speedup.
Local evidence: I:\neospace\work\xcl-2061-5070\nvidia-ballot2061-archive.log and source-before.json, with the source in xcl-dev-xcl-147d054. No runtime or test source modifications made.
AI assistance: OpenAI Codex obtained and checked the source archive, ran the unchanged fixture, inspected the skip and source hashes, and drafted this report.
@jennydeth on GitHub · 2026-11-25 12:59 UTC · original
Test report from an NVIDIA card (listed under Not tested).
Setup: RTX 3060 12 GB (32-lane waves, driver 32.0.16.2101), Ryzen 5 5600X, 32 GB RAM, Windows 11 build 26300, Rust 1.100.0, DXC 1.9.2609.5, debug build. Head
147d054.Result: cargo test --workspace -- --test-threads=4: 1119 passed, 0 failed, 46 ignored.
SKIPPED: 19 GPU tests for no wave64 (expected on this card); the per-lane f16 arithmetic / f16 packed / f32 conversions cases (per-lane form: refused); heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows); pso_measurement_compiles_an_exact_synthetic_record (cannot disable the driver cache).
Not tested: a title run or time to enter the world; native wave64.
AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report.
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.