Repository navigation
Shaders: a DXC compile out of memory runs again with no other compile - #1710
tippythetaidum wants to merge 1 commit into
Conversation
|
Retest on The 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
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 Tested
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. |
A compile that DXC gives up on with E_OUTOFMEMORY left its pipeline without a translation for the rest of the run: pso_async stores the failed build, and every Dispatch with it is skipped. In a 240 s run of a retail title on main c160d86 (RTX 5080, 31 GB RAM) one 1.47 MB compute program failed this way during world loading, while the compiles the title's threads waited for ran beside it (wait_for_memory lets up to WANTED_AT_ONCE of them in however little commit is left). The DXC worker now gives up its slot and, once no other compile is running (or after a minute, as in wait_for_memory), compiles the program once more. While that compile runs, wait_for_memory lets no other compile in (again for a minute at most), so the retry has the memory to itself. Only E_OUTOFMEMORY from DXC's Compile call is retried; compile errors and panics are not. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
edf962e to
89faa8d
Compare
|
@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 On 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. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
PR #1710 verificationDXC retries a compile once after E_OUTOFMEMORY, releasing its original compile slot before it waits for an exclusive slot. What is in it
Tested
Not tested
AI use
|
A 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 Shaders: DXC compiles sources over 8 MB one at a time #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