Skip to content

Recompiler: give each split handoff value one scratch slot and load it where it's used - #2126

Merged
ivall merged 7 commits into
xcl-dev:mainfrom
Kalmarv:direct-split-lazy-restore
Nov 25, 2026
Merged

ivall merged 7 commits into
xcl-dev:mainfrom
Kalmarv:direct-split-lazy-restore

Conversation

@Kalmarv

@Kalmarv Kalmarv commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Part of #1269. Stacked on #2080: only the last two commits are new here, ad03e65 (the change) and f6fa8a9 (its tests). They were 522b1b5 and 3283da4 before the rebase onto main 9633138.

The split in #2080 hands every value live across a cut to the next piece through scratch, and the next piece loads all of them at its entry. A value used several pieces later is stored and loaded again at every cut it crosses, and inside each piece it stays live from the entry to its first use. In one 18,415-instruction ef008c0f piece, 38 % of the values the driver has to keep live across blocks were such handoff values, most of them first used 8 or more blocks after the entry. The NVIDIA driver's build time grows with values live across blocks, so those long ranges cost build time as well as GPU time. Synthetic modules built cold show this: with many live values and memory operations, cost per instruction goes from 24 µs to 65 µs.

With this change the title's three largest direct compute programs build about 1.7–2.1× faster again than with #2080 alone (12–18× faster than whole). On the late shading path the split's GPU time drops from 1.59× the whole program's to 1.23×.

@akimfomin's fixed slot for first-piece values on #2080 (comment) is the narrow case of this; here every carried value gets one.

What is in it

  • crates/xcl/src/gpu/dxil/module/split.rs:
    • Each value carried between pieces gets a fixed per-lane scratch slot. The piece that defines it writes it on the exits where it is live. Pieces that don't use it skip it.
    • A piece that uses the value loads it at the nearest common dominator of its uses, treating each phi input as a use on its incoming edge.
    • Each slot has exactly one writer piece, every read is in a strictly later piece, and no piece reads and writes the same slot, so a sunk load can't see a value overwritten in its own piece. An audit of the signed output checked this for all 24 pieces of the three programs below. Every phi operand's load dominates its incoming edge (52,526 operands across 38 pieces).
    • The emitter also sinks a bitcast, truncation or select into the one block that uses its result, when its operands are already live there.
  • crates/xcl/src/gpu/dxil/module/opt.rs: a one-line change for the sinking.
  • Tests: two GPU tests on a three-piece program. In one, a value skips the middle dispatch. In the other, a value's edge slot would alias another's under the old layout. Both compare the split output with the whole shader and a CPU reference on all 64 words.

Tested

Regression run

The branch was rebased onto main 9633138 with #2080's current head 6c34370. The only change: its two GPU tests' middle blocks, which #2194 would merge with their neighbours, are now conditional, with a phi where the payload arrives.

scripts/smoke.ps1 -Seconds 120, the same retail title, one after the other on the machine under Tested, release builds from clean trees.

