Skip to content

Recompiler: compact form splits out repeated memory ops and dead SGPR stores - #3261

Merged
Prime1997 merged 2 commits into
xcl-dev:mainfrom
Foniass:dxil-compact-microblocks-liveness
Nov 29, 2026
Merged

Prime1997 merged 2 commits into
xcl-dev:mainfrom
Foniass:dxil-compact-microblocks-liveness

Conversation

@Foniass

@Foniass Foniass commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #3250; only the top commit (16f2f5c1) belongs here.

Second part of moving amd-dev's direct DXIL size work (f089a9df) to main: the compact form's micro-blocks and SGPR liveness. This is where the NVIDIA driver's compile time goes down. On large programs (64 blocks or more), a memory instruction that occurs more than once becomes its own micro-block and is lowered once. Blocks that differ only in one literal or s_getpc_b64 position share a class. Successors can come from a target pool. A backward SGPR/SCC liveness drops stores of registers no later block reads, and strips dead far-jump veneers.

What is in it

  • crates/xcl/src/gpu/dxil/compact.rs: micro-blocks, no-op stripping and empty-block bypass, literal / block-PC tables, NextEnc::TargetPool, table limit 12288 to 32768 words, liveness (inst_sreg_scc_use_def, compute_live_out, far-jump veneer stripping, per-class store elision)
  • crates/xcl/src/gpu/dxil/lower.rs, kernel.rs: compact_lit / compact_blk_pc for the parameterized literal and s_getpc_b64
  • the fix of 33d1222d (open as DXIL: fix compact SGPR liveness for RMW/CMOV SALU and Wave32 masks #2604, which cannot land on main without this code): s_cmov* / s_addk / s_mulk / s_bitset* read their destination, wave32 VALU mask writes define one SGPR
  • new here, a fix to the ported code: SDWA sources with S1 set are SGPR uses (the port only handled S0), so an SGPR read through SDWA VSRC1 no longer has its store dropped. Test: sdwa_sgpr_sources_are_uses (fails without the fix)
  • new tests: repeated_loads_split_into_micro_blocks_and_literals_into_a_table and gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form (a 200-copy program with a repeated s_load, a per-copy literal and early outs; compact against plain on the GPU)

Why one commit, and why over 800 lines
On an RTX 5070 Ti, the micro-blocks without the liveness make the retail title's largest compute program (95cc13288a27a96e) a pipeline the NVIDIA driver refuses with E_OUTOFMEMORY. With the liveness it builds. So the two halves can't be separate PRs or separate commits without a broken state in between. Of the 890 changed lines, about 200 are tests.

Tested

  • NVIDIA GeForce RTX 5070 Ti (driver 32.0.16.2114), AMD Ryzen 7 7800X3D, Windows 11 build 26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), release builds for the measurements
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on 16f2f5c: 2607 passed, 6 failed, 49 ignored
    • 4 failures are gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3: E_OUTOFMEMORY from CreateComputePipelineState on this card, the same on main. They pass on Kalmarv's RTX 5070 Ti, so they come from this machine's driver / setup, not the code.
    • 2 were the e2e tests test_title_runs_and_game_folder_is_untouched and incomplete_discovered_corpus_blocks_headless_title_entry, because the test title was not built in that worktree; after cargo build --workspace, cargo test -p xcl --test e2e: 5 passed, 0 failed
    • SKIPPED GPU tests: 30, almost all no wave64; also two_pass_binds_set_the_shared_view_heap (no heap windows) and pso_measurement_compiles_an_exact_synthetic_record (cannot disable the driver cache); the new GPU compact test ran
  • Retail title, every program translated (xcl shaders --direct --sample 0 --max-bytes 0) with Recompiler: encode direct DXIL with bitcode abbreviations #3250 and with this PR: 16307 programs, 5 change (only large ones take the micro-block form):
    • 95cc13288a27a96e: 784 KB to 251 KB
    • 56c0cd3b82a00c6e: 449 KB to 291 KB
    • 958400d2caf07244: 405 KB to 253 KB
    • two 75 KB programs: byte-different, the same size
  • The driver builds all 5 (--precompile --only cs --pipelines --records <the 5>): 5 made, 0 refused
  • Cold driver build of the 6 largest compute pipelines of the title, 1 thread, fresh caches: 49.3 s with Recompiler: encode direct DXIL with bitcode abbreviations #3250, 26.0 s with this change (the before numbers are on Recompiler: encode direct DXIL with bitcode abbreviations #3250)

