gpu: compact unpublished RemapQueue bursts and advance cursor on empty refreshes #2607

Merged
nidea1 merged 1 commit from upstream-pr/2607 into main 2026-11-29 22:54:42 +00:00
nidea1 commented 2026-11-29 14:54:07 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nidea1 on 2026-11-29T14:54:07Z.


Summary

Fixes two bugs in descriptor/host.rs that caused RemapQueue history evictions and repeated full-heap rescans under heavy streaming/remap bursts, flooding the bindless texture upload queue:

  1. Frozen cursor on empty heaps (HostHeap::refresh_remapped): returned early when slots.is_empty() without advancing *cursor = latest, leaving that heap's cursor permanently behind until RemapQueue history rolled over and forced full-heap rescans. Now advances *cursor = latest before the early return.
  2. Eager eviction & missing overlap coalescing (RemapQueue::record): previously coalesced only strictly adjacent ascending ranges (*last_end == start) and evicted published history immediately at REMAP_LIMIT. Now coalesces overlapping/identical/touching bursts in the fast path (start <= *last_end && end >= *last_start) and compacts the unpublished suffix (sequence > self.published) via join() before evicting published entries.

Verification

  • cargo test -p victory-gpu --lib -- remap: 7 passed, 0 failed (including 2 new regression tests covering overlapping/unpublished compaction and cursor advancement on empty heaps).
  • cargo clippy -p victory-gpu --tests: 0 warnings in touched lines.
  • cargo xtask policy --staged: passed.
  • Live RTX 3060 Ti run: oldest not uploaded yet dropped from >500 frames ago to 2–3 frames ago during initial world entry, and evicted from history dropped by >50%.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5551891039 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2607). Originally posted by [nidea1](https://github.com/nidea1) on 2026-11-29T14:54:07Z. --- ## Summary Fixes two bugs in `descriptor/host.rs` that caused `RemapQueue` history evictions and repeated full-heap rescans under heavy streaming/remap bursts, flooding the bindless texture upload queue: 1. **Frozen cursor on empty heaps (`HostHeap::refresh_remapped`)**: returned early when `slots.is_empty()` without advancing `*cursor = latest`, leaving that heap's cursor permanently behind until `RemapQueue` history rolled over and forced full-heap rescans. Now advances `*cursor = latest` before the early return. 2. **Eager eviction & missing overlap coalescing (`RemapQueue::record`)**: previously coalesced only strictly adjacent ascending ranges (`*last_end == start`) and evicted published history immediately at `REMAP_LIMIT`. Now coalesces overlapping/identical/touching bursts in the fast path (`start <= *last_end && end >= *last_start`) and compacts the unpublished suffix (`sequence > self.published`) via `join()` before evicting published entries. ## Verification - `cargo test -p victory-gpu --lib -- remap`: 7 passed, 0 failed (including 2 new regression tests covering overlapping/unpublished compaction and cursor advancement on empty heaps). - `cargo clippy -p victory-gpu --tests`: 0 warnings in touched lines. - `cargo xtask policy --staged`: passed. - Live RTX 3060 Ti run: `oldest not uploaded yet` dropped from >500 frames ago to 2–3 frames ago during initial world entry, and `evicted from history` dropped by >50%.
dyshay commented 2026-11-29 15:40:15 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-29T15:40:15Z.


Merged into our fork's integration branch for testing (dyshay/VIctory-NVIDIA, branch janus-prs). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with --profile diag --features diagnostics, and the CPU tests of the touched crates pass. Runs on an RTX 4090 are queued (Series X 1440p, and Series S with ray tracing, DLSS Quality). Frame times will follow here.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7258272908 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2607#issuecomment-7258272908). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-29T15:40:15Z. --- Merged into our fork's integration branch for testing ([dyshay/VIctory-NVIDIA](https://github.com/dyshay/VIctory-NVIDIA/tree/janus-prs), branch `janus-prs`). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with `--profile diag --features diagnostics`, and the CPU tests of the touched crates pass. Runs on an RTX 4090 are queued (Series X 1440p, and Series S with ray tracing, DLSS Quality). Frame times will follow here.
Sign in to join this conversation.
No reviewers
No labels
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.

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