Recompiler: XCL_OUTLINE_EXCHANGE=0 keeps the split-wave64 rendezvous inline #2210
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!2210
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2210"
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?
@brandostrong on GitHub · 2026-11-25 09:53 UTC · original
brandostrong:narrow-exchange→main· +211 −32 · 3 files · 2 commits · draftWhat changes and why. #1901 decides one thing for three groups of helpers: from 1 024 instructions the memory-window accessors, the split-wave64 rendezvous and the typed-format conversions all become
[noinline]. The reports on that PR show the three groups do not behave alike — the build win comes from the accessors and the format conversions, while the dispatch-time cost (@CharlyRien's 1.7 – 2.7× on Ampere, reproduced here at 1.73× on an RTX 4090) is entirely in the rendezvous helpers, and their "keeping the exchange inline and outlining only the accessors and the format helpers … would keep most of the build gain; I have not measured those variants" is exactly this. This splits the decision in two and puts the exchange group behindXCL_OUTLINE_EXCHANGE=0, which keeps it inline, so the variant can be measured without editing the emitter. Nothing changes by default.What is in it
crates/xcl/src/gpu/recomp/emit.rs:outline_exchange()(XCL_OUTLINE_EXCHANGE=0→ keep inline), andEm::finishpassesoutline && outline_exchange()tox64_preludeinstead ofoutline. The accessor and format thresholds are untouched.Why this is the shape to keep. A retail title's ten largest compute programs that have no driver blob, measured on this rig: eight of the ten have no lane-exchange sites at all (0
xcl_x_ballot,xcl_x_meet,xcl_x_rla_*) and 318 – 467 window-accessor sites, so for them the accessor and format outlining is the whole win and the exchange group is not in the program. The two that do have exchanges (1 030 and 982 ballot sites, both of one shadow-cascade family) are exactly the programs that would pay the dispatch cost. So the two decisions need to be separable, and one build with the switch measures both. Measured both ways the split is real in both directions: for the eight the DXIL is byte-identical between the settings, and for the two that read lanes the inline form costs 21 % of DXIL and 8 % of driver time overmainwhile giving back the 1.73× dispatch cost. The default stays what #1901 chose; the switch is what makes the other side measurable and what a title that reads lanes per iteration can be run with.Tested
cargo build --release --offline --workspacethencargo test --release --offline --workspace -- --test-threads=4on this branch: 1155 passed, 0 failed, 46 ignored, exit 0, 24SKIPPEDlines (no wave64,no heap windows, the direct path's refused f16 / f32 forms) — the same counts and the same skip set asafbc413alone on this adapter, which is what "nothing changes by default" should produce.scripts/smoke.ps1 -Seconds 180run of a retail title withXCL_OUTLINE_EXCHANGE=0on this branch, on a wiped per-tree cache: 1719 frames shown, 0 device removals, 0 crashes, peak commit 30 327 MB, worst single compute compile 11 017 ms.mainand #1901 under the same procedure give 1539 / 29 491 MB / 8 072 ms and 1488 / 30 008 MB / 8 993 ms; all three stop presenting between 90 and 102 s, so the frame counts compare the same screen and this is one run per tree, not a pacing result.XCL_OUTLINE_EXCHANGE=0vs1on the same build, GPU time of a 32 768-iteration exchange loop (2^18 threads, median of 9, RTX 4090): the split-wave64 form that reads a lane every iteration goes 42.909 ms → 24.894 ms, i.e. 1.015×main's 24.522 ms instead of 1.75×; the mask-only split form 8.480 → 7.632 ms (main7.954); the two wave32 forms 7.058 → 7.235 and 7.781 → 7.940 ms (main7.323 / 8.188).dx.opcounts), so for programs without exchanges the switch changes nothing the driver sees. ColdCreateComputePipelineStateof those four, exchange inline: 20.668 / 36.926 / 5.391 / 3.178 s, against 28.608 / 26.553 / 3.066 / 3.474 s for the identical bytes in the other leg — that spread is this machine's run-to-run variance, not a difference between the settings.maincompiles the same four in 75.525 / 132.446 / 8.020 / 4.932 s.73fb752d7f62c3a5, 1 030 ballot + 109 lane-read sites), cold driver each leg:=11 706 500 B / 219 360 instructions / 6 787 phis / 12 198dx.opcalls at 55.401 s and 60.075 s (identical bytes, two legs),=02 075 296 B / 260 182 / 12 066 / 18 951 at 68.295 s, and568e7db1 933 172 B / 236 547 / 16 902 / 30 602 at 63.400 s. On that class the switch is a trade, not a free win: 21 % more DXIL and 14 – 24 % more driver time than the outlined form, 7 % more DXIL and 8 % more driver time thanmain, and 2.5× its DXC time (138.8 s against 55.8 s). It buys the dispatch time there and pays for it in the build.SKIPPEDGPU tests on this adapter: theno wave64set and the direct path's refused f16 / f32-conversion forms, same asmain.Not tested
unsupported→0x887A0005and the RDNA4ParseAddressfailures reported on #1901 are about the outlined switch-form window accessors — #1867's reporter shows the same program builds withXCL_HEAP_WINDOWS=1, where the accessors stay inline and the DXIL is the base's, and the RX 7800 XT report on #1901 finds the suspension follows any remaining[noinline]internal function. This switch only removes the outlined exchange helpers, so it neither fixes nor reproduces those, and I did not test AMD.)AI use
🤖 Generated with Claude Code
@DavidM1911 on GitHub · 2026-11-25 16:07 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!
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.