Staging blocks made with the pool's lock let go #685
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/685"
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 0xkn0wh3r3 on 2026-11-28T03:32:49Z.
Stacked on #684 (and so on #683 and #630). It edits the same function,
take_unlocked. New here: the last two commits,Staging blocks made with the pool's lock let goand its bench.Why
A new 64 MiB block of texture staging is upload memory, which the system zeroes before it's there. It was made under the staging pool's lock, so every texture upload waited to be staged in the meantime.
What
The staging pool makes its blocks the same way texture blocks are made in #683, with the lock released, through one helper (
take_from) for both pools.VICTORY_BLOCKS_UNLOCKED=0puts both back under their locks, as before. The backoff for refused blocks, and the gate on speculative prefetch, are kept.Before / after
bench_staging_while_another_thread_makes_blocks(--ignored --nocapture): one thread stages 64 KiB pieces while another stages 8 MiB pieces and keeps 64 of them, so new staging blocks keep being made. RTX card, four runs each. Latency of the small pieces' staging:VICTORY_BLOCKS_UNLOCKED=0)Correctness
threads_that_stage_at_once_get_zeroed_pieces_of_their_own: eight threads stage 64 MiB each at once, making new blocks. Every piece starts as zeros and holds only what its own thread wrote (sampled every 4 KiB, since the CPU reads write-combined memory slowly).VICTORY_RIPE_BLOCKSunset and=0, and withVICTORY_BLOCKS_UNLOCKED=0. With the debug layer on it reports nothing.-D warnings, andcargo test --workspace --locked, all pass.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Dukestar69 on 2026-11-28T05:18:09Z.
Review: APPROVED
LGTM — verified on Windows (RTX 5090):
cargo test -p victory-gpu --lib pool::passed (12/12, including concurrent staging/texture block creation tests)cargo xtask policypassed (294 files ok)Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by 0xkn0wh3r3 on 2026-11-28T06:49:51Z.
Replaced by #816, one smaller change of the same kind (blocks made with the pool's lock let go, for both textures and staging). It has no switch and no separate thread making blocks ahead, and comes with before/after numbers against current main.
Pull request closed