feat: VICTORY_PAGE_WRITES takes its bits as a number (5: host copies under finished reads, no texture slots) #268

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

@⁠Skyfrye on GitHub · 2026-11-25 22:51 UTC · original
Skyfrye:nep/page-writes-bits → main · +42 −8 · 1 files · 1 commits · merged 2026-11-26 14:21 UTC

Draft: the in-game check is pending (the test machine's GPU is in use for a few hours). Everything else below is done.

Change

When a read of the title's (DirectStorage, or a file read) into a plain address finishes, the host copies of buffers that a copy or a pass took while the read was under way keep the bytes from before, until something else marks that memory written. VICTORY_PAGE_WRITES (watch.rs, page_writes) has a bit for this (4: act on finished reads to plain addresses too), but the only way to set it is all, which also sets bit 2 (texture slots under the write made due again), the bit the code notes "flooded the queue in an earlier form". The default (bit 1) acts on page writes only.

In one 5-minute run on an RTX 5080 (Neptune base, launcher settings), 133,144 such reads finished and were only counted ("reads to plain addresses finished (counted only)" on the frame line), while the user saw walls and meshes missing for a while before they appeared, and the texture queue already held 800 to 5,900 textures.

Now any number from 2 to 7 is taken as the bits themselves, and guards+reads names 5 (bits 1 and 4: host copies under page writes and under finished reads are taken again; texture slots left alone). The names (0, 1, slots, all, unset) keep their meanings. The default is unchanged.

Linked issue: none.

Verification

Windows 11 26300, Rust 1.98.1 (MSVC), RTX 5080, on upstream main at e921268, from third_party/victory:

cargo build --locked --release -p victory                              -> Finished, no new warning (the 3 of main)
cargo build --locked --profile diag -p victory --features diagnostics  -> Finished, no new warning
cargo test --locked -p victory-gpu --lib page_writes_tests             -> 1 passed (CPU only)
cargo xtask policy                                                     -> asset policy: 197 files ok

With the numeric forms removed from page_writes_mode and the test kept, the test fails.

Pending: game runs with VICTORY_PAGE_WRITES=5 against the default (diagnostics build with frame captures of the same frames; the frame line's counts of reads finished and blocks opened; frame time), to decide whether 5 should become the launcher's value. I will add the numbers here before marking the PR ready.

Oracle and test data

None involved. Failure case: page_writes_takes_its_names_and_the_bits_as_a_number (every name keeps its value; 5, guards+reads and 6 give their bits; 8 and an unknown word give the default).

Checklist

  • The PR covers a single reviewable behaviour (the switch's bits can be set one by one).
  • A test fails without this change and passes with it.
  • The commands and results of each check are given above (the game run is pending, said above).
  • An unimplemented function returns an error (E_NOTIMPL), never a fake success. (Not concerned.)
  • README: not touched.
  • No game, console or SDK file, no key, no dump, no download link.
  • Findings drawn from a title: the frame-line counts of my own run.
  • Code taken from another project: none.

AI assistance: written with Claude Code (Claude Opus 5.5): the reading of the base, the change, its test, the checks on my machine and this description.

🤖 Generated with Claude Code

**@⁠Skyfrye** on GitHub · 2026-11-25 22:51 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/268) `Skyfrye:nep/page-writes-bits` → `main` · +42 −8 · 1 files · 1 commits · merged 2026-11-26 14:21 UTC **Draft: the in-game check is pending** (the test machine's GPU is in use for a few hours). Everything else below is done. ## Change When a read of the title's (DirectStorage, or a file read) into a plain address finishes, the host copies of buffers that a copy or a pass took while the read was under way keep the bytes from before, until something else marks that memory written. `VICTORY_PAGE_WRITES` (`watch.rs`, `page_writes`) has a bit for this (4: act on finished reads to plain addresses too), but the only way to set it is `all`, which also sets bit 2 (texture slots under the write made due again), the bit the code notes "flooded the queue in an earlier form". The default (bit 1) acts on page writes only. In one 5-minute run on an RTX 5080 (Neptune base, launcher settings), 133,144 such reads finished and were only counted ("reads to plain addresses finished (counted only)" on the frame line), while the user saw walls and meshes missing for a while before they appeared, and the texture queue already held 800 to 5,900 textures. Now any number from 2 to 7 is taken as the bits themselves, and `guards+reads` names `5` (bits 1 and 4: host copies under page writes and under finished reads are taken again; texture slots left alone). The names (`0`, `1`, `slots`, `all`, unset) keep their meanings. The default is unchanged. Linked issue: none. ## Verification Windows 11 26300, Rust 1.98.1 (MSVC), RTX 5080, on upstream `main` at `e921268`, from `third_party/victory`: ``` cargo build --locked --release -p victory -> Finished, no new warning (the 3 of main) cargo build --locked --profile diag -p victory --features diagnostics -> Finished, no new warning cargo test --locked -p victory-gpu --lib page_writes_tests -> 1 passed (CPU only) cargo xtask policy -> asset policy: 197 files ok ``` With the numeric forms removed from `page_writes_mode` and the test kept, the test fails. Pending: game runs with `VICTORY_PAGE_WRITES=5` against the default (diagnostics build with frame captures of the same frames; the frame line's counts of reads finished and blocks opened; frame time), to decide whether 5 should become the launcher's value. I will add the numbers here before marking the PR ready. ## Oracle and test data None involved. Failure case: `page_writes_takes_its_names_and_the_bits_as_a_number` (every name keeps its value; `5`, `guards+reads` and `6` give their bits; `8` and an unknown word give the default). ## Checklist - [x] The PR covers a single reviewable behaviour (the switch's bits can be set one by one). - [x] A test fails without this change and passes with it. - [x] The commands and results of each check are given above (the game run is pending, said above). - [x] An unimplemented function returns an error (`E_NOTIMPL`), never a fake success. (Not concerned.) - [x] README: not touched. - [x] No game, console or SDK file, no key, no dump, no download link. - [x] Findings drawn from a title: the frame-line counts of my own run. - [x] Code taken from another project: none. AI assistance: written with Claude Code (Claude Opus 5.5): the reading of the base, the change, its test, the checks on my machine and this description. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
When a read of the title's (DirectStorage or a file read) into a plain
address finishes, the host copies of buffers that a copy or a pass took
while the read was under way keep the bytes from before until something
else marks the memory written. Bit 4 of VICTORY_PAGE_WRITES acts on those
reads; in the base it can only be had with "all", which also sets bit 2
(texture slots under the write made due again), the bit the code notes
"flooded the queue in an earlier form". In one 5-minute run on an RTX 5080
133,144 such reads finished and were only counted, while walls and meshes
showed late and the texture queue already held 800 to 5,900 textures.

Now any number from 2 to 7 is taken as the bits themselves, and
"guards+reads" names 5 (bits 1 and 4: host copies under page writes and
under finished reads taken again, texture slots left alone). The names and
the meaning of "1" are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:41:13 +00:00
Author
Owner

@⁠LooperSalty on GitHub · 2026-11-26 00:06 UTC · original

Reviewed: this looks good to merge (tests pass, only the 3 known victory-gpu failures from main). Please mark it ready for review when you are happy with it and we will merge it.

**@⁠LooperSalty** on GitHub · 2026-11-26 00:06 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/268#issuecomment-7178411057) Reviewed: this looks good to merge (tests pass, only the 3 known victory-gpu failures from main). Please mark it ready for review when you are happy with it and we will merge it.
Author
Owner

@⁠KainanP on GitHub · 2026-11-26 10:32 UTC · original

Test report for #268 on three adapters.

Merges cleanly onto current main. Setup: current origin/main (c4c93bd) merged with this PR, Windows 11, cargo test --locked in third_party/victory. Adapters: RTX 4060 Laptop (DXGI 0), Intel UHD 8086:a78b (16-lane waves, no FP64), WARP. The hardware adapter is picked by name through a local, uncommitted test hook and confirmed in its log; WARP for victory-gpu is --features diagnostics + VICTORY_D3D12_WARP=1. victory-gpu runs with --test-threads=1.

victory-gpu --lib main main + #268
RTX 4060 Laptop 183 passed, main's 3 failed 184 passed, main's 3 failed
Intel UHD 183 passed, main's 3 failed 184 passed, main's 3 failed
WARP 196 passed, main's 3 failed 197 passed, main's 3 failed

"main's 3" = descriptor::host::tests::spans_say_the_next_start_and_the_lowest_level_viewed, indirect::tests::warp_card_fetch_copies_flagged_pieces_to_their_slots, indirect::tests::warp_card_patch_writes_the_masked_bytes_and_no_others. They fail on all three adapters on main too. page_writes_tests passes everywhere. No new failure.

Notes from reading the diff:

  • "1" means bits 1+2 (3), while "2".."7" are raw bits. So VICTORY_PAGE_WRITES=1 and =3 are the same, and bit 1 alone has no number (only unset/guards). It is easy to trip on. Worth one line in the doc comment, or in the docs table if the switch is listed there.
  • 4 and 6 are accepted. In title_memory_written, bit 4 only lets finished reads past the mode & 4 gate. With 4 alone, open (bit 1) never runs, so whatever 4 does depends on what descriptor::host::page_written does with bit 2 off. If that is nothing, 4 is a no-op that looks like a setting, and refusing it, or documenting it, would avoid confusion.

AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this.

**@⁠KainanP** on GitHub · 2026-11-26 10:32 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/268#issuecomment-7189498341) Test report for #268 on three adapters. Merges cleanly onto current main. Setup: current `origin/main` (c4c93bd) merged with this PR, Windows 11, `cargo test --locked` in `third_party/victory`. Adapters: RTX 4060 Laptop (DXGI 0), Intel UHD 8086:a78b (16-lane waves, no FP64), WARP. The hardware adapter is picked by name through a local, uncommitted test hook and confirmed in its log; WARP for victory-gpu is `--features diagnostics` + `VICTORY_D3D12_WARP=1`. victory-gpu runs with `--test-threads=1`. | `victory-gpu --lib` | main | main + #268 | |---|---|---| | RTX 4060 Laptop | 183 passed, main's 3 failed | 184 passed, main's 3 failed | | Intel UHD | 183 passed, main's 3 failed | 184 passed, main's 3 failed | | WARP | 196 passed, main's 3 failed | 197 passed, main's 3 failed | "main's 3" = `descriptor::host::tests::spans_say_the_next_start_and_the_lowest_level_viewed`, `indirect::tests::warp_card_fetch_copies_flagged_pieces_to_their_slots`, `indirect::tests::warp_card_patch_writes_the_masked_bytes_and_no_others`. They fail on all three adapters on main too. `page_writes_tests` passes everywhere. No new failure. Notes from reading the diff: - `"1"` means bits 1+2 (3), while `"2"`..`"7"` are raw bits. So `VICTORY_PAGE_WRITES=1` and `=3` are the same, and bit 1 alone has no number (only unset/`guards`). It is easy to trip on. Worth one line in the doc comment, or in the docs table if the switch is listed there. - `4` and `6` are accepted. In `title_memory_written`, bit 4 only lets finished reads past the `mode & 4` gate. With `4` alone, `open` (bit 1) never runs, so whatever `4` does depends on what `descriptor::host::page_written` does with bit 2 off. If that is nothing, `4` is a no-op that looks like a setting, and refusing it, or documenting it, would avoid confusion. _AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this._
github manually merged commit c5d92873f3 into main 2026-11-26 14:23:03 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.