Repository navigation
recomp: cap per-lane compute size so giant shaders use compact DXIL (#2203) - #2341
Conversation
|
Tested: current PR head merged onto current No Linux/Wine report in the thread yet; adding one.
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. |
|
Independent RTX 3070 check of clean PR head Windows 11 Pro build 22631, Core i7-10700K, GeForce RTX 3070 (driver 617.42), Rust 1.100.0 MSVC, DXC/DXIL 1.9.2602.17, release build. The workspace suite reported 1,273 passed, 0 failed, 46 ignored. Its pass count includes 26 runtime cargo build --release --offline --locked --workspace
cargo test --release --offline --locked --workspace --no-fail-fast -- --test-threads=4 --show-outputCodex (GPT-6.2) ran the tests and drafted this report. |
|
Test report for #2341 on RTX 5070 Ti (Windows 11): the cap works at translation level and its test passes; I could not reproduce the memory spike on the base today, so the in-game effect is not shown I reported the Tested
Not tested
Run and written with Claude Code (Claude Fable 5.2 and Claude Sonnet 5.5). |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Independent AMD RDNA4 (native wave64) test report on exact head Tested
Regression run (60 s retail-title smoke, (Matched Not tested
AI use
|
bmjask
left a comment
There was a problem hiding this comment.
No concrete source-level defect found. Giant-program refusal occurs before per-lane lowering and falls through to the existing direct_compute translator/auto-compact path; cache identity invalidates stale per-lane results. Current Windows CI and AMD smoke evidence are green. Nonblocking coverage gap: unit tests stop at refusal rather than proving end-to-end direct_compute fallback accepts the giant program, though external translation evidence covers it. I found no blocker.
92437bd to
45dbd47
Compare
|
Rebased onto current |
|
Independent desktop NVIDIA verification of PR #2341 at head Environment
Targeted release tests & build (
|
| Command | Result |
|---|---|
cargo test --release -p xcl --lib compute_with_refuses_giant_programs_for_compact_fallback -- --nocapture (3 consecutive runs) |
1 passed; 0 failed; 0 ignored; 1336 filtered out × 3 (0.01s, 0.00s, 0.01s, 0 skipped) |
cargo test --release -p xcl --lib gpu::recomp::lower_dxil:: -- --test-threads=4 (3 consecutive runs) |
22 passed; 0 failed; 0 ignored; 1315 filtered out × 3 (0.56s × 3; 17 SKIPPED notices across 7 distinct tests — 14 no wave64 on Wave32-only Ada and 3 pre-existing #1426 per-lane refusals) |
cargo build --release -p xcl |
Clean build (1m 36s, exit 0, 0 new warnings) |
Paired quiet 60 s retail smoke (title: 29640639)
Exact parent & merge-base (b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7, cached baseline on the same machine):
xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1518 (PresentX 1518)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14018 MB
PR #2341 (45dbd47ccdfc6cc7daf14e30700b440c07cb77ef):
xcl-smoke v1
commit: 45dbd47ccdfc6cc7daf14e30700b440c07cb77ef
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1578 (PresentX 1578)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13972 MB
Runtime log observations (xcl.log)
9224log lines,0[ERROR]/ device-removal / panic lines (dxil_cache:460hits,0misses,0compilation failures;228background pipelines,0failures).- Final draw/memory telemetry in log:
19495 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample13972 MB committed by the process; video memory 6115 MB local, 4654 MB non-local.
Limits of coverage
- The per-lane compute DXIL size cap (refusing oversized per-lane modules so giant shaders fall back to compact DXIL) was verified via
compute_with_refuses_giant_programs_for_compact_fallback(3/3,0skipped) andgpu::recomp::lower_dxil::(22/22× 3). - The 60 s retail smoke confirms default-path non-regression on
title: 29640639(single-run frame/commit delta vs. cached parent reflects normal startup variance, not this PR); cold NVIDIA driver compile time on giantXCL_PER_LANE=1retail shaders was not separately benchmarked here.
AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
|
Independent Windows / RTX 3080 Ti check on #2341 head Windows 11 build 26300, Ryzen 7 9800X3D, NVIDIA GeForce RTX 3080 Ti (621.35), Rust 1.99.1 MSVC, debug.
This verifies the synthetic suite and threshold test on another NVIDIA adapter. It does not measure driver compile memory or prove that the post-emission AI use: Codex (GPT-6.2 Sol) ran and checked the tests and drafted this report; Codex (GPT-6.2 Astra) independently reviewed the fallback paths and cross-PR distinction. |
|
merge-check claim |
|
merge-check |
|
Note on my check above: #2796 (rewritten onto main, re-checked today) aims at the same thing and touches the same spot. If both land, this PR's refusals make most of #2796's routing unreachable, and the second to merge conflicts. So "safe to merge" here means safe on its own; one of the two should be chosen, not both (details). AI use: Claude Code (Claude Fable 5.2). |
|
merge-check
|
Takes the upstream sync after 5b0d5fa. Headline changes: - 8c9e83f/e618b742/16f2f5c1 (xcl-dev#3263): compact DXIL form for branch-heavy programs of 2000+ blocks, splitting repeated memory ops and dead SGPR stores; compact block PC/literal plumbing in lower.rs and kernel.rs. - 45dbd47 (xcl-dev#2341): per-lane compute size caps (MAX_INSTS 20,000, MAX_DXIL_BYTES 1 MiB) so giant compute programs fall back to compact. - a7f059b (xcl-dev#2148): SSA trivial-phi/0-pred-phi fixes; 1933324 (xcl-dev#2060): reject image_gather4h/8h instead of a 2x2 Gather; 0738c30 (xcl-dev#2369): dedupe concurrent stand-in creation and harden shell COM; e9d7aef (xcl-dev#2398): saturate 16-bit integer valu16 with CLAMP=1; 6376287 (xcl-dev#1878) dxbc digest rounds. Conflict resolutions: | file | resolution | | --- | --- | | gpu/dxil/lower_wide.rs | took upstream's 32-bit exact CLAMP lowering for the 16-bit integer adds/subs/mads and deleted our T-021 64-bit signed duplicate; kept our v_mul_lo_u16 CLAMP arm (upstream does not cover it) and all our T-124 wave64/OMOD changes; removed the now-unused sat_i16 helper from prelude.rs | | gpu/recomp/lower_dxil.rs | took upstream's MAX_INSTS/MAX_DXIL_BYTES cap and its size check; kept our marks thread-local propagation (marks::enabled / set_thread) in the per-lane thread | | gpu/dxil/core_tests.rs | not a merge conflict, but the direct CLAMP test asserted the removed lowering: now expects 3x icmp sgt/slt i32 for valu16, no IMax/IMin, and 3x icmp sgt/slt i64 for the wide signed mads | | hle/d3d12x/standin.rs | auto-merged upstream's concurrent dedupe and COM hardening; kept our mainline's immediate unref in Drop (our late_release exposes hold(), not hold_pipeline()) and upstream's new tests | | compact.rs, compact_tests.rs, recomp/ssa.rs, lower_image.rs, kernel.rs, lower.rs | upstream's changes; lower_image keeps our watertight ray/triangle alongside upstream's gather4h/8h rejection | Build (only possible target for this crate; native Linux fails on testgame-mw's raw-dylib and retour's stdcall): cargo build --release --workspace --locked --target x86_64-pc-windows-gnu Finished in 55.12s; 47.01s incremental after the dead-helper removal. Focused lib tests (Windows test binary under Wine, builtin DXGI, no GPU): gpu::dxil: 309 passed; 0 failed; 3 ignored; 80 SKIPPED gpu::recomp: 548 passed; 0 failed; 20 ignored; 320 SKIPPED hle::d3d12x::standin: 6 passed; 0 failed; 1 SKIPPED (no GPU or WARP) Direct sweep (xcl.exe under Wine, --sample 0 --threads 8): CS 1636/1636 GS 195/390 MS 8724/8724 PS 9511/9511 VS 2184/2184 total 22250/22445; the 195 unsupported are split-wave64 geometry (ES phase exchanges at group barriers). xcl-dev#2060 moved nothing here: the corpus has no image_gather4h/8h program in the direct set. coverage_gate.py --run-json --skip-recomp: "coverage gate: no regressions" (exit 0); baseline stays 22250/22445. Upstream commits keep their authors; this merge commit only records the resolutions.
What is in it
Follow-up to #2203 addressing @tiagonleal's
XCL_PER_LANE=1memory-spike report on giant compute programs (such as56c0cd3b82a00c6e):56c0cd3b82a00c6e(488,744 B guest code, 14,377 blocks) became accepted byrecomp::lower_dxil::compute_with. Because the per-lane form has no compact loop-switch lowering, it emitted 4,563,088 B of plain DXIL (9.5× larger than gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426's 478,764 B compact form), causing the NVIDIA driver compiler to spike +18 GiB RAM and OOM.crates/xcl/src/gpu/recomp/lower_dxil.rs:MAX_INSTS = 20_000(matchingdxil::compact::large's 20,000-instruction threshold): checked right after decode before spawning the 256 MB worker thread or constructing IR, so giant programs immediately fall back to gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426's compact form.MAX_DXIL_BYTES = 1 << 20(1 MiB): post-lowering safety cap incompute_with(all 39 normal per-lane compute shaders in the 2,000-program sample are<= 197 KB).lower_dxil.rsadvancesXCL_PER_LANE_SOURCE_IDautomatically so any cached multi-megabyte per-lane entries are invalidated on disk.compute_with_refuses_giant_programs_for_compact_fallbackcovering both caps.Impact:
56c0cd3b82a00c6ewith--direct --lanes --split 1: immediately refused ("program too large for the per-lane form") and translated via gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 compact form (478 KB DXIL instead of 4.56 MB DXIL; total sweep time 0.7 s vs 3.2 s).--direct --lanes --split 1 --sample 2000 --max-bytes 0): all 39 / 205 normal per-lane compute shaders continue to translate (0 regressions); 4 giant compute programs (>= 20,000instructions) are routed to gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426's compact form.Tested
rustc 1.100.0, DXC /dxil.dll1.9.2602.17, debug & release builds.cargo test --workspace -- --test-threads=4on45dbd47: 1436 passed, 0 failed, 47 ignored across 37 test binaries (29 runtimeSKIPPEDnotices from adapter-gated tests); the newcompute_with_refuses_giant_programs_for_compact_fallbackpasses.--hash,--sample 2000) were done on the pre-rebase head92437bd; the rebase only merged this PR's test next to a new test inlower_dxil.rs(no code overlap).xcl shaders <pack> --direct --hash 56c0cd3b82a00c6e --lanes --split 1: refused by per-lane (program too large for the per-lane form), compact form 478 KB DXIL, 0 errors.xcl shaders <pack> --direct --lanes --split 1 --sample 2000 --max-bytes 0: 39/205 per-lane compute programs unchanged, 4 giant compute programs capped, 0 validator/panic errors.Regression run
Baseline (
main568e7db):PR (
45dbd47, run withXCL_PER_LANE=1):Not tested
XCL_PER_LANE=1(verified via single-hash56c0cd3b82a00c6erouting to compact form + 60-secondXCL_PER_LANE=1smoke run).AI use
56c0cd3b82a00c6eand the 2,000-program per-lane size distribution, implementingMAX_INSTS/MAX_DXIL_BYTESand the unit test inlower_dxil.rs, and running the test and smoke suites.