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

Closed
nevasouls wants to merge 1 commit from upstream-pr/3634 into main
nevasouls commented 2026-11-30 02:23:12 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nevasouls on 2026-11-30T02:23:12Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5557842266 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3634). Originally posted by [nevasouls](https://github.com/nevasouls) on 2026-11-30T02:23:12Z. --- ## 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.
trustno1-coder commented 2026-12-01 18:50:15 +00:00 (Migrated from github.com)

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


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:7321642829 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3634#issuecomment-7321642829). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-12-01T18:50:15Z. --- 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!3634
No description provided.