Skip to content

Recompiler: programs whose compact table needs more than 12,288 words take the plain form again - #3516

Open
KDenKC wants to merge 1 commit into
xcl-dev:mainfrom
KDenKC:fix/compact-table-limit
Open

KDenKC wants to merge 1 commit into
xcl-dev:mainfrom
KDenKC:fix/compact-table-limit

Conversation

@KDenKC

@KDenKC KDenKC commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

#3261 raised the most table words a program may need to take the direct DXIL compact form from 12,288 to 32,768. On the retail title that lets one more program take it: record 95cc13288a27a96e, whose tables need 16,121 words (19,840 blocks of 1,471 kinds, 237,860 B of DXIL). Its Dispatch never finishes, and the device is removed at the first world frame (DRED's first operation not done: the Dispatch after cs 95cc13288a27a96e). BBareth found it on #505; with the limit at 12,288 the program takes the plain form and the title stays in the world.

This puts the limit back to 12,288 on NVIDIA adapters and keeps 32,768 on others. XCL_COMPACT_TABLE_WORDS (1 to 32,768) sets it on any adapter; a value other than the default goes into the translated cache identity, with the nesting tag. Why the compact form of that program never finishes is not answered here (#3261's liveness or far-jump changes are the suspects in #505); this only stops the form from being chosen for tables that large.

Fixes the removal at the first world frame reported on #3261. Related: #505, #3261. Overlaps #3562 (compact.rs table limit, kernel.rs cache tag) and #3479 (its sized_plan uses the table-limit constant this PR replaces with max_table_words(): the two merge cleanly but the merged tree does not build until that line uses the function).

What is in it (one commit)

  • gpu/dxil/compact.rs: default_table_words: 12,288 on NVIDIA (NVIDIA_TABLE_WORDS), TABLE_WORDS_CEILING (32,768) on other adapters and before the adapter is known; XCL_COMPACT_TABLE_WORDS (max_table_words, table_words) on any adapter; table_words_tag (a limit other than 32,768) for the cache identity; automatic_plan_within takes the limit (tests).
  • gpu/adapter.rs: note_main_vendor / main_vendor, noted where the title's device (hle/d3d12x/real.rs) and the launch preparation's (shaders.rs) are made, so both use the same limit and cache identity.
  • gpu/dxil/kernel.rs: compact_nest_tag also carries that tag, so all three identity sites (recomp/pso.rs) see it.
  • gpu/dxil/compact_tests.rs: a_program_whose_tables_pass_the_limit_takes_the_plain_form (runs of repeated blocks added until the plan needs more than 12,288 table words, and at most 32,768: no plan at NVIDIA's limit, a plan at AMD's; CPU only), compact_table_limit_switch_parses (the limit by vendor, and the switch on any vendor).
  • README.md: the limit by vendor and the switch, where the compact form is described.

Cache. This changes translator source, so the direct DXIL source identity changes: every program is translated again (CPU and DXC) on the first run after updating, as with any translator change. Driver blobs are keyed by their DXIL, so only the programs whose DXIL changes need a new driver compile: on the retail title, by #3261's own count, 5 of 16,307 programs take the new form, so at most those.

Scope: NVIDIA only. The hang is seen on RTX 50-series (our RTX 5090, BBareth's RTX 5070 Ti); on an RTX 4080 the compact form of this program is built and the title stays in the world (throny, #505). On AMD the plain form is the costly one: on an RX 7900 XT with this PR, the driver compile of this program's plain form ran 150–311 s and returned 0x8007000e in 4 runs, and was still in the driver when 7 other runs ended, at the 48 GiB commit limit in most runs (crosettiremi, #505; thehollowedone pointed out what that means for an adapter-wide default, here). That report is not a matched main / head comparison and does not show the compact form is right on AMD, but it is reason enough not to change AMD's default here. The rule is by vendor (0x10DE), not by RTX 50 device ids: all the evidence for the hang is NVIDIA's, and a device-id list would have to be kept up to date for every new card; the RTX 4080 result means NVIDIA cards older than the 50-series pay the plain form's compile cost for nothing (measured on an RTX 3080 below: 124 s once, then a driver blob).

Tested

  • NVIDIA GeForce RTX 3090 24 GB (VM), driver 621.24, Intel i7-10700T, Windows 11 build 26300.9974, Rust 1.99.1, debug:
    • Red, main d52ff48c + the new plain-form test only (50c72beb): cargo test -p xcl --lib -- a_program_whose_tables_pass_the_limit_takes_the_plain_form:
      thread 'gpu::dxil::compact_tests::a_program_whose_tables_pass_the_limit_takes_the_plain_form' (3796) panicked at crates\xcl\src\gpu\dxil\compact_tests.rs:339:9:
      7 runs: 12554 table words take the compact form
      test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 2765 filtered out; finished in 12.20s
      
    • This head 868dd971 (= 8d7d5091 + the GPU vendor noted during launch preparation, so the translation cache's identity carries the table limit from the start), cargo test --workspace --no-fail-fast -- --test-threads=4 (leaving out the 3 uma_driver tests this VM cannot run): 2870 passed, 6 failed, 51 ignored; 28 SKIPPED. The failures are this VM's on main d52ff48c (gpu_direct_image_get_resinfo_d16, the three title_textures::stream_recheck_*, test_title_runs_and_game_folder_is_untouched) and placed_title_textures_share_vram_and_preserve_pixels, which passes when run alone (on main d0832e61 and other heads): a failure of the parallel run on this VM.
    • The previous head 8d7d5091 (the same tree as 81d3f670, tested before the squash), cargo test -p xcl --lib -- compact: test result: ok. 23 passed; 0 failed; 0 ignored; 0 measured; 2744 filtered out (the plain-form test now checks NVIDIA's limit and AMD's). The whole suite on this head, cargo test --workspace --no-fail-fast -- --test-threads=4 (leaving out the 3 uma_driver tests this VM cannot run): in both runs the lib test binary was killed by an access violation in the parallel run (seen on main runs on this VM too); the other binaries 142 passed, 1 failed, 20 ignored, and the lib binary's one-thread rerun (all of uma_driver::tests left out) 2723 passed, 5 failed, 31 ignored. The failures are main d52ff48c's on this machine: gpu_direct_image_get_resinfo_d16, the 3 title_textures::stream_recheck_* and test_title_runs_and_game_folder_is_untouched.
    • Green, the previous head 0dfcbd5e, cargo test -p xcl --lib -- compact:
      test result: ok. 23 passed; 0 failed; 0 ignored; 0 measured; 2744 filtered out; finished in 24.21s
      
    • On 8d7d5091, cargo test --workspace --no-fail-fast -- --test-threads=4 (leaving out the 3 uma_driver tests that need a GPU upload segment this VM does not have): the other binaries 142 passed, 1 failed, 20 ignored; the lib binary gave no result in the parallel run, so its tests come from a one-thread rerun that leaves out all of uma_driver::tests: 2727 passed, 1 failed, 31 ignored. SKIPPED: 11 (7 no wave64, 1 no heap windows, 3 no debug layer). The 2 failures, gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 and test_title_runs_and_game_folder_is_untouched, fail on main d52ff48c on the same machine too (its run lost the lib binary the same way; its one-thread rerun: 2721 passed, 5 failed, 31 ignored, the other 3 being title_textures::stream_recheck_*, which pass here).
  • RTX 5090 32 GB, the retail title, main d52ff48c with our local runner patches (an input filter, D3D12.X: XCL_PAIR_PAGES=1 caps a texture in a live one's memory to its pages #3281, a port of D3D12.X: a sampled texture in the memory of a written one of another format is copied from it (XCL_ALIAS_COPY=1) #3094 with the fix posted there), the same switches in each pair:
    • with 16f2f5c1 (two runs):
      [  119.720][…][ERROR] D3D12 device removed: 0x887a0006 The GPU will not respond to more commands, most likely because of an invalid command passed by the calling application.
      [ 1082.707][…][ERROR] D3D12 device removed: 0x887a0006 The GPU will not respond to more commands, most likely because of an invalid command passed by the calling application.
      
    • with 16f2f5c1 reverted (two runs): WORLD (+268 s in it, entry at 107 s); world fps 5.4; crashes 0, device removals 0 and WORLD (+246 s in it, entry at 98 s); world fps 5.9; crashes 0, device removals 0.
    • On the title: the previous head 8d7d5091 reached the world (entry at 247 s, 600 s, no device removal; its smoke pair was main 9dfbe3e 2,797 / 0 / 46,900 MB against 3,177 / 0 / 48,123 MB); this head 868dd971 stayed in the menus under the same recipe (see Regression run); and the run by BBareth below.
  • A game run by BBareth (thanks!), test report: main 9dfbe3e merged with this head (clean), release, RTX 5070 Ti 16 GB, driver 621.24, 1,800 s with XCL_DRED=1 XCL_PLACE_RETIRE=0 XCL_TEXTURE_LEVEL_PAGES=1 XCL_PRESS_A_AT=450 XCL_ACTIVITY=1 XCL_CS_PSO_WAIT_MS=250, no XCL_SKIP_CS, no XCL_COMPACT_TABLE_WORDS: ran to its 1,800 s limit with no device removal, about 1,260 s of it in the world; record 95cc13288a27a96e's compute PSO is made from 1,383,220 B of DXIL again (the plain form; 237,860 B in the compact form that hung). Their merge check on main 9dfbe3e: cargo test --workspace --no-fail-fast -- --test-threads=4: 2887 passed, 1 failed (gpu_direct_image_get_resinfo_d16, failing on the base alone too), 51 ignored.
  • The plain form's cost on an older card, measured by Gevroska (thanks!), comment, RTX 3080, driver 616.92: creating record 95cc13288a27a96e's compute pipeline took 124.0 s cold in the plain form (this head, no driver blob), against 14.2 s for the compact form on d52ff48c, and 0.2 s warm once XCL supplies the driver blob. Their two device errors came 39 min 29 s and 190.6 s after that creation returned; their logs do not tie them to this program.

Regression run
RTX 5090 32 GB, driver 621.40, the retail title, 600 s each, scripts/smoke.ps1 with preparation off (XCL_PREPARE=0), the main arm from a copy of a translated cache made by main. Both runs used this machine's usual settings (XCL_UMA_WINDOWS=16, XCL_UMA_DRIVER=mixed:1536:1792, XCL_COHERENT_MB=4095, XCL_HUGE_PSO_CONCURRENCY=3), XCL_DRED=1, held Enter from the first frame, and XCL_SKIP_CS=95cc13288a27a96e. The head arm started from a translated cache made by a prepared run of this head (its cache identity carries this PR's table limit, so main's cache does not serve it); it built the program this PR changes in its plain form (1,383,220 B of DXIL) and left its dispatches out.

The head arm stayed on the title's menus for its 600 s under this recipe on this machine (shader preparation off, held-Enter input; other heads did the same tonight), so this pair checks start-up and the menus only: no device removal and no crash in either run; the head's 14,802 frames are menu presents and say nothing about speed or the world. The world is covered by BBareth's runs (RTX 5070 Ti, 7 runs), claudetools-gh's A/B (RTX 5070 Ti) and our pair on the previous head (8d7d5091, same base, world entry at 247 s), listed under Tested.

main 9dfbe3e:

xcl-smoke v1
commit: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b
gpu: NVIDIA GeForce RTX 5090
title: 9cc6a39e
seconds: 600
exit: 0x0
frames shown: 2797 (PresentX 2797)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 46900 MB

this head 868dd971:

xcl-smoke v1
commit: 868dd97145253113e0a903058df1bb3846f64890
gpu: NVIDIA GeForce RTX 5090
title: 9cc6a39e
seconds: 600
exit: 0x0
frames shown: 14802 (PresentX 14802)
presents per 2 s (last 3): 49 53 50
device removals: 0
crashes: 0
peak commit: 19884 MB

Not tested

  • AMD and Intel with this change (their limit stays main's 32,768; the AMD plain-form cost above is from the PR's earlier, adapter-wide head).
  • A run on the RTX 5090 longer than the 600 s regression run (BBareth's 1,800 s run is on an RTX 5070 Ti).
  • The fix in the regression pair: its main run did not hang within its 600 s (the smoke recipe does not reach the hang), so the pair shows no regression, not the fix; the removals it fixes are under Tested.
  • Why the compact form of 95cc13288a27a96e hangs.
  • Other titles on NVIDIA (their programs over 12,288 table words take the plain form too).

AI use

  • Claude Code (Claude Opus 5.5, Claude Sonnet 5.5), Codex (GPT-6.2-Sol), Antigravity (Gemini 4 Neon, Gemini 3.8 Flash): an agent swarm wrote, tested, reviewed and described this change from BBareth's diagnosis.

🤖 Generated with Claude Code
https://claude.ai/code/session_013oPUFCA9W9F8Qb5MPK33bR

@github-actions github-actions Bot added area:docs-ci Documentation, scripts, workflows, repo governance 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 30, 2026
@BBareth

BBareth commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

merge-check claim
head: 0dfcbd5

@github-actions github-actions Bot added the needs-pr-check Failing the PR description check (CONTRIBUTING.md) label Nov 30, 2026
@BBareth

BBareth commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

merge-check
base: 9dfbe3e
head: 0dfcbd5
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2887 passed, 1 failed, 51 ignored; failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, which fails on the base alone too (base: 2885 passed, 1 failed, 51 ignored, 28 SKIPPED lines). 28 SKIPPED lines, as on the base. Both new tests passed (a_program_whose_tables_pass_the_limit_takes_the_plain_form, compact_table_limit_switch_parses), and so did the 14 existing compact tests, the GPU ones included (gpu_compact_inline_table_above_old_cap_checks_late_entries, gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form, gpu_nested_compact_matches_plain_and_flat, ...).
review: no blocking finding; four files, every hunk read. MAX_TABLE_WORDS goes back from 32,768 to 12,288, so a program whose tables need more takes the plain form by default; XCL_COMPACT_TABLE_WORDS (1 to 32,768, anything else is ignored) raises the limit, and a non-default value is added to the translated cache identity next to the nesting tag, so entries made with different limits do not mix. The new test builds a program whose plan passes 12,288 words and still fits 32,768, and checks that automatic_plan refuses it; it returns early when a compact mode or the switch is set in the environment. README updated. This is the reporter's machine for #505 (comment 7271589972): on our tree, on main 53e85fb, a local switch of the same name and value 12288 was what took record 95cc13288a27a96e back to the plain form (1,643,508 B of DXIL) and the title then ran about 2,300 s in the world with no removal, where the compact form was removed in 2 of 2 runs. Not done: a game run of this PR's own head on current main; that needs the shaders prepared again here and I will report it on this PR if I get it done. As the description says, this does not explain why the compact form of that program never finishes.
performance: run time: none for programs within the limit. Start-up: a program between 12,288 and 32,768 table words compiles in the plain form again, which is bigger for the driver (for the one retail program concerned, 1,643,508 B of DXIL in place of 237,860 B), so the compile-time gain #3261 measured for it is given back; the translated cache entries of such programs are made again once.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124); i7-12700K; Windows 11 26200. Claude Code, Claude Fable 5.2 read the diff, ran the build and the suite and wrote this check.

@BBareth

BBareth commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Test report: a game run of this PR's head on current main, as announced in my merge check above.

Result (1 run): ran to the 1,800 s limit (XCL_RUN_SECONDS: 1800 s – ending the title (16139 frames shown, 16140 PresentX calls)), no 0x887a0006, no device-removed line. About 1,260 s of that in the world (631 two-second activity samples with the world's dispatch load), mean 2.7 presents per 2 s there.

Record 95cc13288a27a96e is back in the plain form: its compute PSO is created from 1,383,220 B of DXIL (237,860 B in the compact form that hung here; see the #505 comment linked in the PR).

For comparison, on main 53e85fb plus our local stack the same record in the compact form lost the device about 60 s after the world started, 2 runs of 2.

Not tested: main 9dfbe3e without this PR on this machine (the failing runs were on 53e85fb plus local changes); the XCL_COMPACT_TABLE_WORDS switch itself in a game run; more than one run; AMD.

Claude Code, Claude Fable 5.2 ran the build and the game run, read the log and wrote this report.

@github-actions github-actions Bot removed the needs-pr-check Failing the PR description check (CONTRIBUTING.md) label Nov 30, 2026
@Gevroska

Copy link
Copy Markdown
Contributor

@KDenKC I matched compute record 95cc13288a27a96e from your PR to the native pipeline-creation logs from my RTX 3080 (driver 616.92). Creation succeeded in all three runs. The two #3516 runs used 0dfcbd5e with local measurement counters on top.

Run XCL supplied a driver blob Native creation time When creation returned
Instrumented stock d52ff48c No 14.180 s 659.4 s after the last interval with a present
#3516, cold XCL cache No 124.031 s 24.0 s after Confirm, while frames were still presenting
#3516, warm XCL cache Yes 0.217 s 168.9 s before Confirm

The cold run reported DXGI_ERROR_DEVICE_REMOVED 39 min 29 s after this call returned. The warm run reported DXGI_ERROR_DEVICE_HUNG 190.6 s after it returned. That narrows what I can say about the two exits I reported on #505: this particular creation call had finished in both. My logs don’t identify a subsequent GPU dispatch or completion for this record, so they leave the dispatch hang described in the PR unresolved.

I used Codex GPT-6.2 Sol to analyze the logs. A separate GPT-6.2 Sol agent independently matched the record and checked the return timings against all three runs. Codex GPT-6.2 Astra drafted this comment.

I reviewed and approved this comment before posting.

@github-actions github-actions Bot added the needs-pr-check Failing the PR description check (CONTRIBUTING.md) label Nov 30, 2026
@KDenKC
KDenKC marked this pull request as ready for review November 30, 2026 23:07
@github-actions github-actions Bot removed the needs-pr-check Failing the PR description check (CONTRIBUTING.md) label Nov 30, 2026
@KDenKC

KDenKC commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

@MacieGx @SergeAx a request, only if you have the time: you have both reached the world on an RTX 5080, which would make a useful third RTX 50-series card here. Could one of you check whether #3261's compact form removes the device on a 5080, and whether this PR stops it?

Fair warning: this is a long A/B, and arm B's first start compiles that program cold (Gevroska measured 124 s on a 3080 above). Two runs per arm would settle it; one each already helps.

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.

@BBareth

BBareth commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Test report: runs with this PR on an RTX 5070 Ti (arm B of the request in #505; I did not run arm A again tonight).

run time in the world end
1 805 s time limit, no device removal
2 690 s time limit, no device removal
3 691 s time limit, no device removal
4 687 s time limit, no device removal
5 388 s time limit, no device removal
6 390 s time limit, no device removal
7 18 s device removed at 533.5 s, 0x887a0006
  • Run 7: DRED device state 3, page fault at GPU VA 0x0 with no allocation listed there. The compute list it stopped in had cs 1f2c0a6e62bc5346 bound (132 of 1,529 operations done, cs 87b7403562ba17e7 dispatches before it); the graphics list was in ms 05fca5429fa919c6 ps 9ba3a7801435f7d6. 95cc13288a27a96e is not in the breadcrumbs. After the removal the process did not exit and could not be killed (one thread left in a kernel wait).
  • Earlier the same day, on main 9dfbe3ea + this PR (two of the four runs with one more local change): four runs of about 690 s in the world each, no device removal.
  • For comparison, on 30 November main 53e85fb1 without this PR lost the device about 60 s after the start prompt in both runs I made on this card, with a Dispatch of cs 95cc13288a27a96e in the breadcrumbs.
  • Frame rate in the world in runs 1 to 6: 2.6 to 3.1 presents per 2 s; video memory 16.1 to 18.4 GB of a 15.2 GB budget.

Hardware: NVIDIA GeForce RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124), i7-12700K, 32 GB RAM, Windows 11 Pro 26200.

AI use: Claude Code, Claude Fable 5.2 made the runs and wrote this report.

@KDenKC

KDenKC commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

@BBareth thank you, and that's more than enough from you on this one 😄 Your 30-minute run earlier plus these seven (six clean, and run 7 a different removal: a page fault at VA 0x0 with 95cc13288a27a96e not in the breadcrumbs) cover the 5070 Ti side well. Please don't spend more evenings on it!

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.

@thehollowedone

Copy link
Copy Markdown
Contributor

Cross-linking an AMD result relevant to this PR's adapter-wide default: the RX 7900 XT report in #505 tested d52ff48c plus #3516. The affected compute program took the 1,383,220-byte plain form. In four runs, its driver compile lasted 150–311 seconds and returned 0x8007000e; in seven more, it was still in the driver when the runs ended. Process commit reached the report's 48 GiB limit in most runs.

That report's faster comparison tree differs in more than this PR and had a different cache history. It does not establish that #3516 regresses AMD against a matched current-main control, nor that the compact form is correct there. It does establish that the new plain-form path is costly on this AMD setup; the PR's current “AMD not tested” line misses that evidence.

Before treating the 12,288-word default as an adapter-wide resolution, I suggest a matched AMD main/head comparison with the same driver, inputs, and cache state, recording compile outcome, peak commit, and in-world behavior. If that comparison favors compact on AMD, the narrower RTX 50-series fallback already discussed in the PR description would preserve AMD's path while addressing the observed NVIDIA hang. The separate compact-table fixes in #3473 and #3475 should be assessed on their own heads.

AI use: OpenAI Codex (GPT-6.2 Sol) checked the linked report, this PR's current head, and the source-level selection change. I did not run an AMD test.

@KDenKC
KDenKC marked this pull request as draft December 1, 2026 04:46
@KDenKC
KDenKC force-pushed the fix/compact-table-limit branch from 0dfcbd5 to 8d7d509 Compare December 1, 2026 04:52
@github-actions github-actions Bot added area:d3d12 D3D12.X runtime, command lists, resources, sparse memory area:shaders Shader cache, PSO compilation, pipeline libraries, precompilation gpu:nvidia Code is specific to NVIDIA / wave32 GPUs (scope tag; see needs:nvidia-test) needs-pr-check Failing the PR description check (CONTRIBUTING.md) and removed gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) labels Dec 1, 2026
@KDenKC

KDenKC commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

@thehollowedone thank you, agreed: crosettiremi's RX 7900 XT result shows the plain form of that program is the costly one on AMD, and an adapter-wide 12,288 default was not justified by evidence that is all NVIDIA's.

Narrowed in 8d7d509 (squashed): the limit is 12,288 only when the main adapter's vendor is NVIDIA (0x10DE) and stays 32,768 on every other adapter, as on main; XCL_COMPACT_TABLE_WORDS still sets it on any adapter. The vendor is noted where the title's device and the launch preparation's are made, so both pick the same limit and the same translated cache identity. Vendor-level rather than RTX 50 device ids, because all the hang evidence is NVIDIA's and a device-id list would have to follow every new card; on older NVIDIA cards that only costs the plain form's one-time compile (Gevroska measured 124 s cold on an RTX 3080, then a driver blob).

The tests now check both: the plain-form test builds a program over 12,288 table words and checks that it gets no compact plan at NVIDIA's limit and keeps it at AMD's, and the switch test covers the limit by vendor. A matched AMD main / head comparison is still open, as you say; with this change AMD keeps main's behaviour, so it is no longer needed for this PR.

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.

@AAsobu

AAsobu commented Dec 1, 2026 •

Copy link
Copy Markdown

merge-check
base: df0cfef
head: ab04eae
merge: clean
build: cargo build --workspace -> ok (release)
tests: cargo test --release --workspace --no-fail-fast -- --test-threads=4 -> 2915 passed, 0 failed, 51 ignored; SKIPPED: 28 (22 no wave64, 2 no heap windows, 3 no D3D12 debug layer / d3d12SDKLayers.dll, 1 no GPU_UPLOAD heaps); failing: none. The PR's 4 tests ran and pass (a_program_whose_tables_pass_the_limit_takes_the_plain_form, compact_table_limit_switch_parses, compact_table_policy_freezes_vendor_with_its_cache_tag, offline_precompile_resolves_vendor_before_freezing_identity).
review: the finding of my earlier check (868dd97) is fixed on this machine. Read the whole diff (+245/-5: compact.rs, compact_tests.rs, kernel.rs, adapter.rs, real.rs, shaders.rs, README).

  • The DXIL cache prefill without -Pipelines is reused by the title again. xcl shaders --precompile now resolves the adapter and notes its vendor before the translation identity is taken, and the table limit is frozen with that identity. Same check as before: the same 14 compute programs of the pack (XCL_PRECOMPILE_SLICE=0/200 --only cs), the title's environment (XCL_DIRECT_DXIL=1, the same XCL_DXC_DIR), each into an empty XCL_DXIL_CACHE. Translated cache folder written:
    • 868dd97 (earlier): prefill without --pipelines 43c56ebc6f9ed0c7, title e3241590f3eb508b: different.
    • this head: prefill without --pipelines b5ed3d1b67da23d3, title (60 s, env below) b5ed3d1b67da23d3: the same.
  • Changed behaviour to note, not a blocker here: --precompile now exits 2 when it finds no hardware adapter, so a translation-only prefill on a machine without a GPU stops instead of running.
  • Not testable on this machine (one adapter): the multi-adapter cases of the latest review (a device that falls through to another adapter after preparation noted the first, and the prefill not reading d3d12_adapter from xcl.toml).
    performance: the in-world A/B of my earlier check was on 868dd97 (main b2b1f109 vs that merge, 2 runs each of 420 s: no frame-time or memory change, 0 device removals). This head changes when the limit and the cache identity are fixed, not the limit itself: on NVIDIA it is still 12,288 words. I did not repeat the in-world runs; one 60 s run of this merge with an empty cache ended without a device removal.
    verdict: safe to merge: the prefill issue I reported is fixed and reproduced as fixed, the suite passes, and NVIDIA still gets the 12,288-word limit; the multi-adapter cases are untested here. The required PR description check is red on this head, which the author has to fix before it can be merged.
    hardware / tool and model: NVIDIA GeForce RTX 3090 24 GB (driver 621.24, wave32 only), Intel Core i5-10600K, 32 GB, Windows 11 Home build 26300, rustc 1.100.0 / Claude Code (Claude Opus 5.5), results checked by me

@cj-tomlin

Copy link
Copy Markdown

merge-check claim
head: 868dd97

@cj-tomlin

Copy link
Copy Markdown

merge-check
base: f07e426
head: 868dd97
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2905 passed, 1 failed, 51 ignored; SKIPPED: 27 (22 no wave64, 2 no heap windows, 3 no D3D12 debug layer / d3d12SDKLayers.dll); failing: gpu_two_pass_cache_e2e::two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs, which fails on the base too: run alone 4 times each, 4 of 4 failed on main f07e426d and 4 of 4 on the merge, same machine; this PR does not touch that path. The PR's two tests (a_program_whose_tables_pass_the_limit_takes_the_plain_form, compact_table_limit_switch_parses) ran and pass.
review: none blocking, after reading the whole diff (+125/-5: compact.rs, compact_tests.rs, kernel.rs, adapter.rs, real.rs, shaders.rs, README). The compact form's table limit is 12,288 words when the main adapter is NVIDIA and 32,768 otherwise or before the vendor is known; XCL_COMPACT_TABLE_WORDS (1..=32,768, else the vendor default) overrides it on any adapter, and a limit other than 32,768 goes into the translated cache identity through compact_nest_tag, so the two limits never share translations. The vendor is noted where the title's device and the preparation device are made and in preparation_driver_identity_for_adapter. The new limit test is CPU-only and checks the plan choice at both vendors' limits; it is slow in a debug build. On NVIDIA, which this machine is, the change is in force: translations get the new tag and are made again once after updating. I did not run a title.
performance: no measured run here. By default on NVIDIA, programs whose compact tables need 12,289 to 32,768 words take the plain form again, as before #3261; other adapters are unchanged. AAsobu's world runs above cover the title-level comparison.
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 3080 10 GB, driver 621.40, AMD Ryzen 7 7800X3D, Windows 11 build 26300, debug build / Claude Code (Claude Opus 5.5) merged, built, ran the suite, read the diff and drafted this; I checked it.

@github-actions github-actions Bot added ready-to-merge Has 2 independent safe merge-checks on current head (#3041) and removed needs-2nd-check Has 1 safe merge-check; needs second independent check (#3041) labels Dec 1, 2026
Royalflamejlh added a commit to Royalflamejlh/xcl that referenced this pull request Dec 1, 2026
Folded, the two copies of each repeated memory access are compact blocks
of their own, so a folded program's tables can pass the limit its split
form's stay under, and it then took the plain form. On a tree with
xcl-dev#3516's limit of 12,288 words, a retail wave64 compute program of 78,920
reachable instructions took the compact form split (11,311 table words)
and, folded (14,805 words), the plain form: 4,346,408 B of DXIL in one
function, which NVIDIA's compiler had not finished after ten minutes at
4.9 GB.

The folded translation now refuses a program whose compact form is
refused only for the size of its tables (compact::wanted_plan: the
automatic choice before its table check), and the split form takes the
compact form as it did before folding.

Under main's 32,768 words no program of that pack changes: two folded
programs want the compact form, with 14,776 and 14,805 table words. Under
xcl-dev#3516's 12,288 both do.

The test folds a program of 57,344 copies of a load whose split form's
tables fit and whose folded tables do not: the folded translation is
refused.

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

KDenKC commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Heads-up on overlaps, found by trial merges on main 6bfb5c51:

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

@github-actions github-actions Bot removed the ready-to-merge Has 2 independent safe merge-checks on current head (#3041) label Dec 1, 2026

@bmjask bmjask 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.

Review of 868dd971: 2 finding(s). These are on lines outside the diff:

crates/xcl/src/shaders.rs:4072: On NVIDIA, the documented DXIL cache prefill (precompile-shaders.ps1 -Package without -Pipelines, i.e. xcl shaders --precompile, README ~274) never creates a device, so note_main_vendor never runs. It translates with the 32,768 limit and stores everything under the identity without the table tag, which the NVIDIA title never reads. With pipelines=false, precompile makes no Pipelines, main_vendor() is None, table_words_tag() is None, and translated::identity() is fixed without the tag. All ~16k programs, including 95cc13288a27a96e in compact form, are written under that identity. At title start the device records 0x10DE, the identity gets xcl-compact-table-12288, every lookup misses, and every program is translated again at launch. Passing the vendor (or the limit) explicitly to the prefill, or not making the limit vendor-dependent, would keep the prefill useful.

crates/xcl/src/gpu/recomp/pso.rs:362: Not certain about this one: translated::identity() and direct_output() are computed once (OnceLock), but max_table_words() reads MAIN_VENDOR live on every automatic_plan. A process that fixes the identity before the vendor is recorded, or whose vendor changes, stores translations made with one limit under the other limit's identity. Launch preparation calls preparation_driver_identity_for_adapter, which records the first candidate's vendor and fixes the identity with that tag. init_with_remap can then fall through to another adapter and overwrite MAIN_VENDOR, so later translations use the new limit under the fixed identity. In the direction where the identity is fixed without the tag, translations at 32,768 are later served from cache on NVIDIA, and the compact form of 95cc13288a27a96e (the hang this PR fixes) comes back. Resolving the limit once with the identity, or passing it with the translation request, would keep them consistent.


These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.

On NVIDIA, programs whose compact table needs more than 12,288 words take the plain form. The main adapter's vendor is resolved before offline shader precompile freezes its translation identity, and the table limit is snapshotted once so compact planning and its cache tag cannot disagree if vendor discovery happens later.

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.

The 16,121-word retail program is known to hang in compact form on RTX 50-series cards; on AMD its plain form can take minutes to compile and fail with E_OUTOFMEMORY. Other adapters keep the 32,768-word ceiling by default.

Tests cover compact policy stability across vendor changes and ensure offline precompile resolves the vendor before freezing cache identity.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the checks-disagree Merge-checks disagree (safe vs not yet); needs maintainer/3rd look label Dec 2, 2026
@KDenKC
KDenKC force-pushed the fix/compact-table-limit branch from 868dd97 to ab04eae Compare December 2, 2026 11:48
@github-actions github-actions Bot removed the checks-disagree Merge-checks disagree (safe vs not yet); needs maintainer/3rd look label Dec 2, 2026
@KDenKC

KDenKC commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

@bmjask thanks for the review. Both cache-ordering issues are fixed in ab04eaed: offline xcl shaders --precompile resolves the selected DXGI adapter and records its vendor before the translation identity is requested; if the vendor cannot be resolved, precompile stops before translating. Compact planning and both cache-identity tags now share one frozen table-policy snapshot. Calls made before a vendor is known use the portable 32,768-word ceiling without freezing it; the first known vendor (or valid explicit table limit) freezes the shared limit and tag.

The focused tests cover the policy snapshot (compact_table_policy_freezes_vendor_with_its_cache_tag) and the precompile ordering/failure path (offline_precompile_resolves_vendor_before_freezing_identity). Both pass. Isolated four-thread lib runs on the rebased head and its main base completed without a process crash. The head's four failures are the same four title_textures failures on main; main had one additional intermittent pso_async::used_tests::retained_failed_demand_observes_another_binds_successful_retry failure.

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 2795 filtered out
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 2795 filtered out
test result: FAILED. 2758 passed; 4 failed; 31 ignored; 0 measured; 3 filtered out; finished in 157.22s
test result: FAILED. 2753 passed; 5 failed; 31 ignored; 0 measured; 3 filtered out; finished in 154.99s

The earlier whole-workspace run was on the pre-rebase head and its lib process was killed by an access violation while the VM lane was busy; I have not counted that as a clean result. The rebase removes the old-base D16 failure. A new smoke arm for ab04eaed remains pending.

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

@Foniass

Foniass commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

Follow-up review (head ab04eae, since 868dd97, diff read, not a merge-check; checks red):

  • The cache identity was fixed before any device existed during preparation: fixed. preparation_driver_identity_for_adapter notes the vendor before it returns (real.rs ~9442), warm_library::reuse and status evaluate it before compatibility() reads translation_cache_identity() (warm_library.rs ~91, ~153), and once a vendor is known the limit is frozen (compact.rs ~257).
  • The doc comment of name(): fixed (adapter.rs ~134).
  • Other paths that could fix the identity first (xcl cache status, offline xcl shaders): fixed. --precompile resolves the adapter first (shaders.rs ~1233), xcl cache status goes through expected_for_adapter, and the other offline commands never note a vendor, so they key everything consistently at 32,768 with no tag.
  • A test of the ordering in reuse: partly fixed. offline_precompile_resolves_vendor_before_freezing_identity (shaders.rs ~4823) checks only that precompile_identity_after_vendor calls its two closures in order; nothing checks that run or warm_library::reuse notes the vendor first.
  • A smoke pair on the current head: still open; Regression run still has the 868dd971 block (the reason PR description is red).

New:

  • Title, commit and description no longer agree. The only commit is Recompiler: freeze the compact table limit with its cache identity, a subject that does not say NVIDIA goes back to 12,288; the description still says shaders.rs only notes the vendor and does not mention TablePolicy / table_policy_in, the vendor step and exit 2 in --precompile, or the two new tests, and Tested is for 868dd971.
  • xcl shaders --precompile now refuses to run without a matching hardware adapter. It returns 2 when preparation_driver_identity_for_adapter("auto") finds none (shaders.rs ~1233-1243, real.rs ~9437), where before it translated and compiled with DXC without a device. That affects scripts/precompile-shaders.ps1 on a machine without a GPU, or with an XCL_ADAPTER that matches nothing (the title itself falls back to auto, real.rs ~988); since an unknown vendor already gives a consistent 32,768 with no tag, a warning would do.
  • The commit message says more than the code does. It says planning and the cache tag "cannot disagree if vendor discovery happens later", but table_policy_in deliberately does not freeze while the vendor is unknown (compact.rs ~267) while translated::identity() and direct_output() freeze on first use (pso.rs ~360, ~673); agreement still depends on every caller noting the vendor first. The current callers do, but nothing enforces it.

Fine: the tag reaches every key that depends on the limit through compact_nest_tag (kernel.rs ~107): the translated identity, direct_output, compute_policy_key and the legacy migration identity; the warm library keys on the translation identity and the pipeline library is gated on its receipt.

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

@bmjask bmjask 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.

Review of ab04eaed: 4 finding(s).

Re-review at ab04eaed. Precompile now records the vendor before the identity freezes, and the limit is frozen with the identity, which addresses both points from my earlier review in the normal case. The vendor-freezing approach has some new edge cases: 4 are inline.


These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.

Comment thread crates/xcl/src/shaders.rs
// This command has no D3D device, but its translated cache must use the same adapter
// policy as launch preparation. Resolve the selected DXGI adapter before freezing the
// translation identity or translating any shader.
if let Err(e) = precompile_identity_after_vendor(

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.

xcl shaders --precompile now exits 2 whenever preparation_driver_identity_for_adapter("auto") can't find a hardware DXGI adapter, so translation-only precompile (no --pipelines) no longer runs on a machine without a GPU. On a CI box or headless VM with no hardware adapter (the CI check runs on Windows with no GPU), candidates() is empty, the function returns before note_main_vendor, and the command prints "could not resolve the selected DXGI adapter vendor" and exits 2. Before this PR it translated and filled the DXIL cache. With XCL_ADAPTER=<typo>, the title falls back to Auto (real.rs:990), but precompile now hard-fails instead. Falling back to the non-NVIDIA limit (or an explicit --vendor) when no adapter is found would keep it working.

crate::gpu::adapter::candidates(&factory, &selector).into_iter().next()?.0.cast().ok()?
};
// Cache identity can be read during launch preparation before a device exists.
crate::gpu::adapter::note_main_vendor(adapter.GetDesc().ok()?.VendorId);

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.

preparation_driver_identity_for_adapter records the vendor of the first candidate, but the title's device creation (real.rs:991-1001) moves on to the next candidate when create_device fails and falls back to Auto. Whichever vendor is recorded first freezes the policy for the process. If launch preparation (warm_library::reuse -> expected_for_adapter) records vendor A and freezes table_policy, and init_with_remap then can't create a device on A and falls through to adapter B from another vendor, note_main_vendor(B) is ignored. The title runs on B with A's limit and cache tag, e.g. NVIDIA's 12,288 on an AMD device, where the PR says the plain form takes minutes to compile and runs out of memory.

Comment thread crates/xcl/src/shaders.rs
// translation identity or translating any shader.
if let Err(e) = precompile_identity_after_vendor(
|| {
let _ = crate::hle::d3d12x::real::preparation_driver_identity_for_adapter("auto");

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.

Offline precompile records the first auto / XCL_ADAPTER candidate's vendor and ignores the d3d12_adapter setting in xcl.toml. Since the translated identity is now vendor-dependent, a mixed-vendor multi-GPU machine can build a cache the title never looks up. On a laptop with an NVIDIA dGPU (first in high-performance order) and an AMD/Intel GPU chosen in xcl.toml, xcl pso-precompile <game> without XCL_ADAPTER freezes at NVIDIA 12,288 and tags the identity xcl-compact-table-12288. The title's AMD device has no tag, so every precompiled translation misses. Resolving the adapter through the same Selector::from_env_or(cfg.d3d12_adapter) the title uses would match them.


/// One process-wide snapshot is shared by automatic planning and the translation identity. The
/// selected adapter is noted before either path is entered, including offline precompile.
fn table_policy() -> TablePolicy {

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.

Not certain about this one: the limit and tag still come from a process-global vendor set as a side effect at a few sites, and paths that never record it use 32,768 with no tag. xcl shaders --export-hlsl and --direct (export_hlsl at shaders.rs:1325, direct_sweep at shaders.rs:5337) never create a Pipelines or call note_main_vendor. On an RTX 5090 they translate 95cc13288a27a96e with limit 32,768, the compact form that hangs, so developers export or validate DXIL the NVIDIA runtime never produces. Resolving the vendor lazily inside table_policy(), or passing the limit with KernelOptions, would remove the call-order dependence.

@github-actions github-actions Bot added the needs-pr-check Failing the PR description check (CONTRIBUTING.md) label Dec 2, 2026
Royalflamejlh added a commit to Royalflamejlh/xcl that referenced this pull request Dec 2, 2026
Folded, the two copies of each repeated memory access are compact blocks
of their own, so a folded program's tables can pass the limit its split
form's stay under, and it then took the plain form. On a tree with
xcl-dev#3516's limit of 12,288 words, a retail wave64 compute program of 78,920
reachable instructions took the compact form split (11,311 table words)
and, folded (14,805 words), the plain form: 4,346,408 B of DXIL in one
function, which NVIDIA's compiler had not finished after ten minutes at
4.9 GB.

The folded translation now refuses a program whose compact form is
refused only for the size of its tables (compact::wanted_plan: the
automatic choice before its table check), and the split form takes the
compact form as it did before folding.

Under main's 32,768 words no program of that pack changes: two folded
programs want the compact form, with 14,776 and 14,805 table words. Under
xcl-dev#3516's 12,288 both do.

The test folds a program of 57,344 copies of a load whose split form's
tables fit and whose folded tables do not: the folded translation is
refused.

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

bmjask commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

@Prime1997 could you take a look at this one for review and merge? My automated review notes are above, if any.

@TripyFox

TripyFox commented Dec 2, 2026

Copy link
Copy Markdown

merge-check
base: c53e969
head: ab04eae
merge: conflicts (one hunk: crates/xcl/src/gpu/dxil/kernel.rs, compact_nest_tag: main now also adds the XCL_WAVE64_IDIOMS=0 tag there; resolved locally by putting compact::table_words_tag() into main's tag list, all three tags joined with -)
build: cargo build --workspace -> ok; cargo build --release --workspace -> ok (on the locally resolved merge)
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3008 passed, 0 failed, 52 ignored; SKIPPED: 26 (22 no wave64, 2 no heap windows, 2 no xgameruntime.dll); failing: none (the first pass had 2 e2e failures because the debug test title was not built yet; after cargo build --workspace, cargo test -p xcl --test e2e -> 5 passed, 0 failed)
review: read the whole diff. Besides the conflict above, nothing found: the 12,288-word limit applies only when the adapter vendor is NVIDIA, the policy freezes only once a vendor (or an explicit XCL_COMPACT_TABLE_WORDS) is known, and the limit goes into the translated cache identity, so the first run after updating translates again (here 1,621 used shaders in 17.4 s, 0 errors). On the retail title the change does what it says: see the world-load runs below.
performance: by default only on NVIDIA. Record 95cc13288a27a96e becomes a 1,588,320-byte DXIL program; with a supplied driver blob its compute PSO took 772 ms. Not measured with smoke.ps1.
verdict: not yet: conflicts with current main in kernel.rs (needs a rebase). On an RTX 5090 it removes the GPU exception that ended the world load on main, but the title still loses the device later in the load (below), which looks like a separate problem.
hardware / tool and model: NVIDIA GeForce RTX 5090 32 GB, driver 621.40, AMD Ryzen 7 9800X3D, 64 GB, Windows 11 build 26200.9974, Rust 1.100.0, release build for the title runs / Claude Code (Claude Opus 5.5) ran the build, tests and title runs, read the diff and drafted this

World load on the retail title 1.0.2.1 (Series X profile, 4K swap chain, no Gaming Services installed, same data and DXIL cache folders across the runs):

Run Tree Where it ended Windows nvlddmkm event
1 main c53e969 0x887a0006 (device hung) at frame 3,400, after ~3,000 frames at 30 fps Xid 13 Graphics Exception: SKEDCHECK23_CONSTANT_BUFFER_SIZE failed
2 main c53e969, XCL_DRED=1 0x887a0006 at frame 1,248. DRED: list on the direct queue with 93 of 393 operations done, the pipeline bound there cs 95cc13288a27a96e, the next dispatch not done; page fault VA 0x0 Xid 13 SKEDCHECK23_CONSTANT_BUFFER_SIZE failed
3 merge above, XCL_DRED=1 0x887a0005 at frame ~1,314 (226 s). DRED device state 0, no list in flight, page fault VA 0x0 none

Not tested: AMD and other NVIDIA generations; scripts/smoke.ps1 on main vs this PR; a run with a warm driver cache for the graphics pipelines of the world load.

@github-actions github-actions Bot added the needs-rebase Has merge conflicts with its base branch label Dec 2, 2026
Royalflamejlh added a commit to Royalflamejlh/xcl that referenced this pull request Dec 2, 2026
Folded, the two copies of each repeated memory access are compact blocks
of their own, so a folded program's tables can pass the limit its split
form's stay under, and it then took the plain form. On a tree with
xcl-dev#3516's limit of 12,288 words, a retail wave64 compute program of 78,920
reachable instructions took the compact form split (11,311 table words)
and, folded (14,805 words), the plain form: 4,346,408 B of DXIL in one
function, which NVIDIA's compiler had not finished after ten minutes at
4.9 GB.

The folded translation now refuses a program whose compact form is
refused only for the size of its tables (compact::wanted_plan: the
automatic choice before its table check), and the split form takes the
compact form as it did before folding.

Under main's 32,768 words no program of that pack changes: two folded
programs want the compact form, with 14,776 and 14,805 table words. Under
xcl-dev#3516's 12,288 both do.

The test folds a program of 57,344 copies of a load whose split form's
tables fit and whose folded tables do not: the folded translation is
refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Royalflamejlh added a commit to Royalflamejlh/xcl that referenced this pull request Dec 2, 2026
Folded, the two copies of each repeated memory access are compact blocks
of their own, so a folded program's tables can pass the limit its split
form's stay under, and it then took the plain form. On a tree with
xcl-dev#3516's limit of 12,288 words, a retail wave64 compute program of 78,920
reachable instructions took the compact form split (11,311 table words)
and, folded (14,805 words), the plain form: 4,346,408 B of DXIL in one
function, which NVIDIA's compiler had not finished after ten minutes at
4.9 GB.

The folded translation now refuses a program whose compact form is
refused only for the size of its tables (compact::wanted_plan: the
automatic choice before its table check), and the split form takes the
compact form as it did before folding.

Under main's 32,768 words no program of that pack changes: two folded
programs want the compact form, with 14,776 and 14,805 table words. Under
xcl-dev#3516's 12,288 both do.

The test folds a program of 57,344 copies of a load whose split form's
tables fit and whose folded tables do not: the folded translation is
refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:d3d12 D3D12.X runtime, command lists, resources, sparse memory area:docs-ci Documentation, scripts, workflows, repo governance area:recompiler RDNA2 decoder, HLSL/direct-DXIL recompiler, wave64/wave32 area:shaders Shader cache, PSO compilation, pipeline libraries, precompilation area:tests Unit, integration, e2e tests, or testtitle gpu:nvidia Code is specific to NVIDIA / wave32 GPUs (scope tag; see needs:nvidia-test) needs-pr-check Failing the PR description check (CONTRIBUTING.md) needs-rebase Has merge conflicts with its base branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.