gpu: stop full-card texture-queue hold/wake thrashing and VirtualQuery churn #3832

Closed
KuNQil-o wants to merge 2 commits from upstream-pr/3832 into main
KuNQil-o commented 2026-11-30 08:44:47 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by KuNQil-o on 2026-11-30T08:44:47Z.


What it changes

In a 4-hour play log on a 6 GB RTX 3060 Laptop (Series S, DXGI budget ~4,868 MB), the texture queue had no
room in 2,726 of 2,729 five-second windows (99.9%) and re-held 121.5 M of 124.7 M slots taken
(97.4%). Every 5 seconds that drove:

  • 546 ms median (up to 1,794 ms) waiting on the texture queue mutex, blocking recording threads
    (noting a slot's record) for 290–364 ms / 5 s;
  • 46–337 ms / 5 s holding the queue mutex in taking the slots due;
  • 31–70 ms / 5 s in kernel VirtualQuery (mapped_bytes) and 115–164 ms / 5 s telling the queue
    Told::Held.

Three issues in the full-card hold path caused this churn:

  1. Off-screen slots refused while !room were held with frame + most (~4 s) instead of u64::MAX,
    waking tens of thousands of un-admissible slots every few seconds even though TextureQueue::room wakes all
    held slots as soon as room returns and sampled_wake wakes them when sampled.
  2. TextureQueue::collect_due_and_census did a self.held.get(&e.index) HashMap lookup under the queue
    mutex for every non-due entry, and sampled_wake woke any held slot with e.due > frame && sampled_lately == Some(true) — including visible slots just refused on the same frame, busy-looping every pass.
    self.held also leaked stale entries whenever held slots were overwritten or removed while !room.
  3. View::Placed slots with no host copy (!made) ran kernel VirtualQuery (mapped_bytes) and locked
    self.away (texture_slot_here) before the !room / !first_upload refusal gate.

This PR makes a minimal, targeted fix across two files (crates/victory-gpu/src/descriptor/host.rs,
crates/victory-gpu/src/draw.rs):

  • Adds FLAG_HELD = 1 << 3 on Entry (keeps size_of::<Entry>() == 32), keeps FLAG_HELD ↔
    TextureQueue::held ↔ marks.has_held strictly consistent across all queue mutations (put, take_out,
    later, hold, room, partly, recheck), and replaces the per-entry self.held.get() HashMap lookup
    under the lock with a bit check.
  • Restricts held_sampled_wake to FLAG_HELD entries with due == u64::MAX (with parity in DueBuckets
    for VICTORY_DUE_INDEX=1), and lets TextureQueue::hold lower due from u64::MAX to a finite cooldown
    when a sampled-woken slot is refused again so visible refused slots do not spin every pass.
  • In draw.rs, holds off-screen refused slots (!visible) until u64::MAX while keeping the frame + most cooldown for visible ones, and short-circuits !room && !made placed textures that cannot be admitted
    as first uploads before mapped_bytes / texture_slot_here (reusing made and room_for_first_upload
    without double-counting).

How it was tested

  • GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): Diagnosed from a
    4-hour play log on NVIDIA GeForce RTX 3060 Laptop GPU (6 GB VRAM), Series S, 1080p→1440p, DLSS Performance,
    frame generation off, ray tracing off.
  • Before: 99.9% of 5 s windows in no room; 121.5 M / 124.7 M (97.4%) slots taken held back for room;
    texture queue lock wait 546 ms median (1,794 ms max) per 5 s; mapped_bytes 31–70 ms / 5 s; telling the queue 115–164 ms / 5 s.
  • After: Verified via unit tests covering flat & DueBuckets parity, FLAG_HELD ↔ held ↔
    marks.has_held invariants, off-screen u64::MAX sleep, immediate sampled_wake, finite cooldown
    anti-spin, and room() wakeup. (Full Windows GPU A/B run pending CI / Windows build.)
  • cargo check --target x86_64-pc-windows-msvc --workspace --all-targets --locked (default &
    --all-features): passed.
  • cargo clippy --no-deps --target x86_64-pc-windows-msvc -p victory-gpu --lib --tests --locked (default
    & --all-features): zero new warnings/errors in modified files.
  • TextureQueue / DueBuckets / held_due_frame unit tests (including 4,000-step randomized equivalence
    test and new indefinite_held_slots_wake_when_sampled_and_cooldown_prevents_spin +
    held_due_frame_sleeps_offscreen_and_bounds_visible_retry): 5 passed, 0 failed.
  • cargo xtask policy --staged: asset policy: 2 files ok.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #1877
    (skips mapped_bytes before full-card check), #2608 (sampled readback / held sweep latency), #2770 (held
    flag bit). This PR additionally eliminates off-screen 4 s hold/wake churn (u64::MAX hold), fixes the
    sampled_wake same-frame busy-loop on visible refused slots, cleans stale self.held entries across
    mutations, and brings DueBuckets (VICTORY_DUE_INDEX=1) into parity.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5561934874 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3832). Originally posted by [KuNQil-o](https://github.com/KuNQil-o) on 2026-11-30T08:44:47Z. --- ## What it changes In a 4-hour play log on a 6 GB RTX 3060 Laptop (Series S, DXGI budget ~4,868 MB), the texture queue had no room in 2,726 of 2,729 five-second windows (99.9%) and re-held **121.5 M of 124.7 M** slots taken (**97.4%**). Every 5 seconds that drove: - **546 ms median (up to 1,794 ms)** waiting on the texture queue mutex, blocking recording threads (`noting a slot's record`) for **290–364 ms / 5 s**; - **46–337 ms / 5 s** holding the queue mutex in `taking the slots due`; - **31–70 ms / 5 s** in kernel `VirtualQuery` (`mapped_bytes`) and **115–164 ms / 5 s** telling the queue `Told::Held`. Three issues in the full-card hold path caused this churn: 1. Off-screen slots refused while `!room` were held with `frame + most` (~4 s) instead of `u64::MAX`, waking tens of thousands of un-admissible slots every few seconds even though `TextureQueue::room` wakes all held slots as soon as room returns and `sampled_wake` wakes them when sampled. 2. `TextureQueue::collect_due_and_census` did a `self.held.get(&e.index)` HashMap lookup under the queue mutex for every non-due entry, and `sampled_wake` woke any held slot with `e.due > frame && sampled_lately == Some(true)` — including visible slots just refused on the same frame, busy-looping every pass. `self.held` also leaked stale entries whenever held slots were overwritten or removed while `!room`. 3. `View::Placed` slots with no host copy (`!made`) ran kernel `VirtualQuery` (`mapped_bytes`) and locked `self.away` (`texture_slot_here`) before the `!room` / `!first_upload` refusal gate. This PR makes a minimal, targeted fix across two files (`crates/victory-gpu/src/descriptor/host.rs`, `crates/victory-gpu/src/draw.rs`): - Adds `FLAG_HELD = 1 << 3` on `Entry` (keeps `size_of::<Entry>() == 32`), keeps `FLAG_HELD` ↔ `TextureQueue::held` ↔ `marks.has_held` strictly consistent across all queue mutations (`put`, `take_out`, `later`, `hold`, `room`, `partly`, `recheck`), and replaces the per-entry `self.held.get()` HashMap lookup under the lock with a bit check. - Restricts `held_sampled_wake` to `FLAG_HELD` entries with `due == u64::MAX` (with parity in `DueBuckets` for `VICTORY_DUE_INDEX=1`), and lets `TextureQueue::hold` lower `due` from `u64::MAX` to a finite cooldown when a sampled-woken slot is refused again so visible refused slots do not spin every pass. - In `draw.rs`, holds off-screen refused slots (`!visible`) until `u64::MAX` while keeping the `frame + most` cooldown for visible ones, and short-circuits `!room && !made` placed textures that cannot be admitted as first uploads before `mapped_bytes` / `texture_slot_here` (reusing `made` and `room_for_first_upload` without double-counting). ## How it was tested - GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): Diagnosed from a 4-hour play log on NVIDIA GeForce RTX 3060 Laptop GPU (6 GB VRAM), Series S, 1080p→1440p, DLSS Performance, frame generation off, ray tracing off. - Before: 99.9% of 5 s windows in `no room`; 121.5 M / 124.7 M (97.4%) slots taken held back for room; texture queue lock wait 546 ms median (1,794 ms max) per 5 s; `mapped_bytes` 31–70 ms / 5 s; `telling the queue` 115–164 ms / 5 s. - After: Verified via unit tests covering flat & `DueBuckets` parity, `FLAG_HELD` ↔ `held` ↔ `marks.has_held` invariants, off-screen `u64::MAX` sleep, immediate `sampled_wake`, finite cooldown anti-spin, and `room()` wakeup. (Full Windows GPU A/B run pending CI / Windows build.) - `cargo check --target x86_64-pc-windows-msvc --workspace --all-targets --locked` (default & `--all-features`): passed. - `cargo clippy --no-deps --target x86_64-pc-windows-msvc -p victory-gpu --lib --tests --locked` (default & `--all-features`): zero new warnings/errors in modified files. - `TextureQueue` / `DueBuckets` / `held_due_frame` unit tests (including 4,000-step randomized equivalence test and new `indefinite_held_slots_wake_when_sampled_and_cooldown_prevents_spin` + `held_due_frame_sleeps_offscreen_and_bounds_visible_retry`): 5 passed, 0 failed. - `cargo xtask policy --staged`: `asset policy: 2 files ok`. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #1877 (skips `mapped_bytes` before full-card check), #2608 (sampled readback / held sweep latency), #2770 (held flag bit). This PR additionally eliminates off-screen 4 s hold/wake churn (`u64::MAX` hold), fixes the `sampled_wake` same-frame busy-loop on visible refused slots, cleans stale `self.held` entries across mutations, and brings `DueBuckets` (`VICTORY_DUE_INDEX=1`) into parity.
copilot-pull-request-reviewer[bot] commented 2026-11-30 08:44:58 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-30T08:44:58Z.

Review: COMMENTED


Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:review:6109092369 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3832#pullrequestreview-6109092369). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/apps/copilot-pull-request-reviewer) on 2026-11-30T08:44:58Z. **Review:** COMMENTED --- Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
tyr0nsur commented 2026-11-30 09:25:12 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tyr0nsur on 2026-11-30T09:25:12Z.


The early first-upload gate can keep an old mip view alive after its backing is decommitted. On 86ad3ad, I reproduced this through the real texture pass on an RTX 4060 with a synthetic texture. After rewriting a placed SRV to expose more mips, texture_slot_made_from is false for the new record while the slot still shows the old view. When the queue has no room, it takes Held before mapped_bytes can report that the memory is gone. That skips texture_slot_gone, which releases the descriptor's reference even while the card is full.

Follow-up commit b1aa330 keeps the page-walk shortcut for slots with no made host descriptor. Slots retaining a placed view still check for decommit and keep a bounded retry if that view is still mapped. The regression checks the old view is released and that a second slot with no host view still takes the fast hold path.

The targeted draw/descriptor suite passed on the RTX 4060 (96 passed, 1 ignored). The regression and held-queue test also passed on WARP with the indexed queue enabled. The staged asset policy check passed. Playback impact remains to be measured.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7274181524 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3832#issuecomment-7274181524). Originally posted by [tyr0nsur](https://github.com/tyr0nsur) on 2026-11-30T09:25:12Z. --- The early first-upload gate can keep an old mip view alive after its backing is decommitted. On `86ad3ad`, I reproduced this through the real texture pass on an RTX 4060 with a synthetic texture. After rewriting a placed SRV to expose more mips, `texture_slot_made_from` is false for the new record while the slot still shows the old view. When the queue has no room, it takes `Held` before `mapped_bytes` can report that the memory is gone. That skips `texture_slot_gone`, which releases the descriptor's reference even while the card is full. [Follow-up commit b1aa330](https://github.com/tyr0nsur/VIctory-NVIDIA/commit/b1aa33050cd1e5b2a84445e301c51d782f707211) keeps the page-walk shortcut for slots with no made host descriptor. Slots retaining a placed view still check for decommit and keep a bounded retry if that view is still mapped. The regression checks the old view is released and that a second slot with no host view still takes the fast hold path. The targeted draw/descriptor suite passed on the RTX 4060 (96 passed, 1 ignored). The regression and held-queue test also passed on WARP with the indexed queue enabled. The staged asset policy check passed. Playback impact remains to be measured.
mstrmoos commented 2026-11-30 19:22:38 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mstrmoos on 2026-11-30T19:22:38Z.


Picked onto our branch with #3753, #3756, #3760, #3881, #3832, #3858 and four that have since merged (#3818, #3850, #3874, #3871). #3760 needed a hand merge on top of the others.

All of victory-gpu's and victory-shader's tests passed. On the RTX 5080 16 GB, Ryzen 7 9800X3D, Windows 11, Series X profile, same save and 90 s bench route each run, the frame median went from 40.4 to 39.1 ms for the whole set. I didn't measure the PRs one by one, so this is evidence of no regression rather than this PR's own gain. Screenshots looked clean.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7289291405 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3832#issuecomment-7289291405). Originally posted by [mstrmoos](https://github.com/mstrmoos) on 2026-11-30T19:22:38Z. --- Picked onto our branch with #3753, #3756, #3760, #3881, #3832, #3858 and four that have since merged (#3818, #3850, #3874, #3871). #3760 needed a hand merge on top of the others. All of victory-gpu's and victory-shader's tests passed. On the RTX 5080 16 GB, Ryzen 7 9800X3D, Windows 11, Series X profile, same save and 90 s bench route each run, the frame median went from 40.4 to 39.1 ms for the whole set. I didn't measure the PRs one by one, so this is evidence of no regression rather than this PR's own gain. Screenshots looked clean.
KuNQil-o commented 2026-12-01 02:51:03 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by KuNQil-o on 2026-12-01T02:51:03Z.


Rebased and fixed the stale mip view issue reported by @tyr0nsur:

  • Full card (older host view): Still check for decommitted backing and retry with a bounded delay.
  • Cold slots: Only skip the page check if we can't attempt a first upload or a small copy.

Added regression tests for both cases. Still need to test efcff10a on Windows at runtime.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7299059851 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3832#issuecomment-7299059851). Originally posted by [KuNQil-o](https://github.com/KuNQil-o) on 2026-12-01T02:51:03Z. --- Rebased and fixed the stale mip view issue reported by @tyr0nsur: - **Full card (older host view):** Still check for decommitted backing and retry with a bounded delay. - **Cold slots:** Only skip the page check if we can't attempt a first upload or a small copy. Added regression tests for both cases. Still need to test `efcff10a` on Windows at runtime.
mstrmoos commented 2026-12-01 03:22:25 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mstrmoos on 2026-12-01T03:22:25Z.


A Windows runtime test of efcff10a, since you asked for one. It found a visible problem on a full card.

Setup: RTX 5080 16 GB with VICTORY_VRAM_BUDGET_MB=5000 to stand in for a small card (about your laptop's 4,868 MB). Series X, DLSS Balanced, frame generation off, launcher defaults otherwise. The player stands still on a pier for 120 s with the clock held: water fills the left of the frame, a wooden deck and a railing are in front, people sit at a terrace behind, and a shore is in the distance. That's about 8,900 draws a frame. Main is de21ed57, and the test build is de21ed57 with this PR merged. One run each.

The queue does what you describe:

last 5 s of each run main main + #3832
slots due 15,514-16,054 (oldest written 10,121 frames ago) 133-219 (oldest 8-2,072 frames)
texture queue lock taken 73,970 (40,800 by the pass asking or telling of a slot) 34,749 (1,707)
waited for that lock 443 ms 276 ms
looks that found no more mapped (since start) 353,972 46,847
frame median 132.6 ms 136.3 ms

The frame time is set by the budget on this scene (about 6.1 GB in use against 5.0), so neither run is playable, and the frame doesn't separate them.

The problem is that surfaces in view stay untextured with the PR. Screenshots at 60 s and 116 s:

  • With #3832: the pier's deck and the railing in the foreground render flat white or grey in both pictures, from the middle of the run to its end.
  • On main: the deck and railing are textured in both pictures.
  • Both builds: the player character is untextured, so that part is the budget, not this PR.

My guess, not checked in code: slots refused while there's no room are now held at u64::MAX and woken when room returns. On a card that stays full, room doesn't return, so visible slots that were refused once may never be asked again unless the sampled wake reaches them. These runs had the launcher's VICTORY_SAMPLED_MARKS default. Your laptop log may not show this if its card dropped under the line now and then.

I can rerun with any switch you'd like, or with a longer route.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7299638240 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3832#issuecomment-7299638240). Originally posted by [mstrmoos](https://github.com/mstrmoos) on 2026-12-01T03:22:25Z. --- A Windows runtime test of `efcff10a`, since you asked for one. It found a visible problem on a full card. **Setup:** RTX 5080 16 GB with `VICTORY_VRAM_BUDGET_MB=5000` to stand in for a small card (about your laptop's 4,868 MB). Series X, DLSS Balanced, frame generation off, launcher defaults otherwise. The player stands still on a pier for 120 s with the clock held: water fills the left of the frame, a wooden deck and a railing are in front, people sit at a terrace behind, and a shore is in the distance. That's about 8,900 draws a frame. Main is de21ed57, and the test build is de21ed57 with this PR merged. One run each. **The queue does what you describe:** | last 5 s of each run | main | main + #3832 | | --- | --- | --- | | slots due | 15,514-16,054 (oldest written 10,121 frames ago) | 133-219 (oldest 8-2,072 frames) | | texture queue lock taken | 73,970 (40,800 by the pass asking or telling of a slot) | 34,749 (1,707) | | waited for that lock | 443 ms | 276 ms | | looks that found no more mapped (since start) | 353,972 | 46,847 | | frame median | 132.6 ms | 136.3 ms | The frame time is set by the budget on this scene (about 6.1 GB in use against 5.0), so neither run is playable, and the frame doesn't separate them. **The problem is that surfaces in view stay untextured with the PR.** Screenshots at 60 s and 116 s: - **With #3832:** the pier's deck and the railing in the foreground render flat white or grey in both pictures, from the middle of the run to its end. - **On main:** the deck and railing are textured in both pictures. - **Both builds:** the player character is untextured, so that part is the budget, not this PR. My guess, not checked in code: slots refused while there's no room are now held at `u64::MAX` and woken when room returns. On a card that stays full, room doesn't return, so visible slots that were refused once may never be asked again unless the sampled wake reaches them. These runs had the launcher's `VICTORY_SAMPLED_MARKS` default. Your laptop log may not show this if its card dropped under the line now and then. I can rerun with any switch you'd like, or with a longer route.
KuNQil-o commented 2026-12-01 04:31:16 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by KuNQil-o on 2026-12-01T04:31:16Z.


A Windows runtime test of efcff10a, since you asked for one. It found a visible problem on a full card.一个 Windows 运行时测试 efcff10a,既然你要求了。它在一张满卡上发现了一个明显的问题。

Setup: RTX 5080 16 GB with VICTORY_VRAM_BUDGET_MB=5000 to stand in for a small card (about your laptop's 4,868 MB). Series X, DLSS Balanced, frame generation off, launcher defaults otherwise. The player stands still on a pier for 120 s with the clock held: water fills the left of the frame, a wooden deck and a railing are in front, people sit at a terrace behind, and a shore is in the distance. That's about 8,900 draws a frame. Main is de21ed5, and the test build is de21ed5 with this PR merged. One run each.**设置:**RTX 5080 16 GB,VICTORY_VRAM_BUDGET_MB=5000 来替代一张小显卡(大约你笔记本的 4,868 MB)。Series X,DLSS 平衡,关闭帧生成,启动器默认。玩家在码头上静止 120 秒,手持时钟:画面左侧充满水,前方有木质甲板和栏杆,后方有露台上坐着人,远处有岸边。这大约是每帧 8,900 张。主版本是 de21ed5 ,测试版本是 de21ed5 用这个 PR 合并的。每人一跑。

The queue does what you describe:队列的功能就是你描述的:

last 5 s of each run
每次运行的最后5秒 main  主要内容 main + #3832  主页 + #3832
slots due  截止时段 15,514-16,054 (oldest written 10,121 frames ago)
15,514-16,054(最早写作时间为10,121帧前) 133-219 (oldest 8-2,072 frames)
133-219(最早8-2,072帧)
texture queue lock taken
纹理队列锁定 73,970 (40,800 by the pass asking or telling of a slot)
73,970(通过询问或告知老虎机的人数为40,800) 34,749 (1,707)
waited for that lock
等着那个锁 443 ms 276 ms
looks that found no more mapped (since start)
自开始以来未发现更多地图的查看 353,972 46,847
frame median  框架中位数 132.6 ms  132.6 毫秒 136.3 ms
The frame time is set by the budget on this scene (about 6.1 GB in use against 5.0), so neither run is playable, and the frame doesn't separate them.帧时间由该场景的预算决定(使用时约 6.1GB,5.0GB),因此两帧都无法运行,且帧不分隔它们。

The problem is that surfaces in view stay untextured with the PR. Screenshots at 60 s and 116 s:问题是,在 PR 模式下,视野中的表面始终没有纹理。 截图分别在 60 秒和 116 秒时:

My guess, not checked in code: slots refused while there's no room are now held at u64::MAX and woken when room returns. On a card that stays full, room doesn't return, so visible slots that were refused once may never be asked again unless the sampled wake reaches them. These runs had the launcher's VICTORY_SAMPLED_MARKS default. Your laptop log may not show this if its card dropped under the line now and then.我猜,代码里没检查:在没有房间的情况下,槽位被拒绝,现在被保留在 u64::MAX,房间恢复时被唤醒。对于持续满员的卡,空间不会恢复,因此曾经被拒绝的可见槽位可能永远不会再被要求,除非采样的尾迹到达了它们。这些运行都是启动器的 VICTORY_SAMPLED_MARKS 默认设置。如果你的笔记本日志里,如果显卡偶尔掉到线下,可能就不会显示这个。

I can rerun with any switch you'd like, or with a longer route.我可以用任何你想要的换轨线重跑,或者用更长的路线。

@mstrmoos Thanks for the thorough Windows test and the clear breakdown.

Your guess matches a real path in the code: when VRAM stays pinned above budget and never drops below the threshold, a refused slot parked at u64::MAX won't retry unless a sampled wake hits it. I'll check why the foreground pier surfaces aren't getting woken on that path, and also look at replacing u64::MAX with a bounded fallback delay so a missed mark can't leave visible geometry untextured indefinitely.

Since you offered, a quick rerun on efcff10a with VICTORY_SAMPLED_MARKS=0 on the same pier setup would be super helpful to confirm whether the planks/railing recover.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7300817314 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3832#issuecomment-7300817314). Originally posted by [KuNQil-o](https://github.com/KuNQil-o) on 2026-12-01T04:31:16Z. --- > A Windows runtime test of `efcff10a`, since you asked for one. It found a visible problem on a full card.一个 Windows 运行时测试 `efcff10a`,既然你要求了。它在一张满卡上发现了一个明显的问题。 > > **Setup:** RTX 5080 16 GB with `VICTORY_VRAM_BUDGET_MB=5000` to stand in for a small card (about your laptop's 4,868 MB). Series X, DLSS Balanced, frame generation off, launcher defaults otherwise. The player stands still on a pier for 120 s with the clock held: water fills the left of the frame, a wooden deck and a railing are in front, people sit at a terrace behind, and a shore is in the distance. That's about 8,900 draws a frame. Main is [de21ed5](https://github.com/trustno1-coder/VIctory-NVIDIA/commit/de21ed5710f5299e7cb28236315757f6383219c0), and the test build is [de21ed5](https://github.com/trustno1-coder/VIctory-NVIDIA/commit/de21ed5710f5299e7cb28236315757f6383219c0) with this PR merged. One run each.**设置:**RTX 5080 16 `GB,VICTORY_VRAM_BUDGET_MB=5000` 来替代一张小显卡(大约你笔记本的 4,868 MB)。Series X,DLSS 平衡,关闭帧生成,启动器默认。玩家在码头上静止 120 秒,手持时钟:画面左侧充满水,前方有木质甲板和栏杆,后方有露台上坐着人,远处有岸边。这大约是每帧 8,900 张。主版本是 [de21ed5](https://github.com/trustno1-coder/VIctory-NVIDIA/commit/de21ed5710f5299e7cb28236315757f6383219c0) ,测试版本是 [de21ed5](https://github.com/trustno1-coder/VIctory-NVIDIA/commit/de21ed5710f5299e7cb28236315757f6383219c0) 用这个 PR 合并的。每人一跑。 > > **The queue does what you describe:队列的功能就是你描述的:** > > last 5 s of each run > 每次运行的最后5秒 main  主要内容 main + #3832  主页 + #3832 > slots due  截止时段 15,514-16,054 (oldest written 10,121 frames ago) > 15,514-16,054(最早写作时间为10,121帧前) 133-219 (oldest 8-2,072 frames) > 133-219(最早8-2,072帧) > texture queue lock taken > 纹理队列锁定 73,970 (40,800 by the pass asking or telling of a slot) > 73,970(通过询问或告知老虎机的人数为40,800) 34,749 (1,707) > waited for that lock > 等着那个锁 443 ms 276 ms > looks that found no more mapped (since start) > 自开始以来未发现更多地图的查看 353,972 46,847 > frame median  框架中位数 132.6 ms  132.6 毫秒 136.3 ms > The frame time is set by the budget on this scene (about 6.1 GB in use against 5.0), so neither run is playable, and the frame doesn't separate them.帧时间由该场景的预算决定(使用时约 6.1GB,5.0GB),因此两帧都无法运行,且帧不分隔它们。 > > **The problem is that surfaces in view stay untextured with the PR.** Screenshots at 60 s and 116 s:**问题是,在 PR 模式下,视野中的表面始终没有纹理。** 截图分别在 60 秒和 116 秒时: > > * **With [gpu: stop full-card texture-queue hold/wake thrashing and VirtualQuery churn #3832](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3832):** the pier's deck and the railing in the foreground render flat white or grey in both pictures, from the middle of the run to its end.**在 [gpu: stop full-card texture-queue hold/wake thrashing and VirtualQuery churn #3832](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3832) 两**张照片中,码头甲板和前景栏杆从滑道中段到终点都呈现出平白或灰色。 > * **On main:** the deck and railing are textured in both pictures.**主图:** 两张照片里甲板和栏杆都有纹理。 > * **Both builds:** the player character is untextured, so that part is the budget, not this PR.**两种构建:** 玩家角色没有贴图,所以这部分是预算问题,而不是这个公关。 > > My guess, not checked in code: slots refused while there's no room are now held at `u64::MAX` and woken when room returns. On a card that stays full, room doesn't return, so visible slots that were refused once may never be asked again unless the sampled wake reaches them. These runs had the launcher's `VICTORY_SAMPLED_MARKS` default. Your laptop log may not show this if its card dropped under the line now and then.我猜,代码里没检查:在没有房间的情况下,槽位被拒绝,现在被保留在 `u64::MAX`,房间恢复时被唤醒。对于持续满员的卡,空间不会恢复,因此曾经被拒绝的可见槽位可能永远不会再被要求,除非采样的尾迹到达了它们。这些运行都是启动器的 `VICTORY_SAMPLED_MARKS` 默认设置。如果你的笔记本日志里,如果显卡偶尔掉到线下,可能就不会显示这个。 > > I can rerun with any switch you'd like, or with a longer route.我可以用任何你想要的换轨线重跑,或者用更长的路线。 @mstrmoos Thanks for the thorough Windows test and the clear breakdown. Your guess matches a real path in the code: when VRAM stays pinned above budget and never drops below the threshold, a refused slot parked at `u64::MAX` won't retry unless a sampled wake hits it. I'll check why the foreground pier surfaces aren't getting woken on that path, and also look at replacing `u64::MAX` with a bounded fallback delay so a missed mark can't leave visible geometry untextured indefinitely. Since you offered, a quick rerun on `efcff10a` with `VICTORY_SAMPLED_MARKS=0` on the same pier setup would be super helpful to confirm whether the planks/railing recover.
mstrmoos commented 2026-12-01 04:54:05 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mstrmoos on 2026-12-01T04:54:05Z.


Rerun on efcff10a with VICTORY_SAMPLED_MARKS=0. Same pier, same 5,000 MB budget, clock held, 120 s, de21ed57 + this PR.

The deck and railing recover. They're textured in both the 60 s and the 116 s screenshots, where with marks on they stayed flat for the whole run.

But something else is flat this time. The palm trees right of the terrace (behind the people) render white in both pictures. On main with marks on they're textured, and so are the trees in this PR's marks-on run. The player character is untextured in every build, which is the budget.

last 5 s main (marks on) #3832, marks on #3832, marks off
slots due 15,514-16,054 133-219 8 (oldest written 0 frames ago)
texture queue lock taken 73,970 34,749 28,382 (1,293 by the pass asking or telling of a slot)
waited for that lock 443 ms 276 ms 79 ms
frame median 132.6 ms 136.3 ms 135.5 ms

So which visible surfaces stay bare depends on which wake path reaches them: with marks on, the planks and railing; with marks off, the trees. That fits the held-forever path more than the marks. A bounded fallback delay instead of u64::MAX, as you suggest, should cover both cases. Happy to run whatever you push next on the same setup.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7301218098 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3832#issuecomment-7301218098). Originally posted by [mstrmoos](https://github.com/mstrmoos) on 2026-12-01T04:54:05Z. --- Rerun on `efcff10a` with `VICTORY_SAMPLED_MARKS=0`. Same pier, same 5,000 MB budget, clock held, 120 s, de21ed57 + this PR. **The deck and railing recover.** They're textured in both the 60 s and the 116 s screenshots, where with marks on they stayed flat for the whole run. But something else is flat this time. **The palm trees right of the terrace (behind the people) render white in both pictures.** On main with marks on they're textured, and so are the trees in this PR's marks-on run. The player character is untextured in every build, which is the budget. | last 5 s | main (marks on) | #3832, marks on | #3832, marks off | | --- | --- | --- | --- | | slots due | 15,514-16,054 | 133-219 | 8 (oldest written 0 frames ago) | | texture queue lock taken | 73,970 | 34,749 | 28,382 (1,293 by the pass asking or telling of a slot) | | waited for that lock | 443 ms | 276 ms | 79 ms | | frame median | 132.6 ms | 136.3 ms | 135.5 ms | So which visible surfaces stay bare depends on which wake path reaches them: with marks on, the planks and railing; with marks off, the trees. That fits the held-forever path more than the marks. A bounded fallback delay instead of `u64::MAX`, as you suggest, should cover both cases. Happy to run whatever you push next on the same setup.
trustno1-coder commented 2026-12-01 18:48:18 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:48:18Z.


Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7321576554 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3832#issuecomment-7321576554). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-12-01T18:48:18Z. --- Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

Pull request closed

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!3832
No description provided.