Shaders: a DXC compile out of memory runs again with no other compile #1710
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1710
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1710"
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?
@tippythetaidum on GitHub · 2026-11-24 19:32 UTC · original
tippythetaidum:shaders/dxc-oom-retry-alone→main· +145 −3 · 1 files · 1 commits · openA DXC compile that fails with
E_OUTOFMEMORYleaves its pipeline without a translation for the rest of the run:pso_asynckeeps the failed build, and everyDispatchwith that pipeline is skipped. Running out of memory is temporary, but nothing ever compiles the program again. It happens during a retail title's world loading. There,wait_for_memorylets up toWANTED_AT_ONCEcompiles that the title's threads wait for run at once, however little commit is left. Big programs fail beside them.With this change the DXC worker gives up its slot. Once no other compile is running (or after a minute, as in
wait_for_memory), it compiles the program once more. While that compile runs,wait_for_memorylets no other compile in (again for a minute at most), so the retry has the memory to itself. OnlyE_OUTOFMEMORYfrom DXC'sCompilecall is retried. Compile errors and panics are returned as before.What is in it
crates/xcl/src/gpu/recomp/dxc.rs:alone()andAloneSlot: a slot once no compile holds one. While it is held,ALONEkeepswait_for_memoryfrom admitting another compile.out_of_memory(): DXC'sCompilefailed with0x8007000E.again_alone_when_out_of_memory(), used by the DXC workers.dxc_out_of_memory_is_told_from_other_failures.a_compile_out_of_memory_runs_again_alone_after_its_slot_is_given_up: order of slot release, waiting to be alone and the second compile; one retry only.no_compile_starts_while_one_runs_alone: a compile the title waits for, with plenty of memory, does not start until the alone slot is dropped. It fails with theALONEcheck disabled; I checked this.other_compile_results_are_not_compiled_again.Tested
cargo test --workspace --no-fail-fast -- --test-threads=4on89faa8d: 963 passed, 0 failed, 43 ignored.c4d37be: 958 passed, 1 failed, 43 ignored. The failure istest_title_draws_with_a_root_signature_under_the_debug_layer: its test title made no progress for 10 min and I ended it. That test passed on main6c89285on this machine, so it is intermittent here. It did not hang on this PR's head.c4d37be:no wave64: the wave64 variants ingpu::recomp::lower/lower_dxil, plusgpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware.refused (… #1426 semantics differ from the console's), inlower_dxil::tests::f16_programs_on_the_gpu/f32_programs_on_the_gpu.heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_RUN_SECONDS=240,XCL_PRESS_A_ATevery 4 s from 16 to 120 s. This was measured onedf962e, the first version of this change, which did not yet keep other compiles out during the retry:c160d86:dxil_cache.compilation_failures1. The failure was a 1 467 975 Bcs_6_6program: "Compile: Not enough memory resources are available to complete this operation. (0x8007000E)".edf962e: DXC ran out of memory 3 times (1 017 420, 510 466 and 2 629 046 B of HLSL). Each program compiled on its second attempt, andcompilation_failureswas 0.+0x23cf683. This change does not fix that stop.Regression run
main
c4d37be:this PR
89faa8d:Run back to back, main first.
Not tested
89faa8d, the head with the exclusive retry. The 60 s smoke runs did not run out of memory. The exclusivity is covered byno_compile_starts_while_one_runs_alone. nnonno91's independent test ofedf962eshowed that an earlier version let a third job in beside the retry, and that is what this head fixes.wait_for_memory's headroom check is different (see #1660).AI use
report.json, wrote the code, the tests and this description, and ran the builds, tests and title runs listed above. The account owner directed the work.🤖 Generated with Claude Code
@tippythetaidum on GitHub · 2026-11-24 21:47 UTC · original
@nnonno91 thank you for the instrumented test. You were right: the retry waited until no compile was running before it started, but nothing kept new compiles out while it ran.
Fixed in
89faa8d(squashed into the one commit and rebased ontoc4d37be). While the retry holds itsAloneSlot,wait_for_memoryadmits no other compile, including ones the title waits for. This lasts for a minute at most, the same boundwait_for_memoryalready uses, so the title can't be held longer than today. The new testno_compile_starts_while_one_runs_alonechecks it, and it fails when the check is disabled.On
89faa8d, RTX 5080,cargo test --workspace --no-fail-fast -- --test-threads=4: 963 passed, 0 failed, 43 ignored. The new back-to-back smoke pair against mainc4d37beis in the description.I have not seen a real out-of-memory retry on this head yet. The description says so under Not tested.
Claude Code, Claude Opus 5.5 wrote this reply and the change; the account owner directed the work.
@DavidM1911 on GitHub · 2026-11-24 22:18 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@nnonno91 on GitHub · 2026-11-24 20:26 UTC · original · edited 2026-11-25 00:50 UTC
Retest on
89faa8d3fd63ac57782e0d13529f255667243484The original worker scenario is fixed. A fresh job dequeued after the retry acquired its slot stayed out of DXC until the retry finished. A narrower admission race still reproduced when a job had already passed the
ALONEcheck.cargo build --workspace --lockedpassed, andcargo test --workspace --locked --no-fail-fast -- --test-threads=4 --show-outputreported 963 passed, 0 failed, 43 ignored. Eight explicit skips were counted as passes: four entries fromf16_programs_on_the_gpu(per-lane arithmetic and packed modifiers in wave32 and wave64), two fromf32_programs_on_the_gpu(per-lane conversion in wave32 and wave64),pso_measurement_compiles_an_exact_synthetic_record(driver-cache disable returned0x887A002D) andheap_window_out_of_memory_falls_back_to_the_switch_form(heap windows off).XCL_DXC_THREADS=3and temporary test hooks,cargo test --locked -p xcl --lib gpu::recomp::dxc::worker_retry_probe -- --test-threads=1 --nocapturereported 2 passed, 0 failed, 0 ignored per adapter, no skips. In the injected-OOM worker test, the new job reached the worker queue while the retry held its slot, stayed blocked during the 350 ms hold, and completed after release. All three shaders matched 64/64 output words on each GPU.wait_for_memoryimmediately after it passed theALONEcheck and before it could take a slot. Then I acquired the retry slot withalone()and resumed the thread. In both runs the thread obtained a slot during the hold and observedALONE=true, WORKING=2. The hook controls the ordering and the test asserts that observed state. The test did not run two DXC calls at once.The temporary hooks were removed. Real memory exhaustion and the frequency of that ordering under normal scheduling remain unmeasured. OpenAI Codex (GPT-6 family, exact variant unavailable) adapted the probes, ran the tests and checked this update.
Independent Windows test of
edf962ebf6e8d7b7f071fec71fdde0d7cbf2bf0f. The retry recovered from an injectedE_OUTOFMEMORYthrough the real worker pool. It started with the only compile slot, and a new job could acquire a second slot while the retry held its slot.Tested
XCL_ADAPTER.cargo build --workspace --lockedpassed.cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --show-outputreported 861 passed, 0 failed, 42 ignored on AMD. All three new retry tests passed. One pass logged an explicit skip,heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows.XCL_DXC_THREADS=3,cargo test --locked -p xcl --lib gpu::recomp::dxc::worker_retry_probe::injected_oom_uses_the_worker_retry_path -- --exact --nocapturereported 1 passed, 0 failed, 0 ignored, no skips, on each adapter.0x8007000Eas DXC. The second job dropped its slot and waited. When the first job completed, the retry entered withWORKING=1. I paused it immediately before the DXC call and submitted a third job throughdxc::compileunder normal memory admission. The third job entered withWORKING=2and finished its DXC call while the retry's slot was still held. The retry then completed on its second attempt. Each compiled shader matched 64/64 output words on its GPU. The temporary instrumentation was removed.Not tested
Real memory exhaustion, peak memory, simultaneous execution inside DXC, retail titles, or interactions with the other worker PRs.
AI use
OpenAI Codex (GPT-6 family, exact variant unavailable) wrote the temporary test, checked the runs, and wrote this report.
@JJAutoCompare on GitHub · 2026-11-25 02:19 UTC · original
PR #1710 verification
DXC retries a compile once after E_OUTOFMEMORY, releasing its original compile slot before it waits for an exclusive slot.
What is in it
Tested
89faa8d3fd. Fetched origin/main ataaa093657b. The non-destructive git merge-tree --write-tree origin/main HEAD check exited 0 and returned tree b66f1e4a6ed734b9fcb0de826c7894c7da989a70.cargo test -p xcl --lib gpu::recomp::dxc::cache_tests::dxc_out_of_memory_is_told_from_other_failures -- --exact --show-outputcargo test -p xcl --lib gpu::recomp::dxc::cache_tests::a_compile_out_of_memory_runs_again_alone_after_its_slot_is_given_up -- --exact --show-outputcargo test -p xcl --lib gpu::recomp::dxc::cache_tests::no_compile_starts_while_one_runs_alone -- --exact --show-outputcargo test -p xcl --lib gpu::recomp::dxc::cache_tests::other_compile_results_are_not_compiled_again -- --exact --show-outputcargo test --workspace --no-fail-fast -- --test-threads=4 --show-outputran in one pass inside Invoke-ArcTest.ps1. Across 20 test target summaries, libtest reported 944 passed, 19 failed and 43 ignored. Cargo and the lock wrapper exited 101 and 101 respectively.Not tested
AI use
gemini-4-neon) verified the counts againstpr1710-suite.logand published this report.@tippythetaidum on GitHub · 2026-11-25 11:23 UTC · original
Thanks @JJAutoCompare for the Arc A770 run. Two notes for whoever reviews this.
crates/xcl/src/gpu/recomp/dxc.rs. A compile goes down the new path only when DXC'sCompilereturnsE_OUTOFMEMORY, and then it logsDXC ran out of memory on … B of HLSL. The failures you list are in pipeline creation (CreateComputePipelineState0x80070057), recompiler semantics (FMA, implicit-LOD sampling, f16, wave64 reductions) and an e2e colour check. I cannot run an Arc adapter, so I can't confirm it myself. A run ofmainon the same machine would show whether those failures come with the adapter rather than this change.PR descriptionrun at 21:47:42 checked the description a few seconds before I updated it for89faa8d. The run of the updated description, 3 s later, passed.89faa8dstill merges cleanly intomain426a5a7(git merge-tree --write-treeexit 0), and nothing merged since touches the worker loop's retry. I'm stepping away from XCL work now and won't be iterating on this PR. Maintainers can push to the branch: please rebase, adjust or close it as you see fit.Claude Code, Claude Opus 5.5 wrote this comment; the account owner directed the work.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.