Fix black faces/objects VRAM admission, Bink movie lease, FSR3 handling, and clzero stub reachability #669

Manually merged
github merged 4 commits from github-bot/gh-669 into main 2026-11-28 19:42:50 +00:00 AGit
Owner

@⁠ghost on GitHub · 2026-11-28 03:14 UTC · original
main → main · +1104 −89 · 9 files · 4 commits · merged 2026-11-28 19:39 UTC

Summary

Rebases v9-derived fixes onto upstream v2026.11.27.10:

  • VRAM first-upload admission (victory-gpu): Admits never-before-seen texture slots just over the room line within a bounded 5 s window using their real byte size instead of a flat 64 MiB reserve, fixing black faces/objects while preserving the 80% VRAM ceiling and whole-card guard.
  • Bink / movie plane classification & lease (victory-gpu, victory-hle): Tracks Bink open/close/skip exports and recognizes A8_UNORM alpha alongside R8_UNORM luma planes, adding an expiring lease (by presents + wall-clock cap) so stale movie handles do not permanently disable frame generation.
  • FSR3 context handling (victory-gpu): Keeps FSR3 armed across cutscene movie classifications instead of retiring its context.
  • Loader stub reachability (victory-loader): Searches multiple reachable stub regions during clzero emulation patching rather than failing if the first region is full or out of range.

Changed Files

  • crates/victory-gpu/src/draw.rs
  • crates/victory-gpu/src/host.rs
  • crates/victory-gpu/src/queue.rs
  • crates/victory-gpu/src/resource.rs
  • crates/victory-gpu/src/streamline.rs
  • crates/victory-gpu/src/streamline/fsr.rs
  • crates/victory-gpu/src/texture.rs
  • crates/victory-hle/src/modules/bink.rs
  • crates/victory-loader/src/console_insn.rs
**@⁠ghost** on GitHub · 2026-11-28 03:14 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/669) `main` → `main` · +1104 −89 · 9 files · 4 commits · merged 2026-11-28 19:39 UTC ### Summary Rebases v9-derived fixes onto upstream `v2026.11.27.10`: - **VRAM first-upload admission (`victory-gpu`):** Admits never-before-seen texture slots just over the room line within a bounded 5 s window using their real byte size instead of a flat 64 MiB reserve, fixing black faces/objects while preserving the 80% VRAM ceiling and whole-card guard. - **Bink / movie plane classification & lease (`victory-gpu`, `victory-hle`):** Tracks Bink open/close/skip exports and recognizes `A8_UNORM` alpha alongside `R8_UNORM` luma planes, adding an expiring lease (by presents + wall-clock cap) so stale movie handles do not permanently disable frame generation. - **FSR3 context handling (`victory-gpu`):** Keeps FSR3 armed across cutscene movie classifications instead of retiring its context. - **Loader stub reachability (`victory-loader`):** Searches multiple reachable stub regions during `clzero` emulation patching rather than failing if the first region is full or out of range. ### Changed Files - `crates/victory-gpu/src/draw.rs` - `crates/victory-gpu/src/host.rs` - `crates/victory-gpu/src/queue.rs` - `crates/victory-gpu/src/resource.rs` - `crates/victory-gpu/src/streamline.rs` - `crates/victory-gpu/src/streamline/fsr.rs` - `crates/victory-gpu/src/texture.rs` - `crates/victory-hle/src/modules/bink.rs` - `crates/victory-loader/src/console_insn.rs`
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 03:19:05 +00:00
Author
Owner

@⁠ghost on GitHub · 2026-11-28 03:22 UTC · original

Pre-built test binary (victory.exe, SHA-256: E00EE0BF414AF980EA73205B6D859DA6E4B24B7C8988BDBE61A8EBAE693312F9) is available on my fork's release here:
https://github.com/Mit1123/VIctory-NVIDIA/releases/tag/fix

**@⁠ghost** on GitHub · 2026-11-28 03:22 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/669#issuecomment-7233027616) Pre-built test binary (`victory.exe`, SHA-256: `E00EE0BF414AF980EA73205B6D859DA6E4B24B7C8988BDBE61A8EBAE693312F9`) is available on my fork's release here: https://github.com/Mit1123/VIctory-NVIDIA/releases/tag/fix
Author
Owner

@⁠CuteBooty on GitHub · 2026-11-28 05:33 UTC · original

