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

Manually merged
github merged 1 commit from github-bot/gh-2607 into gh-pr/2607/base 2026-11-29 22:59:40 +00:00 AGit
Owner

@⁠nidea1 on GitHub · 2026-11-29 14:54 UTC · original
nidea1:fix/remap-queue-cursor-and-compaction → main · +123 −8 · 1 files · 1 commits · merged 2026-11-29 22:54 UTC

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%.
**@⁠nidea1** on GitHub · 2026-11-29 14:54 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2607) `nidea1:fix/remap-queue-cursor-and-compaction` → `main` · +123 −8 · 1 files · 1 commits · merged 2026-11-29 22:54 UTC ## 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%.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 14:56:23 +00:00
Author
Owner

@⁠dyshay on GitHub · 2026-11-29 15:40 UTC · original

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.

**@⁠dyshay** on GitHub · 2026-11-29 15:40 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2607#issuecomment-7258272908) 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.
github-bot changed target branch from main to gh-pr/2607/base 2026-11-29 22:58:17 +00:00
github manually merged commit 2fe2d4cc1a into gh-pr/2607/base 2026-11-29 22:58:19 +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!2607
No description provided.