feat: VIctory in the repository as our own code, with 57 Proton and AMD commits (measured on Linux at ~3.7 fps) #199

Manually merged
github merged 69 commits from gh-pr/199/head into gh-pr/199/base 2026-11-26 05:36:51 +00:00
Owner

@⁠Exorion1er on GitHub · 2026-11-25 05:28 UTC · original
Exorion1er:feat/victory-linux-amd → main · +123759 −97 · 203 files · 69 commits · merged 2026-11-25 14:51 UTC

Summary

  • No more submodule, and no upstream. third_party/victory becomes a copy of VIctory inside this repository, and from now on it is our code: nothing is synced or pinned, and it still builds if every repository it came from is taken down. Commit f7b60f8 imports the tree of LooperSalty/victory at the pinned commit 80d58f8 (anyxboxx/fork-7b0-lot9-murs), unchanged (same Git tree). 57 commits for Proton and AMD cards follow. The final tree of third_party/victory is identical to 890a83a, the commit built and measured on Linux.
  • How code from elsewhere comes in (new rule 10 in AGENTS.md, new section in CONTRIBUTING.md): a change taken from another repository is committed by us (cherry-pick with -Xsubtree=third_party/<project>, or a port by hand), and its message ends with Source: <repository> <PR or commit> and Co-authored-by: Name <email>. The 15 commits in this PR written by someone else (12 by myokex, one each by fxceless, oddiums and Joshua Odom) follow that rule. No submodules or pinned forks for new sources.
  • THIRD_PARTY.md: the four VIctory rows become one table row plus a "Sources de third_party/victory" table, one row per source repository (what was in the initial copy, what came after). The anyxboxx/stable and anyxboxx/essai rows are removed: none of their commits is in the copy (anyxboxx/stable is not an ancestor of 80d58f8, and none of its 38 commits matches by patch-id).
  • BCPack tables: admitted. The copy brings crates/victory-formats/src/bcpack-tables.bin (about 78 KiB). The maintainer admitted it as an exception on 2026-11-25; the register row of THIRD_PARTY.md says so (a489301).
  • This PR is stacked on #207 (issues, pull requests and commit messages in English). Its commit shows in this diff until #207 is merged.

Changes since the reviewed head 6e5d7d7

