Frame generation: no 14 fps lock; 100 ms pipeline wait; free given-up render targets; retry OOM pipelines; release memory logs #152

Closed
github-bot wants to merge 0 commits from github-bot/gh-152 into main AGit
Owner

@⁠AVD-appezhax on GitHub · 2026-11-30 18:38 UTC · original
AVD-appezhax:fix/framegen-lock-and-drop-reasons → main · +9 −4 · 2 files · 49 commits · closed without merging

Three commits, each standing alone.

1. Card awake left out while Reflex paces frames (fixes the 14 fps lock, #20)

The launcher sets VICTORY_CARD_AWAKE=1. With frame generation, Reflex low latency is on. Reflex measures GPU time from the card's queues and counts the endless compute job of host/awake.rs, so every frame looks GPU-bound and Reflex sleeps inside the present. In about half of the starts the game then holds 14.0 fps (71.4 ms) for the whole session.

The job is now left out while Reflex is on, and the log says so once. VICTORY_CARD_AWAKE=always keeps the old behaviour. This is a port of trustno1-coder/VIctory-NVIDIA#1938.

Tested: RTX 5070 12 GB, 1440p, DLSS Quality, 4x frame generation.

  • Before: one 20-minute run sat at 71.4 ms in 1,196 of 1,275 five-second windows, with 24 ms of each frame spent inside the present call.
  • After: three runs never locked, at a median of 33–55 ms.

2. Pipeline wait budget default: 500 ms down to 100 ms

The first crash or explosion of a kind froze the game for 490 ms a frame, and up to 2.5 s. Each freeze lined up with "first bind" / "shader translated" lines. At 100 ms, a draw whose pipeline isn't ready is dropped for a frame or two instead.

  • Tested: the player saw the crash freezes go.
  • Cost: over 25 minutes, draws dropped while "being made" showed in ten five-second windows. All but one were under one draw a frame; one reached 6.4.
  • Not affected: passes over the screen keep their own 10 s budget (VICTORY_SCREEN_WAIT_MS), so the lighting tables are untouched.
  • VICTORY_PIPELINE_WAIT_MS=500 restores the old wait.

3. Drop reasons and card memory in release logs (counting only)

  • Drop reasons: the drop tally by reason now runs in every build, and the top 12 reasons are logged every 5 s.
    • A draw dropped while it has a host pipeline (its binding or buffers failed) now names its shader hashes.
    • Refused pipelines are named by hash instead of a Debug dump of their shaders.
  • Card memory: once a minute, a new line splits the card's use into host textures (filled by the title, versus render targets and twins), free texture-block space, tiles, card copies of buffers and windows with their before-twins, pipelines made, and what the layer does not count.

What these lines showed in a 25-minute session (RTX 5070, budget ~10.7 GB), which is relevant to #133:

18:10 18:20 18:33
in use (MB) 9,469 10,855 11,820
title-filled textures 2,770 3,301 2,930
render targets + twins 1,429 1,913 2,311
buffer/window copies 2,148 2,065 2,044
not counted by the layer 2,510 3,516 4,174
  • What grows: render targets and twins (+880 MB in 23 min) and the uncounted part (+1.7 GB). Textures and buffer copies stay flat.
  • Dropped draws: about 220 a frame are the ray-tracing structure builder, which is off on purpose.
  • A pass that never runs: compute 7f61193d2c0e5f22 was refused with E_OUTOFMEMORY during loading and is never retried, so it is missing for the whole session.
  • Heap cap (#105): "title slot past the host heap" fired 0 times in any of the runs.

4. Render-target copies whose title memory was given up are let go

The idle sweep takes only textures the title fills, so host copies of targets, depth and unordered-access textures the title placed in its own memory stayed on the card after the title unmapped that memory. They grew by 880 MB in 23 minutes on a 12 GB card (table above), which put the card over its budget, after which DLSS failed and frame generation switched itself off.

Such a copy now goes when all of these hold:

  • the first page of its title memory is not mapped any more;
  • it has been idle for 30 s and 60 frames;
  • no list not yet reset and no descriptor slot holds it.

The next use makes it again. Textures with a twin are left alone. VICTORY_TARGETS_GIVEN_UP=0 keeps the old behaviour.

The targets census, until now diagnostics-only, is logged once a minute with what was let go.

5. Pipelines refused for want of memory are asked again

Compute 7f61193d2c0e5f22 was refused with E_OUTOFMEMORY during loading, and the refusal was kept, so its dispatch was dropped every frame for the whole session. Such a refusal is now asked again 3 s later, up to 5 times. Draws do not wait for it meanwhile. Other refusals stay final.

4 and 5 are not yet tested in game: clippy is clean on both feature sets and the 471 victory-gpu tests pass. Results will follow in a comment.

Checks

  • cargo clippy -p victory-gpu --all-targets -- -D warnings, with and without --all-features: clean.
  • cargo test -p victory-gpu --lib: 471 passed, 0 failed, run before the third commit. That commit only changes a default value and comments, and was clippy-checked.

🤖 Generated with Claude Code

**@⁠AVD-appezhax** on GitHub · 2026-11-30 18:38 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/152) `AVD-appezhax:fix/framegen-lock-and-drop-reasons` → `main` · +9 −4 · 2 files · 49 commits · closed without merging Three commits, each standing alone. ## 1. Card awake left out while Reflex paces frames (fixes the 14 fps lock, #20) The launcher sets `VICTORY_CARD_AWAKE=1`. With frame generation, Reflex low latency is on. Reflex measures GPU time from the card's queues and counts the endless compute job of `host/awake.rs`, so every frame looks GPU-bound and Reflex sleeps inside the present. In about half of the starts the game then holds 14.0 fps (71.4 ms) for the whole session. The job is now left out while Reflex is on, and the log says so once. `VICTORY_CARD_AWAKE=always` keeps the old behaviour. This is a port of trustno1-coder/VIctory-NVIDIA#1938. **Tested:** RTX 5070 12 GB, 1440p, DLSS Quality, 4x frame generation. - Before: one 20-minute run sat at 71.4 ms in 1,196 of 1,275 five-second windows, with 24 ms of each frame spent inside the present call. - After: three runs never locked, at a median of 33–55 ms. ## 2. Pipeline wait budget default: 500 ms down to 100 ms The first crash or explosion of a kind froze the game for 490 ms a frame, and up to 2.5 s. Each freeze lined up with "first bind" / "shader translated" lines. At 100 ms, a draw whose pipeline isn't ready is dropped for a frame or two instead. - **Tested:** the player saw the crash freezes go. - **Cost:** over 25 minutes, draws dropped while "being made" showed in ten five-second windows. All but one were under one draw a frame; one reached 6.4. - **Not affected:** passes over the screen keep their own 10 s budget (`VICTORY_SCREEN_WAIT_MS`), so the lighting tables are untouched. - `VICTORY_PIPELINE_WAIT_MS=500` restores the old wait. ## 3. Drop reasons and card memory in release logs (counting only) - **Drop reasons:** the drop tally by reason now runs in every build, and the top 12 reasons are logged every 5 s. - A draw dropped while it has a host pipeline (its binding or buffers failed) now names its shader hashes. - Refused pipelines are named by hash instead of a Debug dump of their shaders. - **Card memory:** once a minute, a new line splits the card's use into host textures (filled by the title, versus render targets and twins), free texture-block space, tiles, card copies of buffers and windows with their before-twins, pipelines made, and what the layer does not count. What these lines showed in a 25-minute session (RTX 5070, budget ~10.7 GB), which is relevant to #133: | | 18:10 | 18:20 | 18:33 | |---|---|---|---| | in use (MB) | 9,469 | 10,855 | 11,820 | | title-filled textures | 2,770 | 3,301 | 2,930 | | render targets + twins | 1,429 | 1,913 | **2,311** | | buffer/window copies | 2,148 | 2,065 | 2,044 | | not counted by the layer | 2,510 | 3,516 | **4,174** | - **What grows:** render targets and twins (+880 MB in 23 min) and the uncounted part (+1.7 GB). Textures and buffer copies stay flat. - **Dropped draws:** about 220 a frame are the ray-tracing structure builder, which is off on purpose. - **A pass that never runs:** compute `7f61193d2c0e5f22` was refused with E_OUTOFMEMORY during loading and is never retried, so it is missing for the whole session. - **Heap cap (#105):** "title slot past the host heap" fired 0 times in any of the runs. ## 4. Render-target copies whose title memory was given up are let go The idle sweep takes only textures the title fills, so host copies of targets, depth and unordered-access textures the title placed in its own memory stayed on the card after the title unmapped that memory. They grew by 880 MB in 23 minutes on a 12 GB card (table above), which put the card over its budget, after which DLSS failed and frame generation switched itself off. Such a copy now goes when all of these hold: - the first page of its title memory is not mapped any more; - it has been idle for 30 s and 60 frames; - no list not yet reset and no descriptor slot holds it. The next use makes it again. Textures with a twin are left alone. `VICTORY_TARGETS_GIVEN_UP=0` keeps the old behaviour. The targets census, until now diagnostics-only, is logged once a minute with what was let go. ## 5. Pipelines refused for want of memory are asked again Compute `7f61193d2c0e5f22` was refused with E_OUTOFMEMORY during loading, and the refusal was kept, so its dispatch was dropped every frame for the whole session. Such a refusal is now asked again 3 s later, up to 5 times. Draws do not wait for it meanwhile. Other refusals stay final. **4 and 5 are not yet tested in game:** clippy is clean on both feature sets and the 471 victory-gpu tests pass. Results will follow in a comment. ## Checks - `cargo clippy -p victory-gpu --all-targets -- -D warnings`, with and without `--all-features`: clean. - `cargo test -p victory-gpu --lib`: 471 passed, 0 failed, run before the third commit. That commit only changes a default value and comments, and was clippy-checked. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
With frame generation on, Reflex low latency is on. Reflex measures each
frame's GPU time from the card's queues and counts the never-ending
compute job of VICTORY_CARD_AWAKE=1 (which the launcher sets) as work:
the frame looks GPU-bound, Reflex sleeps inside each present, and the
game holds 14.0 fps (71.4 ms) for the whole session in about half of
the starts (#20).

The job is now left out while Reflex is on, said once in the log.
VICTORY_CARD_AWAKE=always keeps the old behaviour.

Port of trustno1-coder/VIctory-NVIDIA PR #1938.

Tested: RTX 5070 12 GB, 1440p, DLSS Quality, 4x frame generation.
Before, a 20-minute run sat at 71.4 ms in 1,196 of 1,275 five-second
windows, 24 ms of each frame inside the present call. After, two runs
had none (median 33-55 ms).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Two things release logs could not tell on a 12 GB card:

- 100-360 draws a frame were dropped "without a host pipeline (0 being
  made)" while distant objects flashed, and only diagnostics builds
  named a reason. The tally by reason (pipeline::note_drop) now runs in
  every build and the top 12 are logged every five seconds. Drops of a
  draw that has a host pipeline (its binding or buffers failed) get a
  reason with its shader hashes instead of none; refused pipelines are
  named by hash instead of a Debug dump of their shaders.
- VRAM in use grows past the budget over a session while the texture
  pool stays flat (#133). Once a minute a line now splits the card's use
  into host textures (title-filled, render targets and twins), free
  space in texture blocks, tiles, card copies of title buffers and
  windows with their before-twins, the pipelines made, and what the
  layer does not count (driver, DLSS, frame generation).

Counting only: what is drawn and allocated is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The first crash, explosion or other effect of a kind froze the game: its
pipelines were made on first use and the title frame waited up to half a
second for them (frames of 490 ms in a row, up to 2.5 s, each lined up
with "first bind" / "shader translated" lines). At 100 ms a draw whose
pipeline is not ready is dropped for a frame or two instead.

Tested on an RTX 5070 12 GB with VICTORY_PIPELINE_WAIT_MS=100: the
player saw the freezes on crashes go, and over 25 minutes draws dropped
"being made" showed in ten five-second windows, under one a frame in all
but one (6.4). Passes over the screen keep their own 10 s budget
(VICTORY_SCREEN_WAIT_MS), so the lighting tables are not affected.
VICTORY_PIPELINE_WAIT_MS=500 restores the old wait.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 18:39:12 +00:00
github-bot closed this pull request 2026-12-01 01:10:25 +00:00
Author
Owner

@⁠readmet3xt-lab on GitHub · 2026-12-01 01:36 UTC · original

A note on why this shows as closed: GitHub closed every open pull request by itself when main's history was rewritten on 2026-12-01 (text-only changes; every commit hash changed), and they cannot be reopened. This is not a rejection.

Your change is in the batch being tested for the next release, carried over as one commit with you as its author. Nothing is needed from you now; the result will be posted here.

**@⁠readmet3xt-lab** on GitHub · 2026-12-01 01:36 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/152#issuecomment-7297689380) A note on why this shows as closed: GitHub closed every open pull request by itself when main's history was rewritten on 2026-12-01 (text-only changes; every commit hash changed), and they cannot be reopened. This is not a rejection. Your change is in the batch being tested for the next release, carried over as one commit with you as its author. Nothing is needed from you now; the result will be posted here.
github-bot changed title from Frame generation: no 14 fps lock; 100 ms pipeline wait; drop reasons and card memory in release logs to Frame generation: no 14 fps lock; 100 ms pipeline wait; free given-up render targets; retry OOM pipelines; release memory logs 2026-12-01 12:51:11 +00:00
Author
Owner

@⁠AVD-appezhax on GitHub · 2026-12-01 13:27 UTC · original

Results of a 28-minute run (RTX 5070 12 GB, 1440p, DLSS Quality, 4x frame generation), and two more commits

Commit 4 (let go given-up render targets) did nothing here. The targets census in the new minute line shows 0 placed targets and 0 in unmapped memory. The render-target copies the title still holds are what grow:

count MB
12:52 (menu) 308 274
12:55 737 1,796
13:10 1,027 2,255
13:20 1,069 2,500

None of them was idle 30 s and unheld. The change stays, because it is correct where it applies, but it is not the fix for this growth. The new e1bf3a5 logs the eight biggest kinds by shape and format once a minute, to name them.

Commit 5 (retry pipelines refused for want of memory) did not help this one. 7f61193d2c0e5f22 was refused with E_OUTOFMEMORY at 12:52, when the card held 2.3 GB of 11.2. That makes it not a memory problem. It is weatherParticle:CS_BeginUpdate: NVIDIA's compiler rejects an atomic subtraction on group-shared memory (see trustno1-coder/VIctory-NVIDIA#4449).

250e7f4 ports their fix (#1939 / Marvisak/VIctory#3619): on NVIDIA such atomics become a compare-exchange loop, and the setting is part of the shader cache key. One change from upstream: the vendor comes from the adapter the host device is actually made on (hardware_adapter), not from EnumAdapters1(0), which can be an integrated GPU. Its unit test passes. It is not yet confirmed in game.

The card still ends over its budget (12.5 of 11.0 GB). DLSS then reports "out of VRAM" and frame generation switches itself off in town.

**@⁠AVD-appezhax** on GitHub · 2026-12-01 13:27 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/152#issuecomment-7312658870) ## Results of a 28-minute run (RTX 5070 12 GB, 1440p, DLSS Quality, 4x frame generation), and two more commits **Commit 4 (let go given-up render targets) did nothing here.** The targets census in the new minute line shows 0 placed targets and 0 in unmapped memory. The render-target copies the title still holds are what grow: | | count | MB | |---|---|---| | 12:52 (menu) | 308 | 274 | | 12:55 | 737 | 1,796 | | 13:10 | 1,027 | 2,255 | | 13:20 | 1,069 | 2,500 | None of them was idle 30 s and unheld. The change stays, because it is correct where it applies, but it is not the fix for this growth. The new **e1bf3a5** logs the eight biggest kinds by shape and format once a minute, to name them. **Commit 5 (retry pipelines refused for want of memory) did not help this one.** `7f61193d2c0e5f22` was refused with E_OUTOFMEMORY at 12:52, when the card held 2.3 GB of 11.2. That makes it not a memory problem. It is `weatherParticle:CS_BeginUpdate`: NVIDIA's compiler rejects an atomic subtraction on group-shared memory (see trustno1-coder/VIctory-NVIDIA#4449). **250e7f4** ports their fix (#1939 / Marvisak/VIctory#3619): on NVIDIA such atomics become a compare-exchange loop, and the setting is part of the shader cache key. One change from upstream: the vendor comes from the adapter the host device is actually made on (`hardware_adapter`), not from `EnumAdapters1(0)`, which can be an integrated GPU. Its unit test passes. It is not yet confirmed in game. The card still ends over its budget (12.5 of 11.0 GB). DLSS then reports "out of VRAM" and frame generation switches itself off in town.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.