feat: victory: fps ports from rorodev6 and the forks, behind VICTORY_* switches (-Fast launcher set) #234

Closed
LooperSalty wants to merge 14 commits from upstream-pr/234 into main
LooperSalty commented 2026-11-25 20:11:51 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by LooperSalty on 2026-11-25T20:11:51Z.


Summary

Ports of the parts of rorodev6's and the fork's fps work that save time without changing the picture, plus the fork commits this branch builds on, behind VICTORY_* switches. Everything new is off by default; the launcher's -Fast switch turns on the measured-useful set. Nothing here has been measured in game yet except where stated.

Commits

Commit What Source
fa9e5b35, e4700a97 Series S upscaler stand-in (a pass of ours) shadowdog00/vi-pc-combo af62a99
16957d6e VICTORY_TEXTURE_BATCH=1: textures read in place together, several threads shadowdog00/vi-pc-combo 6f07e7b (hand port)
9ce6d1c5 Parallel copy refreshes on multicore hosts Trexies/victory-fork VIwork, via WillyboPeep/victory-all-forks 8422f48
ae114b90 VICTORY_COPY_COMPARE=1: refresh only changed 4 KiB pieces Trexies/victory-fork, all-forks 7ac7891 (author recorded as victory-local, no real identity)
ce0216c4 Split an unwatchable range instead of copying the whole buffer Trexies/victory-fork, all-forks 807a0d0 (author recorded as anonymous)
c20f10a7 VICTORY_INDIRECT_GATHER=1: scattered indirect records clamped once per list fxceless
778e3fec VICTORY_STAGING_DOUBLE=1 (off; see below) and the in-flight fix: a staging buffer dropped while a submission may read it is kept until that submission finishes, never pooled at once this repository
0840776f VICTORY_STAGING_BLOCKS=1: staging cut from 64 MiB upload blocks (ranges.rs); a buffer dropped mid-flight hands its range back only when its submissions finish shadowdog00/vi-pc-combo 0781f61, via rorodev6/victory
a4f807fa VICTORY_HEAP_PASS_DIRTY=1: the heap-buffer pass re-looks only at slots marked since its last pass (full sweep every 256 passes) ShakiraRED V1 c2271e5 (squash over Trexies VIwork)
3a3bb8ef Copy merge compares 32-byte chunks and skips equal ones (no switch; tested against the byte loop) ShakiraRED V1 c2271e5
28e91ccd tools/lancer_victory.ps1 -Fast: the measured set, never VICTORY_RELAY this repository
0770a070 THIRD_PARTY rows for the sources above -

The Trexies and ShakiraRED commits are squashes or re-applications; their author identities in the source repositories are placeholders or contributor-level, so they are recorded as found.

Measurements (honest labels)

  • Maintainer, RTX 4070 SUPER / i7-13700KF, Series S, 1280x720, world (earlier runs): rorodev6 build 10-11.6 fps, 86 ms/frame, GPU busy about 66 ms per frame. Ours with the four options (VICTORY_RELAY=2 etc.): 4.9 fps, 202 ms/frame; passes 61 -> 45 ms with VICTORY_CARD_REHASH_RUNS=1.
  • Analysis of the logs (measured counters, not a profiler): the gap is not GPU work (the card is busy about the same, 66-71 ms per frame in both). It is about 12 submissions a frame waiting for a staging buffer still in flight, roughly 60 ms a frame of settles under "title memory read". VICTORY_STAGING_BLOCKS and the in-flight fix address that path. This is an inference from counters, not yet confirmed by a run.
  • VICTORY_STAGING_DOUBLE=1 (fresh buffer instead of settling): regressed in Series X, 2.9 fps against about 5 (the fresh buffers are refreshed in full at first submission: 240 MB a frame). Kept off, not in -Fast. The in-flight safety fix in the same commit stays.
  • Not yet measured in game: VICTORY_STAGING_BLOCKS, VICTORY_HEAP_PASS_DIRTY, the chunked merge, and the default-on questions. All default off. Measure with -Fast and without, then decide defaults.