The branch was rebuilt: rebased on main (198cf0b, with #204 and #206), commit messages in English, the 15 commits above re-authored with Source: and Co-authored-by:, plus these answers to the review:

  1. -BatchCardRehash restored (8c93075): b06ff90 re-applied as is, option and test. Against main, tools/lancer_victory.ps1 now differs only by the messages about the copy.
  2. Last submodule mentions removed: README.md line 10 and the intro sentence (9 languages), the "Updating an existing copy" paragraph of both guides, docs/research/victory-xcl-fivestar.md (en, fr), and the tools/sync_voisins.py comments. The guides and READMEs no longer speak of a pinned branch or of upstream (01c9999).
  3. Asset policy in CI (c8d7990): a new job, politique VIctory, in .github/workflows/tests.yml runs cargo xtask policy in third_party/victory (locally: "asset policy: 181 files ok").
  4. BCPack: admitted by you on 2026-11-25; register row updated in a489301.
  5. AGENTS.md: rule 8 exempts third_party/ from the 400-line rule and from ruff; the policy command is documented next to the lint command.

Updating an existing clone

A clone that still has the submodule must remove it before pulling, or the checkout stops (tried on a clone): git submodule deinit -f third_party/victory, delete third_party/victory and .git/modules/third_party/victory, then git pull. target/ goes with it, so the first build starts from scratch. The shader cache key changes, so a -Precompile cache is rebuilt.

Large diff: the import adds the whole VIctory source (about 4.5 MB). To review only the change against the previous pin, read the 63 commits after f7b60f8, or git diff f7b60f8 HEAD -- third_party/victory.

What the 57 commits bring (grouped; each commit names its source and author)

  • Proton (Wine): the runtime's internal HLSL compiles with Wine's d3dcompiler (fork #127, BitWuehler); pipeline library under vkd3d-proton (Marvisak/VIctory #1722, Impre-visible); far fewer GetWriteWatch, VirtualQuery and VirtualProtect calls per frame; guards held open over the runtime's kernel writes, and no deadlock under the guards' lock; raw DirectStorage and fread reads copied in from a buffer (Joshua Odom, JoshuuDev/victory-amd).
  • AMD: ballots and reductions per half wave for wave32 pixel programs on a 64-lane host (PastiiJay, klbf-lab); view indices clamped on 2^21 heaps (fork #134 triippywhale, #98 sillynocodecat); 64-bit integer compares (fork #135, alexdeliu).
  • Shaders: v_cvt_f32_f64 and v_add_f64 sums (fork #9, MartinIndra02), v_permlane16/x16_b32 (fork #134), 9-bit primitive indices (VIctory #1718, tjthebigbearcat-hub), v_interp_p2_f16 (VIctory #1696, Calvix2k), interpolation as declared by PSV0 (fork #150, wildheathen), NaN guard (PastiiJay), shader clean-up passes (fxceless, 1684989).
  • Views and textures: the texture guard sees every view of a page (fork #115, Spexivus, with joroyt's correction); heap records and buffer views made at submission (port of Marvisak's 86a5ed6); placed UAVs (fork #114, Kaivyyy); late waits (fork #191 gdawid9407, #206 AscilCH, #141 adritoyalser); a budget for view copies; and twelve commits by myokex (myokex/victory-amd): placed texture views by mip, lost views put back in the queue, dispatches of more than 65,535 groups, 64 KiB CBVs, texture queue, DirectStorage page arrays, pipeline waits while loading, early pipeline list.
  • Diagnostics and tests: per-frame counters, A/B switches, VICTORY_NULL_MAGENTA, mesh shader pipeline test (fork #14, oddiums).

Switches: most new behaviours are on by default (0 turns them off: VICTORY_SHADER_OPT, VICTORY_PS_HALVES and VICTORY_L6_HEAP_CLAMP only on the hosts they apply to, VICTORY_L6_*, VICTORY_L7_*, VICTORY_L9_DSTORAGE_GUARDS, VICTORY_L9_GUARD_TITLE_VIEWS, VICTORY_TEXTURE_SWEEP, VICTORY_TEXTURE_GATE_S=60, VICTORY_PIPELINE_GATE_S=120). Off by default: VICTORY_L9_ALIAS_UNCLEAN, VICTORY_HEAP_RECHECK (face geometry lost and black skin in Linux runs 28 and 30, observed), VICTORY_L7_SKIP/ROLES/UNLIT, VICTORY_NULL_MAGENTA, VICTORY_RT_RESOLVE. Full table in the guide.

Measurements (Linux only)

Fedora 44, RX 9070 XT 16 GB, RADV through vkd3d-proton, GE-Proton11-12 with a community "view-tree" wineserver patch; victory.exe built from 890a83a (same third_party/victory tree as this PR); VIctory log of run 31 (25 Nov, 06:09 to 06:32, about 23 min); shader cache warmed with victory translate --cache (25,985 containers, 25,699 translated, 286 refused, 125 s).

  • Median world frame: 266 ms, about 3.7 fps. Measured.
  • No crash, no device loss, no DirectStorage failure, 0 ERROR lines in the log. Measured.
  • Faces, skin and geometry complete, textures stable. Observed.
  • Indoor and shadowed areas are black: ray tracing does not run. Observed.
  • Before: batch 6 on stock Proton, 685 ms median frame; with the wineserver patch and the write-watch cuts, run 14: 274 ms. Measured.
  • Linux settings of that run (in the guide, not in the launcher): VICTORY_LATE_WAIT=0, VICTORY_WIDE_BACK=0 (with late waits the device is lost on RADV, fork issue #184), VICTORY_SHADER_LOOP_LIMIT=256, VICTORY_PIPELINE_WAIT_MS=50, VICTORY_TEXTURE_BUDGET_MB=8192, VICTORY_TEXTURE_NO_WAIT=1, VICTORY_CARD_BUFFERS_MIN_MB=1, VICTORY_CARD_BUFFERS_MB=1024, VKD3D_CONFIG=descriptor_heap, VICTORY_SKIP_PIPELINES (9 hashes), VICTORY_L7_SKIP=rt,gi,reflections with a role table built locally from my own copy (outside the repository).

Limits

  • No ray tracing (out of scope for this PR).
  • Windows not tested with these 57 commits. Most new behaviours are on by default on every host, and the launcher keeps VICTORY_LATE_WAIT=3 and VICTORY_WIDE_BACK=1, paths I have not run. A run on your RTX 4070 Super before merging would help; if something regresses, the A/B switches above (0 turns off) narrow it down.
  • The Windows target builds (cross-compiled), but the GPU tests ran under Proton, not Windows.
  • The rebuild since 6e5d7d7 changed no Rust source, so the Linux measurements still apply; the launcher and docs changes were not run in game.

Tests

  • python -m ruff check --select W605,F,E9 PrototypeScarlett tests tools: All checks passed.
  • python -m pytest -q (Linux, Python 3.12.13): 578 passed, 232 skipped, 1 failed: tests/test_jour_j.py::test_missing_executable_is_reported, which fails the same way on main under Linux; unrelated.
  • cargo xtask policy in third_party/victory: "asset policy: 181 files ok".
  • Copy: the final tree of third_party/victory is identical to 890a83a (same tree hash), before and after the rebuild.
  • Updating an existing clone tried on a clone: the checkout stops as described, and passes with the steps above.
  • VIctory side, at 890a83a: cargo check --profile diag -p victory --features diagnostics (Windows target) on each of the 57 commits, 0 errors; Windows diag build without warnings; cargo test -p victory-shader --lib (Linux) 176 passed, 2 ignored; victory-gpu tests (Windows target, under GE-Proton11-12, RADV) 158 passed, 2 ignored. The Windows GPU tests of victory-shader do not compile, already the case at 80d58f8.
  • In-game run on Linux (see measurements).
  • Windows run by the maintainer.
  • CI.

Credits

In THIRD_PARTY.md, per source repository: Joshua Odom (JoshuuDev), myokex, fxceless, oddiums (commits taken, with Co-authored-by); BitWuehler, MartinIndra02, triippywhale, Spexivus, joroyt, adritoyalser, alexdeliu, gdawid9407, AscilCH, Kaivyyy, sillynocodecat, wildheathen (fork pull requests, ported); Impre-visible, tjthebigbearcat-hub, Calvix2k, Marvisak (VIctory); PastiiJay (KLBF, klbf-lab); Exorion (the rest).

AI assistance: the VIctory branch assembled and copied into the repository, the porting commits, this PR and its translations were written with Claude Code (Claude Opus 5.5); the in-game runs and observations are mine.

🤖 Generated with Claude Code

**@⁠Exorion1er** on GitHub · 2026-11-25 05:28 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/199) `Exorion1er:feat/victory-linux-amd` → `main` · +123759 −97 · 203 files · 69 commits · merged 2026-11-25 14:51 UTC ## Summary - **No more submodule, and no upstream.** `third_party/victory` becomes a copy of VIctory inside this repository, and from now on it is our code: nothing is synced or pinned, and it still builds if every repository it came from is taken down. Commit `f7b60f8` imports the tree of `LooperSalty/victory` at the pinned commit `80d58f8` (`anyxboxx/fork-7b0-lot9-murs`), unchanged (same Git tree). 57 commits for Proton and AMD cards follow. The final tree of `third_party/victory` is identical to `890a83a`, the commit built and measured on Linux. - **How code from elsewhere comes in** (new rule 10 in `AGENTS.md`, new section in `CONTRIBUTING.md`): a change taken from another repository is committed by us (cherry-pick with `-Xsubtree=third_party/<project>`, or a port by hand), and its message ends with `Source: <repository> <PR or commit>` and `Co-authored-by: Name <email>`. The 15 commits in this PR written by someone else (12 by myokex, one each by fxceless, oddiums and Joshua Odom) follow that rule. No submodules or pinned forks for new sources. - **`THIRD_PARTY.md`**: the four VIctory rows become one table row plus a "Sources de `third_party/victory`" table, one row per source repository (what was in the initial copy, what came after). The `anyxboxx/stable` and `anyxboxx/essai` rows are removed: none of their commits is in the copy (`anyxboxx/stable` is not an ancestor of `80d58f8`, and none of its 38 commits matches by patch-id). - **BCPack tables: admitted.** The copy brings `crates/victory-formats/src/bcpack-tables.bin` (about 78 KiB). The maintainer admitted it as an exception on 2026-11-25; the register row of `THIRD_PARTY.md` says so (`a489301`). - **This PR is stacked on #207** (issues, pull requests and commit messages in English). Its commit shows in this diff until #207 is merged. ## Changes since the reviewed head `6e5d7d7` The branch was rebuilt: rebased on `main` (`198cf0b`, with #204 and #206), commit messages in English, the 15 commits above re-authored with `Source:` and `Co-authored-by:`, plus these answers to the review: 1. **`-BatchCardRehash` restored** (`8c93075`): `b06ff90` re-applied as is, option and test. Against `main`, `tools/lancer_victory.ps1` now differs only by the messages about the copy. 2. **Last submodule mentions removed**: `README.md` line 10 and the intro sentence (9 languages), the "Updating an existing copy" paragraph of both guides, `docs/research/victory-xcl-fivestar.md` (en, fr), and the `tools/sync_voisins.py` comments. The guides and READMEs no longer speak of a pinned branch or of upstream (`01c9999`). 3. **Asset policy in CI** (`c8d7990`): a new job, `politique VIctory`, in `.github/workflows/tests.yml` runs `cargo xtask policy` in `third_party/victory` (locally: "asset policy: 181 files ok"). 4. **BCPack**: admitted by you on 2026-11-25; register row updated in `a489301`. 5. **`AGENTS.md`**: rule 8 exempts `third_party/` from the 400-line rule and from ruff; the policy command is documented next to the lint command. ## Updating an existing clone A clone that still has the submodule must remove it before pulling, or the checkout stops (tried on a clone): `git submodule deinit -f third_party/victory`, delete `third_party/victory` and `.git/modules/third_party/victory`, then `git pull`. `target/` goes with it, so the first build starts from scratch. The shader cache key changes, so a `-Precompile` cache is rebuilt. Large diff: the import adds the whole VIctory source (about 4.5 MB). To review only the change against the previous pin, read the 63 commits after `f7b60f8`, or `git diff f7b60f8 HEAD -- third_party/victory`. ## What the 57 commits bring (grouped; each commit names its source and author) - **Proton (Wine)**: the runtime's internal HLSL compiles with Wine's d3dcompiler (fork #127, BitWuehler); pipeline library under vkd3d-proton (Marvisak/VIctory #1722, Impre-visible); far fewer `GetWriteWatch`, `VirtualQuery` and `VirtualProtect` calls per frame; guards held open over the runtime's kernel writes, and no deadlock under the guards' lock; raw DirectStorage and `fread` reads copied in from a buffer (Joshua Odom, JoshuuDev/victory-amd). - **AMD**: ballots and reductions per half wave for wave32 pixel programs on a 64-lane host (PastiiJay, klbf-lab); view indices clamped on 2^21 heaps (fork #134 triippywhale, #98 sillynocodecat); 64-bit integer compares (fork #135, alexdeliu). - **Shaders**: `v_cvt_f32_f64` and `v_add_f64` sums (fork #9, MartinIndra02), `v_permlane16/x16_b32` (fork #134), 9-bit primitive indices (VIctory #1718, tjthebigbearcat-hub), `v_interp_p2_f16` (VIctory #1696, Calvix2k), interpolation as declared by PSV0 (fork #150, wildheathen), NaN guard (PastiiJay), shader clean-up passes (fxceless, `1684989`). - **Views and textures**: the texture guard sees every view of a page (fork #115, Spexivus, with joroyt's correction); heap records and buffer views made at submission (port of Marvisak's `86a5ed6`); placed UAVs (fork #114, Kaivyyy); late waits (fork #191 gdawid9407, #206 AscilCH, #141 adritoyalser); a budget for view copies; and twelve commits by myokex (myokex/victory-amd): placed texture views by mip, lost views put back in the queue, dispatches of more than 65,535 groups, 64 KiB CBVs, texture queue, DirectStorage page arrays, pipeline waits while loading, early pipeline list. - **Diagnostics and tests**: per-frame counters, A/B switches, `VICTORY_NULL_MAGENTA`, mesh shader pipeline test (fork #14, oddiums). Switches: most new behaviours are **on by default** (`0` turns them off: `VICTORY_SHADER_OPT`, `VICTORY_PS_HALVES` and `VICTORY_L6_HEAP_CLAMP` only on the hosts they apply to, `VICTORY_L6_*`, `VICTORY_L7_*`, `VICTORY_L9_DSTORAGE_GUARDS`, `VICTORY_L9_GUARD_TITLE_VIEWS`, `VICTORY_TEXTURE_SWEEP`, `VICTORY_TEXTURE_GATE_S=60`, `VICTORY_PIPELINE_GATE_S=120`). Off by default: `VICTORY_L9_ALIAS_UNCLEAN`, `VICTORY_HEAP_RECHECK` (face geometry lost and black skin in Linux runs 28 and 30, observed), `VICTORY_L7_SKIP`/`ROLES`/`UNLIT`, `VICTORY_NULL_MAGENTA`, `VICTORY_RT_RESOLVE`. Full table in the guide. ## Measurements (Linux only) Fedora 44, RX 9070 XT 16 GB, RADV through vkd3d-proton, GE-Proton11-12 with a community "view-tree" wineserver patch; `victory.exe` built from `890a83a` (same `third_party/victory` tree as this PR); VIctory log of run 31 (25 Nov, 06:09 to 06:32, about 23 min); shader cache warmed with `victory translate --cache` (25,985 containers, 25,699 translated, 286 refused, 125 s). - Median world frame: 266 ms, about 3.7 fps. **Measured.** - No crash, no device loss, no DirectStorage failure, 0 `ERROR` lines in the log. **Measured.** - Faces, skin and geometry complete, textures stable. **Observed.** - Indoor and shadowed areas are black: ray tracing does not run. **Observed.** - Before: batch 6 on stock Proton, 685 ms median frame; with the wineserver patch and the write-watch cuts, run 14: 274 ms. **Measured.** - Linux settings of that run (in the guide, not in the launcher): `VICTORY_LATE_WAIT=0`, `VICTORY_WIDE_BACK=0` (with late waits the device is lost on RADV, fork issue #184), `VICTORY_SHADER_LOOP_LIMIT=256`, `VICTORY_PIPELINE_WAIT_MS=50`, `VICTORY_TEXTURE_BUDGET_MB=8192`, `VICTORY_TEXTURE_NO_WAIT=1`, `VICTORY_CARD_BUFFERS_MIN_MB=1`, `VICTORY_CARD_BUFFERS_MB=1024`, `VKD3D_CONFIG=descriptor_heap`, `VICTORY_SKIP_PIPELINES` (9 hashes), `VICTORY_L7_SKIP=rt,gi,reflections` with a role table built locally from my own copy (outside the repository). ## Limits - No ray tracing (out of scope for this PR). - **Windows not tested with these 57 commits.** Most new behaviours are on by default on every host, and the launcher keeps `VICTORY_LATE_WAIT=3` and `VICTORY_WIDE_BACK=1`, paths I have not run. A run on your RTX 4070 Super before merging would help; if something regresses, the A/B switches above (`0` turns off) narrow it down. - The Windows target builds (cross-compiled), but the GPU tests ran under Proton, not Windows. - The rebuild since `6e5d7d7` changed no Rust source, so the Linux measurements still apply; the launcher and docs changes were not run in game. ## Tests - [x] `python -m ruff check --select W605,F,E9 PrototypeScarlett tests tools`: All checks passed. - [x] `python -m pytest -q` (Linux, Python 3.12.13): 578 passed, 232 skipped, 1 failed: `tests/test_jour_j.py::test_missing_executable_is_reported`, which fails the same way on `main` under Linux; unrelated. - [x] `cargo xtask policy` in `third_party/victory`: "asset policy: 181 files ok". - [x] Copy: the final tree of `third_party/victory` is identical to `890a83a` (same tree hash), before and after the rebuild. - [x] Updating an existing clone tried on a clone: the checkout stops as described, and passes with the steps above. - [x] VIctory side, at `890a83a`: `cargo check --profile diag -p victory --features diagnostics` (Windows target) on each of the 57 commits, 0 errors; Windows diag build without warnings; `cargo test -p victory-shader --lib` (Linux) 176 passed, 2 ignored; `victory-gpu` tests (Windows target, under GE-Proton11-12, RADV) 158 passed, 2 ignored. The Windows GPU tests of `victory-shader` do not compile, already the case at `80d58f8`. - [x] In-game run on Linux (see measurements). - [ ] Windows run by the maintainer. - [ ] CI. ## Credits In `THIRD_PARTY.md`, per source repository: Joshua Odom (JoshuuDev), myokex, fxceless, oddiums (commits taken, with `Co-authored-by`); BitWuehler, MartinIndra02, triippywhale, Spexivus, joroyt, adritoyalser, alexdeliu, gdawid9407, AscilCH, Kaivyyy, sillynocodecat, wildheathen (fork pull requests, ported); Impre-visible, tjthebigbearcat-hub, Calvix2k, Marvisak (VIctory); PastiiJay (KLBF, klbf-lab); Exorion (the rest). AI assistance: the VIctory branch assembled and copied into the repository, the porting commits, this PR and its translations were written with Claude Code (Claude Opus 5.5); the in-game runs and observations are mine. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Copy of the tree of LooperSalty/victory, branch anyxboxx/fork-7b0-lot9-murs,
commit 80d58f8fe2769d6c857eb27abc159b6cf64530a3 (the commit the submodule
pinned), unchanged: same Git tree (7e318dc). VIctory is GPL-3.0-or-later; its
authors stay credited in THIRD_PARTY.md.

The following commits add the 57 commits of the anyxboxx/linux-amd branch on
top. Those written by someone else end with Source: and Co-authored-by: lines.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Under Wine/Proton the runtime's own HLSL (argument clamp, card compare, the
depth plane's twin) did not compile: Wine's d3dcompiler takes no
[RootSignature] attribute and no ByteAddressBuffer. The shaders now use
StructuredBuffer<uint> and the root signatures are built in Rust, so no
external DXC is needed. The pin's parallel card-compare shader and its
dispatch helper are kept, ported to the same form.

From fxceless/victory-fork #127 by BitWuehler (cc79860a). Removes the
"no pipeline to draw a depth plane from its twin" and card-compare
failures seen under Proton (AnyXboxX lot 5, kept since; runs 14/25).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Some title programs convert doubles to floats and sum doubles over the
wave: they did not translate ("v_cvt_f32_f64 is not supported", twice in
AnyXboxX run 8). v_cvt_f32_f64 is lowered on the dword pair, v_add_f64
whole-wave sums and s_mov_b32 copies are modelled, and makeDouble.f64 is
declared with the DOUBLES shader flag.

From fxceless/victory-fork #9 by MartinIndra02 (342245e1, b17b69fd,
61e5f79a).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The console's tree of v_add_f16 over DPP and permlanes was refused in a
block some lanes skip ("a wave sum of 16-bit floats where not every lane
runs"). On one 64-lane host wave the running lanes' sum is now taken in
f32 by WaveActiveSum and rounded once to 16 bits (an ulp or so off). Two
host waves of 32 still refuse it. Targets compute b22a16a178976e1b (14-28
dispatches a frame dropped in the world).

Our own leonida/render commit 024f3214, by Exorion.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Present in AnyXboxX runs 4, 6 and 8 ("v_permlanex16_b32 is not
supported"). Each lane reads src0 of the lane its nibble of {src2, src1}
picks, in its own row of 16 or the other row of its half, through
WaveReadLaneAt. The pick stays inside a 32-lane half, so two host waves
of 32 need no exchange.

The shader part of fxceless/victory-fork #134 by triippywhale (8698a80d):
the lowering arm and its test. Its v_cvt_f32_f64 is not taken (#9's is),
its view heap clamp comes later as VICTORY_L6_HEAP_CLAMP.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title shows one physical page at several addresses, and DirectStorage
writes page destinations through a view of the runtime's own. A host copy
guarded at one address kept stale bytes when the page was written through
another: meshes and textures streamed in were drawn from old data for the
rest of a launch. The runtime now indexes the views of each 64 KiB page,
guards (and opens) all of them together, re-checks a guard when a new view
of its pages is mapped, and reports the runtime's own physical-page writes
(xmem write_physical, DirectStorage page windows) at every view.

From fxceless/victory-fork #115 by Spexivus. Kept beside
VICTORY_DSTORAGE_NOTIFY (562cf334), which stays an opt-in experiment:
this notification is always on and goes through the GPU side's own view
index. AnyXboxX geo lot; in every run since (14, 25).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
vkd3d-proton refuses CreatePipelineLibrary with a non-null blob of length
0 (an empty Rust slice has a dangling pointer), so under Proton no
library was ever made and nothing was kept between launches. The empty
library is now asked for with a null blob (VICTORY_L6_NULL_LIBRARY, on
unless 0). Separately, when there is still no library, the early pipeline
list is saved anyway: without it every launch made all its pipelines on
first use and the world's first frames dropped thousands of draws as
"being made", different ones on each start.

Null blob: port of Marvisak/VIctory #1722 by Impre-visible. Early list
without a library: ours (AnyXboxX geo lot 02). In every run since lot 6.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With VICTORY_LATE_WAIT a texture's staging buffer could be written again
while the GPU still copied from it, so the texture got the next upload's
bytes. The upload now waits for the copy that reads the staging buffer
before it reuses it. Harmless with LATE_WAIT=0 (our launcher's setting),
where every upload already waits.

From fxceless/victory-fork #141 by adritoyalser (AnyXboxX geo lot 03).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The console packs edge flags above the 9-bit vertex indices of a mesh
primitive. Read whole, an index past the primitive's vertices made
triangles go to the wrong vertices or vanish ("squares" and holes in
streamed geometry).

Port of Marvisak/VIctory #1718 by tjthebigbearcat-hub, adapted to this
base (AnyXboxX geo lot 04).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
v_interp_p2_f16 ignored op_sel (which half of the destination it writes),
omod and clamp, so half-precision pixel inputs packed two to a register
overwrote each other: skin and eyes shaded wrong.

Port of Marvisak/VIctory #1696 by Calvix2k (AnyXboxX skin lot 02).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
RADV runs pixel shaders in waves of 64, the console's pixel programs are
wave32. Ballots and wave reductions then mixed two console waves: per-
lane decisions (skin, eyes, foliage) came out wrong on AMD. On such a host
pixel and vertex programs now compute ballots and reductions per 32-lane
half (the host's pixel wave is read from the card). VICTORY_PS_HALVES=0
turns it off; it and VICTORY_HOST_WAVE are part of the shader cache key.
The half split goes through a wave_reduce helper that keeps the pin's
signed flag on f32 prefix sums (ffc0e3d0).

From PastiiJay/klbf-lab klbf-amd by PastiiJay (a39bae7d, 0bc76cbe,
1d333f05; AnyXboxX skin lot 01).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
AMD orders a 64-bit integer compare whose operands share a dword wrong.
v_cmp_*_u64/i64 are now lowered as a compare of the high dwords, and of
the low dwords when those are equal.

From fxceless/victory-fork #135 by alexdeliu (AnyXboxX skin lot 03).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A module (crate::l6) for the missing-geometry work that follows: each of
its behaviour changes is on by default and VICTORY_L6_<NAME>=0 turns one
off, so one build can be bisected by environment, and the switches are
logged once. A per-frame log line counts the host view slots left null
(address 0, off an element, ...), which is how the missing geometry was
traced to the view heap.

Ours (AnyXboxX lot 6, patches-l6-geo 01).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title copies descriptor records into its shader-visible heaps with
plain memory copies, not through a call the runtime sees. Those slots
kept their old host descriptor until the next full pass over the heap, so
draws read null or stale views: missing geometry. Each submission now
mirrors the records copied since the last (VICTORY_L6_HEAP_SYNC, on
unless 0).

Port of the heap-record half of Marvisak/VIctory 86a5ed6b by Marvis
(AnyXboxX lot 6, patches-l6-geo 02).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A buffer view the title writes into the view heap got its host slot (and
its bytes) at the next frame's pass over the heap, so draws of the same
frame read a null slot. Such views are now made at the submission that
follows them (VICTORY_L6_SUBMIT_SLOTS, on unless 0).

Ours (AnyXboxX lot 6, patches-l6-geo 03).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A buffer view that cannot start where its bytes lie in its buffer's host
copy (off an element, a raw view not on 16 bytes, a constant buffer not
on 256) was left null: the draws that read it lost their geometry. Such a
view is now made over a copy of its own bytes, refreshed when they change
(VICTORY_L6_VIEW_COPY, on unless 0).

Port of the view half of Marvisak/VIctory 86a5ed6b by Marvis (AnyXboxX
lot 6, patches-l6-geo 04).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With flights in the air (VICTORY_LATE_WAIT, VICTORY_RELAY), a submission
that refreshes a host copy over memory a flight writes through another
copy, a texture read-back or a bottom-of-pipe write now waits for that
flight first (VICTORY_L6_LATE_ALIAS): the refresh took the bytes from
before the flight's writes, skinned vertices from an earlier frame or
zeros. A refresh of a range a flight may write also takes the pages the
copy never took (VICTORY_L6_LATE_UNCOPIED): they stayed zeros. Both only
act under late waits; our launcher runs LATE_WAIT=0, where they are
idle, and they are kept for runs that turn late waits on.

From fxceless/victory-fork #191 by gdawid9407 and #206 by AscilCH
(AnyXboxX lot 6, patches-l6-geo 05).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Unordered views of textures the title placed in memory itself (a 3D
volume in the world) were left out ("placed unordered texture view not
mirrored"), so compute passes writing them did nothing. They are now
mirrored onto host unordered-access textures, and shader views placed at
the same address read from them (VICTORY_L6_PLACED_UAV, on unless 0).

From fxceless/victory-fork #114 by Kaivyyy (AnyXboxX lot 6,
patches-l6-amd 01).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Only a capped host (NVIDIA) clamped view indices. On AMD an index past
the heap's end read past it: page faults on RDNA3/RDNA4 under Windows,
and whatever descriptor memory follows under vkd3d-proton. Where the
host takes a view heap of 2^21, every view heap is now that size and
shaders clamp view indices to its last, null slot
(VICTORY_L6_HEAP_CLAMP, on unless 0; part of the shader cache key).
Offline warm-up gets the same limit through prepare_host's probe.

The heap half of fxceless/victory-fork #134 by triippywhale and #98 by
sillynocodecat, sized as upstream's HEAP_VIEWS (AnyXboxX lot 6,
patches-l6-amd 02).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A NaN or infinity written to a colour target or a typed UAV spreads
through later passes on AMD (purple/magenta blocks, black screens after
bloom). Colour exports and typed stores now write NaN as 0 and clamp
infinities to 65504 (VICTORY_L6_NAN_GUARD, on unless 0; part of the
shader cache key).

From PastiiJay/klbf-lab klbf-amd by PastiiJay (0e5f4b2a, then 33feddd1;
AnyXboxX lot 6, patches-l6-amd 03).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every pixel input was interpolated perspective-correct. The console's
PSV0 part declares flat, linear (no perspective) and centroid inputs;
read as perspective-correct, they shaded wrong (bands and smeared
values on flat-shaded and screen-space inputs). The translator now takes
each input's mode from PSV0 (VICTORY_L6_PSV_INTERP, on unless 0; part of
the shader cache key).

From fxceless/victory-fork #150 by wildheathen (AnyXboxX lot 6,
patches-l6-amd 05).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
For bisecting the dark world: VICTORY_L6_PLANE_PASS=0 puts back the
depth plane pass as it was before the Wine HLSL fix (pipeline refused,
planes left as they were), and the A/B switches in effect are logged
once. `victory shader-info` takes VICTORY_SHADER_ONLY=<hash prefix>,...
(the hashes a run's log names) and writes those containers to
VICTORY_SHADER_OUT; `translate` takes VICTORY_HOST_PIXEL_WAVE for pixel
programs as on a 64-lane host.

Ours (AnyXboxX lot 6, patches-l6-dark 01 and 03).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GPU tests for the 16-, 32- and 64-bit whole-wave sums the f16 wave sum
and #9 lower, in a branch some lanes skip, on a host of 64-lane waves.
The WARP harness takes VICTORY_TEST_HW=1 to run on the first hardware
adapter instead (under Proton there is no WARP: the card behind
vkd3d-proton), which is how they were checked on RADV.

Ours (AnyXboxX lot 6, patches-l6-dark 02).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The dynamic slots (tables made afresh for each draw) were 2^18 of them.
In the world a frame needs more, so tables wrapped onto slots still in
flight and geometry and textures came and went. On a host that takes view
heaps of 2^21 the dynamic slots are now every slot between the title's
and the null slot at the end, about 852k (VICTORY_L7_DYNAMIC_SLOTS, on
unless 0). Adds crate::l7, the lot 7 switches (VICTORY_L7_<NAME>=0 turns
one off) and their per-frame counts.

Ours (AnyXboxX lot 7, patches-l7-stab 01). Runs 14/25.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The pass over the heap's buffer views also made the title's constant
buffer views, though shaders that pick buffers by index read none (those
go through tables made afresh): wasted slots and copies every frame. CB
views are now left out of that pass, and a CB view's bytes are brought
up to date by the draws that read its slot (VICTORY_L7_CB_SLOTS, on
unless 0).

Ours (AnyXboxX lot 7, patches-l7-stab 02). Runs 14/25.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
VICTORY_L6_VIEW_COPY made a committed buffer per view and never let one
go; a frame past the old fixed cap left 1,400-3,600 views null (run 11).
The copies are now kept within a budget (VICTORY_L7_VIEW_COPY_MB, 512 by
default), the least recently used that no slot or list holds let go
first (VICTORY_L7_VIEW_COPY_LRU, on unless 0). Each copy is counted at
what it really takes, a 64 KiB placement, and their number is held under
VICTORY_L8_VIEW_COPY_MAX (4096): run 12 counted them at 256 bytes,
reached 432,861 copies and RADV ran out of memory for command
submission.

Ours (AnyXboxX lots 7 and 8, patches-l7-stab 03 and the lot 8 fix). The
crash is gone since run 13; runs 14/25.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A shader that takes the address of a table's view (to read it as raw
memory) got one only for buffer views of resources; for constant buffer
views and views of plain memory it got 0 and read nothing ("view
address 0" in the lot 6 counts). The address is now given for those too
(VICTORY_L7_VIEW_ADDRESS, on unless 0).

Ours (AnyXboxX lot 7, patches-l7-stab 04). Runs 14/25.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Six pipelines stayed "being made" for whole runs on RADV, their draws
dropped every frame, with nothing to name them. The drop reason now
says "being made for 30 s or more" with the pipeline's shaders, which
is how the compute pipelines RADV never makes were found (they are
skipped by VICTORY_SKIP_PIPELINES in our launcher).

Ours (AnyXboxX lot 7, patches-l7-stab 05).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A slot the title writes with a view of a texture it placed in memory read
as null until the texture pass or a draw made it, even when the host
copy of that texture existed already: textures flickered in and out.
Such a slot is now made at the write (VICTORY_L7_TEXTURE_SLOTS, on
unless 0).

Ours (AnyXboxX lot 7, patches-l7-stab 06). Runs 14/25.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Six compute pipelines never finish on RADV (runs 9-11: translated,
bound, never made in 42 minutes), and the first dispatch of each frame
waited the whole pipeline budget (VICTORY_PIPELINE_WAIT_MS) for them:
50.1 ms of every frame of run 11. A pipeline is now waited for within
the budget in the first frame that asks for it only; in later frames one
still being made is dropped at once (VICTORY_L7_PIPELINE_WAIT_ONCE, on
unless 0). Adds crate::l7perf for the lot 7 performance switches.

Ours (AnyXboxX lot 7, patches-l7-perf 01). Runs 14/25.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With VICTORY_L6_HEAP_SYNC and VICTORY_L6_SUBMIT_SLOTS, a buffer view the
heap sync found was made null by the sync and made again by the
submission's fresh slots right after: two host descriptor writes, and a
null in between that a flight could read. It is now made at once with
its bytes brought up to date by the submission (VICTORY_L7_SYNC_MERGE,
on unless 0).

Ours (AnyXboxX lot 7, patches-l7-perf 03). Runs 14/25.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Without the ray-tracing structure the RT, GI and reflection passes read
nothing and cost frame time. VICTORY_L7_ROLES=<file> gives shader roles
by hash (made from the names in shaders.rpf) and VICTORY_L7_SKIP=<role>,...
skips the draws and dispatches of pipelines with a shader of those roles,
as VICTORY_SKIP_PIPELINES does by hash. Our launcher skips rt, gi and
reflections. VICTORY_L7_UNLIT=replace|add (off unless set) composites
the G-buffer albedo under or instead of the lighting: an experiment for
the black indoor scenes, kept off by default (runs 26/27 showed no
visible gain at 0.15).

Ours (AnyXboxX lot 7, patches-l7-unlit 01). Skips in runs 14/25.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Under Wine every write-watch, protection, query and kernel read call takes
ntdll's process-wide address-space lock, which the title's own mappings
hold across wineserver calls, so the number of calls matters more than
the bytes. A per-frame line now counts them (GetWriteWatch, protections,
QueryWorkingSetEx, ReadProcessMemory, guard faults, waits for our locks),
and crate::l8ww holds the lot 8 switches (VICTORY_L8_<NAME>).

Ours (AnyXboxX lot 8, patches-l8-ww 01).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Memory in a placeholder reservation of the runtime's (xmem, where
physical pages are mapped as views) is never write-watched: the call
fails and the guards answer. It failed for every check of view memory,
and a submission's query split a run of view ranges in halves until each
failed alone, one call each, each taking Wine's address-space lock for
nothing. xmem now tells the GPU side which reservations are write-watched
or placeholders, and those ranges skip the call
(VICTORY_L8_WW_KNOWN_VIEWS, on unless 0).

Ours (AnyXboxX lot 8, patches-l8-ww 02). Runs 14/25.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Under Wine a block of the runtime's placeholder reservations that the
guards found unmapped stays so until the runtime maps it, and the
runtime tells when it does. Every check of a range holding such blocks
still ran a VirtualQuery per block. Under Wine (sections committed whole)
they are now trusted absent until remapped (VICTORY_L8_WW_ABSENT_TRUST,
on unless 0; Windows keeps the query, where a view can be committed
without a word).

Ours (AnyXboxX lot 8, patches-l8-ww 03). Runs 14/25.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
An option for a submission's write-watch query to cover all its ranges
in one write-watched reservation with one call (up to 1 GiB) instead of
one call per group of ranges within 8 MiB. Fewer waits for the address
space lock, but under GE-Proton 11's kernel write watch (PAGEMAP_SCAN) a
call walks the whole range, about 0.33 us per MiB (bench included), so
it only pays while the waits are long. Off by default
(VICTORY_L8_WW_BY_RESERVATION=1 turns it on); runs 14/25 ran without it.

Ours (AnyXboxX lot 8, patches-l8-ww 04).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A protection change stays within one view. A run of guarded blocks across
views was asked first and refused, then done block by block, and the
other views of guarded pages (fork #115) were armed and opened one block
per call: thousands of VirtualProtect calls a frame, each taking Wine's
address-space lock. Runs are now cut where the runtime's views begin and
end and changed a run at a time (VICTORY_L8_WW_PROTECT_RUNS, on unless 0).

Ours (AnyXboxX lot 8, patches-l8-ww 05). Runs 14/25 (267-274 ms median
world frame).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each guard fault under Wine is a signal, an exception dispatch and two
protection changes on the title's thread. An option leaves a guarded
block that the title writes again after its re-arm in the same frame
open until the next frame: checks meanwhile report it written and copy
it again, with no more faults for it. Off by default
(VICTORY_L8_GUARD_REARM_FRAME=1 turns it on); worth it only where the
"faulted earlier in the frame" count is high. Runs 14/25 ran without it.

Ours (AnyXboxX lot 8, patches-l8-ww 06).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Under GE-Proton 11 a GetWriteWatch call walks its whole range
(PAGEMAP_SCAN, about 0.33 us per MiB) holding the address-space locks the
title's mappings need. VICTORY_L8_WW_CHUNK_MB=<n> caps how much one call
walks, so the title can get in between. The micro-benchmark saw neither
gain nor loss at 64 and a loss at 16, so it is off (0) until a run's
lot 8 line shows long answered calls. Runs 14/25 ran without it.

Ours (AnyXboxX lot 8, patches-l8-ww 07).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A DirectStorage file read into a title address is the kernel's write,
which does not fault into our guard: it fails with ERROR_NOACCESS.
kernel_will_write opened the guards first but let go at once, and a check
on another thread (at a submission) armed the destination's blocks again
while the read ran: the request failed and the title stopped on its int3
(AnyXboxX lot 8 run 20, an uncompressed 54,240-byte request; three times
without the stop in run 11). kernel_write now holds the blocks open until
the write is done and notes them written again after it, and a read that
still meets a read-only page is opened and retried once
(VICTORY_L9_DSTORAGE_GUARDS, on unless 0).

Ours (AnyXboxX patches-l8-fix 01). Run 25: no DirectStorage failures.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Freeze in lot 9 runs 13 and 15-21: a check covering 4 MiB around a root
constant's address made a 1 MiB block of Wine's process heap read-only
(between Wine's mapped locale files, which is_view took for views), then
allocated in it under the guards' lock; the fault's handler waited for
the lock its own thread held. Lot 8 has the same guards and allocates
under the lock too. Now blocks no title view shows are never made
read-only (they are reported written at every check instead;
VICTORY_L9_GUARD_TITLE_VIEWS, on unless 0), and a write fault on the
thread that holds the lock opens the block without the lock and leaves
it for the next holder to forget, with a lock-free stderr line
(crate::l9guard).

Ours (AnyXboxX patches-lot9-fix 01, ported to lot 8 as patches-l8-fix
02). Evidence: runs/lot9-run21-wine-stacks.txt. Run 25: no re-entrant
guard faults.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Our fork #115 port armed the other views of a page a check had just
copied and noted them clean. Their own copies had not taken the pages,
so after a write through one view, a check at another one re-armed it as
clean and its own next check did not report the write: its copy kept
the old bytes. They are now made read-only without being noted clean (a
block that was clean stays so). Pages of more than 64 views (the page
the title shows wherever it has nothing) are left to each view's own
guard, or every check would mark thousands of blocks written.
VICTORY_L9_ALIAS_UNCLEAN=0 puts back the lot 8b behaviour. The test
fails with the old behaviour.

joroyt's correction of fxceless/victory-fork #115 (Spexivus/victory-fork
#1) and the 64-view limit, as carried in myokex/victory-amd c6dc4d8c by
myokex, applied to our port instead of taking that commit whole (our
write-watch cuts and guard fixes sit on our port). Runtime unverified:
not in runs 14/25.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A raw DirectStorage request read its file straight into the title's
destination, a write of the kernel's. The guard over all the views of a
page makes other views read-only from the GPU side's threads, and a block
guarded again between `kernel_will_write` and the read failed the read
with ERROR_INVALID_USER_BUFFER (0x800706f8); the title stops at a failed
request. Two runs of two died so, seconds after the world's first frame;
with `VICTORY_VIEW_GUARD=0` the run went on.

Such reads now land in a buffer and are copied in from user mode, where
a guarded block faults into the guard like the title's own writes.
`fread` does the same a megabyte at a time; `ReadFile` keeps writing in
place, as the title retries a failed synchronous read and each retry
opens the block again.

With the fix and the guard on, a run went 5.5 minutes past the world's
first frame without a failed request.

On AnyXboxX linux-amd (from JoshuuDev/victory-amd, branch victory-amd):
the conflict in into_destination is resolved by keeping our hold of the
destination's guards (kernel_write, VICTORY_L9_DSTORAGE_GUARDS) around
the copy. Ours closed the same race by holding the guards open and
retrying an ERROR_NOACCESS read; this commit takes the kernel out of the
write for raw file reads and fread, which ours left alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Source: JoshuuDev/victory-amd 10ea38ed
Co-authored-by: Joshua Odom <[email protected]>
A title writes a texture's view and may fill its memory only afterwards,
with nothing to tell of it: the host copy kept what the memory held at the
first look. A texture uploaded whole is looked at again after 4, 12, 40,
120 and 400 frames, and uploaded again if its memory changed (315 were in
one run). VICTORY_HEAP_RECHECK=0 turns it off.

The idea is fxceless's (victory-fork a803c87), written anew on this fork's
queue: the looks are kept apart from the slots that wait to be uploaded,
are limited per pass, and take a fingerprint spread over the memory.

On AnyXboxX linux-amd (from myokex/victory-amd via JoshuuDev/victory-amd):
conflicts were context only (that fork's texture_sweep, upload_again and
two descriptor tests of 4436f8f1, not taken); the change itself is as
it was, 255 lines. Runtime unverified on Linux.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Source: myokex/victory-amd 1daf3fd1
Co-authored-by: myokex <[email protected]>
- Clean-up passes over each translated module (VICTORY_SHADER_OPT bits: dead
  code, folding, reuse, branch facts, loads within a block, wave64 first-lane
  exchange), part of the shader cache key. About 43 % fewer host instructions
  over the pack; about 20 ms less GPU time per frame on the test machine.
- translate: a census of the emitted code.
- Checked with plain game runs of this tree on the test machine.

Co-Authored-By: Claude Fable 5.2 <[email protected]>

Conflict resolved: the shader_opt() bits go into the base's hashed cache key (after its
switch list); the README hunk is left out.

Source: fxceless/victory-fork 16849898
Co-authored-by: fxceless <[email protected]>
Source: fxceless/victory-fork #14 39309893
Co-authored-by: oddiums <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Source: myokex/victory-amd bddfb4a5
Co-authored-by: myokex <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

Conflicts resolved: the base already exports host_max_wave/view_heap_limit; the f16 sum
over the lanes that run (one host wave of 64) is already ours (8307f793), so its copy here
is left out; the translator source list in lib.rs is left out (its cache key is covered by
the base's build.rs source hash). What is taken: USER_GROUP_BASE added to the x group id
of one-dimensional compute programs, and its test.

Source: myokex/victory-amd 892d2598
Co-authored-by: myokex <[email protected]>
The console runs any number of groups in one dimension; the host at most
65,535 (the final gather of indirect light asks 115,200 at 2560x1440, and
clamped, the tiles at the bottom of the screen kept what they showed before).
A compute program that reads its group number in x alone takes the number of
its first group (USER_GROUP_BASE, 8b100dc6): a direct dispatch is made in
parts of 65,535 with that dword set between them, and an indirect one of a
single record without a count buffer is clamped into two records (the clamp's
bit 2) and run as two. Host value 0 outside the parts. No switch (none in the
source).

Ported from myokex/victory-amd 4436f8f1, its "dispatches in parts" part
(adapted to the base's StructuredBuffer clamp shader and its readback barriers
in the test).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Source: myokex/victory-amd 4436f8f1
Co-authored-by: myokex <[email protected]>
A title that streams textures describes every mip of them and has memory
only for the ones streamed in, which a view of it shows; it puts the next
texture right behind them (a 1024x1024 texture of which 128x128 is there).
Taken for as long as its description, such a texture lay over its
neighbours: in the source's runs 109,638 views were taken for stale in 8
minutes and showed nothing from then on, and 700 KB were read for the 12 KB
there. Now:
- a view's span is the memory of the mips from its first one on
  (resource::placed_bytes_from, first_mip; bddfb4a5's Layout::bytes_from),
  and the spans keep the resource description: views of one description at
  one start that show more and fewer mips are one texture's;
- a texture's staging buffer and upload begin at the first mip a view
  shows (texture::upload_from), read from that much title memory, and are
  made anew when a view asks for larger mips;
- the ranges the runtime remaps are kept up to 2^18 between texture passes
  (131,072 were dropped in one run at 2^15).
No switch (none in the source).

Ported from myokex/victory-amd 4436f8f1, its "texture spans by true memory"
part (adapted to the base's heap re-check of 1daf3fd1, kept beside it).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Source: myokex/victory-amd 4436f8f1
Co-authored-by: myokex <[email protected]>
A view whose memory is there, whose host slot shows nothing (or another
view) and which is not in the texture queue stays that way until the title
writes it again, and a shader that picks it by index reads black. The heap's
placed texture views are looked at a part at a time (2^15 slots, at most every
100 ms); one whose memory no newer view describes otherwise (its own span,
or memory no other view describes) goes back into the queue, at most 128 per
part and only while the queue is shorter than 4,000. The others are counted
for the memory line (diagnostics). Slots read through tables are no longer
left out of the remapped-memory pass: they wait for their draw as a write
does (TABLED_GRACE), so one that shaders also pick by index does not keep
what it showed before; and a texture uploaded from the queue that tables
also sample is copied whole by the next list that uploads it
(texture::upload_again).
VICTORY_TEXTURE_SWEEP=0 turns it off, =count only counts (the source's switch).

Ported from myokex/victory-amd 4436f8f1, its "lost views put back" part
(adapted: runs after the base's heap re-check of 1daf3fd1 in the same pass).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Source: myokex/victory-amd 4436f8f1
Co-authored-by: myokex <[email protected]>
A run that asks for no title pipeline (an offline warm-up, a run stopped in
the menus) wrote an empty list over the earlier runs' one, and the next world
began with every pipeline still to be asked for. The list saved is this run's
merged with the one read at the start, with a host pipeline library and
without one (the base's list kept under Wine, 2968762e). No switch.

Ported from myokex/victory-amd 4436f8f1, its "early pipeline list kept" part
(adapted: also on the base's no-library path).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Source: myokex/victory-amd 4436f8f1
Co-authored-by: myokex <[email protected]>
- While a world loads, a frame may wait up to 4 s for a graphics pipeline
  and 12 s for a compute one (each kind with its own per-frame budget), all
  such waits of a run bounded together by VICTORY_PIPELINE_GATE_S (default
  120, 0: none). The passes that unpack a world's models are dispatched once:
  in a source run whose pipelines were all still to be loaded, 130 of them
  were dropped, and with them walls, floor, ceiling and faces, which never
  came back. A pipeline the driver has been at for longer than most (10 s
  compute, 3 s graphics) is not waited for.
- Compute programs that only shade ray-tracing hits (CS_RaytracingResolve,
  about 1,000, 5 to 9 s of AMD's compiler each, queued before the passes that
  make the picture) are not made while the structure builder is off
  (VICTORY_RT_RESOLVE=1 makes them); VICTORY_ACTIVATE_RAYS=0 leaves out
  CS_ScreenProbes_ActivateRays (85 s and 1.3 GB of AMD's compiler once).
- Kept with the base's VICTORY_L7_PIPELINE_WAIT_ONCE (bcb08d00): with it on,
  only the first frame that asks waits, then with the larger loading budget;
  and the base's "being made for 30 s or more" names.

Ported from myokex/victory-amd 4436f8f1 (pipeline/make.rs; adapted to the
base's pipeline key function and lot 7 wait/drop-reason fields).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Source: myokex/victory-amd 4436f8f1
Co-authored-by: myokex <[email protected]>
- A constant buffer view is made of at most 64 KiB (whole 256s): the host
  removes the device for a larger one, and the title's heap holds old views
  of any size in slots it does not use.
- Diagnostics: a buffer view left null (off its copy's elements, or refused
  by the host) is told at each doubling of the distinct views of a kind.
- Not taken from the same source hunks: cutting a view that reaches past its
  host copy to the elements inside (elements_inside). The base makes such a
  view over a copy of its own bytes instead (49e9e274), which keeps the bytes
  past the copy's end; cutting first would bypass that.
No switch (none in the source).

Ported from myokex/victory-amd 4436f8f1 (descriptor/host.rs buffer views;
adapted to the base's own-copy views and lot 6 counters).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Source: myokex/victory-amd 4436f8f1
Co-authored-by: myokex <[email protected]>
In a world's first minutes the queue of texture slots to upload holds over
20,000, which at the usual pace (192 MiB and 250 ms a frame) took three and
a half minutes with the materials black. While the queue is longer than
2,000, a frame may stage 512 MiB and spend 1.5 s on it, until the time spent
past the usual pace reaches VICTORY_TEXTURE_GATE_S (the source's switch;
default 60 s, 0: never).

Ported from myokex/victory-amd 4436f8f1 (draw.rs texture pass).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Source: myokex/victory-amd 4436f8f1
Co-authored-by: myokex <[email protected]>
- VICTORY_NULL_MAGENTA=1: a 2D colour texture view that shows nothing yet
  shows magenta, so a texture that is not there is told from black contents.
- Captures take two frames in a row each time (the title draws to two
  buffers in turn); the menu pictures before the world only with
  VICTORY_CAPTURE_MENUS=1 (saving them made menus and music stutter).
Diagnostics builds only; the source's switch names.

Ported from myokex/victory-amd 4436f8f1 (capture.rs, descriptor/host.rs).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Source: myokex/victory-amd 4436f8f1
Co-authored-by: myokex <[email protected]>
The title fills a destination's array of physical page numbers after it
enqueued the request (a copy taken then holds zeros, or the numbers of the
array's last use), so it is read when the request runs, word by word
(volatile: the title may write it from another thread); a number still zero
then is waited for, 0.1 s at most, and said. A failed write names its first
page and the request's options. No switch (none in the source).

Ported from myokex/victory-amd 4d64efe1, its DirectStorage part (cherry-pick
-x, conflicts resolved). Not taken: its xmem "memory hooks" (physical pages
knowing where they are shown, kernel_will_write after write_physical and at a
PageWindow's drop): the base already tells the GPU side of such writes
through its own per-page view index (PageWindow::written, wrote_physical;
fork #115 port 28174e2d and Looper's 80d58f8f).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Source: myokex/victory-amd 4d64efe1
Co-authored-by: myokex <[email protected]>
Both were on unless =0; now off unless =1. A/B on anyxboxx/linux-amd
(cec5803f), RX 9070 XT, RADV, GE-Proton11-12-viewtree:
- run 28, both on: characters' face geometry missing (floating eyes and
  mouths); world geometry fine.
- run 29, both off: faces fine.
- run 30, ALIAS_UNCLEAN=0, HEAP_RECHECK on: face geometry fine, face skin
  textures black.
So VICTORY_L9_ALIAS_UNCLEAN (840d0d33: other views of a guarded page armed
without being noted clean, and the 64-view limit) breaks face geometry, and
VICTORY_HEAP_RECHECK (myokex 1daf3fd1: textures picked by index re-checked
after upload) blackens skin textures. Off, both are the lot 8b behaviour of
runs 14/25. The code stays for later work; the comment where each is read
says why it is off.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
third_party/victory is no longer a submodule. The launcher no longer points to
`git submodule update`; the tests check that .gitmodules no longer declares
VIctory and that its source is tracked without a gitlink. AGENTS.md describes
the folder; THIRD_PARTY.md says the anyxboxx/linux-amd branch is copied (import
of 80d58f8, then 57 commits) and proposes the BCPack tables that came with the
copy for the exceptions register, for the maintainer to decide.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Guides (en, fr): section on the 57 Proton and AMD commits (what they bring,
switches, Linux measurements of run 31), VIctory copied into
third_party/victory, steps for a clone that still has the submodule (deinit
and delete before pulling), clone without a submodule. READMEs in 9 languages:
news bullet and table row. Test count unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The repository no longer depends on any other repository to build:
third_party/victory is our code, with no upstream. A change taken from
elsewhere lands as our own commit, ending with Source: and Co-authored-by:
lines (AGENTS.md rule 10, section in CONTRIBUTING.md).

THIRD_PARTY.md: the four VIctory rows become one table row plus a sources
table, one row per source repository (initial copy, then taken after). The
anyxboxx/stable and anyxboxx/essai branches leave it: none of their commits is
in the copy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run guides (en, fr): intro, section heading and switches table no longer speak
of a pinned branch or upstream; the obsolete submodule update paragraph is
removed. READMEs (9 languages): the news bullet and the table row say the copy
is our own code, nothing synced or pinned.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
While reworking the PR's guides, a two-dot diff against main reverted b06ff90
(Radoudouu): the launcher's -BatchCardRehash switch and its test. The commit is
re-applied as is; VIctory still reads VICTORY_CARD_REHASH_RUNS.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- tests.yml: "politique VIctory" job runs `cargo xtask policy` in
  third_party/victory (its own hook and workflow do not run here).
- AGENTS.md: third_party/ is exempt from the 400-line rule and from ruff; the
  policy command is documented. CONTRIBUTING.md lists the new check.
- READMEs in 9 languages (intro, Windows measurements row) and the
  victory-xcl-fivestar note (en, fr): no more VIctory submodule.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
LooperSalty admitted third_party/victory/crates/victory-formats/src/bcpack-tables.bin
as an exception on 2026-11-25 (#199, rule 1 of AGENTS.md). The register row
now says so, in the wording he asked for; the rest of the row is 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:36:49 +00:00
github manually merged commit 873f359f5d into gh-pr/199/base 2026-11-26 05:36:51 +00:00
Author
Owner

@⁠LooperSalty on GitHub · 2026-11-25 13:49 UTC · original

Revue de la tête 6e5d7d7 (lue statiquement, pas encore lancée) :

  1. Régression probable : -BatchCardRehash disparaît. La PR retire cette option de tools/lancer_victory.ps1 et son test dans tests/test_lanceur_victory.py. Elle vient de b06ff90, déjà dans ta base 6802e44, et la copie de VIctory lit toujours VICTORY_CARD_REHASH_RUNS (crates/victory-gpu/src/host.rs). Ça ressemble à une résolution de conflit : peux-tu remettre l'option et le test ?
  2. Mentions du sous-module restantes : README.md:10 (« submodule third_party/victory », 80d58f8), docs/running-gta6.md:133 (paragraphe « Updating an existing copy », qui contredit la ligne 13) et son jumeau fr, docs/research/victory-xcl-fivestar.md:31 (+ fr), commentaires de tools/sync_voisins.py:1 et :56 (« épinglé »).
  3. Politique anti-assets inactive : la copie apporte third_party/victory/.github/workflows/ci.yml et .githooks/pre-commit, qui ne tournent pas dans ce dépôt, donc cargo xtask policy n'est plus lancé nulle part. Soit un job dans .github/workflows/tests.yml, soit retirer ces fichiers inertes.
  4. bcpack-tables.bin : l'exception est « À décider » dans THIRD_PARTY.md ; sans décision du mainteneur, la copie enfreint la règle 1. Je tranche ça de mon côté.
  5. AGENTS.md : ajouter que third_party/ (VIctory, ~123 000 lignes) est exempté de la règle des 400 lignes et de ruff, sinon les audits le signaleront à tort.

Côté main, #204 (tri du dépôt) ne touche pas aux mêmes lignes : fusion simulée sans conflit.

**@⁠LooperSalty** on GitHub · 2026-11-25 13:49 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/199#issuecomment-7164346684) Revue de la tête `6e5d7d7` (lue statiquement, pas encore lancée) : 1. **Régression probable : `-BatchCardRehash` disparaît.** La PR retire cette option de `tools/lancer_victory.ps1` et son test dans `tests/test_lanceur_victory.py`. Elle vient de `b06ff90`, déjà dans ta base `6802e44`, et la copie de VIctory lit toujours `VICTORY_CARD_REHASH_RUNS` (`crates/victory-gpu/src/host.rs`). Ça ressemble à une résolution de conflit : peux-tu remettre l'option et le test ? 2. **Mentions du sous-module restantes** : `README.md:10` (« submodule `third_party/victory` », `80d58f8`), `docs/running-gta6.md:133` (paragraphe « Updating an existing copy », qui contredit la ligne 13) et son jumeau fr, `docs/research/victory-xcl-fivestar.md:31` (+ fr), commentaires de `tools/sync_voisins.py:1` et `:56` (« épinglé »). 3. **Politique anti-assets inactive** : la copie apporte `third_party/victory/.github/workflows/ci.yml` et `.githooks/pre-commit`, qui ne tournent pas dans ce dépôt, donc `cargo xtask policy` n'est plus lancé nulle part. Soit un job dans `.github/workflows/tests.yml`, soit retirer ces fichiers inertes. 4. **`bcpack-tables.bin`** : l'exception est « À décider » dans `THIRD_PARTY.md` ; sans décision du mainteneur, la copie enfreint la règle 1. Je tranche ça de mon côté. 5. **`AGENTS.md`** : ajouter que `third_party/` (VIctory, ~123 000 lignes) est exempté de la règle des 400 lignes et de ruff, sinon les audits le signaleront à tort. Côté `main`, #204 (tri du dépôt) ne touche pas aux mêmes lignes : fusion simulée sans conflit.
Author
Owner

@⁠Exorion1er on GitHub · 2026-11-25 14:04 UTC · original

Thanks for the review. The branch is rebuilt and force-pushed (new head 7f426eb, on main 6473db9 with #204):

  1. -BatchCardRehash: restored in f3c8a8e (b06ff90 re-applied as is, option and test). It was my mistake: a two-dot diff against main while carrying the guides. Against main, tools/lancer_victory.ps1 now differs only by the messages about the copy.
  2. Submodule mentions: all removed: README.md line 10 and the intro sentence (9 languages), the "Updating an existing copy" paragraph (en, fr), victory-xcl-fivestar (en, fr), and the sync_voisins.py comments.
  3. Asset policy: new CI job politique VIctory in tests.yml, which runs cargo xtask policy in third_party/victory (locally: 181 files ok).
  4. BCPack: yours to decide, as you said.
  5. AGENTS.md: rule 8 exempts third_party/, and the policy command is documented.

Two more changes, described in the updated PR body:

  • third_party/victory is now treated as our own code with no upstream. Code taken from elsewhere is committed by us with Source: and Co-authored-by: lines (new rule 10 in AGENTS.md), and THIRD_PARTY.md lists the sources per repository.
  • Commit messages are in English, following #207, which this PR is stacked on.
**@⁠Exorion1er** on GitHub · 2026-11-25 14:04 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/199#issuecomment-7164724300) Thanks for the review. The branch is rebuilt and force-pushed (new head `7f426eb`, on `main` `6473db9` with #204): 1. **`-BatchCardRehash`**: restored in `f3c8a8e` (`b06ff90` re-applied as is, option and test). It was my mistake: a two-dot diff against `main` while carrying the guides. Against `main`, `tools/lancer_victory.ps1` now differs only by the messages about the copy. 2. **Submodule mentions**: all removed: `README.md` line 10 and the intro sentence (9 languages), the "Updating an existing copy" paragraph (en, fr), `victory-xcl-fivestar` (en, fr), and the `sync_voisins.py` comments. 3. **Asset policy**: new CI job `politique VIctory` in `tests.yml`, which runs `cargo xtask policy` in `third_party/victory` (locally: 181 files ok). 4. **BCPack**: yours to decide, as you said. 5. **`AGENTS.md`**: rule 8 exempts `third_party/`, and the policy command is documented. Two more changes, described in the updated PR body: - `third_party/victory` is now treated as our own code with no upstream. Code taken from elsewhere is committed by us with `Source:` and `Co-authored-by:` lines (new rule 10 in `AGENTS.md`), and `THIRD_PARTY.md` lists the sources per repository. - Commit messages are in English, following #207, which this PR is stacked on.
Author
Owner

@⁠LooperSalty on GitHub · 2026-11-25 14:16 UTC · original

Décision du mainteneur : bcpack-tables.bin est admise comme exception au registre de THIRD_PARTY.md (règle 1 d'AGENTS.md), le 2026-11-25.

@⁠Exorion1er, peux-tu remplacer dans la ligne du registre « À décider : proposée par la PR qui copie VIctory dans le dépôt » par « Admise par décision du mainteneur le 2026-11-25 (#199) ; admise dans VIctory par décision de son propriétaire le 2026-11-23 » ? Le reste de la ligne ne change pas : la licence du dépôt ne couvre pas ces données, et aucune autre donnée propriétaire n'entre avec cette décision.

**@⁠LooperSalty** on GitHub · 2026-11-25 14:16 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/199#issuecomment-7165019984) **Décision du mainteneur : `bcpack-tables.bin` est admise** comme exception au registre de `THIRD_PARTY.md` (règle 1 d'AGENTS.md), le 2026-11-25. @⁠Exorion1er, peux-tu remplacer dans la ligne du registre « **À décider** : proposée par la PR qui copie VIctory dans le dépôt » par « **Admise par décision du mainteneur le 2026-11-25** (#199) ; admise dans VIctory par décision de son propriétaire le 2026-11-23 » ? Le reste de la ligne ne change pas : la licence du dépôt ne couvre pas ces données, et aucune autre donnée propriétaire n'entre avec cette décision.
Author
Owner

@⁠Exorion1er on GitHub · 2026-11-25 14:19 UTC · original

Done in a489301: the register row now reads « Admise par décision du mainteneur le 2026-11-25 (#199) ; admise dans VIctory par décision de son propriétaire le 2026-11-23 », rest of the row unchanged.

**@⁠Exorion1er** on GitHub · 2026-11-25 14:19 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/199#issuecomment-7165088990) Done in `a489301`: the register row now reads « **Admise par décision du mainteneur le 2026-11-25** (#199) ; admise dans VIctory par décision de son propriétaire le 2026-11-23 », rest of the row unchanged.
This discussion has been locked. Commenting is limited to contributors.
No description provided.