Repository navigation
Conversation
…-oom dxil: eliminate giant-shader IR and CFG blowup in FormatLoad and multi-window memory
Replace the single global xcl-cpu-writes worker with a dedicated FIFO worker per queue (cleaned up on q_release) so one stalled queue cannot HOL-block or deadlock independent queues, reset the wait event before SetEventOnCompletion, and store 8-byte aligned 64-bit Write::Immediate values atomically. Assisted-by: Antigravity (Claude Sonnet 5.5)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses xcl-dev#1488 (
XCL-BT-003).Previously,
cpu_writesused a single globalxcl-cpu-writesFIFO worker thread for all command queues and wroteWrite::Immediatedwords with a loop of 32-bitAtomicU32stores:WAIT_MS(10,000 ms) head-of-line blocked or deadlocked independent queues' bottom-of-pipe writes.write_nowtore 8-byte aligned 64-bitWrite::Immediatestores into two separate 32-bit writes, allowing spinning CPU readers to observe a half-writtenu64.FENCEShad no cleanup on queue release.What is in it
crates/xcl/src/hle/d3d12x/cpu_writes.rs:worker()with a dedicated FIFO worker thread per queue insideQueueFence(spawn_worker), checkingCreateEventWforNULL, callingResetEventbeforeSetEventOnCompletionto avoid stale timeout signals, and advancingentry.valueonly afterq.Signalsucceeds.on_queue_release(queue)to remove released queues fromFENCESand shut down their worker thread cleanly.is_region_writableacrosswrite_now,write_u64_now, andwritable, and store 8-byte aligned 64-bitWrite::Immediatevalues atomically viawrite_u64_now.independent_queues_do_not_hol_block_each_otherandwrite_now_stores_64bit_immediates_atomicallyunit tests (withQueueCleanupguards).crates/xcl/src/hle/d3d12x/real.rs: callsuper::cpu_writes::on_queue_release(this as usize)inq_releasewhen refcount reaches0.Tested
Hardware: Windows 11 x64, NVIDIA GeForce RTX 5060 Ti.
cargo test -p xcl --lib cpu_writes::tests -- --test-threads=4:4 passed; 0 failed; 0 ignoredcargo test --workspace -- --test-threads=4:893 passed; 0 failed; 42 ignoredSKIPPED:gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware(no wave64),shaders::tests::pso_measurement_compiles_an_exact_synthetic_record(Windows Developer Mode is required),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows)Regression run
Main (
4178e888c0b5be50a2887eda45cdb832763b68a4):PR (
ef0b30b1535e20c66eef5cd1991e6a6c1635ff8a):Not tested
AI use
Claude Sonnet 5.5): implemented thecpu_writes.rs/real.rschanges and unit tests, ran the test suites andsmoke.ps1, and verified the diff with an independent adversarial reviewer subagent.Mirror of xcl-dev#1819 (auto-synced, do not edit).