panel: F3's VRAM row shows what the texture queue weighs, and its line #3634

Closed
github-bot wants to merge 1 commit from github-bot/gh-3634 into main AGit
Owner

@⁠nevasouls on GitHub · 2026-11-30 02:23 UTC · original
nevasouls:vram8/f3-line → main · +99 −8 · 2 files · 1 commits · closed without merging

The problem

F3's memory row gives the card's use against the budget. The texture queue decides against a
different number on both sides of the comparison.

From a log at VICTORY_VRAM_BUDGET_MB=7256 (the measured budget of a real 8 GB card,
docs/windows-memory.md):

the texture queue's room: 1852 MB in use - 24 MB free in texture blocks
  + 850 MB kept for card copies of title buffers
  + 239 MB kept for render targets
  = 2917 MB against a line of 6530 MB (90.0 % of a budget of 7256 MB;
    6274 MB after face headroom, 487 MB in texture copies): room

So the line is room_line(budget) minus the face headroom (6,530 → 6,274 MB), and the use
weighed against it is the card's use less what lies free in texture blocks, plus the room kept
for card copies and for render targets a world has not made yet. The panel showed neither. A player
reading VRAM 5.9/7.1 would think the queue had 1.2 GB of room when it had already stopped.

before:  VRAM 9.1/7.1 GB  SHARED 0.5
after:   VRAM 9.1/7.1 GB  TEX 2.9/6.1 SH 0.5

TEX is the queue's own pair: what it weighs, over the line it refuses at. SH is the PC's shared
memory in use, unchanged, shortened to fit the box.

The change

  • resource::queue_use(memory) — the sum room() compared inline. room() and the panel now both
    call it, so the two cannot drift.
  • resource::refusal_line(budget) — room_line(budget) - face_headroom_bytes(), replacing the three
    inline copies (in room(), the reclaim line, and room_terms, whose log line is unchanged).
  • resource::queue_against_line(memory) — (weighed, line), or None where room() consults no
    line at all: no budget from the system, or VICTORY_TEXTURE_BUDGET_MB set, which weighs the
    textures' own bytes instead (room_terms returns None for the same two cases).
  • panel::vram_row() — formats the row and fits COLUMNS (40); without a queue pair it prints the
    old SHARED form.

Why it is safe at 12 GiB+

No behaviour changes. Every value is computed by the same expression as before, moved behind a name:
room()'s comparison, the reclaim line, and room_terms' log line all produce identical bytes.
The panel only formats numbers, and nothing reads them back.

Verification

$ cargo test -p victory-gpu --lib panel::
running 10 tests
...
test host::panel::tests::the_vram_row_fits_the_box ... ok
test result: ok. 10 passed; 0 failed; 0 ignored

the_vram_row_fits_the_box formats the row at a 7,256 MiB budget with the queue over its line, at
11,229 MiB, and at 24 GiB, asserts each fits the 40-column box, and checks the no-line form prints
SHARED and no TEX.

Cost of the row. A run with VICTORY_PANEL=1 at the same budget and seed measured 11.5 fps
median (87.2 ms) against a baseline spread of 11.4-11.8 fps over two runs without the panel, so the
row costs nothing measurable; it builds two format! strings on the panel's existing update, which
already calls video_memory() there.

cargo clippy -p victory-gpu --lib: no warning on the changed lines. The warnings that crate
reports are on main too (wide_chunk, nothing_new_with in shadow.rs, etc.).

What is not verified

I have not seen the row on screen: the bench's captured frames do not include the panel overlay (it
is drawn at present, after the capture), so the text is pinned by the test rather than a screenshot.
VICTORY_PANEL=1 shows it at once.

This patch is the second version. An independent review of the first — which paired LINE with the
system's raw used — found exactly the mismatch this version fixes: the line only means something
beside the use the queue weighs, and that was not the number on screen.

Turning it off

VICTORY_PANEL=0 hides the panel; there is nothing else to switch.

