texback, host: keep readback pool under pressure, recycle at landing, and offload relay bury #3482

Manually merged
github merged 1 commit from github-bot/gh-3482 into gh-pr/3482/base 2026-11-30 14:16:24 +00:00 AGit
Owner

@⁠Maverick0351a on GitHub · 2026-11-29 23:48 UTC · original
Maverick0351a:fix/readback-pool-and-async-bury → main · +28 −8 · 3 files · 1 commits · merged 2026-11-30 14:12 UTC

Summary

In open-world water/city gameplay (~20–25 ocean/water texture readbacks per frame, 149,760 texture readbacks in 14 minutes), landing per frame on the single ictory-relay thread spent 10.76–25.57 ms/frame in
ead-backs and lists and 17.36–20.92 ms/frame in he rest:

  1. In crates/victory-gpu/src/texback.rs, ake_read_back and give_read_back checked !crate::residency::pressured(), and sweep() called rim_read_backs() (READBACK_POOL.clear()) every second when pressured() was true. On 32 GB hosts where pressured() stays latched (physical_free < 5 GiB), READBACK_POOL was completely disabled, forcing CreateCommittedResource + Map ~365 times/sec and Unmap + D3DKMTDestroyAllocation2 ~365 times/sec.
  2. Detached flight lists held their ReadBack buffers across the full 16-to-64-submission ury_lag until HostList::reset() instead of recycling them immediately at landing after
    ead_backs(...) copied their contents into title memory.
  3. In Host::relay_land, ury(last) (17–21 ms/frame of D3DKMTDestroyAllocation2 calls) ran synchronously on ictory-relay before updating line() (written,
    arrow, *settling = false) and waking LINE_MOVED / LINE_LANDED.
  4. card_steps::Taken::landed called drop(std::mem::take(&mut *self.own.list.deferred())) instead of self.own.list.deferred().clear(), discarding internal Vec/HashMap capacities on every landed flight.

Fix

  1. crates/victory-gpu/src/texback.rs & crates/victory-gpu/src/host.rs:
    • Keep READBACK_POOL active unless crate::residency::critical_commit() is true, and add sweep_read_backs() to trim only the unborrowed 1 Hz low-water surplus ( rim_window()) under normal pressure.
    • Call detached.host().recycle_read_backs() at flight landing alongside
      elease_tables() and
      elease_scratch().
  2. crates/victory-gpu/src/host.rs & crates/victory-gpu/src/host/card_steps.rs:
    • In Host::relay_land, call fast uav_pool::drain_retired_uavs(last) and offload ury(FINISHED.load(Ordering::Acquire)) to late_helper ( ictory-late-wait thread, woken on every landing by line.poke = true) while also running ury(FINISHED.load(Ordering::Acquire)) in synchronous Host::settle.
    • In card_steps::Taken::landed, guard late::landed / late::landed_cpu with if late::on() and call self.own.list.deferred().clear().

Testing

  • cargo test -p victory-gpu --lib texback (4 passed; 0 failed)
**@⁠Maverick0351a** on GitHub · 2026-11-29 23:48 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3482) `Maverick0351a:fix/readback-pool-and-async-bury` → `main` · +28 −8 · 3 files · 1 commits · merged 2026-11-30 14:12 UTC ### Summary In open-world water/city gameplay (~20–25 ocean/water texture readbacks per frame, 149,760 texture readbacks in 14 minutes), landing per frame on the single ictory-relay thread spent **10.76–25.57 ms/frame** in ead-backs and lists and **17.36–20.92 ms/frame** in he rest: 1. In crates/victory-gpu/src/texback.rs, ake_read_back and give_read_back checked !crate::residency::pressured(), and sweep() called rim_read_backs() (READBACK_POOL.clear()) every second when pressured() was true. On 32 GB hosts where pressured() stays latched (physical_free < 5 GiB), READBACK_POOL was completely disabled, forcing CreateCommittedResource + Map ~365 times/sec and Unmap + D3DKMTDestroyAllocation2 ~365 times/sec. 2. Detached flight lists held their ReadBack buffers across the full 16-to-64-submission ury_lag until HostList::reset() instead of recycling them immediately at landing after ead_backs(...) copied their contents into title memory. 3. In Host::relay_land, ury(last) (17–21 ms/frame of D3DKMTDestroyAllocation2 calls) ran synchronously on ictory-relay before updating line() (written, arrow, *settling = false) and waking LINE_MOVED / LINE_LANDED. 4. card_steps::Taken::landed called drop(std::mem::take(&mut *self.own.list.deferred())) instead of self.own.list.deferred().clear(), discarding internal Vec/HashMap capacities on every landed flight. ### Fix 1. **crates/victory-gpu/src/texback.rs & crates/victory-gpu/src/host.rs**: - Keep READBACK_POOL active unless crate::residency::critical_commit() is true, and add sweep_read_backs() to trim only the unborrowed 1 Hz low-water surplus ( rim_window()) under normal pressure. - Call detached.host().recycle_read_backs() at flight landing alongside elease_tables() and elease_scratch(). 2. **crates/victory-gpu/src/host.rs & crates/victory-gpu/src/host/card_steps.rs**: - In Host::relay_land, call fast uav_pool::drain_retired_uavs(last) and offload ury(FINISHED.load(Ordering::Acquire)) to late_helper ( ictory-late-wait thread, woken on every landing by line.poke = true) while also running ury(FINISHED.load(Ordering::Acquire)) in synchronous Host::settle. - In card_steps::Taken::landed, guard late::landed / late::landed_cpu with if late::on() and call self.own.list.deferred().clear(). ### Testing - cargo test -p victory-gpu --lib texback (4 passed; 0 failed)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 23:49:18 +00:00
github-bot changed target branch from main to gh-pr/3482/base 2026-11-30 14:15:11 +00:00
github manually merged commit f9eaf5e633 into gh-pr/3482/base 2026-11-30 14:15:14 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!3482
No description provided.