Regression run

The PR's run used -StartupTimeoutSeconds 3600: new DXIL means the title's shader preparation rebuilds its pipelines before the timed minute.

main:

xcl-smoke v1
commit: b10cc4c6766adc947c2054ada4a2af98be15108d
gpu: NVIDIA GeForce RTX 5070 Ti
title: 3cb1d8e0
seconds: 60
exit: 0x0
frames shown: 1565 (PresentX 1565)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16026 MB

this PR:

xcl-smoke v1
commit: 16f2f5c106e11760eca77a0ada31ba7eee04804b
gpu: NVIDIA GeForce RTX 5070 Ti
title: 3cb1d8e0
seconds: 60
exit: 0x0
frames shown: 1550 (PresentX 1550)
presents per 2 s (last 3): 60 60 61
device removals: 0
crashes: 0
peak commit: 15985 MB

Not tested

  • AMD GPUs and wave64 hardware
  • Whether the image looks the same (frame counts only)
  • Other titles; on this one only 5 programs take the new form
  • Kernel mode (tests only): when the loop budget runs out at a loop header, a register whose store was dropped because that header overwrites it would be dumped stale. Compute shaders have nothing live at the end, so the runtime is not affected.

AI use

  • Claude Code with Claude Opus 5.5: split this part out of f089a9df, merged in 33d1222d, found and fixed the SDWA S1 gap, wrote the new tests, found the A-without-B refusal on NVIDIA, ran the tests, measurements and smoke runs above, wrote this description
  • The original code is from amd-dev's f089a9df (raylitebull, from 46aecbf7, written with Antigravity (Gemini 4 Neon High)) and 33d1222d (Alp Pesen, Antigravity (Gemini 4 Neon))

🤖 Generated with Claude Code

Foniass and others added 2 commits November 29, 2026 01:17
The direct DXIL writer emitted every record unabbreviated, so each
operand took a full 6-bit VBR chunk plus the record header. Define LLVM
DEFINE_ABBREV records for the hot function-block opcodes (binop without
flags, cast, cmp2, vselect, extractval, 4-byte-aligned load / store, br,
call, phi, gep) and for integer / f32 constants, and write the compact
form's lookup tables as one CST_CODE_DATA record instead of an aggregate
of interned integer constants. The records decode to the same operands,
so the module means the same; only its encoding is smaller.

Measured on the retail title with an RTX 5070 Ti (numbers in the PR).

Ported from the bitcode-encoding part of amd-dev's f089a9d (cherry
picked there from 46aecbf, raylitebull, Assisted-by: Antigravity
(Gemini 4 Neon High)). Left out here: its dead-constant pruning (main
already prunes, 09a65d6) and its IR / compact-form changes, which
follow separately.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… stores

The compact form lowers each class of identical blocks once, but a block
only joins a class when everything in it matches, and every class stores
all SGPRs and SCC it wrote back to their slots. In large console
programs the same buffer / SMEM / image access sits in many blocks with
different ALU around it, so its long lowering was emitted once per block.
On large programs (64 blocks or more):

- a memory instruction that occurs more than once becomes a micro-block
  of its own, lowered once for all its occurrences; pure no-ops
  (s_nop, s_waitcnt*, s_clause, ...) are left out, and the empty jump
  blocks that leaves are bypassed;
- blocks that differ only in one 32-bit literal, or only in where an
  s_getpc_b64 sits, share a class and read the literal / block PC from a
  packed table, when that saves at least 64 classes;
- the successor field can index a pool of distinct taken targets
  (fallthrough = 0) when that is smaller than inline block numbers or
  offset pairs; the table limit rises from 12288 to 32768 words;