Test instructions (Series X, the maintainer's rule)

All game runs for this PR use the default console, Series X. Do not set VICTORY_DISPLAY_MODE and do not pass --console series-s.

# baseline (default options, Series X)
.\tools\lancer_victory.ps1 -GameDir <your game folder>
# faster set (adds VICTORY_CARD_REHASH_RUNS, INDIRECT_WINDOW, JOIN_COPIES, TEXTURE_BATCH, INDIRECT_GATHER, STAGING_BLOCKS, HEAP_PASS_DIRTY)
.\tools\lancer_victory.ps1 -GameDir <your game folder> -Fast

Compare the frame line (fps, ms/frame, passes, and the "staging buffers" and "heap buffers" lines). Check a cutscene screenshot for any difference from the baseline; a picture change is a bug in the port.

Left out (and why)

  • VICTORY_TITLE_CACHED (rorodev, vmem.rs, from 78e95de): about 230 lines in the HLE memory model; needs its own review.
  • VICTORY_TEXTURE_HEAPS (rorodev, the texture half of 0781f61, resource.rs): about 250 lines placing textures in heaps; separate change.
  • VICTORY_GROUPED_MESH_CLAMP (rorodev, the draw half of 31634e4): overlaps VICTORY_INDIRECT_GATHER, already ported from c20f10a7.
  • VICTORY_DEPTH_BOUNDS (rorodev, pipeline/host.rs, inside 4436f8f with 180 unrelated lines): not separable cleanly.
  • rorodev's STAGING_POOL variant: covered by VICTORY_STAGING_BLOCKS (rorodev's default is the block path).
  • From ShakiraRED c2271e5, deliberately not taken: VICTORY_COPY_PLAIN, low guards, ambient.

Known test issue

watch::tests::a_check_during_a_held_kernel_write_leaves_its_blocks_open is flaky (it also fails intermittently on the base commit; it passes alone). Not touched here.

Verification

  • cargo build --locked --profile diag -p victory --features diagnostics: ok, no warnings.
  • cargo test -p victory-gpu --features diagnostics --lib: 174 passed (the flaky test passed in this run).
  • cargo xtask policy: 185 files ok.
  • pytest (full): 1031 passed, 300 skipped.
  • ruff check --select W605,F,E9 PrototypeScarlett tests tools: clean.
  • Game was not run for these tests; the game and the in-game numbers above are the maintainer's.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz

<!-- greyfinch-sync:LooperSalty/AnyXboxX:issue:6612832233 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/234). Originally posted by [LooperSalty](https://github.com/LooperSalty) on 2026-11-25T20:11:51Z. --- ## Summary Ports of the parts of rorodev6's and the fork's fps work that save time without changing the picture, plus the fork commits this branch builds on, behind `VICTORY_*` switches. Everything new is **off by default**; the launcher's `-Fast` switch turns on the measured-useful set. Nothing here has been measured in game yet except where stated. ## Commits | Commit | What | Source | | --- | --- | --- | | fa9e5b35, e4700a97 | Series S upscaler stand-in (a pass of ours) | shadowdog00/vi-pc-combo af62a99 | | 16957d6e | `VICTORY_TEXTURE_BATCH=1`: textures read in place together, several threads | shadowdog00/vi-pc-combo 6f07e7b (hand port) | | 9ce6d1c5 | Parallel copy refreshes on multicore hosts | Trexies/victory-fork VIwork, via WillyboPeep/victory-all-forks 8422f48 | | ae114b90 | `VICTORY_COPY_COMPARE=1`: refresh only changed 4 KiB pieces | Trexies/victory-fork, all-forks 7ac7891 (author recorded as victory-local, no real identity) | | ce0216c4 | Split an unwatchable range instead of copying the whole buffer | Trexies/victory-fork, all-forks 807a0d0 (author recorded as anonymous) | | c20f10a7 | `VICTORY_INDIRECT_GATHER=1`: scattered indirect records clamped once per list | fxceless | | 778e3fec | `VICTORY_STAGING_DOUBLE=1` (off; see below) and the in-flight fix: a staging buffer dropped while a submission may read it is kept until that submission finishes, never pooled at once | this repository | | 0840776f | `VICTORY_STAGING_BLOCKS=1`: staging cut from 64 MiB upload blocks (`ranges.rs`); a buffer dropped mid-flight hands its range back only when its submissions finish | shadowdog00/vi-pc-combo 0781f61, via rorodev6/victory | | a4f807fa | `VICTORY_HEAP_PASS_DIRTY=1`: the heap-buffer pass re-looks only at slots marked since its last pass (full sweep every 256 passes) | ShakiraRED V1 c2271e5 (squash over Trexies VIwork) | | 3a3bb8ef | Copy merge compares 32-byte chunks and skips equal ones (no switch; tested against the byte loop) | ShakiraRED V1 c2271e5 | | 28e91ccd | `tools/lancer_victory.ps1 -Fast`: the measured set, never `VICTORY_RELAY` | this repository | | 0770a070 | THIRD_PARTY rows for the sources above | - | The Trexies and ShakiraRED commits are squashes or re-applications; their author identities in the source repositories are placeholders or contributor-level, so they are recorded as found. ## Measurements (honest labels) - Maintainer, RTX 4070 SUPER / i7-13700KF, **Series S**, 1280x720, world (earlier runs): rorodev6 build 10-11.6 fps, 86 ms/frame, GPU busy about 66 ms per frame. Ours with the four options (`VICTORY_RELAY=2` etc.): 4.9 fps, 202 ms/frame; passes 61 -> 45 ms with `VICTORY_CARD_REHASH_RUNS=1`. - Analysis of the logs (measured counters, not a profiler): the gap is not GPU work (the card is busy about the same, 66-71 ms per frame in both). It is about 12 submissions a frame waiting for a staging buffer still in flight, roughly 60 ms a frame of settles under "title memory read". `VICTORY_STAGING_BLOCKS` and the in-flight fix address that path. This is an inference from counters, not yet confirmed by a run. - `VICTORY_STAGING_DOUBLE=1` (fresh buffer instead of settling): **regressed in Series X, 2.9 fps against about 5** (the fresh buffers are refreshed in full at first submission: 240 MB a frame). Kept off, not in `-Fast`. The in-flight safety fix in the same commit stays. - **Not yet measured in game:** `VICTORY_STAGING_BLOCKS`, `VICTORY_HEAP_PASS_DIRTY`, the chunked merge, and the default-on questions. All default off. Measure with `-Fast` and without, then decide defaults. ## Test instructions (Series X, the maintainer's rule) All game runs for this PR use the default console, Series X. Do **not** set `VICTORY_DISPLAY_MODE` and do not pass `--console series-s`. ```powershell # baseline (default options, Series X) .\tools\lancer_victory.ps1 -GameDir <your game folder> # faster set (adds VICTORY_CARD_REHASH_RUNS, INDIRECT_WINDOW, JOIN_COPIES, TEXTURE_BATCH, INDIRECT_GATHER, STAGING_BLOCKS, HEAP_PASS_DIRTY) .\tools\lancer_victory.ps1 -GameDir <your game folder> -Fast ``` Compare the frame line (`fps`, `ms/frame`, `passes`, and the "staging buffers" and "heap buffers" lines). Check a cutscene screenshot for any difference from the baseline; a picture change is a bug in the port. ## Left out (and why) - `VICTORY_TITLE_CACHED` (rorodev, `vmem.rs`, from 78e95de): about 230 lines in the HLE memory model; needs its own review. - `VICTORY_TEXTURE_HEAPS` (rorodev, the texture half of 0781f61, `resource.rs`): about 250 lines placing textures in heaps; separate change. - `VICTORY_GROUPED_MESH_CLAMP` (rorodev, the draw half of 31634e4): overlaps `VICTORY_INDIRECT_GATHER`, already ported from c20f10a7. - `VICTORY_DEPTH_BOUNDS` (rorodev, `pipeline/host.rs`, inside 4436f8f with 180 unrelated lines): not separable cleanly. - rorodev's `STAGING_POOL` variant: covered by `VICTORY_STAGING_BLOCKS` (rorodev's default is the block path). - From ShakiraRED c2271e5, deliberately not taken: `VICTORY_COPY_PLAIN`, low guards, ambient. ## Known test issue `watch::tests::a_check_during_a_held_kernel_write_leaves_its_blocks_open` is flaky (it also fails intermittently on the base commit; it passes alone). Not touched here. ## Verification - `cargo build --locked --profile diag -p victory --features diagnostics`: ok, no warnings. - `cargo test -p victory-gpu --features diagnostics --lib`: 174 passed (the flaky test passed in this run). - `cargo xtask policy`: 185 files ok. - `pytest` (full): 1031 passed, 300 skipped. - `ruff check --select W605,F,E9 PrototypeScarlett tests tools`: clean. - Game was not run for these tests; the game and the in-game numbers above are the maintainer's. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
chatgpt-codex-connector[bot] commented 2026-11-25 20:12:05 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T20:12:05Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T20:15:25.283866Z 0770a07 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:LooperSalty/AnyXboxX:comment:7173326610 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/234#issuecomment-7173326610). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-11-25T20:12:05Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"0770a070d70eb0de0121ce1bcec7844646cad950","has_any_findings":true,"has_unresolved_findings":true,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-25T20:15:25.283866Z">2026-11-25T20:15:25.283866Z</relative-time> | `0770a07` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
chatgpt-codex-connector[bot] commented 2026-11-25 20:15:22 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T20:15:22Z.

Review: COMMENTED


💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0770a070d7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<!-- greyfinch-sync:LooperSalty/AnyXboxX:review:6064320137 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/234#pullrequestreview-6064320137). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-11-25T20:15:22Z. **Review:** COMMENTED --- <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `0770a070d7` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". </details>
chatgpt-codex-connector[bot] commented 2026-11-25 20:15:22 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T20:15:22Z.

Code review location: third_party/victory/crates/victory-gpu/src/host.rs; line 5195

@@ -4968,6 +5184,18 @@ impl HostList {
                 self.list.ResolveQueryData(heap, D3D12_QUERY_TYPE_TIMESTAMP, 0, count + 1, back, 0);
             }
         }
