Textures: skip unchanged linear plane uploads and lockless-first plane reads (VICTORY_PLANE_SAME, VICTORY_PLANE_PIN) #1909

Manually merged
github merged 1 commit from github-bot/gh-1909 into gh-pr/1909/base 2026-11-29 08:21:21 +00:00 AGit
Owner

@⁠Nosheboo on GitHub · 2026-11-29 02:14 UTC · original
Nosheboo:port/foxhound-plane-same-pin → main · +162 −5 · 1 files · 1 commits · merged 2026-11-29 08:16 UTC

Fixes #

What it changes

Ports VICTORY_PLANE_SAME and VICTORY_PLANE_PIN from readmet3xt-lab/foxhound commit 4349ab56 (GPL-3.0-or-later) into crates/victory-gpu/src/texture.rs.

  • VICTORY_PLANE_SAME (Last::plane_step, Staging::plane_unchanged, PLANES counters in upload_from): skips redundant linear CPU-written R8 plane uploads when the plane's title-memory digest is unchanged from the last recorded upload, entering a 30-frame trust window after 4 consecutive changing checks (for active video frames). If an earlier check in the same frame found the plane unchanged (plane_same == true), subsequent checks in that frame still re-sample so mid-frame CPU writes are picked up immediately without a 1-frame delay; opt out via VICTORY_PLANE_SAME=0.
  • VICTORY_PLANE_PIN (fill_plane): reads linear plane memory locklessly without taking watch::title_memory_reading() first, falling back to the pinned mapping lock only when read_into misses a page (VICTORY_PLANE_PIN=1 restores lock-first reads).
  • Scope is strictly limited to crates/victory-gpu/src/texture.rs.