- a backward liveness over s0..s105 and SCC gives each class the union
  of its blocks' live-out sets, and a class stores only what is live;
  the same liveness strips far-jump veneers (s_getpc_b64 + s_add_u32 +
  s_addc_u32 feeding a resolved s_setpc_b64) whose registers and SCC are
  dead at the target. Kernel-mode programs (the tests' ABI) keep every
  register live at the end.

The use / def sets are conservative: s_movrel* reads every SGPR,
conditional and read-modify-write SALU (s_cmov*, s_addk, s_mulk,
s_bitset*) read their destination and s_cmov* does not kill it, and a
wave32 VALU mask write defines only its low SGPR (from 33d1222, open as
xcl-dev#2604). New here: SDWA sources with their S0 / S1 bit set are SGPR uses,
as Lw::sources reads them; the ported code missed S1, so a v_add_nc_u32
sdwa reading s20 through VSRC1 left s20 dead and its store out.

The micro-blocks and the liveness are one commit: on an RTX 5070 Ti the
micro-blocks alone make the retail title's largest compute program
(95cc13288a27a96e) one the driver refuses (E_OUTOFMEMORY); with the
liveness it builds, and goes from 804 KB to 258 KB of DXIL.

Ported from the compact-form and liveness parts of amd-dev's f089a9d
(raylitebull, cherry-picked there from 46aecbf, Assisted-by:
Antigravity (Gemini 4 Neon High)) and 33d1222 (Alp Pesen,
Assisted-by: Antigravity (Gemini 4 Neon)).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added area:recompiler RDNA2 decoder, HLSL/direct-DXIL recompiler, wave64/wave32 area:tests Unit, integration, e2e tests, or testtitle gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) labels Nov 29, 2026
@Foniass
Foniass marked this pull request as ready for review November 29, 2026 02:19
@github-actions github-actions Bot added needs-pr-check Failing the PR description check (CONTRIBUTING.md) and removed needs-pr-check Failing the PR description check (CONTRIBUTING.md) labels Nov 29, 2026
@Kalmarv

Kalmarv commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

merge-check
base: fa20459
head: 16f2f5c
merge: clean (stacked on #3250, merges cleanly onto main and with the 7-PR stack).
build: cargo build --workspace -> ok; cargo build --release -p xcl -> ok.
tests: tested in the clean 7-PR stack (#3250+#3261+#3263+#3264+#3265+#3266+#3268) on main fa204595: cargo test --workspace --no-fail-fast -- --test-threads=4 (DXC 1.9.2609.5; -p xcl --lib rerun skipping the 2 known main #3187 uma_driver mixed-window tests a_refused_gpu_upload_segment_becomes_custom and mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment) -> 2620 passed, 0 failed, 49 ignored (2481 lib + 139 integration, 25 SKIPPED notices; all 4 fuzz_validate_and_gpu_0..3 passed); failing: none. 150 s xcl-smoke (ea3b5e4d, XCL_PREPARE=0, RTX 5070 Ti) on the combined 8-PR stack: exit: 0x0, 2096 frames shown, 0 device removals, 0 crashes, 0 display System events, 32049 MB peak commit.
review: none (diff reviewed: micro-block splitting for repeated memory ops on >=64-block programs, literal/PC table sharing, target pool, backward SGPR/SCC liveness with conservative s_movrel*/s_cmov*/SDWA S0+S1 uses; kernel-mode ABI keeps all registers live).
performance: positive: shrinks large compact-form CS DXIL and pipeline compile time; no runtime regression in 150 s smoke (2096 frames, 32049 MB peak commit).
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 5070 Ti 16 GB (wave32 only), Windows 11, DXC 1.9.2609.5 via XCL_DXC_DIR; Antigravity (Gemini 3.5 Pro) ran the merges, builds, workspace test suites, 150 s title smokes, diff reviews, and drafted this check.

@moombathepilot

Copy link
Copy Markdown

merge-check

base: 0fe06eb

head: 16f2f5c

merge: clean. The trial merge includes #3250 (e13ccd7), the PR head’s parent. No later stack slices were added.

build: cargo build --workspace -> ok. cargo build --release -p xcl also passed on main, the exact PR head, and the trial merge.

tests: cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture -> 2,740 passed, 3 failed, 49 ignored. 12 SKIPPED notices: 6 unsupported per-lane f16/f32 cases, 2 no heap windows, 3 missing D3D12 debug layer, and 1 driver cache could not be disabled.

  • New failure: gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form at compact_tests.rs:180. The compact shader returned (50, 0, 1, 5) instead of (50, 10045, 1, 5). It reproduced in isolated reruns with XCL_SPLIT_WAVE64=0 and =1 using cargo test -p xcl --lib gpu::dxil::compact_tests::gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form -- --exact --nocapture --test-threads=1. This fixture is new in the PR and is absent on main.
  • Existing failures: fuzz_validate_and_gpu_1 (seed 722) and two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (two-pass state release) match earlier targeted runs on this exact unmodified main commit and machine.
  • The new CPU micro-block planning and SDWA liveness tests passed.

review: Read the compact-form changes and the stacked bitcode prerequisite. The GPU failure occurs at the compact output assertion, before the comparison against the plain path. The isolated runs report 401 blocks of 4 kinds. The cause of the missing SGPR 1 accumulation is unconfirmed. git diff --cached --check passed.

performance: 60-second scripts/smoke.ps1 -Game <folder> -Seconds 60 -StartupTimeoutSeconds 300 runs on title 817b32af, with XCL_PREPARE=0, networking off and no input. All three exited 0 with zero crashes and zero device removals.

Build Frames shown Peak commit
main 1596 15103 MB
trial merge 416bb94f973c458462eb1d339811486273786902 1644 16336 MB
exact PR head 1610 16873 MB

These are startup smoke results. Gameplay and visual parity were not checked. The cold PSO check with XCL_DIRECT_DXIL=1 and --measure-pso 95cc13288a27a96e --repeat 1 exited 2 because D3D12 could not disable the driver cache (0x887A002D), so cold compile time was not measured.

verdict: not yet: the new compact-form GPU test returns the wrong scalar accumulator on RX 7800 XT in both native and forced split wave64.

hardware / tool and model: Radeon RX 7800 XT (32.0.32029.2010), Ryzen 7 5700X3D, Windows 11 Home build 26300, Rust 1.100.0 x86_64-pc-windows-msvc, DXC 1.9.2602.17. Codex (GPT-6, exact variant unavailable) verified refs, inspected the diffs, ran the build, tests and smokes, and drafted this report.

Reviewed by the posting user before submission.

@github-actions github-actions Bot added checks-disagree Merge-checks disagree (safe vs not yet); needs maintainer/3rd look and removed needs-2nd-check Has 1 safe merge-check; needs second independent check (#3041) labels Nov 29, 2026

@KOLESNiii KOLESNiii left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Static review of 16f2f5c1 for the stack in the #3041 comparison.

Wave32 liveness can drop a live SGPR store. inst_sreg_scc_use_def treats the destination of S_AND_SAVEEXEC_B64 s[4:5], ??? as a two-register definition. Wave32 lowering writes only s4. If one compact block writes s5 and its successor reads s5 after the save, liveness can drop the first block's store and the successor then reads stale data. A wave32 compact/plain comparison with that cross-block dependency would cover the case.

Plan::words() also omits the new PC and literal tables, so the 32,768-word limit can admit a larger plan.

Review assisted by Codex (GPT-6, exact variant unavailable). No new build or GPU run for this review.

@Prime1997
Prime1997 merged commit 16f2f5c into xcl-dev:main Nov 29, 2026
7 of 9 checks passed
@Foniass

Foniass commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for the RX 7800 XT run. It caught a real bug that NVIDIA can't show. I reproduced it on an RDNA2 iGPU: the compact form read every parameterized literal as 0. The cause is the two-word read of the literal's pool index, which AMD's driver gets wrong when the result indexes the next table. The same DXIL is right on NVIDIA. This PR was merged before the fix, so the fix is #3473. A rerun of gpu::dxil::compact_tests on that branch on your card would confirm it on RDNA3.

(Claude Code, Claude Opus 5.5, for Foniass)

@KDenKC

KDenKC commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

@Prime1997 @Foniass: a regression on main from this PR (16f2f5c1), confirmed on two NVIDIA cards.

What happens. The title's largest compute program, 95cc13288a27a96e (the one this PR shrinks from 784 KB to 251 KB), never finishes its Dispatch in the new compact form, and the device is removed at the first world frames. BBareth found it first on an RTX 5070 Ti (#505, comment 7271589972). On our RTX 5090 32 GB, on main d52ff48c (plus #3094 and #3281, which do nothing without their switches, and here ran with them off):

[   57.962] D3D12.X: driver compile start #1816: compute PSO, 228708 B DXIL, record 95cc13288a27a96e, driver blob supplied
[  119.439] activity (2 s): 22 presents, 100 submits, 14100 draws, 9552 dispatches
[  119.461] D3D12.X: split command list (type 2) around mid-list Wait after Write64 (#4)
[  119.720] D3D12 device removed: 0x887a0006 The GPU will not respond to more commands, most likely because of an invalid command passed by the calling application.
[  119.721] DRED device state: 7

The same tree with only 16f2f5c1 reverted:

[   42.320] D3D12.X: driver compile start #1833: compute PSO, 612824 B DXIL, record 95cc13288a27a96e, driver blob supplied
[  107.387] activity (2 s): 13 presents, 101 submits, 18566 draws, 14678 dispatches
[  261.836] D3D12.X: split command list (type 2) around mid-list Wait after Write64 (#256)
[  375.570] activity (2 s): 15 presents, 282 submits, 74697 draws, 72234 dispatches
  • main: removed in the world in 2 of 2 runs (with and without other switches). With 16f2f5c1 reverted: the world in 2 of 2 runs, 268 s and 246 s in it, 0 removals.
  • DRED stops at the same place on both cards: operation 93 of 393 of one list, the Dispatch after cs 95cc13288a27a96e is bound.
  • Building just that program plain (the compact table limit back to 12,288 words) or skipping it (XCL_SKIP_CS=95cc13288a27a96e) also avoids it.
  • Not the shader-code heap of NVIDIA: the device is removed when the pipelines in use need more than 512 MB of shader code (0x887a0005) #2403: every run here uses the same NVIDIA profile (2 GiB, keyed by the exe name each run uses), and these removals are 0x887a0006 with DRED state 7 at a known Dispatch, not a silent 0x887a0005.

Why it was easy to miss. The program builds fine ("5 made, 0 refused"), and it only runs once the world is drawn, which the 60-second smoke run doesn't reach on this title.

A suggestion for translator changes. A change in gpu/dxil or gpu/recomp changes the translated programs, so every tester rebuilds their shader cache to pick it up, and again for any fix. And as this PR shows, such a change can pass every current check (the suite, a driver build of each changed program, the 60-second smoke run) and still stop main from loading the world. So for PRs that touch the translator, it's probably worth asking for a full run that confirms the title still enters the world, not only the smoke run. It's an expensive check, but a failure here is far more expensive: this one stops the world from loading for anyone running current main on NVIDIA (two cards so far), and the fix costs every tester another full shader-cache rebuild, which takes hours. A number of cards in this thread already get into the world, so the check is within reach, and it would have caught this before everyone paid for it.

It may also help if translator changes come from, or are checked by, someone who can load the world themselves.

Meanwhile we run main with 16f2f5c1 reverted locally, and say so in our reports, until a fix lands. Before this merge, our runs on an older main reached the prologue's first interior scene every time (0 device removals in the 16 runs that reached the world), and that's the baseline we're working from on the room's lighting.

Related: #505, #2403.

AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 3.8 Flash.

@KDenKC

KDenKC commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

A correction to the scope of my comment above: this removal looks specific to RTX 50-series cards, not NVIDIA in general.

throny ran main with #3261 on an RTX 4080 (#505, comment 7287561824): the record 95cc13288a27a96e was built in the same compact form that hangs here (228,708 B and 237,860 B of DXIL) and both runs stayed in the world for about 13 and 18 minutes after it without a removal, and none of their 20-odd runs on main since lost the device. The two cards where it removes the device are both Blackwell (BBareth's RTX 5070 Ti and our RTX 5090).

So the same compact program runs on Ada and never finishes on Blackwell, which may help find the fault (a difference in how the two driver generations compile it). The revert / #3516 results above are unchanged; they just apply to RTX 50-series cards.

AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 3.8 Flash.

Foniass added a commit to Foniass/xcl that referenced this pull request Nov 30, 2026
The compact form (xcl-dev#3261) gives each block of a parameterized class its
literal through two tables: a bit-packed index per block (xcl_lit_idx)
and the pool of distinct literals (xcl_lit_pool). An index could
straddle two words of xcl_lit_idx and was read with a two-word funnel
extraction. AMD's driver (an RX 7800 XT, 32.0.32029, and a Ryzen
7800X3D's RDNA2 iGPU, 32.0.21030) gets the pool index wrong from that
extraction: gpu_compact_form_with_micro_blocks_and_literal_table_runs_
as_the_plain_form read 0 for every literal (s1 = 0 instead of 10045),
in native and split wave64. The same DXIL runs correctly on NVIDIA, and
the index is right when used as a value; only its use as the next
table's index goes wrong (with a clamp, it read the last pool entry).

The index width is now a power of two, so an index never straddles two
words and the lookup reads one word. The table grows at most 2x (an
8-bit index stays 8 bits; 9 bits take 16).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bobosneefdev pushed a commit to bobosneefdev/xcl that referenced this pull request Dec 1, 2026
The compact form (xcl-dev#3261) gives each block of a parameterized class its
literal through two tables: a bit-packed index per block (xcl_lit_idx)
and the pool of distinct literals (xcl_lit_pool). An index could
straddle two words of xcl_lit_idx and was read with a two-word funnel
extraction. AMD's driver (an RX 7800 XT, 32.0.32029, and a Ryzen
7800X3D's RDNA2 iGPU, 32.0.21030) gets the pool index wrong from that
extraction: gpu_compact_form_with_micro_blocks_and_literal_table_runs_
as_the_plain_form read 0 for every literal (s1 = 0 instead of 10045),
in native and split wave64. The same DXIL runs correctly on NVIDIA, and
the index is right when used as a value; only its use as the next
table's index goes wrong (with a clamp, it read the last pool entry).

The index width is now a power of two, so an index never straddles two
words and the lookup reads one word. The table grows at most 2x (an
8-bit index stays 8 bits; 9 bits take 16).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 12d4f35)
KDenKC added a commit to KDenKC/xcl that referenced this pull request Dec 1, 2026
…2,288 words take the plain form

xcl-dev#3261 raised the most table words a program may need to take the compact
form from 12,288 to 32,768. On the retail title one program then takes it
whose tables need 16,121 words (19,840 blocks of 1,471 kinds, record
95cc13288a27a96e); on RTX 50-series cards its Dispatch never finishes and
the device is removed at the first world frame (DRED: the Dispatch after
that program). With the limit at 12,288 the program takes the plain form
and runs (BBareth, xcl-dev#505).

The limit goes back to 12,288 on NVIDIA adapters only. On AMD the plain
form of that program is the costly one (an RX 7900 XT report on xcl-dev#505: a
driver compile of minutes refused with E_OUTOFMEMORY), so other adapters
keep 32,768. The vendor is that of the main adapter, noted where the
title's device and the launch preparation's are made, so both pick the
same limit and the same cache identity. XCL_COMPACT_TABLE_WORDS sets the
limit on any adapter (1 to 32,768); a limit other than 32,768 goes into
the translated cache identity with the nesting tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KDenKC added a commit to KDenKC/xcl that referenced this pull request Dec 1, 2026
…2,288 words take the plain form

xcl-dev#3261 raised the most table words a program may need to take the compact form from 12,288 to 32,768. On the retail title one program then takes it whose tables need 16,121 words (19,840 blocks of 1,471 kinds, record 95cc13288a27a96e); on RTX 50-series cards its Dispatch never finishes and the device is removed at the first world frame (DRED: the Dispatch after that program). With the limit at 12,288 the program takes the plain form and runs (BBareth, xcl-dev#505).

The limit goes back to 12,288 on NVIDIA adapters only. On AMD the plain form of that program is the costly one (an RX 7900 XT report on xcl-dev#505: a driver compile of minutes refused with E_OUTOFMEMORY), so other adapters keep 32,768. The vendor is that of the main adapter, noted where the title's device and the launch preparation's are made, so both pick the same limit and the same cache identity. XCL_COMPACT_TABLE_WORDS sets the limit on any adapter (1 to 32,768); a limit other than 32,768 goes into the translated cache identity with the nesting tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Checked: xcl-dev#3516, including Foniass merge-check 7305483219 (cache identity is requested before device creation).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:recompiler RDNA2 decoder, HLSL/direct-DXIL recompiler, wave64/wave32 area:tests Unit, integration, e2e tests, or testtitle checks-disagree Merge-checks disagree (safe vs not yet); needs maintainer/3rd look gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) needs:amd-test Needs a test report or merge-check on an AMD GPU

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants