perf: share texture uploads across duplicate VIctory heap views #304

Manually merged
github merged 1 commit from github-bot/gh-304 into main 2026-11-26 14:23:02 +00:00 AGit
Owner

@⁠mauroalvare on GitHub · 2026-11-26 01:53 UTC · original
mauroalvare:codex/victory-streaming → main · +316 −8 · 3 files · 1 commits · merged 2026-11-26 14:21 UTC

Change

Neptune’s bindless texture pass records an upload for a due SRV and takes the staging entry out of the lookup table. A second due SRV for the same host texture and first mip then stages and uploads the same mip data again.

Reuse a complete upload within the pass, keyed by the title resource, host copy and first mip. Each slot still gets its host descriptor, queue completion and optional fingerprint recheck. Partial textures and different first mips follow their own upload path. This runs in the victory-gpu runtime launched by tools/lancer_victory.ps1.

Verification

Base c4c93bdc413191a9dc909998d2d53080a3f0c880. The same regression was built with the test-only changes on the base and with the upload fix.

cd third_party/victory
cargo test --locked --offline -j 2 -p victory-gpu --features diagnostics duplicate_texture_views_share_uploads_within_each_pass -- --nocapture --test-threads=1

The synthetic workload rewrites and rotates eight tiled RGBA8 textures in four passes, with 64 due slots per pass. It mixes views starting at mip 0 and mip 2 and checks every texel of every mip by GPU readback each round. The base passes readback and fails the upload count (256 != 64). The fix passes both checks on the RTX 5070 Ti and on WARP.

RTX 5070 Ti, driver 621.40. Same diagnostic test build profile and settings on both sides (VICTORY_STAGE_POOL_MB=256, VICTORY_LEVELS_ON_DEMAND=1, VICTORY_HEAP_RECHECK=0). Five alternating pairs after one warm-up pair, with a fresh process and staging pool each run. Timings are medians over all four passes per run.

Synthetic measurement Base Fix
Staged uploads 256 64
Title texture bytes counted for uploads 45 MiB 11.25 MiB
Peak live staging footprint at a pass boundary 11.49 MiB 2.87 MiB
Record texture passes 43.16 ms 17.29 ms
Submit and wait, including readback copies 41.90 ms 13.84 ms
  • cargo test --locked --offline -j 2 -p victory-loader --test load_probe — 2 passed.
  • cargo test --locked --offline -j 2 -p victory-gpu --features diagnostics -- --test-threads=1 — 197 passed, 3 failed, 3 ignored. The same three failures reproduced on the base: spans_say_the_next_start_and_the_lowest_level_viewed, warp_card_fetch_copies_flagged_pieces_to_their_slots, and warp_card_patch_writes_the_masked_bytes_and_no_others.
  • cargo xtask policy — 199 files OK.
  • cargo build --release --manifest-path rust/Cargo.toml and cargo test --release --manifest-path rust/Cargo.toml — build succeeded and 12 tests passed.
  • python -m ruff check --select W605,F,E9 PrototypeScarlett tests tools — All checks passed.
  • cmake -S runtime -B runtime/build -A x64 and cmake --build runtime/build --config Release --parallel 2 — succeeded. python tools/build_tombox.py — built and installed 10 DLLs from the pinned source.
  • python -m pytest -ra with ANYXBOXX_REQUIRE_RUNTIME=1 — 1665 passed in 107.67 s, no skips. Windows, Python 3.13.15 and NVIDIA GeForce RTX 5070 Ti (driver 621.40).
  • The regression also passed on the RTX 5070 Ti with cargo test --locked --offline -j 2 -p victory-gpu duplicate_texture_views_share_uploads_within_each_pass -- --nocapture --test-threads=1, using the default feature set.

Oracle and test data

All texture bytes are generated in the test from integer patterns, tiled with the repository’s layout code, then compared with the same patterns after readback. No game or console files were used. AI-assisted with OpenAI Codex.

