Recompiler: the compact form's larger tables on a 64-lane GPU with heap windows #2365
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2375"
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?
Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-11-25T17:22:23Z.
On a GPU with 64-lane waves, the direct compact form now takes tables of up to 12,288 words, as on a GPU with 32-lane waves, only with heap memory windows (
XCL_HEAP_WINDOWS=1); with the default switch windows such a GPU keeps 8,192 words, as onmain. So record95cc13288a27a96etakes the compact form on such a GPU only with heap windows, and the default path does not change. That matters because since #2120 a compute program with over 8 MB of HLSL takes the direct translator withoutXCL_DIRECT_DXIL, and this one does; the first commit alone (39ec915) changed the default path on such GPUs, and an earlier version of this description wrongly said the change acts only withXCL_DIRECT_DXIL=1. The second commit (9975836) is the guarded rollout asked for in review; the third (98b60d0) only moves a doc comment back to its function. Part of #2088.What holds now, on one AMD card model, the RX 9070 XT, in 2 runs on each of two machines: with heap windows (
XCL_HEAP_WINDOWS=1) this program's compact form builds, and its plain form, which the guard kept, did not within 48 GB. @bielfreedom's run of this branch on a 32 GB machine built it in 137.8 and 149.1 s at a 17.64 GB peak (2 of 2), where68a284a's plain form passed 24 GB; @komglebissarov's run on a 64 GB machine, onmain0829441before #2076 with the form forced, built it in 198 and 203 s at 33.9 GB, where the plain form passed 48 GB. With the default switch windows neither form builds within 24 GB (the compact form gets there sooner, 95 s against 226 s), so on the default path the guard bought nothing. The guard came from @bielfreedom's run oncbc296a, before #2174 nested the dispatch, where neither form built within 24 GB and the compact form reached it sooner (31 s against about 205 s).What is in it
kernel.rs,compact.rs,pso.rs:direct_computetakes the larger tables wherelarge_tablessays so, on a GPU with 32-lane waves only or with heap windows (mainasks only the first). The net change againstmainis that condition, its test and two doc lines.pso.rs:a_gpu_with_64_lane_waves_takes_the_larger_tables_only_with_heap_windows. Withlarge_tablesreturningsplit_wave64alone it fails (pso.rs:1398); with the condition it passes, with the 13 compact tests (under Wine, at98b60d0).nvidia-dev(c044dc6) andamd-dev(6a0bb5b) inkernel.rsandpso.rs. On a GPU with 32-lane waves it changes nothing, so there is nonvidia-devversion of it.Tested
main8b957be(and earlierb49be18): no conflict; under Wine, CPU only,-p xcl --lib -- compact large_table: 15 passed on both.9975836(the same code as the head98b60d0) againstmaine0d93c8, Linux through Wine, CPU only,XCL_DIRECT_DXIL=1 xcl shaders <folder> --precompile --only cs, the six largest compute programs, 1 translation each: with--split 0(a GPU with 64-lane waves) andXCL_HEAP_WINDOWS=1,95cc13288a27a96egoes from 2,175,252 B (plain) to 1,075,700 B (compact); in the other three combinations (--split 0with switch windows,--split 1with either) all six aremain's bytes (SHA-256). Under Wine,-p xcl --lib -- large_table compact: 14 passed; the workspace suite with the same condition onmaine0d93c8: 1,413 passed, 8 failed, 46 ignored, againstmain's 1,414 / 7 / 46, the eighth (split_compute_program_prebuilds_and_caches_chain_pieces) passed 3 of 3 alone. The bullets below were taken on the first commit, before the condition.x86_64-pc-windows-gnu. The numbers below were taken withmain68a284aand the head3205f86; the head is now39ec915, the same commit rebased ontomaine0d93c8(its message corrected; no change to the code).XCL_DIRECT_DXIL=1 xcl shaders <folder> --precompile --only cs --split 0(a GPU with 64-lane waves) from an empty cache, 1 translation each:95cc13288a27a96egoes from 2,420,640 B (plain) to 1,218,224 B (compact, 13,890 blocks of 2,643 kinds); withXCL_HEAP_WINDOWS=1from 2,177,324 B to 1,078,544 B. The other five aremain's bytes in both window forms (SHA-256), and with--split 1all six are. Again at39ec915againste0d93c8: 2,418,576 → 1,215,392 B with--split 0, the other five and all six with--split 1main's bytes.3205f86against its parent68a284a: RX 9070 XT 16 GB (native wave64, driver 32.0.32029.2010), Ryzen 7 7700, 32 GB RAM, Windows 11, release,XCL_DIRECT_DXIL=1, nestingauto, one pipeline thread,XCL_PSO_DISK_CACHE=0and a new exe name per run, this record alone, a watchdog at 24 GB of private bytes, each build with a local patch that logs DXIL size and driver time:68a284a68a284aThe DXIL sizes are the ones above byte for byte.
98b60d0: AMD Radeon RX 6800M (RDNA2, native wave64, driver 30.0.13002.13003), Windows 11,XCL_HEAP_WINDOWS=1: the 5gpu_compact tests anda_gpu_with_64_lane_waves_takes_the_larger_tables_only_with_heap_windowspassed, none skipped. Not run there:95cc13288a27a96eitself and a title run.main8b957bec, the record alone,XCL_HEAP_WINDOWS=1, cold driver cache: the compact form (1,050 KB) built in 101.8 s at a 15,706 MB peak;main's plain form (2,124 KB) ran the commit out after 664.2 s at 67,765 MB and was refused. With the default switch windows the branch keepsmain's plain 2,399 KB. On an oldermainthey also found the compact form builds there with switch windows (82.3 s, 13.9 GB, selected throughXCL_SPLIT_WAVE64=1), where the plain form did not. The 13 compact tests anda_gpu_with_64_lane_waves_takes_the_larger_tables_only_with_heap_windowspassed with and without heap windows. In the title (https://github.com/xcl-dev/xcl/pull/2375#issuecomment-7229028265), with the branch merged onmain6089122aandXCL_HEAP_WINDOWS=1, the driver built this program's compact form (1,075,700 B) in 129,159 ms at a 30.2 GB peak and the title kept presenting;main's plain form (2,456,664 B) had not finished after about 2 min, when their commit guard stopped the title at 59.3 GB.98b60d0: the three CPU tests of the window and threshold rules and, withXCL_SPLIT_WAVE64=1,gpu_compact_inline_table_above_old_cap_checks_late_entriespassed, none skipped.ec207194and a local patch), at the head98b60d0, debug, under Wine,XCL_REQUIRE_GPU=wave64:a_gpu_with_64_lane_waves_takes_the_larger_tables_only_with_heap_windowspassed;gpu::recomp::pso::25 passed, 0 failed; the workspace suite with three tests skipped, lib 1,288 passed and 8 failed, againstmainf9a0cb8in the same session at 1,323 and 9, every failure amongmain's (comment). Not run there: the large program's build and a title run.main: thegpu_tests 159 passed, 4 failed, the four failing onmainthere too by their report.main:cargo test -p xcl --lib1,039 passed, 0 failed on a single-threaded rerun; one test aborted in one parallel run (#1978).cargo test --workspace --release --target x86_64-pc-windows-gnu --no-fail-fast -- --test-threads=8under Wine, no card: 1,281 passed, 8 failed, 46 ignored;main68a284a: 1,283 passed, 7 failed, 46 ignored, 335 SKIPPED lines on both. The sevenmainhas fail here too. The eighth,xapu_connect_returns_oom_and_cleans_up_on_failure(an audio test, "data buffer must be released when event creation fails"), passed in this pull request's own CI run and in 3 of 3 runs of its own here. One test fewer passes because the guard's test goes.-p xcl --lib -- compact --test-threads=4: 11 passed, 0 failed (the card tests skip there).cargo test --workspace -- compact --test-threads=1at3205f86, 1 run: 11 passed, 0 failed, none skipped. The whole suite there,cargo test --workspace -- --test-threads=4: 1,288 passed and 1 failed at3205f86, 1,289 passed and the same 1 failed onmain68a284a(a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier), 29 SKIPPED lines on both, the same tests; one test fewer because the guard's test goes. This card cannot show the path the change opens.Build and test (Windows, no GPU)fails ona_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier, which fails the same way inmain's own CI at68a284aand50a9fde.Regression run
Native Windows 11, RTX 2070 SUPER 8 GB (driver 621.01), the retail title, 60 s, at
98b60d0andmaine0d93c8, the head first. On this GPU, which has only 32-lane waves, the change alters nothing, so the pair shows only that the branch builds and runs. That PC gives some runs at about 410 frames and 22 presents per 2 s whatever the tree (two of the first commit's earlier, one ofmain's at 13:47); none in this pair.main:
PR:
Not tested
AI use
Imported from ivall/xcl. Originally posted by bielfreedom on 2026-11-25T17:56:46Z.
@Royalflamejlh here's the run you asked for. On an RX 9070 XT with 32 GB of RAM, this branch builds
95cc13288a27a96e(ActivateRays) with heap windows: 138–149 s at a 17.6 GB peak, 2 of 2 runs. With the default switch windows it still passes 24 GB, but sooner than plain. So the change helps AMD on the heap path and fits a 32 GB machine.Setup
68a284a;3205f86.CreateComputePipelineStatetime.Method
XCL_DIRECT_DXIL=1,XCL_DIRECT_COMPACT_NESTunset (auto),XCL_PIPELINE_THREADS=1.XCL_PSO_DISK_CACHE=0and a fresh exe name per run, because the AMD driver cache is keyed on the exe file name.XCL_HEAP_WINDOWS=0)68a284aXCL_HEAP_WINDOWS=1)68a284apipelines made on the GPU 1, refused 0.Read / inference
0829441. Here the peak is about half that, on68a284a. I don't know whether the difference is the newer base or how the peak was sampled (I sample the process's private bytes).Not tested
AI use: Claude Code (Claude Opus 5.5) ran the measurements and drafted this. Counts and timings only, no game data.
upstream-sync referenced this pull request2026-11-25 19:07:20 +00:00
Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-11-25T18:06:46Z.
@bielfreedom: thank you, that settles it for heap windows. On the RX 9070 XT with 32 GB, this branch built the program in 138 and 149 s at a 17.6 GB peak, 2 of 2 runs. The plain form the guard kept passed 24 GB and was stopped. So with heap windows the guard kept the one form that built out of reach. With the default switch windows neither form built within 24 GB, and the compact one got there sooner (95 s against 226 s), so the guard bought nothing there either. Your table is in the description.
AI use: Claude Code (Claude Opus 5.5) wrote this reply.
Posted without review by a person: the account owner was away and reads replies later.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T19:12:08Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.Thanks!
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-25T19:18:50Z.
Tested: current PR head merged onto current
origin/main(clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo targetx86_64-pc-windows-gnurun under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).gpu_suite, cold cache: 159 passed / 4 failed. Three are the known baseline trio on this lane; the fourth is the newgpu_promoted_uav_clear_values_pass_create_committed_resourcefailure that current main carries (reported here), not caused by this PR. Everything else is green.Not tested: retail titles (no title data on this lane, counts only).
AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T20:24:37Z.
Review: COMMENTED
No confirmed code defect: the 12,288-word cap is applied consistently and the table-packing guard remains safe; current Windows CI is green. Before merge, please provide native-wave64/AMD GPU-output equivalence and title/smoke validation (or a clearly guarded rollout). The PR admits these are untested, and the preceding native-wave64 restriction originated from AMD resource concerns.
[PR #2375] Recompiler: the compact form's larger tables on every GPU againto [PR #2375] Recompiler: the compact form's larger tables on a 64-lane GPU with heap windowsImported from ivall/xcl. Originally posted by Royalflamejlh on 2026-11-25T20:59:35Z.
@bmjask: thank you, and one correction to the description first.
XCL_DIRECT_DXIL, and95cc13288a27a96eis one, so this branch's first commit gave it the compact form there by default. With the default switch windows neither form built within 24 GB on @bielfreedom's RX 9070 XT, the compact one sooner.XCL_DIRECT_COMPACT=0turns the compact form off for every program. The description now says so.gpu_run of the first commit on an RX 7900 XT had only the four failuresmainhas there; @SlopTart, did the compact form's five card tests run there, not skip? Nobody has compared this record's own output on AMD.So I took the guarded rollout:
9975836, on top, makes a GPU with 64-lane waves take the larger table limit only withXCL_HEAP_WINDOWS=1, the case where both AMD runs built the program, so the default path on such GPUs is as onmainagain. It is one condition (large_tables, whichdirect_computenow asks) with a test that fails without it; offline, with--split 0and switch windows all six of the largest programs aremain's bytes, and with heap windows95cc…is 1,075,700 B compact against 2,175,252 B plain. The description is corrected, with smoke blocks from the new head.AI use: Claude Code (Claude Opus 5.5) wrote this reply.
Posted without review by a person: the account owner was away and reads replies later.
upstream-sync referenced this pull request2026-11-26 04:07:14 +00:00
Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T09:44:51Z.
Independent RDNA2 validation
I tested clean, detached PR head
98b60d0876e5a29e60e4078d1ff4885eb1689d6eon Windows 11 build 26200.9711 with an AMD Radeon RX 6800M (driver 30.0.13002.13003), Ryzen 9 5980HX, Rust 1.99.0, and SDK DXC/DXIL 1.8.2502.11. The adapter sanity test printedGPU: AMD Radeon RX 6800M.With
XCL_ADAPTER=6800M,XCL_REQUIRE_GPU=wave64andXCL_HEAP_WINDOWS=1,cargo test --locked -p xcl --lib -j 2 gpu::dxil::compact_tests::gpu_ -- --test-threads=1 --show-outputpassed 5/5 in 7.68 s, with zero failures, ignores, or runtime skips. The fixtures checked compact/plain register and carry agreement, loop budget, entry targets, late entries in an inline table above 8,192 words, and nested/flat/plain results. The separatea_gpu_with_64_lane_waves_takes_the_larger_tables_only_with_heap_windowspolicy fixture passed 1/1. The adapter sanity check and DXC identity test each passed 1/1.The GPU fixtures call the direct test-kernel translator with their own window options. They verify the compact emitter's output on this native-wave64 RDNA2 adapter. The policy fixture separately checks when the runtime selects the larger table limit. This run did not exercise the retail record
95cc13288a27a96e, in-title heap-window selection, or a paired smoke run.AI use: OpenAI Codex (GPT-6.2 Sol) ran the tests, checked the logs and fixture scope, and drafted this report.
Imported from ivall/xcl. Originally posted by cindertheblue on 2026-11-27T00:31:08Z.
RDNA3 with 15 GB of RAM, for "AMD cards other than the RX 9070 XT; machines with 16 GB": with heap windows, this branch makes
95cc13288a27a96ebuild on an RX 7600 XT (101.8 s, 15.7 GB peak).main's plain form ran Windows' commit out after 664 s, at 67.8 GB, and was refused.Tested
XCL_ADAPTER=7600.main8b957bec, andmain8b957becwith this branch (98b60d08) merged in, without conflicts. Both are release builds from clean worktrees.xcl rpf --extract, then run withxcl shaders <folder> --precompile --only cs,XCL_PSO_DISK_CACHE=0,XCL_DXC_THREADS=1,XCL_PIPELINE_THREADS=1.--pipelines, that is translation and DXC only; with it, plus the driver.xcl.exeprivate bytes were sampled every 1 s.What each tree produces for
95cc13288a27a96e(translation only, 3 s each):XCL_HEAP_WINDOWS=1(log:4 memory windows from the descriptor heap)main13890 blocks of 2643 kinds)Cold AMD driver build, heap windows:
mainWith the default switch windows, on
mainb49be18(an older base, not rerun on8b957bec), from the #1598 comment above:13890 blocks of 2643 kinds), took 82.3 s at 13.9 GB, and the pipeline was made. That run selected it throughXCL_SPLIT_WAVE64=1.XCL_DIRECT_COMPACT=1without the split form gives the same 1,204 KB DXIL; AMD's driver cache recognised it, so that run was not timed on its own.Tests on this branch, debug,
XCL_REQUIRE_GPU=wave64:cargo test -p xcl --lib gpu::dxil::compact_tests -- --test-threads=1: 13 passed, 0 failed, both withXCL_HEAP_WINDOWS=1and without. No skips, sinceXCL_REQUIRE_GPU=wave64is set.a_gpu_with_64_lane_waves_takes_the_larger_tables_only_with_heap_windows: passed.Not tested
95cc13288a27a96e's compact form, and a title or smoke run with heap windows.8b957becitself.AI use
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-27T00:43:18Z.
Tested: Clean
98b60d0876e5a29e60e4078d1ff4885eb1689d6e, Windows 11 build 26200.9974, Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust 1.100.0 MSVC debug. Builtcargo test --locked -j 2 -p xcl --lib --no-run. Three exact CPU tests passed for the mode/window combinations, 8,192/12,288-word thresholds and compact selection for a large repeated program. On Arc withXCL_SPLIT_WAVE64=1, exactgpu_compact_inline_table_above_old_cap_checks_late_entries --test-threads=1 --nocapturepassed, checking five inputs to a table above the old limit. Zero failures, ignores or skips.Not tested: Native wave64 execution, in-title selection, full suite and retail smoke.
AI use: T3 Code / Codex (
gpt-6.2-sol) ran and reran the checks and wrote this report.Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-27T17:18:01Z.
Tested on AMD / Linux:
98b60d08(RX 9070 16 GB, RDNA4, Mesa 26.3.1 RADV; Ryzen 5 9600X, 32 GB; CachyOS; Proton Experimentalexperimental-11.0-20261112with vkd3d-proton masterec207194plus a local patch dropping thelpVtblchecks of command allocators and lists; DXC 1.9.2609.5; Rust 1.96.0,x86_64-pc-windows-gnudebug build, tests run under Wine)The head as it is (base
e0d93c84), withmainf9a0cb80the same session as the baseline. The RX 9070 runs 64-lane waves natively.Tests (
XCL_REQUIRE_GPU=wave64)cargo test -p xcl --lib -- a_gpu_with_64_lane_waves_takes_the_larger_tables_only_with_heap_windows --test-threads=1: 1 passed, 0 failed, 0 ignored.cargo test -p xcl --lib -- gpu::recomp::pso:: --test-threads=1: 25 passed, 0 failed, 1 ignored.cargo test --workspace --no-fail-fast -- --test-threads=4with--skip compositor_blends_ui_plane_over_scene_plane --skip failed_restore_stops_before_importing_an_unbacked_window --skip grooming_leaves_a_window_under_1_gib_only_its_hole(the first loses the RADV device here, the other two run out of memory under Wine): lib 1288 passed, 8 failed, 26 ignored;mainlib the same session: 1323 passed, 9 failed, 27 ignored (--test-threads=1and two--test-threads=4runs). All failures are amongmain's. The other binaries fail the same 3 tests as onmain(e2e,pls_quota,predication_e2e).d3d12_resource_and_sync: 3 passed, 0 failed.Not tested
XCL_HEAP_WINDOWS=1: the large program's build was not tried (this machine has 32 GB)AI use
Imported from ivall/xcl. Originally posted by cindertheblue on 2026-11-27T22:06:06Z.
Follow-up to my standalone test above, this time in the game on the same machine: with this branch and
XCL_HEAP_WINDOWS=1, the retail title gets past95cc13288a27a96eon an RX 7600 XT. Earlier the same day,maingot stuck on that pipeline in AMD's driver and memory ran out.main6089122a6089122a(9e74daa9),XCL_HEAP_WINDOWS=195cc13288a27a96edirect DXIL compact form: 13890 blocks of 2643 kinds)After the compile, the title kept presenting frames at about 30 fps, with
0 skippeddraws and dispatches. It slowed to 8.7 fps at 36,600 frames, about 26 min after the launch, and then logged no more frame counts. At 44 min the picture was still black. The window title read0.0 FPS | compiling shaders: 0 running, 899 done, 56877 pipelines queued, and new shaders were still reaching the DXIL cache at about 12 a minute. Its highest private memory was 39.1 GB, with 24.2 GB of commit left.Tested
cargo build --release -p xcl) from clean worktrees.98b60d08merged ontomain6089122awithout conflicts (local merge commit9e74daa9), compared with a run of6089122aitself.xcl run <game>withXCL_ADAPTER=7600andXCL_PREPARE=0; this PR's run also hadXCL_HEAP_WINDOWS=1(log:memory windows from the shared descriptor heap (no per-access switch)). Both used the default DXIL cache, so the second run reused the first run's shaders.console shaders in the PSO without a translation: mesh pipeline … refused); this PR does not change that.Not tested
e0d93c84), the test suite on the merged tree, a smoke pair, andmainwithXCL_HEAP_WINDOWS=1.AI use
Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-11-28T04:26:41Z.
Closing:
maintakes the compact form's larger tables on every GPU since3cde0cc3(#2959), which is what the first commit here did. The second commit's heap-window condition would put the 8,192-word limit back on 64-lane GPUs without heap windows; the measurements for that are in this thread if it is wanted again.AI use: Claude Code (Claude Opus 5.5) compared this change with
mainand wrote this comment.Pull request closed