gpu: avoid unrelated range-lock wakeups and linear overlap scans #3292
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3292"
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 spk-c on 2026-11-29T21:22:48Z.
What it changes
The watch range lock stores writer ranges sorted and merged, but checks them linearly while holding the state mutex. Reader drops also wake all waiters even when the departing reader is outside the writer's ranges.
Use binary search over the joined intervals and notify waiters only when the departing reader overlaps the pending writer. Writer release still notifies all. Lock ownership and ordering are unchanged.
How it was tested
cargo testpassed for the crates it touches: no, not yet run. Added a predicate-equivalence regression test; existing concurrency tests retained.victory-loader::unwind_copyis unused, outside the changed file. No successful test run is claimed.cargo test -p victory-gpu rangelock --lockedand identical streaming-route A/B, comparing CPU preparation time, p95/p99 and displayed FPS.Checked for overlap
AI assistance
Prepared with AI assistance; gameplay validation and human review remain pending.