**@⁠mauroalvare** on GitHub · 2026-11-26 01:53 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/304) `mauroalvare:codex/victory-streaming` → `main` · +316 −8 · 3 files · 1 commits · merged 2026-11-26 14:21 UTC ## Change Neptune’s bindless texture pass records an upload for a due SRV and takes the staging entry out of the lookup table. A second due SRV for the same host texture and first mip then stages and uploads the same mip data again. Reuse a complete upload within the pass, keyed by the title resource, host copy and first mip. Each slot still gets its host descriptor, queue completion and optional fingerprint recheck. Partial textures and different first mips follow their own upload path. This runs in the `victory-gpu` runtime launched by `tools/lancer_victory.ps1`. ## Verification Base `c4c93bdc413191a9dc909998d2d53080a3f0c880`. The same regression was built with the test-only changes on the base and with the upload fix. ```powershell cd third_party/victory cargo test --locked --offline -j 2 -p victory-gpu --features diagnostics duplicate_texture_views_share_uploads_within_each_pass -- --nocapture --test-threads=1 ``` The synthetic workload rewrites and rotates eight tiled RGBA8 textures in four passes, with 64 due slots per pass. It mixes views starting at mip 0 and mip 2 and checks every texel of every mip by GPU readback each round. The base passes readback and fails the upload count (`256 != 64`). The fix passes both checks on the RTX 5070 Ti and on WARP. RTX 5070 Ti, driver 621.40. Same diagnostic test build profile and settings on both sides (`VICTORY_STAGE_POOL_MB=256`, `VICTORY_LEVELS_ON_DEMAND=1`, `VICTORY_HEAP_RECHECK=0`). Five alternating pairs after one warm-up pair, with a fresh process and staging pool each run. Timings are medians over all four passes per run. | Synthetic measurement | Base | Fix | | --- | ---: | ---: | | Staged uploads | 256 | 64 | | Title texture bytes counted for uploads | 45 MiB | 11.25 MiB | | Peak live staging footprint at a pass boundary | 11.49 MiB | 2.87 MiB | | Record texture passes | 43.16 ms | 17.29 ms | | Submit and wait, including readback copies | 41.90 ms | 13.84 ms | - `cargo test --locked --offline -j 2 -p victory-loader --test load_probe` — 2 passed. - `cargo test --locked --offline -j 2 -p victory-gpu --features diagnostics -- --test-threads=1` — 197 passed, 3 failed, 3 ignored. The same three failures reproduced on the base: `spans_say_the_next_start_and_the_lowest_level_viewed`, `warp_card_fetch_copies_flagged_pieces_to_their_slots`, and `warp_card_patch_writes_the_masked_bytes_and_no_others`. - `cargo xtask policy` — 199 files OK. - `cargo build --release --manifest-path rust/Cargo.toml` and `cargo test --release --manifest-path rust/Cargo.toml` — build succeeded and 12 tests passed. - `python -m ruff check --select W605,F,E9 PrototypeScarlett tests tools` — All checks passed. - `cmake -S runtime -B runtime/build -A x64` and `cmake --build runtime/build --config Release --parallel 2` — succeeded. `python tools/build_tombox.py` — built and installed 10 DLLs from the pinned source. - `python -m pytest -ra` with `ANYXBOXX_REQUIRE_RUNTIME=1` — 1665 passed in 107.67 s, no skips. Windows, Python 3.13.15 and NVIDIA GeForce RTX 5070 Ti (driver 621.40). - The regression also passed on the RTX 5070 Ti with `cargo test --locked --offline -j 2 -p victory-gpu duplicate_texture_views_share_uploads_within_each_pass -- --nocapture --test-threads=1`, using the default feature set. ## Oracle and test data All texture bytes are generated in the test from integer patterns, tiled with the repository’s layout code, then compared with the same patterns after readback. No game or console files were used. AI-assisted with OpenAI Codex.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:42:30 +00:00
github manually merged commit 329f228ea0 into main 2026-11-26 14:23:02 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.