Repository navigation
Conversation
wait_for_memory previously checked WORKING against commit headroom and WANTED_AT_ONCE with an unlocked load before calling fetch_add(1), allowing concurrent worker wakeups to admit an unbounded burst past both limits. Wrap the admission check and working-slot increment in a MemoryGate mutex while keeping MemorySlot::drop lock-free and sleeping outside the mutex, and add multi-threaded unit tests verifying tight-headroom, WANTED_AT_ONCE, low-commit single-slot, and timeout behavior. Part of xcl-dev#2463 Part of xcl-dev#1566 Part of xcl-dev#1269 Assisted-by: Antigravity (Gemini 4 Hydrogen)
|
Tested: exact clean head
Not tested: real compiler-memory peaks, Windows-native execution, GPU dispatch, retail title, or matched-parent regression. These are CPU synchronization tests with supplied memory values, not proof of Wine's commit telemetry or a hard memory budget. The existing 60-second escape remains; this addresses #2463 item 2, not its separate title-thread driver-compile bypass. No title-safety or FPS claim. Local log: |
|
Tested: current PR head merged onto current
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 native AMD test report for #2652 (issue #2463, item 2) on exact head Tested
Regression run
Not tested
AI use
🤖 Generated with Claude Code |
|
Independent native Windows/NVIDIA test of PR #2652 head Tested
Not tested: a measured DXC memory peak under retail world load, deliberate system commit exhaustion, AMD/Intel hardware, or my own paired title smoke. These results verify the synthetic admission tests and workspace behavior on this machine; they do not establish a title-level memory or frame-rate improvement. AI-assisted: Codex (GPT-6.2 Sol) ran the tests and drafted this report. |
|
Two contributors checked independently and found that #1417 solves the same problem (for #2463) in a different way: #1607, group D126. You may want to compare them with the other author and agree on one, or say in the PR why both are needed. This is a hint from the community triage in #1607, not a maintainer decision. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table. |
|
Thanks for flagging #1417, @throny I checked #1417 (
Happy to defer to whichever approach maintainers prefer. |
|
Independent desktop NVIDIA verification of PR #2652 at head Environment
Targeted release tests & build (
|
| Command | Result |
|---|---|
cargo test --release -p xcl --lib tight_commit_headroom_bounds_concurrent_admissions -- --nocapture |
1 passed; 0 failed; 0 ignored; 1339 filtered out (0.04s) |
cargo test --release -p xcl --lib wanted_burst_never_exceeds_wanted_at_once -- --nocapture |
1 passed; 0 failed; 0 ignored; 1339 filtered out (0.01s) |
cargo test --release -p xcl --lib wait_for_memory_drains_concurrent_waiters_within_cap -- --nocapture |
1 passed; 0 failed; 0 ignored; 1339 filtered out (0.08s) |
cargo test --release -p xcl --lib low_commit_unwanted_admits_only_one_progress_slot -- --nocapture |
1 passed; 0 failed; 0 ignored; 1339 filtered out (0.00s) |
cargo test --release -p xcl --lib gpu::recomp::dxc:: (3 consecutive runs) |
24 passed; 0 failed; 0 ignored; 1316 filtered out × 3 (0.44s, 0.44s, 0.43s) |
cargo build --release -p xcl --bin xcl |
Clean build (1m 07s, exit 0) |
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 #2652 (88d7b0a19a276f81491e8430acb5d7dd501ebb1e):
xcl-smoke v1
commit: 88d7b0a19a276f81491e8430acb5d7dd501ebb1e
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1631 (PresentX 1631)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14017 MB
Runtime log observations (xcl.log)
9220log lines,0[ERROR]/ device-removal / panic lines.- Final draw/memory telemetry in log:
19621 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample14016 MB committed by the process; video memory 6114 MB local, 4683 MB non-local.
Limits of coverage
- Serialized
dxc::wait_for_memoryslot admission under tight commit headroom, concurrent waiter draining, wanted bursts, and single-slot unwanted progress were verified via all 4 newmemory_gate_testsand 3×gpu::recomp::dxc::(24/0/0). - The 60 s retail smoke ran on a 32 GB RAM host with the existing warm shader cache, so it confirms zero runtime regression on
title: 29640639rather than reproducing cold DXC commit-pressure bursts (frame-count delta vs. cached parent smoke reflects single-run startup variance, not this PR).
AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
Fixes the TOCTOU admission race in
dxc::wait_for_memory(crates/xcl/src/gpu/recomp/dxc.rs) where concurrent DXC worker wakeups readWORKINGwithout synchronization before callingfetch_add(1), admitting bursts past both the commit headroom check andWANTED_AT_ONCE. Part of #2463, Part of #1566, Part of #1269.What is in it
crates/xcl/src/gpu/recomp/dxc.rs: wrapWORKINGadmission checks (plenty,timed_out,cur == 0, andcur < WANTED_AT_ONCE && wanted()) andfetch_add(1)in aMemoryGatemutex while keepingMemorySlot::droplock-free and sleeping outside the mutex; add synthetic multi-threaded unit tests inmemory_gate_tests.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09), DXC 1.9.2602.17 (Windows SDK 10.0.26100.0), debug & release builds on commit88d7b0a1.cargo test -p xcl --lib gpu::recomp::dxc:: -- --test-threads=4: 24 passed, 0 failed, 0 ignored (0 SKIPPED); also 24 passed, 0 failed underXCL_ADAPTER=warp.cargo test -p xcl --lib -- --test-threads=4: 1312 passed, 1 failed (gpu::recomp::tests::gpu_clamp_and_omod_per_instruction,v_pk_add_i16clamp mismatch on RTX 3060), 27 ignored (25 SKIPPED: 21no wave64, 3wave32 per-lane refused, 1cannot disable the driver cache).XCL_ADAPTER=warp cargo test -p xcl --lib -- --test-threads=4: 1312 passed, 1 failed (hle::d3d12x::list_x::tests::mid_list_write64_wait64_split_avoids_cycle_and_reuses_sparesunder parallel adapter/UMA init; passed on default GPU), 27 ignored.cargo test -p xcl --test '*' -- --test-threads=4: 126 passed, 0 failed, 20 ignored across 33 integration test suites (1 SKIPPED:no heap windows).Regression run
Not tested
AI use
MemoryGateandmemory_gate_tests, test/smoke execution, and PR description drafting.