+        // The scratch buffers its prelude fills and leaves readable as
+        // arguments: common again behind the list, as every scratch buffer.
+        for set in self.gather.lock().unwrap_or_else(|e| e.into_inner()).sets.iter().filter(|s| s.records() > 0) {
+            // SAFETY: an open list and a live buffer.
+            unsafe {
+                self.list.ResourceBarrier(&[transition(
+                    &set.scratch,
+                    D3D12_RESOURCE_STATE_INDIRECT_ARGUMENT,
+                    D3D12_RESOURCE_STATE_COMMON,

P1 Badge Keep gathered scratch buffers in one consistent resource state

With VICTORY_INDIRECT_GATHER=1 (including the launcher's -Fast set), State::indirect still calls crate::indirect::done(list, &bounded) after each gathered draw, explicitly transitioning its scratch buffer from INDIRECT_ARGUMENT to COMMON. This additional transition at list close therefore declares an incorrect before-state after the final draw. The gathered path needs separate state handling: either retain INDIRECT_ARGUMENT until this closing barrier or avoid emitting the redundant barrier. Otherwise the new path records invalid D3D12 resource transitions.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:LooperSalty/AnyXboxX:review-comment:4700335703 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/234#discussion_r4700335703). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-11-25T20:15:22Z. **Code review location:** `third_party/victory/crates/victory-gpu/src/host.rs`; line 5195 ~~~~diff @@ -4968,6 +5184,18 @@ impl HostList { self.list.ResolveQueryData(heap, D3D12_QUERY_TYPE_TIMESTAMP, 0, count + 1, back, 0); } } + // The scratch buffers its prelude fills and leaves readable as + // arguments: common again behind the list, as every scratch buffer. + for set in self.gather.lock().unwrap_or_else(|e| e.into_inner()).sets.iter().filter(|s| s.records() > 0) { + // SAFETY: an open list and a live buffer. + unsafe { + self.list.ResourceBarrier(&[transition( + &set.scratch, + D3D12_RESOURCE_STATE_INDIRECT_ARGUMENT, + D3D12_RESOURCE_STATE_COMMON, ~~~~ --- **<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Keep gathered scratch buffers in one consistent resource state** With `VICTORY_INDIRECT_GATHER=1` (including the launcher's `-Fast` set), `State::indirect` still calls `crate::indirect::done(list, &bounded)` after each gathered draw, explicitly transitioning its scratch buffer from `INDIRECT_ARGUMENT` to `COMMON`. This additional transition at list close therefore declares an incorrect before-state after the final draw. The gathered path needs separate state handling: either retain `INDIRECT_ARGUMENT` until this closing barrier or avoid emitting the redundant barrier. Otherwise the new path records invalid D3D12 resource transitions. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
chatgpt-codex-connector[bot] commented 2026-11-25 20:15:22 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T20:15:22Z.

Code review location: third_party/victory/crates/victory-gpu/src/shadow.rs; line 2553

@@ -2463,7 +2542,20 @@ impl Shadow {
                 }
                 return copied;
             }
-            self.watched.store(NOT_WATCHED, Ordering::Relaxed);
+            // `GetWriteWatch` refuses a range that spans two reservations as
+            // a whole (`watch::writes` returns None). Splitting it keeps the
+            // rest of the buffer watched instead of copying all of it every
+            // frame: only the piece that cannot be watched is copied.
+            if to - from > PAGE {
+                let mid = ((from + to) / 2) & !(PAGE - 1);
+                if mid > from && mid < to {
+                    let left = self.update_free(from, mid);
+                    return left + self.update_free(mid, to);

P2 Badge Remember ranges that cannot be write-watched

For committed memory that has neither write-watch nor view guards, every recursive watch::writes call returns None. This now splits the entire range down to 64 KiB pieces, but those leaves never set NOT_WATCHED, so the complete failed-query tree is repeated on every refresh. For example, a 64 MiB unwatchable buffer incurs 2,047 watch/guard attempts per refresh instead of the previous one-time failure followed by a direct copy. Cache unwatchable pieces or distinguish wholly unwatchable allocations from ranges crossing reservation boundaries so this default-on change does not turn ordinary buffer refreshes into thousands of kernel queries.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:LooperSalty/AnyXboxX:review-comment:4700335713 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/234#discussion_r4700335713). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-11-25T20:15:22Z. **Code review location:** `third_party/victory/crates/victory-gpu/src/shadow.rs`; line 2553 ~~~~diff @@ -2463,7 +2542,20 @@ impl Shadow { } return copied; } - self.watched.store(NOT_WATCHED, Ordering::Relaxed); + // `GetWriteWatch` refuses a range that spans two reservations as + // a whole (`watch::writes` returns None). Splitting it keeps the + // rest of the buffer watched instead of copying all of it every + // frame: only the piece that cannot be watched is copied. + if to - from > PAGE { + let mid = ((from + to) / 2) & !(PAGE - 1); + if mid > from && mid < to { + let left = self.update_free(from, mid); + return left + self.update_free(mid, to); ~~~~ --- **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Remember ranges that cannot be write-watched** For committed memory that has neither write-watch nor view guards, every recursive `watch::writes` call returns `None`. This now splits the entire range down to 64 KiB pieces, but those leaves never set `NOT_WATCHED`, so the complete failed-query tree is repeated on every refresh. For example, a 64 MiB unwatchable buffer incurs 2,047 watch/guard attempts per refresh instead of the previous one-time failure followed by a direct copy. Cache unwatchable pieces or distinguish wholly unwatchable allocations from ranges crossing reservation boundaries so this default-on change does not turn ordinary buffer refreshes into thousands of kernel queries. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
chatgpt-codex-connector[bot] commented 2026-11-25 20:15:22 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T20:15:22Z.

Code review location: third_party/victory/crates/victory-gpu/src/upscale.rs; line 40

@@ -0,0 +1,116 @@
+//! The title's upscaler, stood in for.
+//!
+//! As the smaller console the title renders at a low resolution and has
+//! AMD's upscaler (`amd_fidelityfx_upscaler_xbox.dll`, FSR 4) make the
+//! full-size picture. Its passes are console-compiled compute programs in
+//! a container part the translator does not read (`ACCC`, magic `FSPX`):
+//! none of them runs here, the output stays as it was made and the picture
+//! is black (run `ss_try4`).
+//!
+//! The title's loader library looks the upscaler's `ffxDispatch` up by
+//! name; the runtime hands it [`dispatch`] instead ([`hook`]). An upscale
+//! dispatch is then one pass of ours that draws the colour input over the
+//! output with linear filtering (`crate::list::upscale`); the upscaler's
+//! own passes are not recorded at all. Every other dispatch, and an
+//! upscale we cannot make sense of, goes to the upscaler as before.
+//!
+//! `VICTORY_UPSCALE=title`: nothing is hooked.
+
+use std::ffi::c_void;
+use std::sync::atomic::{AtomicU64, AtomicUsize, Ordering::Relaxed};
+
+/// The upscaler's own `ffxDispatch`.
+static ORIGINAL: AtomicUsize = AtomicUsize::new(0);
+
+/// Dispatches seen; upscales drawn by us; upscales handed on.
+static CALLS: [AtomicU64; 3] = [const { AtomicU64::new(0) }; 3];
+
+/// `ffxDispatch(context, description)`.
+type Dispatch = extern "system" fn(*mut c_void, *const u8) -> u32;
+
+/// The description type of an upscale dispatch (`ffx_upscale.h`).
+const UPSCALE: u64 = 0x0001_0001;
+
+/// What the title's lookup of the upscaler's `ffxDispatch` gets: ours, which
+/// keeps `original` for what it hands on.
+pub fn hook(original: usize) -> usize {
+    if std::env::var_os("VICTORY_UPSCALE").is_some_and(|v| v == "title") {
+        return original;
+    }
+    ORIGINAL.store(original, Relaxed);

P1 Badge Add regression coverage for the new upscaler interception

The new upscaler interception is enabled by default, parses a dispatch description using fixed byte offsets, and substitutes a new GPU pass, but the commit adds no test exercising that behavior. The existing internal-HLSL compilation test also omits UPSCALE; the launcher tests merely check the DLL filename. Add synthetic dispatch-description tests covering interception and fallback, plus compilation or WARP coverage of the replacement pass. This is required by the repository's explicit rule that new behavior include a test that fails without it.

AGENTS.md reference: AGENTS.md:L54-L54

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:LooperSalty/AnyXboxX:review-comment:4700335727 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/234#discussion_r4700335727). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-11-25T20:15:22Z. **Code review location:** `third_party/victory/crates/victory-gpu/src/upscale.rs`; line 40 ~~~~diff @@ -0,0 +1,116 @@ +//! The title's upscaler, stood in for. +//! +//! As the smaller console the title renders at a low resolution and has +//! AMD's upscaler (`amd_fidelityfx_upscaler_xbox.dll`, FSR 4) make the +//! full-size picture. Its passes are console-compiled compute programs in +//! a container part the translator does not read (`ACCC`, magic `FSPX`): +//! none of them runs here, the output stays as it was made and the picture +//! is black (run `ss_try4`). +//! +//! The title's loader library looks the upscaler's `ffxDispatch` up by +//! name; the runtime hands it [`dispatch`] instead ([`hook`]). An upscale +//! dispatch is then one pass of ours that draws the colour input over the +//! output with linear filtering (`crate::list::upscale`); the upscaler's +//! own passes are not recorded at all. Every other dispatch, and an +//! upscale we cannot make sense of, goes to the upscaler as before. +//! +//! `VICTORY_UPSCALE=title`: nothing is hooked. + +use std::ffi::c_void; +use std::sync::atomic::{AtomicU64, AtomicUsize, Ordering::Relaxed}; + +/// The upscaler's own `ffxDispatch`. +static ORIGINAL: AtomicUsize = AtomicUsize::new(0); + +/// Dispatches seen; upscales drawn by us; upscales handed on. +static CALLS: [AtomicU64; 3] = [const { AtomicU64::new(0) }; 3]; + +/// `ffxDispatch(context, description)`. +type Dispatch = extern "system" fn(*mut c_void, *const u8) -> u32; + +/// The description type of an upscale dispatch (`ffx_upscale.h`). +const UPSCALE: u64 = 0x0001_0001; + +/// What the title's lookup of the upscaler's `ffxDispatch` gets: ours, which +/// keeps `original` for what it hands on. +pub fn hook(original: usize) -> usize { + if std::env::var_os("VICTORY_UPSCALE").is_some_and(|v| v == "title") { + return original; + } + ORIGINAL.store(original, Relaxed); ~~~~ --- **<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Add regression coverage for the new upscaler interception** The new upscaler interception is enabled by default, parses a dispatch description using fixed byte offsets, and substitutes a new GPU pass, but the commit adds no test exercising that behavior. The existing internal-HLSL compilation test also omits `UPSCALE`; the launcher tests merely check the DLL filename. Add synthetic dispatch-description tests covering interception and fallback, plus compilation or WARP coverage of the replacement pass. This is required by the repository's explicit rule that new behavior include a test that fails without it. AGENTS.md reference: [AGENTS.md:L54-L54](https://github.com/LooperSalty/AnyXboxX/blob/0770a070d70eb0de0121ce1bcec7844646cad950/AGENTS.md#L54-L54) Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
chatgpt-codex-connector[bot] commented 2026-11-25 20:15:22 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T20:15:22Z.

Code review location: THIRD_PARTY.md; line 52

@@ -47,6 +47,9 @@ Le détail par changement est dans `git log -- third_party/victory`. La copie in
 | [JoshuuDev/victory-amd](https://github.com/JoshuuDev/victory-amd) (Joshua Odom) | GPL-3.0 | | Lectures noyau dans la mémoire du titre faites à côté puis recopiées (`10ea38e`) |
 | [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab), branche `klbf-amd` (PastiiJay, KLBF) | GPL-3.0 | | Portages : demi-vagues wave32 sur un hôte à 64 lanes, garde NaN |
 | [rorodev6/victory](https://github.com/rorodev6/victory) (rorodev6) | GPL-3.0 ou ultérieure | | Compteur de fps en haut à gauche (`fps_overlay.rs`, commit `4ddc0c1`), porté avec une taille réglable (`VICTORY_FPS_OVERLAY_SIZE`) |
+| [shadowdog00/vi-pc-combo](https://github.com/shadowdog00/vi-pc-combo) (shadowdog00) | GPL-3.0 ou ultérieure | | Stand-in de l'upscaler du titre en Series S (`upscale.rs`, `af62a99`) ; lecture groupée des textures sur place sur plusieurs threads (`6f07e7b`, portage à la main, `VICTORY_TEXTURE_BATCH=1`) ; staging découpé dans des blocs de 64 Mio (`ranges.rs`, `0781f61`, `VICTORY_STAGING_BLOCKS=1`, repris via [rorodev6/victory](https://github.com/rorodev6/victory)) |
+| [Trexies/victory-fork](https://github.com/Trexies/victory-fork) (branche VIwork), repris via [WillyboPeep/victory-all-forks](https://github.com/WillyboPeep/victory-all-forks) (`all-forks`) | GPL-3.0 ou ultérieure (licence du fork, à confirmer par son auteur) | | Copies de rafraîchissement en parallèle sur les machines multicœurs (`9ce6d1c5`, source `8422f48`, auteur spacede) ; `VICTORY_COPY_COMPARE=1` (`ae114b90`, source `7ac7891`, auteur inscrit victory-local, faute d'identité réelle) ; découpe d'une plage non surveillée (`ce0216c4`, source `807a0d0`, auteur inscrit anonymous) |
+| [reddxd-byte/ShakiraRED-dt](https://github.com/reddxd-byte/ShakiraRED-dt) (commit `c2271e5`, squash de la branche VIwork de Trexies) | GPL-3.0 ou ultérieure | | Passe du heap à lignes sales (`heap_pass.rs`, `VICTORY_HEAP_PASS_DIRTY=1`, désactivée par défaut) et comparaison de fusion de copies par blocs de 32 octets (`shadow.rs`, `merge_piece`, sans changement de rendu : testée contre la boucle d'octets) |

P1 Badge Preserve the required source-author trailers for the ports

These rows document code imported from other repositories, but reviewed commit 5dfdf53 contains neither the required Source: trailer nor any Co-authored-by: trailer crediting the source authors. Its summary table identifies repositories and commits, but does not preserve the author attribution required by AGENTS.md rule 10. Retain the required source and author trailers when consolidating these ports; updating THIRD_PARTY.md satisfies only the separate sources-table requirement.

AGENTS.md reference: AGENTS.md:L59-L59

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:LooperSalty/AnyXboxX:review-comment:4700335733 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/234#discussion_r4700335733). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-11-25T20:15:22Z. **Code review location:** `THIRD_PARTY.md`; line 52 ~~~~diff @@ -47,6 +47,9 @@ Le détail par changement est dans `git log -- third_party/victory`. La copie in | [JoshuuDev/victory-amd](https://github.com/JoshuuDev/victory-amd) (Joshua Odom) | GPL-3.0 | | Lectures noyau dans la mémoire du titre faites à côté puis recopiées (`10ea38e`) | | [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab), branche `klbf-amd` (PastiiJay, KLBF) | GPL-3.0 | | Portages : demi-vagues wave32 sur un hôte à 64 lanes, garde NaN | | [rorodev6/victory](https://github.com/rorodev6/victory) (rorodev6) | GPL-3.0 ou ultérieure | | Compteur de fps en haut à gauche (`fps_overlay.rs`, commit `4ddc0c1`), porté avec une taille réglable (`VICTORY_FPS_OVERLAY_SIZE`) | +| [shadowdog00/vi-pc-combo](https://github.com/shadowdog00/vi-pc-combo) (shadowdog00) | GPL-3.0 ou ultérieure | | Stand-in de l'upscaler du titre en Series S (`upscale.rs`, `af62a99`) ; lecture groupée des textures sur place sur plusieurs threads (`6f07e7b`, portage à la main, `VICTORY_TEXTURE_BATCH=1`) ; staging découpé dans des blocs de 64 Mio (`ranges.rs`, `0781f61`, `VICTORY_STAGING_BLOCKS=1`, repris via [rorodev6/victory](https://github.com/rorodev6/victory)) | +| [Trexies/victory-fork](https://github.com/Trexies/victory-fork) (branche VIwork), repris via [WillyboPeep/victory-all-forks](https://github.com/WillyboPeep/victory-all-forks) (`all-forks`) | GPL-3.0 ou ultérieure (licence du fork, à confirmer par son auteur) | | Copies de rafraîchissement en parallèle sur les machines multicœurs (`9ce6d1c5`, source `8422f48`, auteur spacede) ; `VICTORY_COPY_COMPARE=1` (`ae114b90`, source `7ac7891`, auteur inscrit victory-local, faute d'identité réelle) ; découpe d'une plage non surveillée (`ce0216c4`, source `807a0d0`, auteur inscrit anonymous) | +| [reddxd-byte/ShakiraRED-dt](https://github.com/reddxd-byte/ShakiraRED-dt) (commit `c2271e5`, squash de la branche VIwork de Trexies) | GPL-3.0 ou ultérieure | | Passe du heap à lignes sales (`heap_pass.rs`, `VICTORY_HEAP_PASS_DIRTY=1`, désactivée par défaut) et comparaison de fusion de copies par blocs de 32 octets (`shadow.rs`, `merge_piece`, sans changement de rendu : testée contre la boucle d'octets) | ~~~~ --- **<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Preserve the required source-author trailers for the ports** These rows document code imported from other repositories, but reviewed commit `5dfdf53` contains neither the required `Source:` trailer nor any `Co-authored-by:` trailer crediting the source authors. Its summary table identifies repositories and commits, but does not preserve the author attribution required by `AGENTS.md` rule 10. Retain the required source and author trailers when consolidating these ports; updating `THIRD_PARTY.md` satisfies only the separate sources-table requirement. AGENTS.md reference: [AGENTS.md:L59-L59](https://github.com/LooperSalty/AnyXboxX/blob/0770a070d70eb0de0121ce1bcec7844646cad950/AGENTS.md#L59-L59) Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
LooperSalty commented 2026-11-25 20:39:40 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by LooperSalty on 2026-11-25T20:39:40Z.


Superseded: our VIctory base moves to Neptune (VIctory Edit.) 2026-11-25c in a new PR, which measured ~12.5 fps median in the world in Series X on the maintainer's RTX 4070 SUPER (this branch: ~3.8 fps, still rising, in a short run). Closed at the maintainer's request.

<!-- greyfinch-sync:LooperSalty/AnyXboxX:comment:7173999445 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/234#issuecomment-7173999445). Originally posted by [LooperSalty](https://github.com/LooperSalty) on 2026-11-25T20:39:40Z. --- Superseded: our VIctory base moves to Neptune (VIctory Edit.) 2026-11-25c in a new PR, which measured ~12.5 fps median in the world in Series X on the maintainer's RTX 4070 SUPER (this branch: ~3.8 fps, still rising, in a short run). Closed at the maintainer's request.

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
LooperSalty/AnyXboxX!234
No description provided.