**@⁠nevasouls** on GitHub · 2026-11-30 02:23 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3634) `nevasouls:vram8/f3-line` → `main` · +99 −8 · 2 files · 1 commits · closed without merging ## The problem F3's memory row gives the card's use against the **budget**. The texture queue decides against a different number on *both* sides of the comparison. From a log at `VICTORY_VRAM_BUDGET_MB=7256` (the measured budget of a real 8 GB card, `docs/windows-memory.md`): ``` the texture queue's room: 1852 MB in use - 24 MB free in texture blocks + 850 MB kept for card copies of title buffers + 239 MB kept for render targets = 2917 MB against a line of 6530 MB (90.0 % of a budget of 7256 MB; 6274 MB after face headroom, 487 MB in texture copies): room ``` So the line is `room_line(budget)` **minus** the face headroom (6,530 → 6,274 MB), and the use weighed against it is the card's use less what lies free in texture blocks, **plus** the room kept for card copies and for render targets a world has not made yet. The panel showed neither. A player reading `VRAM 5.9/7.1` would think the queue had 1.2 GB of room when it had already stopped. ``` before: VRAM 9.1/7.1 GB SHARED 0.5 after: VRAM 9.1/7.1 GB TEX 2.9/6.1 SH 0.5 ``` `TEX` is the queue's own pair: what it weighs, over the line it refuses at. `SH` is the PC's shared memory in use, unchanged, shortened to fit the box. ## The change - `resource::queue_use(memory)` — the sum `room()` compared inline. `room()` and the panel now both call it, so the two cannot drift. - `resource::refusal_line(budget)` — `room_line(budget) - face_headroom_bytes()`, replacing the three inline copies (in `room()`, the reclaim line, and `room_terms`, whose log line is unchanged). - `resource::queue_against_line(memory)` — `(weighed, line)`, or `None` where `room()` consults no line at all: no budget from the system, or `VICTORY_TEXTURE_BUDGET_MB` set, which weighs the textures' own bytes instead (`room_terms` returns `None` for the same two cases). - `panel::vram_row()` — formats the row and fits `COLUMNS` (40); without a queue pair it prints the old `SHARED` form. ## Why it is safe at 12 GiB+ No behaviour changes. Every value is computed by the same expression as before, moved behind a name: `room()`'s comparison, the reclaim line, and `room_terms`' log line all produce identical bytes. The panel only formats numbers, and nothing reads them back. ## Verification ``` $ cargo test -p victory-gpu --lib panel:: running 10 tests ... test host::panel::tests::the_vram_row_fits_the_box ... ok test result: ok. 10 passed; 0 failed; 0 ignored ``` `the_vram_row_fits_the_box` formats the row at a 7,256 MiB budget with the queue over its line, at 11,229 MiB, and at 24 GiB, asserts each fits the 40-column box, and checks the no-line form prints `SHARED` and no `TEX`. **Cost of the row.** A run with `VICTORY_PANEL=1` at the same budget and seed measured 11.5 fps median (87.2 ms) against a baseline spread of 11.4-11.8 fps over two runs without the panel, so the row costs nothing measurable; it builds two `format!` strings on the panel's existing update, which already calls `video_memory()` there. `cargo clippy -p victory-gpu --lib`: no warning on the changed lines. The warnings that crate reports are on `main` too (`wide_chunk`, `nothing_new_with` in `shadow.rs`, etc.). ## What is not verified I have not seen the row on screen: the bench's captured frames do not include the panel overlay (it is drawn at present, after the capture), so the text is pinned by the test rather than a screenshot. `VICTORY_PANEL=1` shows it at once. This patch is the second version. An independent review of the first — which paired `LINE` with the system's raw `used` — found exactly the mismatch this version fixes: the line only means something beside the use the queue weighs, and that was not the number on screen. ## Turning it off `VICTORY_PANEL=0` hides the panel; there is nothing else to switch.
`VRAM 9.1/7.1 GB  SHARED 0.5` gives the card's memory in use against the budget, but not
the number the texture queue actually stops admitting host copies at: `room()` weighs the
use against `room_line(budget)` less the headroom kept inside it for faces, which at a
7,256 MiB budget is 6,812 MiB. Nothing on screen says so, so the panel can read "1.9 GB
under budget" while the queue has already stopped — the state `docs/windows-memory.md` calls
the texture queue blocked by its VRAM budget.

The row is now `VRAM 9.1/7.1 GB  LINE 6.7 SH 0.5`, and `refusal_line()` is the same
expression `room()` and the reclaim line used inline, so what is shown is what they act on.
The box is 40 columns (`COLUMNS`), so the row is pinned by a test that formats it at three
budget/use pairs and checks it fits.

No behaviour change: the two call sites compute exactly what they computed before,
through a name.

Verified: `cargo test -p victory-gpu --lib panel::` -- 10 passed, including the new
`the_vram_row_fits_the_box`; `cargo clippy -p victory-gpu --lib` adds no warning on the
changed lines.

Not visually checked in game: the bench's captured frames do not include the panel
overlay, so the row's text is pinned by the test, not by a screenshot.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 02:26:31 +00:00
github-bot changed title from panel: F3's VRAM row says the line the queue refuses at to panel: F3's VRAM row shows what the texture queue weighs, and its line 2026-11-30 02:31:53 +00:00
github-bot force-pushed github-bot/gh-3634 from 26631c6518 to 0cb9c406f0 2026-11-30 02:31:54 +00:00 Compare
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:50 UTC · original

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.

**@⁠trustno1-coder** on GitHub · 2026-12-01 18:50 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3634#issuecomment-7321642829) 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.
github-bot closed this pull request 2026-12-01 18:58:07 +00:00

Pull request closed

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