main 9633138 (this PR's base):

xcl-smoke v1
commit: 963313835813f475037b3a9f5fcc3cb591696928
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 120
exit: 0x0
frames shown: 1323 (PresentX 1323)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 29175 MB

this PR, f6fa8a9:

xcl-smoke v1
commit: f6fa8a931eaadf925cb42dbac8024af9e3875e1b
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 120
exit: 0x0
frames shown: 1329 (PresentX 1329)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 30533 MB

PR vs main: 1329 / 1323 frames (100 %), peak commit 30533 / 29175 MB (105 %); device removals 0 and crashes 0 on the PR run, 0 and 0 on main.

Both runs use XCL_DIRECT_DXIL=1 and start with the same private XCL pipeline cache, holding only the pipeline list; the driver's own cache was left alone. The PR run logged compute split: 34 programs split, 188 pieces built, 134 chained dispatches issued at 120 s (0 by 60 s, all 134 by 70 s), and no piece ... refused warning. Before the rebase, 3283da4 logged 29 programs, 162 pieces, 83 chains in the same setup; how far the title gets before it stops varies between runs. Both runs present no frames in their last 6 s, for a reason this change doesn't touch.

Not tested

AI use

OpenAI Codex (GPT-6.2) wrote the change, the tests and the audits. Claude Code (Claude Opus 5.5) helpers ran the driver timings and GPU checks, and Claude Code wrote this description and opened the PR.

🤖 Generated with Claude Code

@akimfomin

Copy link
Copy Markdown

Thanks for distinguishing the dispatch and scratch effects. PortBridge checked a conservative last-consumer reuse rule against nine synthetic lifetime arrangements at the dimensions in this PR.

At the ef008c0f dimensions, the model requested 11.14 MiB for 64 groups with fixed slots, and 3.15, 6.29, or 11.14 MiB with reuse depending on the lifetimes. The modeled read/write counts stayed the same and all 50,865 value checks per arm and order passed. Reusing a slot in the same dispatch as the last read failed the write-first control. The existing overlapping-edge fixture is a good check for keeping those slots separate.

For actual plans, per-program totals in dwords per group with fixed slots versus reuse strictly after the last consuming piece would decide whether a prototype is worthwhile. Aggregates are enough without sharing shader inputs. The CPU model leaves GPU speed to a separate measurement. PortBridge #54 is open for optional independent runs of the two pinned tests on Radeon and Intel Arc.

@DavidM1911

Copy link
Copy Markdown
Contributor

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

Thanks!

@bielfreedom

Copy link
Copy Markdown

AMD RDNA4 data for #2126: on top of #2080, the split builds 1.76× faster in wall time and do 2.36× less driver work. That makes the split 14.4× faster than the whole programs on the RX 9070 XT. The 17 programs and the method are the same as in my #2080 report. Every whole and piece build succeeded.

Setup

  • GPU: RX 9070 XT 16 GB (RDNA4), AMD driver 32.0.32029.2010.
  • CPU and memory: Ryzen 7 7700 (16 threads), 32 GB RAM, Windows 11, release.
  • Builds:
  • Both builds carry the same local timing patch. For each program with a dispatch_chain, it builds the whole DXIL, then the pieces on up to 16 threads, and times every CreateComputePipelineState.

Method

Totals (mean of 2 rounds)

#2080 #2126
whole programs, sum 1,028 s 997 s same code, noise
split, wall (16 threads) 125.8 s 71.3 s 1.76×
sum of piece builds 961.8 s 408.0 s 2.36×
whole / split wall 8.2× 14.0×
process peak private 10.1 / 11.5 GB 9.7 / 12.4 GB

Per program (split wall, mean of 2 rounds)

direct DXIL pieces #2080 #2126 faster
108 KB 2 1.1 s 1.1 s ×1.03
133 KB 2 1.6 s 2.0 s ×0.82
166 KB 2 1.4 s 1.3 s ×1.05
786 KB 9 7.2 s 3.8 s ×1.89
792 KB 10 6.8 s 4.7 s ×1.45
830 KB 10 6.8 s 5.8 s ×1.18
845 KB 10 7.0 s 5.2 s ×1.34
917 KB 10 11.4 s 5.7 s ×1.99
918 KB 10 11.4 s 6.1 s ×1.86
959 KB 12 6.9 s 2.3 s ×2.98
1005 KB 11 8.1 s 4.3 s ×1.88
1014 KB 11 8.3 s 6.0 s ×1.38
1016 KB 12 11.5 s 4.2 s ×2.71
1036 KB 12 8.4 s 4.6 s ×1.82
1071 KB 12 12.1 s 4.9 s ×2.48
1201 KB 13 7.6 s 4.1 s ×1.88
1299 KB 14 8.2 s 5.1 s ×1.60
  • In this run the sum of piece build times dropped 1.7–3.0× on every program of 9 pieces or more. With one PSO worker, the split now does about 40 % of the whole program's driver work (408 / 997 s), against 94 % with Recompiler: split large direct compute pipelines at CFG edges #2080 alone.
  • The 2-piece programs (108–166 KB) are unchanged within noise. The 133 KB one was ×0.82, but it is under 2 s either way.

Read / inference

  • The AMD compiler reacts to the shorter live ranges at least as strongly as NVIDIA's (1.7–2.1× in the description). The biggest gains are on the programs whose pieces were the slowest with Recompiler: split large direct compute pipelines at CFG edges #2080 (the 917, 1016 and 1071 KB rows).
  • Because the summed work fell 2.4×, a machine with few free PSO workers gains here as well, not only a 16-thread one. Peak memory with 16 pieces at once did not change.

Tests on this card

  • cargo test --release -p xcl --lib -- dispatch_chain split --test-threads=1 with XCL_REQUIRE_GPU=1 and XCL_ADAPTER=9070: 27 passed, 0 failed, 1 ignored (the opt-in bench_split_wave64), with no SKIPPED notices.
  • That includes 3283da4's dispatch_chain_payload_skips_middle_piece and dispatch_chain_payload_survives_reused_edge_slot, plus the four earlier dispatch_chain_* tests.

Not tested

  • GPU time of the split dispatches.
  • A title run.
  • RDNA2 and RDNA3.

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

@throny throny added the goal:world-load Bears on the retail title getting past world loading label Nov 25, 2026
@Kalmarv

Kalmarv commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor Author

@bielfreedom, thank you. On RDNA4 the summed driver work of the pieces drops 2.36×, more than on NVIDIA (1.8–2.0× on the three programs in the description), so machines with few free PSO workers gain too. I've added your numbers and the 27/0/1 test run to #2126's description.

AI use: Claude Code (Claude Opus 5.5) wrote this reply.

@akimfomin

Copy link
Copy Markdown

Following up with a replay on the actual XCL planner and emitter at 3283da4. PortBridge's replay and raw results include the pinned inputs and a clean reproduction guide.

Strict reuse after the last consuming piece reduced the published native Wave32 loop fixture from 288 to 256 DWORDs per group (11.1%), reaching its peak live-word bound. Static payload accesses stayed at 12 reads and 8 writes. The two original payload fixtures kept 128 and 160 DWORDs per group and emitted byte-identical DXIL. All 28 emitted pieces passed DXV. The CPU replay matched 832 scratch words per layout and access order. Deliberately aliasing the overlapping control produced 32 mismatches.

That is a capacity result for the synthetic plans. GPU timing and stride on the three measured programs remain open. The replay compares the fixed stride, the peak live-word bound and the assigned stride without requiring shader inputs to be shared. Thanks for adding the independent Radeon results. Both pinned tests are covered there, so PortBridge #54 now asks for the remaining Intel Arc run.

@JJAutoCompare

Copy link
Copy Markdown

Tested

At 3283da481077c1962f13f1b4078841662f7a4ccb in a clean detached checkout, dispatch_chain_payload_skips_middle_piece ran on Intel Arc A770 (driver 32.0.101.9175), Ryzen 7 3800X, and Windows 11 25H2 x64 build 26200.9974. Unoptimized test profile, Rust 1.100.0 (0ef1bc386) for x86_64-pc-windows-msvc, DXC/DXIL 1.9.2609.5, XCL_ADAPTER=A770.

cargo test --locked -p xcl --lib --no-run --message-format=json-render-diagnostics
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test {
    & 'L:/XclTooling/pr1947-1831ec4-t3-97236edf/target/debug/build/xcl/97fdf2b9ff8e1482/out/xcl-97fdf2b9ff8e1482.exe' `
        'gpu::dxil::module::split::tests::dispatch_chain_payload_skips_middle_piece' --exact --test-threads=1 --nocapture
}

1 passed, 0 failed, 0 ignored, 0 GPU skips, 1,129 filtered out, 0.50 s. The executable SHA-256 matched before and after mutex acquisition. The stock wave32 fixture issued one whole-shader dispatch and three direct-DXIL chain dispatches, each with a 1×1×1 group grid and 32×1×1 threads per group. Both readbacks matched the 64-word CPU reference. Lanes 0–31 matched mix(mix(1009*i + 77, 10), 50), and words 32–63 were zero.

Not tested

Reused-edge-slot stress, overflow, negative inputs, other fixtures or adapters, performance, full suite, and retail smoke.

AI use

T3 Code / Codex (gpt-6.2-sol) ran the fixture, verified the evidence, and wrote this report.

@thehollowedone

Copy link
Copy Markdown

Native Windows verification of 3283da4 from a clean checkout. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, debug.

Tested

  • cargo build --offline --locked --workspace -j 3 passed.
  • cargo test --offline --locked --workspace --no-fail-fast -j 3 -- --nocapture --test-threads=4 reported 1,160 passed, 0 failed, 46 ignored. Separately, 26 runtime skip notices (21 no native wave64, three unsupported per-lane forms, one driver-cache disable probe, one no heap windows).
  • Both new tests, dispatch_chain_payload_skips_middle_piece and dispatch_chain_payload_survives_reused_edge_slot, ran without skips. Each compared 64 readback words from the whole shader and the split chain against the CPU expectation. The three other split-chain GPU comparisons also passed. The native wave64 fixture skipped its GPU portion.

Not tested
Retail load, cold compile times, GPU execution times, or other adapters. Opt-in samples were unset.

AI use
Codex (GPT-6.2 Sol) ran the tests and drafted this report.

@akimfomin

Copy link
Copy Markdown

Kalmarv, PortBridge found one capacity case that the first-fit order in our earlier scratch census misses. On a new four-piece Wave32 fixture using your pinned #2126 planner and DXIL emitter, fixed slots and the earlier first-fit order both used 192 DWORDs per group. Placing longer-lived values first among values defined in the same piece reached the exact 160-DWORD bound (−16.7%) with the same strict last-consumer rule. The two-word transport value fits without adding slots. The static count stayed at 7 reads and 5 writes. CPU replay matched 224 words per checked order, and DXV validated all 12 emitted pieces.

For the three #2126 plans, a useful aggregate is whether the first-fit stride exceeds the peak live-word bound. Where it does, the two orders can be compared without sharing the shaders. The Intel Arc A770 report covers the skip-middle-piece case. Reused-edge-slot on Intel and GPU timing remain open. The independent RTX 3080 Ti run covered both existing cases at the same revision.

PortBridge reproducer · Earlier replay

Synthetic CPU and DXV checks developed in PortBridge with Codex using GPT-6.

@akimfomin

Copy link
Copy Markdown

Kalmarv, PortBridge turned the strict lifetime rule and the same-piece ordering from the preceding checks into a one-file patch and runnable evidence on 3283da4. It reuses one- and two-word payload slots only after the last carrying destination. When packing saves no space, it keeps the original offsets.

With the real planner and emitter, the Wave32 loop used 288 → 256 DWORDs/group and the four-piece fragmentation case used 192 → 160. The upstream skip-middle and overlap controls kept their original DXIL bytes. Microsoft DXV accepted all 58 generated variants. Replay matched 1,056 words per access order, and the allocator matched an independent reference for 6,585 lifetimes across 128 seeded cases.

The patch is available as an optional add-on if it fits your stack. Its GPU runs and timings on the three upstream programs remain open. The existing Arc A770 skip-middle run covers the original revision. PortBridge ran the checks with Codex.

@Kalmarv

Kalmarv commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

@akimfomin, thanks. #2126 stays as it is for review, since its runs and reports are all on 3283da4. Slot reuse fits better as a small follow-up PR stacked on it.

Your patch covers both rules: reuse only after the last carrying destination, and the same-piece ordering. The original offsets stay whenever packing saves nothing. That makes it a good base. PortBridge is MIT, so it can come over with a provenance note and a THIRD_PARTY.md entry.

What it still needs before it's worth a PR is the scratch per group and GPU time on ef008c0f, c3ae6819 and fb1c6d2d. Those are where #2126 grew scratch 3.5–5.4×. Nobody has started that follow-up yet.

AI use: Claude Code (Claude Opus 5.5) wrote this reply.

@bielfreedom

Copy link
Copy Markdown

#2126 and #2107 compound on AMD RDNA4. On the 13 programs that only #2107 splits on the RX 9070 XT, the split wall drops from 87.3 s to 34.3 s with this PR on top. That is 24× faster than whole. It includes 84eee477d68b6fdf (CS_RaytracingResolve), which never finishes on the HLSL path on AMD (#1809) and now builds in 2.6 s.

Setup

Method

  • XCL_DIRECT_DXIL=1, default split target, XCL_PSO_DISK_CACHE=0.
  • A fresh exe name per run, since the AMD driver cache is keyed on it.
  • 2 rounds, interleaved.
  • Programs: the 12 from my #2107 report plus 84eee477…. Piece counts are the same in both builds.
  • The merged tree's tests on this card: cargo test --release -p xcl --lib -- dispatch_chain split::tests gave 8 passed, 0 failed, no SKIPPED notices.
direct DXIL pieces whole split, #2107 split, #2107 + #2126 gain from #2126
895 KB 11 60.1 s 5.8 s 2.1 s ×2.75
918 KB 11 59.3 s 5.5 s 2.4 s ×2.34
940 KB 11 64.3 s 5.8 s 2.3 s ×2.53
957 KB 11 59.5 s 6.8 s 3.3 s ×2.06
963 KB 11 84.1 s 6.2 s 3.1 s ×1.97
983 KB 12 68.6 s 7.7 s 2.6 s ×2.97
997 KB 12 59.8 s 8.5 s 2.5 s ×3.40
1025 KB 12 65.1 s 5.6 s 2.6 s ×2.17
1026 KB (84eee477…) 12 63.9 s 9.4 s 2.6 s ×3.66
1057 KB 12 44.1 s 6.1 s 2.5 s ×2.45
1096 KB 13 93.4 s 6.2 s 2.6 s ×2.36
1144 KB 13 66.4 s 7.5 s 3.0 s ×2.45
1235 KB 14 48.4 s 6.3 s 2.7 s ×2.35
total 837.1 s 87.3 s (9.6×) 34.3 s (24.4×) ×2.55

Read: with both PRs, every one of these 13 programs builds in 2–3.3 s on a 16-thread CPU. On AMD Windows, the HLSL path takes 1–2 minutes per program, or never finishes for 84eee477….

Not tested: GPU output of the merged form beyond the chain tests, a title run, RDNA2 and RDNA3.

AI use: Claude Code (Claude Opus 5.5) ran this and drafted it. Account owner away; counts and timings only, no game data.

@akimfomin

Copy link
Copy Markdown

Thanks, Kalmarv. Agreed on using the reviewed 3283da4 for #2126 and gating a stacked follow-up on the measurements. I put together a local A/B kit for ef008c0f (early and late seeds), c3ae6819 and fb1c6d2d. It can read scratch per group from your existing harness or use an opt-in probe that prints only piece count and DWORDs per group. The comparison uses full-chain GPU timestamps after a 3 s warm-up, four paired rounds of 20 per build and the same output reference. Only the summary needs to be shared.

The probe reproduced 288 → 256 and 192 → 160 DWORDs/group on two public synthetic fixtures. Scratch and GPU time for the three RTX workloads still need measurement with your inputs. Pinned kit and exact protocol

Codex helped prepare and verify the kit.

@akimfomin

Copy link
Copy Markdown

Kalmarv, PortBridge linked a new independent report from thehollowedone to the exact compact-slot candidate on 3283da4. On Windows with an RTX 3080 Ti (driver 621.35), all three tests passed with zero skips. The native Wave32 test used 256 DWORDs of scratch per group, and all 96 output words across three groups matched the whole shader and the CPU reference.

This adds synthetic hardware correctness coverage. Scratch per group and GPU time for ef008c0f, c3ae6819, and fb1c6d2d remain unmeasured for the candidate.

AI use: Codex (GPT-6, exact variant unavailable) verified the public report and patch digest and drafted this update.

@Kalmarv
Kalmarv force-pushed the direct-split-lazy-restore branch 4 times, most recently from 3b6f7d3 to c9e3945 Compare November 25, 2026 11:10
@Toons29

Toons29 commented Nov 25, 2026

Copy link
Copy Markdown

Regression run of c9e3945f on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 568e7db7, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1566 (PresentX 1566)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14592 MB
xcl-smoke v1
commit: c9e3945fb568dac63a6bd95725dabc412210add2
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1629 (PresentX 1629)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14593 MB

Against the limits in CONTRIBUTING.md: 104 % of main's frames, 100 % of its peak commit, no crash, no device removal.

AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; a script posted this right after the run, with both blocks exactly as printed.

@Kalmarv
Kalmarv force-pushed the direct-split-lazy-restore branch from c9e3945 to 303455a Compare November 25, 2026 11:25
Kalmarv and others added 2 commits November 25, 2026 06:46
Keep control-flow cycles in one pipeline, pass edge-live values through per-dispatch scratch and compile the pieces on the PSO workers. Direct dispatch records the chain with UAV ordering. Indirect dispatch builds the whole form on demand.

Assisted-by: OpenAI Codex (GPT-6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The synthetic split fixture declared u2 twice with different coherence flags. Bind its existing memory window and validate the whole fixture before checking the cut.

Assisted-by: OpenAI Codex (GPT-6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Kalmarv and others added 5 commits November 25, 2026 06:46
Adjacent lanes previously accessed ef008c0f's continuation data 1,612 bytes apart. Store the tag and each live dword in a separate lane-contiguous plane; transport both halves of i64 values through their own planes.

Assisted-by: OpenAI Codex (GPT-6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adopt WebIdentity1's fixture from xcl-dev#2080. Lanes return early, skip ahead
over a piece, or run different numbers of loop iterations. Check the
whole and split outputs against the CPU model and guard words on a
2 x 3 x 2 dispatch grid for native wave32 and split wave64.

Source: xcl-dev#2080 (comment)
Assisted-by: OpenAI Codex (GPT-6)
Co-authored-by: WebIdentity1 <212448219+WebIdentity1@users.noreply.github.com>
Compile and validate a partitionable CFG through the native-wave64 admission gate. On a wave64 adapter, run the whole pipeline and check its lane count and output. Identify the existing compare(64) case as two hardware waves.

Assisted-by: OpenAI Codex (GPT-6)
@Kalmarv
Kalmarv force-pushed the direct-split-lazy-restore branch from 303455a to f6fa8a9 Compare November 25, 2026 11:51
@ettehn

ettehn commented Nov 25, 2026 •

Copy link
Copy Markdown

Independent check on f6fa8a9, Windows 11, RTX 5070 Ti Laptop, DXC/DXIL 1.8.2502.11. cargo test --offline --locked -p xcl --lib dispatch_chain_payload -- --test-threads=1 --nocapture ran both payload readback tests: 2 passed, 0 failed, 0 skips.

One CPU-only comparison on the same local compute record with XCL_DIRECT_DXIL=1, the 12,500-instruction target, split-wave policy, four windows and disk translation caching off. Comparing the base 6c34370 with f6fa8a9, the whole form stayed 957,016 bytes and both emitted 12 valid pieces. Total piece DXIL fell from 1,927,980 to 1,257,712 bytes (−34.8%). Scratch rose from 11,040 to 47,712 DWORDs per group (4.32×), or 44,160 to 190,848 bytes. This measures one translation result; I did not measure GPU time or driver compilation for that record.

Compact-slot follow-up: The PortBridge candidate from 8988421 applied cleanly to f6fa8a9. The same record still emitted 12 valid pieces totaling 1,257,116 bytes. Scratch fell from 47,712 to 20,064 DWORDs/group (−57.9%), still above #2080’s 11,040. At the current 4 GiB per-dispatch limit, the theoretical group-count cap moves from 22,504 to 53,515 with the candidate (97,259 on #2080), before accounting for driver allocation constraints.

On the RTX 5070 Ti Laptop, cargo test --offline --locked -p xcl --lib gpu::dxil::module::split::tests -- --test-threads=1 --nocapture passed all 8 tests, 0 failed and 0 skips, including the allocator, Wave32 and payload readback fixtures. No game launch or GPU timings for the local record.

AI use: OpenAI Codex (GPT-6.2 Sol) assisted with verification.

Originally posted by @ettehn in #2126 (comment)

@itsSio

itsSio commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Tested

Independent verification on clean f6fa8a931eaadf925cb42dbac8024af9e3875e1b. Both PCs: Windows 11 Pro build 26200, debug MSVC, NVIDIA driver 610.88, and isolated XCL caches.

System dispatch_chain filter (pass / fail / ignore; runtime skips) Workspace (pass / fail / ignore; runtime skips)
RTX 5080 16 GB, Ryzen 7 9800X3D, 32 GiB RAM, Rust 1.97.0, DXC 1.9.2609.5 7 / 0 / 0; 1 1248 / 2 / 46; 26
RTX 2080 SUPER 8 GB, Ryzen 5 5600X, 16 GiB RAM, Rust 1.99.1, DXC 1.8.2502.11 7 / 0 / 0; 1 1248 / 2 / 46; 28

Commands: cargo build --workspace --locked -j 4 (exit 0 on both), cargo test -p xcl --lib --locked -j 4 dispatch_chain -- --test-threads=1 --nocapture (exit 0 on both), and cargo test --workspace --locked -j 4 --no-fail-fast -- --test-threads=4 --nocapture (exit 101 on both). The two persistent-payload GPU tests ran and passed on both. Each targeted run skipped only dispatch_chain_native_wave64_builds_whole on NVIDIA. Full-suite skips: 21 no native wave64, 3 unsupported per-lane cases, no heap windows and cache-disable unavailable, plus two missing D3D12 debug-layer cases on RTX 2080 SUPER.

I ran the same targeted filter on the 9800X3D's Radeon RDNA2 iGPU (driver 32.0.21043.5001): 7 passed, 0 failed, 0 ignored, 0 skips, including the native-wave64 fallback and the two payload tests. The divergent 3D test selected AMD Radeon Graphics and checked 384 (wave32) and 768 (64-lane form) output words plus 16 guard words per form.

The two NVIDIA workspace failures match those documented against 9633138 in the PR: rerouted_disk_entries_follow_the_direct_translator (68 vs 1) and pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa (28 vs 85).

Not tested: I did not independently rerun that base, run an AMD workspace suite, or test retail performance, driver compile times, or smoke on this head.

AI use

Ran via Samaritan:

  • OpenCode (GPT-6.2 Sol): ran and audited the tests and wrote this report.

@ivall

ivall commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Merged as afc5ee8 together with the other two of the split (#2080, #2107, #2126), thanks.

Tested on the merged tree: AMD RDNA4, Windows, DXC 1.8.2502.11, debug. cargo test --workspace --no-fail-fast -- --test-threads=4: 1261 passed, 2 failed (fuzz_validate_and_gpu_1 / _3, #2115, as on main), 46 ignored. XCL_DIRECT_DXIL=all on gpu::: 638 passed, the same 2 failed, 22 ignored.

In a title (these heads on main 1a0bbe3 with other open PRs on top: #1803, #2092, #541; AMD RDNA4): two runs of 366 s and 699 s without a removal, and one of 96 s that ended in 0x887a0006, in a list whose last labelled pipeline was a graphics one (a light shader), not a chain. That 96 s run, with a slab commit on top, logged 177 programs split, 1 809 pieces, 75 chained dispatches, each in one slab, scratch at most 54 MiB, largest dispatch 15 MiB. The merge tree itself has not been run in a title.

Conflicts with #1592 (real.rs: the moved compute container and the XCL_DRED labels) and with the test in split.rs were resolved in the merge; XCL_DRED=1 now labels the compute pipelines that a chain returns.

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

akimfomin added a commit to akimfomin/xcl that referenced this pull request Nov 25, 2026
Stack PortBridge's compact allocator on Kalmarv's merged xcl-dev#2126 baseline. Preserve the earlier scratch layout whenever packing saves no space and retain same-stage ordering.

AI use: OpenAI Codex (GPT-6 family; exact serving variant was not exposed) assisted with rebasing, code review, synthetic regression checks and preparation of this fork branch for human review.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

goal:world-load Bears on the retail title getting past world loading

Projects

None yet

Development

Successfully merging this pull request may close these issues.