How it was tested

  • GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): NVIDIA GeForce RTX 4070 Ti (12 GiB), Windows 11 — unit tests, clippy, and rustfmt verified locally; live in-game telemetry A/B pending after merge/release testing.
  • Before: Every command list using a single-level linear CPU-written R8 plane re-filled an upload buffer on every submission under the mapping pin lock.
  • After: Unchanged static planes skip redundant uploads and active plane reads avoid unnecessary pin lock waits; verified by new unit test texture::allocation_costs::plane_step_skips_static_and_trusts_active_video (covering baseline seed, same-frame change reuse, same-frame mid-frame write invalidation without 1-frame delay, and the 4-change -> 30-frame video trust window).
  • For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A (no shader changes).
  • cargo test passed for the crates it touches: yes
    • cargo test -p victory-gpu --lib --locked -- --test-threads=1 on 99b2855: 590 passed; 0 failed; 44 ignored (--test-threads=1 used due to pre-existing parallel watch flake #724; VICTORY_HOME/LOCALAPPDATA isolated, VICTORY_STREAMLINE_DIR unset).
    • cargo clippy -p victory-gpu --no-deps --all-targets --locked: 0 warnings in crates/victory-gpu/src/texture.rs (only pre-existing baseline warnings elsewhere in victory-gpu).
    • rustfmt --edition 2024 --config-path rustfmt.toml: 0 formatting diffs on touched lines in crates/victory-gpu/src/texture.rs.
    • Note: cargo xtask policy fails on pre-existing untouched crates/victory-shader/src/emit/lower.rs (> 655,360 bytes) already present on main (#1460/#1493/#1527).

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. No duplicate open PR ports VICTORY_PLANE_SAME or VICTORY_PLANE_PIN in crates/victory-gpu/src/texture.rs.

Council review

Reviewer Model Round 1 Round 2 Verdict
Concurrency & Safety Auditor gpt-6-luna (xhigh) 7/10 (C1 mid-frame write staleness) 9/10 (C1 resolved) APPROVE
Performance & Modernization Architect gpt-6-luna (xhigh) 8/10 (nosh-perf) 8/10 (verified) APPROVE
Upstream PR Hygiene & Test Critic gpt-6-luna (xhigh) 6/10 (H1 baseline, H2–H4) 9/10 (H1 acknowledged baseline, H2–H4 resolved) APPROVE

Created with Gemini Pro Orchestrator (Neon) and reviewed by GPT-6 Luna (xhigh) in T3 Code.

**@⁠Nosheboo** on GitHub · 2026-11-29 02:14 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1909) `Nosheboo:port/foxhound-plane-same-pin` → `main` · +162 −5 · 1 files · 1 commits · merged 2026-11-29 08:16 UTC Fixes # ## What it changes Ports `VICTORY_PLANE_SAME` and `VICTORY_PLANE_PIN` from `readmet3xt-lab/foxhound` commit `4349ab56` (GPL-3.0-or-later) into `crates/victory-gpu/src/texture.rs`. - **`VICTORY_PLANE_SAME`** (`Last::plane_step`, `Staging::plane_unchanged`, `PLANES` counters in `upload_from`): skips redundant linear CPU-written R8 plane uploads when the plane's title-memory digest is unchanged from the last recorded upload, entering a 30-frame trust window after 4 consecutive changing checks (for active video frames). If an earlier check in the same frame found the plane unchanged (`plane_same == true`), subsequent checks in that frame still re-sample so mid-frame CPU writes are picked up immediately without a 1-frame delay; opt out via `VICTORY_PLANE_SAME=0`. - **`VICTORY_PLANE_PIN`** (`fill_plane`): reads linear plane memory locklessly without taking `watch::title_memory_reading()` first, falling back to the pinned mapping lock only when `read_into` misses a page (`VICTORY_PLANE_PIN=1` restores lock-first reads). - Scope is strictly limited to `crates/victory-gpu/src/texture.rs`. ## How it was tested - GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): NVIDIA GeForce RTX 4070 Ti (12 GiB), Windows 11 — unit tests, `clippy`, and `rustfmt` verified locally; live in-game telemetry A/B pending after merge/release testing. - Before: Every command list using a single-level linear CPU-written R8 plane re-filled an upload buffer on every submission under the mapping pin lock. - After: Unchanged static planes skip redundant uploads and active plane reads avoid unnecessary pin lock waits; verified by new unit test `texture::allocation_costs::plane_step_skips_static_and_trusts_active_video` (covering baseline seed, same-frame change reuse, same-frame mid-frame write invalidation without 1-frame delay, and the 4-change -> 30-frame video trust window). - For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A (no shader changes). - `cargo test` passed for the crates it touches: yes - `cargo test -p victory-gpu --lib --locked -- --test-threads=1` on `99b2855`: `590 passed; 0 failed; 44 ignored` (`--test-threads=1` used due to pre-existing parallel watch flake #724; `VICTORY_HOME`/`LOCALAPPDATA` isolated, `VICTORY_STREAMLINE_DIR` unset). - `cargo clippy -p victory-gpu --no-deps --all-targets --locked`: 0 warnings in `crates/victory-gpu/src/texture.rs` (only pre-existing baseline warnings elsewhere in `victory-gpu`). - `rustfmt --edition 2024 --config-path rustfmt.toml`: 0 formatting diffs on touched lines in `crates/victory-gpu/src/texture.rs`. - Note: `cargo xtask policy` fails on pre-existing untouched `crates/victory-shader/src/emit/lower.rs` (> 655,360 bytes) already present on `main` (`#1460`/`#1493`/`#1527`). ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. No duplicate open PR ports `VICTORY_PLANE_SAME` or `VICTORY_PLANE_PIN` in `crates/victory-gpu/src/texture.rs`. ## Council review | Reviewer | Model | Round 1 | Round 2 | Verdict | | --- | --- | --- | --- | --- | | Concurrency & Safety Auditor | `gpt-6-luna` (`xhigh`) | 7/10 (`C1` mid-frame write staleness) | 9/10 (`C1` resolved) | APPROVE | | Performance & Modernization Architect | `gpt-6-luna` (`xhigh`) | 8/10 (`nosh-perf`) | 8/10 (verified) | APPROVE | | Upstream PR Hygiene & Test Critic | `gpt-6-luna` (`xhigh`) | 6/10 (`H1` baseline, `H2`–`H4`) | 9/10 (`H1` acknowledged baseline, `H2`–`H4` resolved) | APPROVE | Created with Gemini Pro Orchestrator (Neon) and reviewed by GPT-6 Luna (xhigh) in T3 Code.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 02:17:29 +00:00
github-bot changed title from [pr-performance] Textures: skip unchanged linear plane uploads and lockless-first plane reads (VICTORY_PLANE_SAME, VICTORY_PLANE_PIN) to Textures: skip unchanged linear plane uploads and lockless-first plane reads (VICTORY_PLANE_SAME, VICTORY_PLANE_PIN) 2026-11-29 02:28:41 +00:00
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-29 03:35 UTC · original · approved these changes

Tested locally merged onto main (568c5e5).

  • Merge: Clean merge in crates/victory-gpu/src/texture.rs.
  • Tests (RTX 5090): cargo test -p victory-gpu --lib texture:: passed (10 passed; 0 failed; 4 ignored, including the new plane_step_skips_static_and_trusts_active_video and a_digest_tells_bytes_apart tests) with 0 warnings in texture.rs.

Nice linear-plane upload skip and lockless-first read optimization (VICTORY_PLANE_SAME / VICTORY_PLANE_PIN). LGTM.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-29 03:35 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1909#pullrequestreview-6101258460) · **approved these changes** Tested locally merged onto `main` (`568c5e5`). - **Merge**: Clean merge in `crates/victory-gpu/src/texture.rs`. - **Tests (RTX 5090)**: `cargo test -p victory-gpu --lib texture::` passed (`10 passed; 0 failed; 4 ignored`, including the new `plane_step_skips_static_and_trusts_active_video` and `a_digest_tells_bytes_apart` tests) with 0 warnings in `texture.rs`. Nice linear-plane upload skip and lockless-first read optimization (`VICTORY_PLANE_SAME` / `VICTORY_PLANE_PIN`). LGTM. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
github-bot changed target branch from main to gh-pr/1909/base 2026-11-29 08:21:03 +00:00
github manually merged commit 99b285525b into gh-pr/1909/base 2026-11-29 08:21:04 +00:00
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!1909
No description provided.