Reading notes on this PR from the angle of an 8 GB card (RTX 3070, frame generation on, the card at 90-97 % of its DXGI budget in play). I built the admission part (25b3b5ce9's draw.rs and resource.rs hunks and the meter hunk in host.rs) onto main 63b902fe1 with the admissions switched off, so nothing below comes from a run with them on. These are notes from reading the code, by more than one reviewer:

  1. A one-byte estimate. In the first-upload branch of heap_textures, placed_len starts at 1 and is replaced only for View::Placed(false, …); a failed placed_bytes_from also leaves 1. A title-filled view of another kind can pass both the window and the whole-card check at that estimate.
  2. The whole-card check can let used pass the budget. A texture whose size fits in the summed free space of the texture blocks passes even when used >= budget, but that space can be fragmented and the pool can grow by a whole 64 MiB block. The _counted argument (render-target and card-buffer reserves) is not used in first_upload_decision or first_upload_headroom_from. On a card that already runs near its budget, this is the part I would worry about.
  3. A large first request can spend the window. If I read it right, a first request larger than the window (say 129 MiB in a fresh 128 MiB window) records the window as spent and is refused, so smaller ones wait for the rest of it.
  4. The meter counts decisions. The reasons advance before the window check and "admitted" before the commit and staging, so the 5-second line does not show that an upload finished.
  5. Not switchable. targets_kept moves from half to a quarter of the reserve, so the render-target reserve is released once the targets reach a quarter of it instead of half (with our 2,048 MiB setting: 512 MiB instead of 1,024), also with both switches at 0.
  6. The movie lease and frame generation. As I read present_begins, a present with a Bink call has frame generation off, held for some presents after the movie's last call, with no switch. So an in-game TV that is playing would switch DLSS-G on and off.
  7. A non-Windows test build. first_upload_decision is gated cfg(any(windows, test)) but calls room_line, which is cfg(windows) only. On Windows the build and the existing tests pass (I built it on that base).

With VICTORY_TEXTURE_ROOM_PERCENT=85, the ceiling min(line + FIRST_UPLOAD_MB, 80 % of budget) is always the 80 % term, so on such a setup the hard stop is the whole budget only. If it helps, I can run the admissions on this card gently (VICTORY_FACE_HEADROOM_MB=0, VICTORY_TEXTURE_FIRST_UPLOAD_WINDOW_MB=128) and report the new meter lines.

These notes were prepared with AI assistants (Claude Code and Codex) reading the code; nothing here was measured with the admissions on.

**@⁠CuteBooty** on GitHub · 2026-11-28 05:33 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/669#issuecomment-7234744771) Reading notes on this PR from the angle of an 8 GB card (RTX 3070, frame generation on, the card at 90-97 % of its DXGI budget in play). I built the admission part (25b3b5ce9's `draw.rs` and `resource.rs` hunks and the meter hunk in `host.rs`) onto main `63b902fe1` with the admissions switched off, so **nothing below comes from a run with them on**. These are notes from reading the code, by more than one reviewer: 1. **A one-byte estimate.** In the first-upload branch of `heap_textures`, `placed_len` starts at 1 and is replaced only for `View::Placed(false, …)`; a failed `placed_bytes_from` also leaves 1. A title-filled view of another kind can pass both the window and the whole-card check at that estimate. 2. **The whole-card check can let `used` pass the budget.** A texture whose size fits in the summed free space of the texture blocks passes even when `used >= budget`, but that space can be fragmented and the pool can grow by a whole 64 MiB block. The `_counted` argument (render-target and card-buffer reserves) is not used in `first_upload_decision` or `first_upload_headroom_from`. On a card that already runs near its budget, this is the part I would worry about. 3. **A large first request can spend the window.** If I read it right, a first request larger than the window (say 129 MiB in a fresh 128 MiB window) records the window as spent and is refused, so smaller ones wait for the rest of it. 4. **The meter counts decisions.** The reasons advance before the window check and "admitted" before the commit and staging, so the 5-second line does not show that an upload finished. 5. **Not switchable.** `targets_kept` moves from half to a quarter of the reserve, so the render-target reserve is released once the targets reach a quarter of it instead of half (with our 2,048 MiB setting: 512 MiB instead of 1,024), also with both switches at 0. 6. **The movie lease and frame generation.** As I read `present_begins`, a present with a Bink call has frame generation off, held for some presents after the movie's last call, with no switch. So an in-game TV that is playing would switch DLSS-G on and off. 7. **A non-Windows test build.** `first_upload_decision` is gated `cfg(any(windows, test))` but calls `room_line`, which is `cfg(windows)` only. On Windows the build and the existing tests pass (I built it on that base). With `VICTORY_TEXTURE_ROOM_PERCENT=85`, the ceiling `min(line + FIRST_UPLOAD_MB, 80 % of budget)` is always the 80 % term, so on such a setup the hard stop is the whole budget only. If it helps, I can run the admissions on this card gently (`VICTORY_FACE_HEADROOM_MB=0`, `VICTORY_TEXTURE_FIRST_UPLOAD_WINDOW_MB=128`) and report the new meter lines. These notes were prepared with AI assistants (Claude Code and Codex) reading the code; nothing here was measured with the admissions on.
Author
Owner

@⁠ghost on GitHub · 2026-11-28 11:36 UTC · original

@⁠CuteBooty
Thanks for the thorough review and for offering to test this on an 8 GB RTX 3070 near budget.

That would definitely help running with VICTORY_FACE_HEADROOM_MB=0 and VICTORY_TEXTURE_FIRST_UPLOAD_WINDOW_MB=128 and sharing the new meter lines would give great real world signal.

I put these changes together with an AI coding assistant, so I'm going to walk through each of the points you flagged (placed_len fallback, summed free space vs. fragmentation / _counted reserves, oversized first requests spending the window, decision vs. completed upload meter counts, targets_kept quarter-reserve behavior, Bink lease toggling on things like in-game TVs, the cfg(any(windows, test)) vs cfg(windows) gate on room_line, and the 80% cap when VICTORY_TEXTURE_ROOM_PERCENT=85) and see how we should tighten them.

**@⁠ghost** on GitHub · 2026-11-28 11:36 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/669#issuecomment-7238664325) @⁠CuteBooty Thanks for the thorough review and for offering to test this on an 8 GB RTX 3070 near budget. That would definitely help running with `VICTORY_FACE_HEADROOM_MB=0` and `VICTORY_TEXTURE_FIRST_UPLOAD_WINDOW_MB=128` and sharing the new meter lines would give great real world signal. I put these changes together with an AI coding assistant, so I'm going to walk through each of the points you flagged (`placed_len` fallback, summed free space vs. fragmentation / `_counted` reserves, oversized first requests spending the window, decision vs. completed upload meter counts, `targets_kept` quarter-reserve behavior, Bink lease toggling on things like in-game TVs, the `cfg(any(windows, test))` vs `cfg(windows)` gate on `room_line`, and the 80% cap when `VICTORY_TEXTURE_ROOM_PERCENT=85`) and see how we should tighten them.
github-bot referenced this pull request from a commit 2026-11-28 19:41:56 +00:00
github manually merged commit 7627be14f4 into main 2026-11-28 19:42:50 +00:00
Author
Owner

@⁠ghost on GitHub · 2026-11-28 19:55 UTC · original

@⁠CuteBooty
Thanks for the detailed code review notes on the 8 GB / high-budget DXGI path and the VICTORY_FACE_HEADROOM_MB=0 / VICTORY_TEXTURE_FIRST_UPLOAD_WINDOW_MB=128 test suggestion. I pushed the updated branch and pre-built victory.exe release so you can test and inspect the current state directly:

  • Branch: https://github.com/Mit1123/VIctory-NVIDIA/tree/our-quality720-facefix (commit 456a8f86ed04986fb8b0c725fac1991dea8677c2)
  • Release (victory.exe): https://github.com/Mit1123/VIctory-NVIDIA/releases/tag/v2026.11.28.03-patched
  • victory.exe SHA-256: B62F563E67B772451452E87E905A9DA2B219F684B8D3BEF66CD40CA0AF87513B
**@⁠ghost** on GitHub · 2026-11-28 19:55 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/669#issuecomment-7244900873) @⁠CuteBooty Thanks for the detailed code review notes on the 8 GB / high-budget DXGI path and the `VICTORY_FACE_HEADROOM_MB=0` / `VICTORY_TEXTURE_FIRST_UPLOAD_WINDOW_MB=128` test suggestion. I pushed the updated branch and pre-built `victory.exe` release so you can test and inspect the current state directly: - Branch: `https://github.com/Mit1123/VIctory-NVIDIA/tree/our-quality720-facefix` (commit `456a8f86ed04986fb8b0c725fac1991dea8677c2`) - Release (`victory.exe`): `https://github.com/Mit1123/VIctory-NVIDIA/releases/tag/v2026.11.28.03-patched` - `victory.exe` SHA-256: `B62F563E67B772451452E87E905A9DA2B219F684B8D3BEF66CD40CA0AF87513B`
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!669
No description provided.