Recompiler: emit globallycoherent on compute memory windows only when needed #1850
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!1850
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1850/head"
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?
@certified-retart on GitHub · 2026-11-24 21:46 UTC · original
certified-retart:recomp/conditional-globallycoherent→main· +181 −5 · 5 files · 1 commits · closed without mergingOnly emit
globallycoherenton compute shaders' flat memory windows (mem,mem1… andXCL_HEAP_WINDOWSheap views) when the RDNA2 program actually uses cross-workgroup flat-memory coherence (GLC/DLC/SLC, flat-memory atomics, or data cache invalidation). Part of #675 and #1269.Previously both the HLSL emitter and the direct DXIL translator marked every compute shader's flat memory UAVs
globallycoherentunconditionally so cross-workgroup algorithms (such as bottom-up BVH builds) would see other workgroups' writes. On NVIDIA D3D12 hardware,globallycoherentbypasses SM L1 for everyRWByteAddressBufferload—including uniformSMEMloads that all threads in a wave fetch from the same address—turning L1 broadcasts into serialized L2 traffic (and on imported host-memory heaps, multi-microsecond GPU-wide serialized loads).On RDNA2 hardware itself, a workgroup can span both CUs of a WGP (each with its own GL0 cache), so any console shader relying on cross-wave or cross-workgroup flat-memory visibility already emits
GLC/DLC/SLC, atomics, or cache invalidations. Plain compute shaders without any of those only access read-only or disjointly written memory within the dispatch and can safely keep L1 caching enabled.What is in it
crates/xcl/src/gpu/recomp/mod.rs: add sharedneeds_coherent_mem(insts: &[Decoded]) -> boolreturningtrueiff the program contains any flat-memory atomic (BUFFER_ATOMIC_*,GLOBAL_ATOMIC_*,FLAT_ATOMIC_*),GLC/DLC/SLConENC_SMEM/ENC_MUBUF/ENC_MTBUF/ENC_FLAT/ENC_FLAT_GLBL, or cache invalidation (S_DCACHE_INV,S_GL1_INV,BUFFER_GL0_INV,BUFFER_GL1_INV); setem.coherent_memintranslate().crates/xcl/src/gpu/recomp/emit.rs: emitgloballycoherenton rootmem/mem1… declarations andXCL_HEAP_WINDOWSaccessors (XCL_MW) only whenself.coherent_memis set.crates/xcl/src/gpu/dxil/kernel.rs&crates/xcl/src/gpu/recomp/lower_dxil.rs: passcs.is_some() && recomp::needs_coherent_mem(insts)tomem_windowsinLw::new(covering both direct DXIL andlower_dxil).crates/xcl/src/gpu/recomp/tests.rs: addcompute_globallycoherent_only_when_needed(HLSL root/switch/heap,Mode::Kernel, and Direct DXILannotateHandleIsGloballyCoherentbit checks across all triggers) andgpu_compute_coherent_and_cached_loads(real GPU execution of cached plain compute and multi-workgroup coherent atomic+GLC compute across both HLSL and Direct DXIL).Measured GPU impact (RTX 5070)
Load4, 320×180×1 groups of 8×8×1):6.140 ms(globallycoherent) →0.552 ms(cached) — 11.1× fasterXCL_HEAP_WINDOWS=1):6.975 ms→0.538 ms— 13.0× faster4.921 ms→2.297 ms(2.14× faster)5.514 ms→2.171 ms(2.54× faster)XCL_GPU_PROFILE=1,XCL_HEAP_WINDOWS=1):85.4 ms16×16×16 pass dropped to2.3 ms), allowing the title to advance through 10+ consecutive 3D world frames (~24k dispatches).Tested
XCL_D3D12_DIRAgility SDK v614, DXC 1.9.2602.17.maincbc296a(ecc9723):cargo test -p xcl --lib compute_globallycoherent_only_when_needed -- --nocapture: 1 passed, 0 failed (HLSL & Direct DXIL).XCL_DIRECT_DXIL=1 cargo test -p xcl --lib gpu_compute_coherent_and_cached_loads -- --nocapture: 1 passed, 0 failed.cargo test --workspace -- --test-threads=4passed with 0 failures on prior rebase (3da2abb); targeted unit and real-GPU tests plus 60 s smoke re-verified onecc9723.SKIPPEDGPU tests on this host:gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware(no wave64),shaders::tests::pso_measurement_compiles_an_exact_synthetic_record(cannot disable the driver cache),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).Regression run
main:
PR:
Not tested
AI use
@thehollowedone on GitHub · 2026-11-24 21:55 UTC · original · edited 2026-11-24 21:58 UTC
Tested
On
0861c8ce, both stock tests passed on the RTX 3080 Ti. That covered the generated coherence flags and the synthetic cached-load and atomic-ticket readbacks.I also ran a separate HLSL microbenchmark that varied only
globallycoherenton a single root UAV. Each of 8,192 groups of 32 threads summed 80 group-uniformLoad4reads and stored one result per thread. Both versions matched the CPU values at all 262,144 output positions. GPU timestamps excluded pipeline creation, uploads, and CPU waits. In coherent / cached / cached / coherent order, the medians were 0.1966 / 0.0410 / 0.0420 / 0.1966 ms, with nine measured dispatches per batch after omitting the first.Windows 11 build 26300, RTX 3080 Ti / 621.35, Ryzen 7 9800X3D, Rust 1.99.1 MSVC debug, DXC 1.8.2502.11.
cargo test --offline --locked -p xcl --lib <filter> -- --nocapture --test-threads=1passed 1/1 each forcompute_globallycoherent_only_when_needed,gpu_compute_coherent_and_cached_loads, and the localscratch_coherence_flag_timing_on_root_uavfixture. Zero skips.Not tested
The timings isolate the qualifier on an HLSL compute shader. This does not measure retail frame time or descriptor-heap dispatch performance.
AI-assisted. Codex (GPT-6 family, exact variant unavailable) wrote and ran the timing fixture and drafted this report.
Descriptor-heap retest on the same revision
I ran the cached-load and atomic-ticket fixtures with two distinct 4 KiB descriptor-heap views on the same RTX 3080 Ti setup. The shader addressed window 1 for its input, output, and atomic counter. Window 0 held sentinels at the same offsets.
HLSL, per-instruction DXIL, and per-lane DXIL each returned all 128 expected load results and all 512 atomic tickets, with a final counter of 512. All 1,024 sentinel words in window 0 stayed intact in both cases. Each backend was compiled and dispatched directly.
cargo test --offline --locked -p xcl --lib scratch_gpu_two_heap_windows_coherence -- --nocapture --test-threads=1passed 1/1 with zero skips. This measures correctness through descriptor-heap views. The timing above remains for the root UAV only.@upipibi on GitHub · 2026-11-24 22:28 UTC · original
On Ampere: RTX 3070 8 GB (32-lane waves), driver 616.56, Windows 11, debug.
Merge with
main689f2db: one conflict, indxil/kernel.rs.mainaddedEntry::Geometryto theresline. Keeping main'sresand your twocoherent/mem_windowslines builds cleanly.cargo test -p xcl --lib -- gpu_ coherent --skip gpu_sparse_vram --test-threads=4:XCL_DIRECT_DXIL=1main689f2db0861c8con689f2db*
coherent_buffer_sanitizes_console_flags_and_state, theVirtualFreeflake from #1487 / #1590, onmainonly. The extra passes are yourcompute_globallycoherent_only_when_neededandgpu_compute_coherent_and_cached_loads(both paths). No new failures, including the split-wave64 and BVH GPU tests. XCL's own cross-wave state (exchange slots, barrier counters,XCL_WT) is ingroupshared, so droppinggloballycoherentfrom the memory windows doesn't touch it. The sparse test was skipped because of #1727.AI-assisted (Claude Code). Synthetic tests only.
@CharlyRien on GitHub · 2026-11-24 22:31 UTC · original · edited 2026-11-24 22:37 UTC
Tested (RTX 3090, 32-lane waves so the split wave64 form,
XCL_HEAP_WINDOWS=1)I applied the HLSL-path part of this PR (
needs_coherent_memand the twoemit.rssites, not the direct-DXIL part) on the tree under Setup below and ran a heavy retail title into its 3D world. GPU times below are D3D12 timestamp queries around each dispatch.1. The rule removes the worst dispatches here
2. Why it is seconds here and milliseconds in the description: the imported host-memory heap
The cost is not only the L1 bypass. It depends on what backs the memory window. Micro-benchmark, one heap view, 1 024 dependent loads per thread, ns per load per wave:
globallycoherentOpenExistingHeapFromAddress(the committed window)So a coherent load from the committed window is about 30 times more expensive than the same load from video memory, and other groups wait for it. That is what turned loops over a constant buffer into 8 s dispatches.
3. What remains with the rule: programs kept for one atomic
About 23 % of the pack's compute programs keep the qualifier under this rule. In a world frame they now carry almost all the GPU time, about 5 s per frame on the main queue:
XCL_UMA_SHADOW=1, two runs)Every one of these is kept because of a
buffer_atomic_addorbuffer_atomic_cmpswap(GLC on the atomic itself); their ordinary loads carry no GLC. So the next step could be per instruction rather than per program: a coherent view for the instructions that ask for it and a plain view of the same window for the rest. I am measuring that offline (whether a plain view stays fast when a coherent view of the same heap is used in the same shader, and whether outputs match) and will report here.Setup (edited in: the exact stack)
main9e3831emerged locally with #1288, #1448, #684, #889, #1323, #929 and #640, plus local diagnostics (GPU timestamp queries around each operation, a device-removal watcher), then the HLSL-path part of this PR. The table of section 1 also uses a local switch that drops the qualifier for chosen programs (same HLSL as this PR emits for them). The #1329 column is the same tree with #1326, #1327 and #1329 instead of this PR, and a local change insparse.rs(see my comment on #1329).XCL_HEAP_WINDOWS=1 XCL_NETWORK=0 XCL_ACTIVITY=1, warm DXIL and driver caches, scripted A presses, 230 – 300 s per run, noXCL_PSO_WAIT_MSunless a row says so.XCL_PSO_WAIT_MS); the title's own stall watchdog is neutralised so that long stalls can be observed.TdrDelayandTdrDdiDelayset to 30 s. With the default 2 s the driver resets the device during the multi-second dispatches (System event 4101) and nothing can be timed.Not tested
main, AMD or Intel GPUs. Noscripts/smoke.ps1block: the base is old and carries local diagnostics.XCL_PSO_WAIT_MS=50), so 5 s per frame is a lower bound. The per-dispatch times are not affected.GPU queue.Waitrelease. Looking into it separately.AI use: Claude Code (Claude Fable 5.2) ran the measurements and drafted this report.
@Krashgamer on GitHub · 2026-11-24 23:44 UTC · original
Title runs with both parts of
0861c8c(direct DXIL and HLSL) on an RTX 3080 10 GB (driver 610.88),XCL_DIRECT_DXIL=1, retail 1.0.2.1 into the world load. This adds the direct-DXIL path to @CharlyRien's HLSL-path numbers.Tree:
main4178e88+ #640 + #742 + #751 + #800 + #1055 + #1405 + #1580 + #1765 + #1766 + #1791, and this PR ported by hand.kernel.rsandmod.rsneeded the change re-applied on that base, becausekernel.rsdecodes intocfg.inststhere. I didn't port the tests.XCL_PSO_WAIT_MS=50 XCL_PAGE_BUDGET_MB=4096, warm caches, A every 10 s.1. The program from #1766's example,
CS 79d178afa02abd49(XCL_GPU_PROFILE, per dispatch, same tree with and without this PR):2. The GPU wait stalls (#1452) over the whole run:
queue.Wait … released on CPUThe two runs with this PR that ended early, at 213 s and 225 s, are the title reading through garbage pointers (the #1164 family), not GPU waits.
Not tested: this PR's own head (only the port); its tests on this base; AMD.
AI use: Claude Code (Claude Opus 5.5) ported the change, ran the runs and wrote this.
@DavidM1911 on GitHub · 2026-11-25 01:16 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
@certified-retart on GitHub · 2026-11-25 01:48 UTC · original
Rebased cleanly onto \main\ (\
3da2abb, new head \dc7565d) to resolve the \dxil/kernel.rs\ andecomp/tests.rs\ conflicts. Re-ran the full workspace test suite (1,113 passed, 0 failed), direct-DXIL tests, and fresh matched 60 s smoke runs. Thanks everyone for the thorough independent benchmarks and verification!
@certified-retart on GitHub · 2026-11-25 02:05 UTC · original
@CharlyRien I ran a quick follow-up microbenchmark on an RTX 5070 (Blackwell, Agility SDK v614, DXC 1.9.2602.17) backed by a 1 MiB host-memory buffer imported via \OpenExistingHeapFromAddress\ (64 groups × 32 threads, 512 dependent loads/thread, D3D12 timestamp queries, median of 3 measured dispatches after warmup) to test splitting plain loads and \globallycoherent\ atomics/stores in the same compute shader:
A same-thread hazard check (plain \Load\ → coherent \Store\ → plain \Load\ → coherent \InterlockedAdd\ → plain \Load) also showed \
@imnicho on GitHub · 2026-11-25 02:27 UTC · original
RTX 5080: a retail dispatch that does not finish with
globallycoherentheap windows, and finishes without the flagMeasured tonight before I knew of this PR, so this is not a run of your code: it is the same change made by hand in one program. It supports what you measured, from a card with 32-lane waves where that dispatch ends the run.
Setup. RTX 5080 16 GB (driver 610.47), i7-7700K, Windows 10 22H2; the retail title of #675 (my own copy),
XCL_NETWORK=0, noXCL_PSO_WAIT_MS, heap windows on, every pipeline already built (0 driver builds of 10 s or more in these runs), nothing skipped. Tree:mainb7aa9f3+ #684 + #266 + #1288 + #1316 / #1448 + #1323 (XCL_GPU_CULPRIT=1). The longer account is on #675: #675In the title. Every run on this card ends in
0x887a00067 - 98 s after the world's set-up. The first dispatch not done at the watchdog's report is record50625695d2e6cbe7:numthreads(4, 4, 4), groups 32x32x2, split wave64. Its own code has 87mem.Load*and 83xcl_loadx4sites and no store or atomic on flat memory (whether its loads carry GLC I did not check). With a local hook that substitutes text in the HLSL of that one record and leaves every other pipeline as it is, one run each:globallycoherent(asmainemits them)0x887a0006NonUniformResourceIndextaken off the index0x887a00060x887a0006globallycoherent0x887a0006with other programs not donegloballycoherent)Synthetic, same card (my own shader in a local test:
[WaveSize(32)],numthreads(4, 4, 4), groups 32x32x2, 1,024 loads a thread from 4 windows of 64 MiB of committed video memory; wall time of the dispatch, median of the three after the first):globallycoherentgloballycoherentgloballycoherentSo here too the flag costs 4 - 8x on loads every thread repeats; the heap form's handle per access doubles that once more (taking the four handles once at the start of
mainbrings it back to the switch form's time); and for one retail program that is the difference between a dispatch that completes and a device removal. The synthetic numbers are on committed video memory, not on the imported host memory the title's windows sit on, where your numbers say the cost is higher still.Not tested
AI use: Claude Code with Claude Fable 5.2 ran the title and the tests and wrote this.
@CharlyRien on GitHub · 2026-11-25 02:30 UTC · original
@certified-retart thanks for running that – it matches what we measured here, and here is the follow-up I promised above: the per-instruction form implemented in the translator and what it does to the programs this PR's rule keeps coherent.
Setup
main9e3831emerged locally with #1288, #1448, #684, #889, #1323, #929 and #640, plus the HLSL-path part of this PR, plus a local change behind a switch (default off): programs thatneeds_coherent_memkeeps get two views of each memory window from the same heap descriptor, one plain and onegloballycoherent. An instruction goes through the coherent view if it is a memory atomic or has GLC/DLC/SLC set (SMEM, MUBUF, MTBUF, FLAT, GLBL, MIMG); everything else uses the plain view. Whole-program coherence stays as the fallback for programs with a cache invalidation, without heap windows, or with a single window.XCL_HEAP_WINDOWS=1, split wave64, release. RTX 3090 24 GB (driver 616.56), Ryzen 9 5950X, Windows 11 22631, DXC 1.9.2602.17. Timings are timestamp queries with nothing else on the GPU, two passes.Micro-benchmark (one shader with both views of the same imported host heap, 1 024 dependent loads per thread; ns per load per wave)
Atomics cost the same through either view (1 423 ns per wave), stores too (37 ns). 64 groups, whole dispatch: plain 0.085 ms, coherent 373 ms, split 0.161 ms. Results exact in every run (65 536 of 65 536 tickets distinct, counter exact, stores visible to the CPU). The DXIL has one
createHandleFromHeapand twoannotateHandle.On the pack
buffer_atomic_*: 1 of 109 memory instructions in the heaviest one, 1 of 12, 4 of 22, 6 of 32, 1 of 14, 2 of 61, 74 of 452.Not tested yet
I can post the diff (
emit.rs, the_ccopies of the memory helpers and the test) if you want to fold it into this PR or a follow-up.AI use: Claude Code (Claude Fable 5.2 coordinating, Claude Opus 5.5 for the implementation and the benchmark) did this and drafted the report.
@JJAutoCompare on GitHub · 2026-11-25 03:00 UTC · original
PR #1850 qualifier test
Tested
ecc9723b6cdbd8e33ea00fabfa72987ba71337bcbefore and after the run. The assigned checkout was clean at that commit before and after the test. Before the run, GitHub returned nine discussion comments, zero reviews and zero inline review comments. I found no independent report of this qualifier test at the exact head in those comments. After the run, GitHub's public PR page still showed the PR open and the same discussion comment IDs. The public Git ref confirmed the exact SHA.26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 driver32.0.101.9175, Rust1.100.0(0ef1bc386,x86_64-pc-windows-msvc, LLVM23.1.5), Cargo1.100.0(3acc79c0c). Cargo used the unoptimized test profile with debug info disabled. The fixture logged DXC and DXIL1.9.2609.5(DXC build01b62ad4).XCL_ADAPTER=A770,XCL_DXC_DIR=C:\Users\ljensen\AppData\Local\XclTooling\dxc-1.9.2609\bin\x64,CARGO_BUILD_JOBS=2,CARGO_INCREMENTAL=0,CARGO_PROFILE_DEV_DEBUG=0,CARGO_PROFILE_TEST_DEBUG=0,CARGO_TARGET_DIR=L:/XclTooling/pr1778-2e2ee55-20261125-020159/target, and bothTEMPandTMPset toL:/XclTooling/pr1850/temp.SKIPPEDlines), with 1,125 filtered out and exit code 0. The fixture verified the generated HLSL qualifier for plain compute and the checked-in coherence triggers across single-root, multi-window switch, and descriptor-heap configurations. It checked that kernel-mode HLSL omits the qualifier for the atomic case. With DXC loaded, it also checked the direct-DXILIsGloballyCoherentbit for plain and atomic compute shaders in single-root and descriptor-heap configurations.L:/XclTooling/pr1850/qualifier-ecc9723-20261125T025429671Zand have.environment.log,.stdout.log, and.stderr.logsuffixes. Cargo emitted two Rustfetch_updatedeprecation warnings.Not tested
gpu_compute_coherent_and_cached_loadson its own revision,a03bc75e8bebe1dc9864356fd875abb9c5b165fb.AI use
gpt-6.2-sol) ran the checked-in fixture and recorded the results.@TyraelDauthau on GitHub · 2026-11-25 04:54 UTC · original
Tested
ecc9723alone (release) on the retail title of #675 with heap windows: no GPU reset in 12 runs, 10 of which reached the world load (9 of those with a warm cache).RTX 5060 Ti 16 GB (driver 610.88), Ryzen 9 9900X, Windows 11 build 26300, DXC 1.9.2609.5.
XCL_HEAP_WINDOWS=1 XCL_PSO_TRACE=1, A pressed every 10 s from 20 s (XCL_PRESS_A_AT), 100 s per run withscripts/smoke.ps1, the first run on an empty XCL cache. A reset is annvlddmkmevent in the System log.XCL_DIRECT_DXIL=1)Before this PR, on
c4d37bewith the same input (builds and settings varied), 6 of 10 warm heap-window runs reset the GPU at the world load, and 0 of 3 cold. One dispatch of50625695d2e6cbe7, the program in imnicho's report, took 1.6 s there, near Windows' 2 s timeout.Not tested
mainwith heap windows on this base: the runs before this PR are onc4d37be.AI use: Claude Code (Claude Opus 5.5) built the head, ran the runs and drafted this report.
@imnicho on GitHub · 2026-11-25 05:38 UTC · original
RTX 5080 16 GB, the title on this PR's rule (the follow-up I promised above): the dispatch that hung takes 7 ms; what is left are the programs the rule keeps coherent
Setup. As in my comment above (RTX 5080 16 GB, driver 610.47, 32-lane waves; i7-7700K, 16 GB RAM; Windows 10 22H2; the retail title of #675, my own copy;
XCL_NETWORK=0, binds waiting, nothing skipped but in the one run named below). Tree: #2057 atf862f5f, which carries this PR's rule (itsneeds_coherent_memis the same asecc9723's), + #684 + #266; from the fourth section on also #1515 (the budget in the memory line).XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_HUGE_PSO_CONCURRENCY=2, release. Five 15-minute runs filled the caches first; the numbers are from the runs after them.TdrDelayis 8 s on this PC.1. The program of my first table (
50625695d2e6cbe7, 4x4x4 threads, groups 32x32x2). With this rule it is not coherent any more, and in #1766's profile it takes 7.4 ms a call, longest 15.1 ms (the 9 calls that reached the 2 s lists of one run). Before, it was the first dispatch not done at every device removal.2. The device is still removed, later (imported host memory behind the committed window, the default on this card). Seven runs:
0x887a0006at 93, 153, 233 and 722 s after the world's set-up in four of them, each with a System event 4101 (the display driver stopped responding) at that time; the other three ended in the title after the GPU-wait watchdog had released 47 to 146 waits: two in an exception, one at the null write of #675's title, 25 s after a burst of dispatches skipped with "unified memory is full" (the committed window at 4,095 of 4,095 MB). Frames after the set-up: 13 to 285 a run. On the tree of my first comment the removal came 7 to 98 s after the set-up.3. Where the GPU time is now (one run with
XCL_GPU_PROFILE=1, 35 world frames, 89.8 s of console GPU time in all, removal 156 s after the set-up):1b5466f261a70cde(8x8x1, 9,060 B, 160x90x1)19a1c1ba0b567618(8x8x1, 1,148 B, 160x90x1)9dc85ad397cbaffe(8x8x1, 2,404 B, 160x90x1)3429c04607b00016(32x1x1, 684 B, 57600x1x1)b78fa10b425b8e54(8x8x1, 7,228 B, 160x90x1)56446569eccb04f0(32x1x1, 2,052 B, 57600x1x1)67657769b50d2f8b(32x1x1, 4,196 B, 57600x1x1)"Kept coherent" is from each program's translated source. Later in that run single calls reached 3.0 s (
9dc85ad397cbaffe) and 3.4 s (3429c04607b00016). This is the picture of @CharlyRien's section 3 above, on another card.4. With the committed window in video memory (
XCL_UMA_SHADOW=1, #1329 as #2057 has it): three runs, 0 waits released, no device removal (two ran to their 300 s limit, one ended at 252 s at the title'sint3of #1164). In the two that had the profile on, the six coherent programs take 1 ms a call or less (longest call 3.4 ms), and all console code of a run is 5.1 and 6.6 s of GPU time (120 to 140 ms per world frame, against 2,566 ms in the run of section 3). The cost on a 16 GB card: 19.4 GB of local video memory against a budget of 15.2 GB. Without the shadow it is 15.4 GB against 15.1 GB, so this card is at its budget in the Series X profile either way.5. Instruction by instruction. That is #2067 now. I had made the direct-path part of the same idea locally before I saw it, and measured it in this title: the frame's console GPU time falls by about a third without the shadow, five of the six coherent programs above take 2.4 to more than 10 times less a call, the sixth (
56446569eccb04f0, onebuffer_atomic_addwith GLC in a dispatch of 57,600 groups) does not, and the device is still removed. The table is on #2067: #2067Not tested
main: every run here is on #2057's tree, with the two PRs the title needs on this PC.AI use: Claude Code with Claude Fable 5.2 ran the title and the tests and wrote this.
@bielfreedom on GitHub · 2026-11-25 05:49 UTC · original
AMD RDNA4 offline numbers for #1850: AMD driver time −2.3 % (repeats in both rounds), but DXC's DXIL grows 6.9 %. That is on the HLSL path, 24 retail compute programs; 21 of the 24 lose
globallycoherent.Setup
cbc296a;cbc296a+ this PRecc9723, merged cleanly.CreateComputePipelineStatetime.Method
xcl shaders --precompile --only cs, then--pipelinesfrom that cache.XCL_HEAP_WINDOWS=0,XCL_DXC_THREADS=1,XCL_PIPELINE_THREADS=1.XCL_PSO_DISK_CACHE=0, with a fresh exe name per phase, since the AMD driver cache is keyed on it.Totals (round 1 / round 2; 0 refused in all runs)
Per program (mean of 2 rounds)
Read / inference
globallycoherentqualifier, so the DXIL growth comes from DXC treating non-coherent UAV access differently. Possibly it combines or reorders more freely. I did not look at the DXIL to confirm. It does not slow the AMD driver here, but the description might want to mention it, since DXIL size is used as a cost proxy elsewhere in #1269.Not tested
lower_dxil.rs/kernel.rschanges).XCL_HEAP_WINDOWS=1.AI use: Claude Code (Claude Opus 5.5) ran the measurement and drafted this. Counts and timings only, no game data.
@raylitebull on GitHub · 2026-11-25 10:47 UTC · original
ecc9723now conflicts incrates/xcl/src/gpu/recomp/tests.rsafter #2054 merged onmain.Please rebase onto
main; in addition,@bielfreedom's RDNA4 check covered offline HLSL only, so an exact-head AMD GPU test / direct-path pass on the rebased head will also be needed before merge.@gefydev on GitHub · 2026-11-25 15:56 UTC · original
@certified-retart in case it saves you the rebase: I applied
ecc9723ontomain0829441and it comes out as one commit,83ad6a5, with your authorship and your message unchanged. It is in my fork, and I have not pushed anything to your branch:git fetch https://github.com/gefydev/xcl.git globallycoherent-rebased(thengit reset --hard FETCH_HEADon your branch andgit push --force-with-lease, orgit cherry-pick FETCH_HEADonto a fresh branch frommain).What conflicted. Three places, all two changes adding next to each other; nothing of the change itself was touched:
gpu/recomp/emit.rs, two hunks:mainadded theimg_writesfield ofEm(andimage_write_srsrcs) where this PR addscoherent_mem. Both fields are kept, andcoherent_mem: falsenext toimg_writes: Vec::new()in the constructor.gpu/recomp/tests.rs: both tests appended at the end of the file are kept,main's resinfo one and this PR'scompute_globallycoherent_only_when_neededandgpu_compute_coherent_and_cached_loads(the conflict was after #2054, as @raylitebull said, andemit.rsconflicts too).Tested (
83ad6a5,CARGO_BUILD_JOBS=2): NVIDIA GeForce GTX 1650 4 GB (32-lane waves), driver 621.24, Ryzen 5 1600, 16 GB RAM, Windows 11 Pro 26300, Rust 1.100.0, debug.compute_globallycoherent_only_when_neededandgpu_compute_coherent_and_cached_loadspass; the GPU one ran, it was not skipped.cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4: 1274 passed, 0 failed, 46 ignored. 27 SKIPPED: 21 wave64 cases (no wave64 on this GPU), 3 per-lane f16 cases the per-lane form refuses, 1 "no heap windows", 2 for the D3D12 debug layer not being installed.Not done, and it is yours or a reviewer's to do:
xcl-smokepair: the two blocks in the description are forecc9723, soPR checkswill want a pair for the rebased head. I did not run one: my card runs out of memory with the title.AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @gefydev and rebased the commit.
@gefydev on GitHub · 2026-11-25 16:11 UTC · original
@certified-retart @raylitebull since #1850 no longer merges into
mainand the author has not answered, the rebased commit is open as #2346: the same change, your commitecc9723ontomain0829441(83ad6a5) with its authorship and message, and nothing of it altered. Its description carries your explanations and measurements, credited to you, plus what the rebase changed (three conflicts, both sides kept) and my own run on a GTX 1650: the whole suite 1274 passed, 0 failed, 46 ignored.It lacks what I cannot make: a smoke pair for the rebased head and the exact-head AMD pass raylitebull asked for. If you rebase #1850 yourself, say so here and the two should not both be merged; I have not touched your branch.
AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @gefydev.
@gefydev on GitHub · 2026-11-25 16:20 UTC · original
@certified-retart @raylitebull the rebased commit was merged as #2346 (merge commit
3f4495aonmain, by @raylitebull), with the author's commit83ad6a5and its authorship. So the change of this PR is onmainnow andecc9723here is obsolete; it conflicts withmainand should not be merged as well. I have not touched this branch or closed anything.AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @gefydev.
@Prime1997 on GitHub · 2026-11-26 01:19 UTC · original
Closing because this change is already on main. #2346 carried this PR's commit, rebased with its author and message kept, as
83ad6a55("Recompiler: emit globallycoherent on compute memory windows only when needed"), and it was merged in3f4495a2. Thanks for the fix; it is in main.Compared at head
ecc9723bagainst main08db802. Reviewed with Claude Code (Claude Opus 5.5); I checked the comparison before closing.@DavidM1911 on GitHub · 2026-11-26 06:28 UTC · original
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current
mainon the new head — needs another rebase before it can be tested.Pull request closed