gpu(watch): spin-backoff before yielding in fault-ask open wait #2814
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2814"
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?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Nosheboo on 2026-11-29T17:37:14Z.
Motivation
On upstream
55d06914, baseline profiling shows the submitter spending3.4–3.7 ms/frameinwrite watch. Inwait_open_done, the open-wait loop immediately calledstd::thread::yield_now()on contention and unconditionally evaluatedInstant::now()even whenfault_asks()diagnostics were off.Changes
crates/victory-gpu/src/watch.rs:OpenWait,wait_open_done, and testablewait_open_done_with.std::hint::spin_loop()fast-spin phase (OPEN_FAST_SPINS = 8) before falling back tostd::thread::yield_now()up toOPEN_LONGEST_US = 2_000.Instant::now()reads inside thefault_asks()diagnostics branch so the non-diagnostic hot path avoids extra clock syscalls.wait_open_done_covers_immediate_fast_spin_yield_cleared_and_timeoutcovering all six wait outcomes.Verification
cargo test -p victory-gpu --lib --locked watch:: -- --test-threads=1->63 passed; 0 failed; 0 ignoredcargo clippy -p victory-gpu --no-deps --lib --tests --locked -- -W clippy::undocumented_unsafe_blocksreported 0 warnings inwatch.rsgit diff --cached --checkclean;cargo xtask policy --stagedpassed (1 files ok)Council review
Rounds: 3
gpt-6-luna,xhigh)gpt-6-luna,xhigh)gpt-6-luna,xhigh)Created in T3 Code (reviewed by Council: 3× gpt-6-luna on xhigh).