Working shader translation + precompilation (Belobug) + v7-v10 RTX 5070 perf + main fixes #1396

Open
github-bot wants to merge 582 commits from github-bot/gh-1396 into main AGit
Owner

@⁠Alpacher on GitHub · 2026-11-26 22:50 UTC · original
Alpacher:pr/fxceless-full-v10 → main · +88342 −33966 · 235 files · 582 commits · open

From: Alpacher/victory-fork:pr/fxceless-full-v10 (head fe703a0)
Into: fxceless/victory-fork:main (52ac4ec)

⚠️ Why this PR

On our test PC (RTX 5070), shaders on fxceless/victory-fork:main (52ac4ec) do not compile, and the game renders full black. The tree in this PR renders GTA VI correctly on the same machine.

This PR brings in:

  1. The working shader translation + precompilation stack from Belobug (Belobug/VIctory-Belobug-AMD, branch a-publier). This fixes the black screen and the shaders that don't compile on main.
  2. All of our v7–v10 GPU/CPU performance work and diagnostics for the RTX 5070 + Ryzen 7 5800X3D. In-game this took GTA VI from ~4 fps / 268 ms to ~9 fps / 113.6 ms, with GPU busy going from 33% to 86%.
  3. main's later standalone fixes (#1320, #1324, #1336, #1353), ported by hand with their authors kept. #1321 is already covered by an equivalent fix in this tree.

The branch merges into main with zero conflicts. 52ac4ec is an ancestor of this branch (via an explicit merge commit), so GitHub sees it as a clean merge. All 1,039 tests pass, 0 fail, and the release build succeeds.


Contents

  1. How the branch is built (merge strategy)
  2. Attribution
  3. Belobug's stack: shaders, precompilation, renderer
  4. Our v7–v10 optimizations and diagnostics
  5. main's fixes ported on top
  6. Environment variables
  7. Benchmarks (RTX 5070 + 5800X3D, GTA VI)
  8. Root cause: face spikes = PORT_CONSTANTS, not EXACT_REUSE
  9. What changes for main (read before merging)
  10. Verification

1. How the branch is built (merge strategy)

Shape

a26859f (common ancestor)
 ├── fxceless main … 99 commits … 52ac4ec
 └── Belobug a-publier … 555 commits … + our v7–v10 (20) … 677880c (rework/v10-5070)
                                                              │
       b4143a9  Remove personal local launcher scripts        │
       9d6da5c  Merge fxceless/victory-fork main (52ac4ec)  ◄─┘ (+ 52ac4ec as 2nd parent)
       826a9c3  Keep main's diagnostics/ run logs and notes
       fe13d44  #1320  (cherry-pick -x, clean)
       dd95546  #1353  (by hand)
       e2489cc  #1336  (by hand)
       fe703a0  #1324  (by hand)

Why it is done this way

  • A plain three-way merge of main into the v10 tree gave 39 conflicting files, about 440 conflict hunks. They are in host.rs (98), draw.rs (39), indirect.rs (31), shadow.rs (29), descriptor/host.rs (25), watch.rs (24), emit/lower.rs (21) and others.
  • The two GPU layers took different paths after a26859f. Mixing them hunk by hunk would give a tree that neither side tested.
  • main's shaders don't compile on the RTX 5070. So the maintainers' rule was: on any conflict in shader translation, precompilation or rendering, keep the v10/Belobug code.

What the merge commit does

  • 9d6da5c records 52ac4ec as a parent but keeps the v10 tree (git merge -s ours).
  • This keeps the full history and authorship of both sides.
  • It makes the PR conflict-free against main.

What was then added on top

  • main's diagnostics/ run logs and notes, which are pure additions (826a9c3).
  • main's standalone fixes after its big Nov 26 commit, ported with their original authors (see §5).

Other changes

  • Our personal PowerShell launchers were removed in their own commit (b4143a9): Launch-Rework-v7..v10.ps1 and Warm-v7.ps1.
  • Belobug's scripts/play.ps1 stays.

2. Attribution

The shader translation, precompilation ("warm"), list::thin, host/card_steps, the renderer ports and nearly all of the GPU layer in this tree are the work of Belobug and the contributors merged into Belobug/VIctory-Belobug-AMD, branch a-publier.

Commit counts on this branch that are not on main (git shortlog -sne 52ac4ec..HEAD):

Author Commits
Belobug, committing as local <local@localhost> (and beloooo <[email protected]>) 393 + 3
Contributors merged through Belobug's PRs (gomeaw, feanorsun, Vyacheslav Venglovsky, 给伊莉雅补魔, Duff, quaternion, Maraco91, Noname0202, fever308, AnoHunted, BastienRdz, EatCodeSleep2, TG0000, Tex, Yoshi-233, sawetco, Mumogg, slatefield, Fuzeofficial, Luiz Gustavo Benicio Neves, and more: 83 authors) 162
cccw (#1320, #1324, #1336, ported from main) 3
Filip Michalski (#1353, ported from main) 1
Alpacher (v7–v10 RTX 5070 work, merge and packaging) 20

Every commit keeps its original author. The ports from main say (cherry picked from commit …) in their messages.

3. Belobug's stack: shaders, precompilation, renderer

This section lists the parts of Belobug's work that matter most for the black screen. The full list is in the history.

Shader translation: "every shader the title uses translates"

  • Merge 190a686: 25,790 of 25,985 shaders translate. The 195 that don't are unused geometry shaders.
  • The shader store is versioned, and the shader cache is keyed by translator version (1162d38).
  • Fixes for wave64 programs on 32-lane hosts (NVIDIA):
    • LDS flag regions (#4);
    • thread counts of wave64 builder programs (#66, 06fe22a);
    • exact tiled cascade shadows on wave32 (4fd34fd).
  • Mask operations, level queries and interpolation modes (d1f883e, 41d3184, 0dc5d1b).
  • Native code stored without its XBCH wrapper (e70e031).
  • Computed-index view addresses (027e367).
  • Hardware tests for scalar ops (0fbec7e, 9a0843d, 2d30943, 6fac561).

Precompilation (apps/victory/src/warm.rs, translate --warm)

  • Pipelines are built ahead of play by worker processes.
  • Worker startup failures are reported without marking pipelines as bad (#128, c6ff045).
  • Both host wave override names are honoured (#139).
  • A worker that exits records the failed pipeline and resumes.
  • A pipeline library keeps the "bad key" list of driver-compiler crashes.
  • Shader and driver work on pipeline workers is traced (#144).
  • File-scan outcomes are reported in shader-info / shaders (#117).
  • GPU selection is shared between runtime and shader validation (#7).

List translation (crates/victory-gpu/src/list/thin.rs, VICTORY_THIN)

  • Title command lists are translated on a pool of threads.

Card steps (crates/victory-gpu/src/host/card_steps.rs)

  • Copy, compare and land steps happen on the card.
  • VICTORY_PLACED_ORDER: a placed copy refuses a submission only for taken steps behind it, and cut_for splits the submission instead of waiting.

Renderer ports 1–7 (port.rs, all opt-in)

  • In-place constants (VICTORY_PORT_CONSTANTS), descriptors, CBVs, guard plan and journal.
  • Port 1 must stay off: see §8.

Other

  • Residency waits (VICTORY_WAIT_RESIDENT).
  • Card copies of title buffers (VICTORY_CARD_BUFFERS_MB, …_MIN_MB).
  • Page-write tracking, the HUD panel (VICTORY_PANEL), and replay and timeline tooling.

4. Our v7–v10 optimizations and diagnostics

All of these were made and measured on the RTX 5070 + 5800X3D. Each one is behind an env var with an A/B fallback. The code defaults are listed in §6.

4.1 Memory notices: merge overlaps, rescan-all on overflow (v7, a8f02d5)

  • File: crates/victory-gpu/src/watch.rs
  • Problem: when the remap or page-write queue reached 32,768 entries, ranges were dropped. Completed uploads could then stay stale, which showed as black textures.
  • Fix: ported from DexNom/VIctory record_remap (921d8d3b).
    • Overlapping last ranges are merged.
    • The cap is raised to 2^18.
    • On overflow, a single (0, u64::MAX) rescan-all entry is kept.
  • Safety: this can only cause extra rescans; it never skips one.

4.2 Exact-copy buffer reuse: VICTORY_EXACT_REUSE (v7 e1c2045, hardened in v9 f5c51f9, v10 69a259e)

  • File: crates/victory-gpu/src/shadow.rs, in exact(), Spares, spare_gate and spare_tests
  • Problem: views that sit off their copy's elements get a byte-exact copy keyed by (address, len). The title's ring positions move every frame, so there were 650–675 new committed buffers a frame with about 6,000 alive.
    • Each one was made resident and mapped.
    • All of this happened under the EXACT lock that every list-translating thread takes.
    • On top of that, a scan of all the kept copies ran at every new one.
  • Fix:
    • Idle buffers are pooled by width, capped at 256 MB, oldest retired first.
    • Creation happens outside the lock.
    • The idle sweep runs every 32 new copies and does the cheap tests first: Arc::strong_count, then recent use, then the COM refcount (v10).
  • Safety gate (v9): a spare is reused only once STARTED + bury_lag() (64; 16 when RAM is limited) submissions have finished and 3 frames have passed (VICTORY_EXACT_REUSE_FRAMES).
    • That is the same margin the codebase uses for retired buffers, because lists recorded but not yet sent may still name them.
    • Descriptor slots and per-list views hold COM refs (Kept), so a buffer they use is never idle.
    • A reused buffer is zeroed and gets a new Shadow (new id, no card side, no dirty state).
  • Tests: shadow::spare_tests.
  • A/B:
    • VICTORY_EXACT_REUSE=0 gives the v7 path.
    • VICTORY_EXACT_REUSE_SAFE=0 gives v8's weaker gate.

4.3 Mapping waits on a shared signal: VICTORY_MAPPED_SHARED (v7, 825e8e7)

  • File: crates/victory-gpu/src/host.rs, in mapped()
  • Problem: with VICTORY_WAIT_RESIDENT on, every new heap or buffer sent a copy on an aside queue and waited for it while holding one global lock. Run run-v7-20261126-212142 had 161,200 waits in a row.
  • Fix: any copy sent after the memory was made covers it. So threads now wait for any such signal, using a null-event SetEventOnCompletion outside the lock.
  • A/B: VICTORY_MAPPED_SHARED=0.

4.4 Translated list calls by kind: VICTORY_THIN_OPS (v7, 7d7fde7; diagnostic)

  • File: crates/victory-gpu/src/list/thin.rs
  • Problem: v7 translated 27,000–31,000 calls a frame in 1.0–1.7 s of thread time. That is 35–62 µs a call, against 6.4 µs in Belobug's runs.
  • What it adds: the thin line now also prints the eight heaviest kinds of call (calls, ms, µs each).
  • A/B: VICTORY_THIN_OPS=0.

4.5 Card-cap turn-down log (v9, f5c51f9; diagnostic)

  • File: crates/victory-gpu/src/shadow.rs, in card_room_for
  • Problem: once card copies reached VICTORY_CARD_BUFFERS_MB (512 MB by default on budgets ≤12 GiB), later big buffers were turned down silently. They stayed in system memory and were compared on the CPU: 161.9 MB a frame.
  • What it adds: a rate-limited info! line on each turn-down (the first 16, then every 64th). Behaviour is unchanged.

4.6 Why submissions wait on card steps: VICTORY_CARD_STEPS_WHY (v9, 02d3724; diagnostic)

  • File: crates/victory-gpu/src/host/card_steps.rs
  • What it adds: counts the reasons plan() leaves a submission to the wait, by cause.
  • That is what found the placed-copy refusal (1.0–1.8 a frame, each a 38–49 ms+ wait), which VICTORY_PLACED_ORDER=1 fixes.
  • A/B: VICTORY_CARD_STEPS_WHY=0.

4.7 Bind-time split: VICTORY_BIND_SPLIT (v9 c7732cb, v10 0f9722c; diagnostic)

  • Files: crates/victory-gpu/src/draw.rs and list/thin.rs
  • What it adds: per frame, State::bind is split into the early texture pass, descriptor tables, title memory by address, and the rest.
  • In v10, the tables part is split further into slots made, list views and exact copies (BIND_NS[8]).
  • This is what pinned descriptor tables, and exact-copy creation inside them, as the hot spot.
  • A/B: VICTORY_BIND_SPLIT=0.

4.8 SHR breakdown line: VICTORY_SHARED_LINE (v10, 69a259e; diagnostic)

  • File: crates/victory-gpu/src/shadow.rs, plus inplace::in_place_bytes()
  • What it adds: a breakdown of the HUD's "SHR" figure (non-local video memory). It counts:
    • the CPU sides of host copies;
    • windows;
    • in-place regions;
    • the upload pool;
    • staging and readbacks.
  • It shows that SHR is there by design, not spill.
  • It also counts exact copies over port-1 memory.
  • A/B: VICTORY_SHARED_LINE=0.

4.9 .gitignore for isolated target dirs (v7, c1af2da)

  • Ignores /target-*/, /logs/ and root-level *.log files.

5. main's fixes ported on top

main commit Author Status here
af23c65 #1320: split submissions give their tables' slots back cccw fe13d44, clean cherry-pick -x
46da5ee #1353: finish a pipeline queue entry when its build panics Filip Michalski dd95546, by hand. The v10 make.rs doesn't use get_or_init, so the compiler guard's bad-key check stays first and the build is wrapped in catch_unwind. Test brought over.
a463dcb #1336: pin the texture a placed view aliases while the copy uses it (use-after-free) cccw e2489cc, by hand. alias_of returns Held. The two callers that copy (draw.rs readable, external.rs prepare_input) hold it. The two callers that only check (texture_at, the texture-ahead pass) use a new has_alias that takes no reference, so a check can never be the last release while a lock is held.
e4245f3 / 52ac4ec #1324: dynamic descriptor slots go back only to the heap that took them cccw fe703a0, by hand. HostHeap::id (NEXT_ID), State::dynamic keeps (heap, id, first, n), and release_dynamic / HostHeap::release check the id. Test brought over. (On main, this change landed inside e4245f3, and 52ac4ec carries only its message.)
2440c7b #1321: a stale staging file no longer loses a translation cccw Already covered. This tree's victory-pipeline/src/cache.rs already retries up to 128 new names on AlreadyExists, and has the test staging_retries_collisions_without_changing_existing_files.

6. Environment variables

Added or changed by our v7–v10 work (code defaults; "on" means on unless set to 0):

Variable Default What it does A/B
VICTORY_EXACT_REUSE on Reuse exact-copy buffers =0: always create (v7)
VICTORY_EXACT_REUSE_SAFE on v9 gate: bury lag (64) finished submissions + frames =0: v8 gate (in-flight only)
VICTORY_EXACT_REUSE_FRAMES 3 Frames a spare waits before reuse Raise to be more conservative
VICTORY_MAPPED_SHARED on Mapping waits on a shared signal, outside the lock =0: v7
VICTORY_THIN_OPS on Heaviest translated call kinds on the thin line =0: not timed
VICTORY_CARD_STEPS_WHY on Why submissions are left to the wait =0: not counted
VICTORY_BIND_SPLIT on Bind and descriptor-table time split =0: not timed
VICTORY_SHARED_LINE on SHR breakdown line =0: not printed

Belobug switches we measured with (the defaults are Belobug's and unchanged; this is the set we ran):

Variable Code default We ran Note
VICTORY_PLACED_ORDER off 1 Removes the placed-copy refusals (§4.6)
VICTORY_PORT_CONSTANTS off off Keep off: it causes the face spikes and doubles GPU time (§8)
VICTORY_CARD_BUFFERS_MB 512 (≤12 GiB) 1024 With …_MIN_MB=1: CPU compare of ≥1 MiB copies goes from 161.9 MB to 0.0 MB a frame
VICTORY_CARD_BUFFERS_MIN_MB — 1
VICTORY_WAIT_RESIDENT on on Required for safety on NVIDIA (see the device-loss notes in host.rs)
VICTORY_THIN / VICTORY_THIN_THREADS — 1 / 6
VICTORY_PORT_GUARD, VICTORY_PORT_JOURNAL off 1 Ports 6 and 7
VICTORY_JOIN_PARTS, VICTORY_UPLOAD_AHEAD — 8, 1
Plus VICTORY_TEXTURE_NO_WAIT=1, VICTORY_RELAY=2, VICTORY_WIDE_BACK=1, VICTORY_CARD_REHASH_RUNS=1, VICTORY_JOIN_COPIES=1, VICTORY_INDIRECT_WINDOW=1, VICTORY_RELAY_COPY=1, VICTORY_CARD_STEPS=2, VICTORY_INDIRECT_BATCH=2, VICTORY_MAP_THREADS=1, VICTORY_TITLE_PRIORITIES=0, VICTORY_CARD_AWAKE=1, VICTORY_SHOW_AFTER=1, VICTORY_D3D12_DRED=light, VICTORY_DSTORAGE_STAGING_MB=256, VICTORY_MAP_LEAN=1, VICTORY_STREAM_PRIORITY=1, VICTORY_FRAME_INTERVAL_MS=16.667, VICTORY_D3D12_ADAPTER=NVIDIA, VICTORY_PANEL=1 (from Belobug's scripts/play.ps1 stack)

7. Benchmarks (RTX 5070 + 5800X3D, GTA VI)

Rig and settings

  • RTX 5070 12 GB (budget 11,175 MB), Ryzen 7 5800X3D, 31.9 GB RAM, Windows 11.
  • GTA VI game_scarlett_master.exe, Series X mode.
  • Numbers come from the frame-line logs and the HUD.

End to end

Build FPS Frame time GPU busy CPU Visuals
v9 config (port 1 on, PLACED_ORDER off) ~4 (4.4) 225–268 ms ~33% ~89% face spikes
v10 = this PR + §6 settings (port 1 off, PLACED_ORDER=1, exact reuse on) ~9 113.6 ms ~86% ~59% spikes gone

Subsystems

Measure Before After Source
descriptor tables bind time per frame (all threads) 1,073.1 ms (reuse off) 212.4 ms (reuse on; 208–212 across frames) VICTORY_BIND_SPLIT line, runs 225548 / 225146
Whole bind per frame 1,132.9 ms over 9,325 binds 250.2 ms over 9,589 binds same
New exact-copy buffers per frame 650–675 a few dozen exact line
Mapping/residency waits for new memory (cumulative) 292,400 waits, 31.3 s at 22:58 CET; ~293,000 waits, ~59 s over the session 21,200 waits, 3.7 s WAIT_RESIDENT line
CPU compare of ≥1 MiB copies 161.9 MB/frame (cap 512 MB) 0.0 MB/frame (cap 1024 MB) shader writes looked for on the CPU line, runs 215944 / 225146
GPU time, port 1 on vs off 202 ms 88 ms §8
Placed-copy refusals 1.0–1.8 a frame, each a 38–49 ms+ wait 0.2 a frame and 0 ms settles with port off; none with PLACED_ORDER=1 VICTORY_CARD_STEPS_WHY line

Caveat: the two runs behind the bind numbers (225548 / 225146) also differ in render scale and in port 1. The table cost, though, is almost all exact-copy creation, which reuse removes directly.

8. Root cause: face spikes = PORT_CONSTANTS, not EXACT_REUSE

Symptom: faces and skinned meshes showed vertex "spikes". The first A/B changed exact reuse, port 1 and render scale at once, so it looked as if reuse was to blame.

Mechanism

  • VICTORY_PORT_CONSTANTS=1 (renderer port 1) opens the title's 185 MB graphics region in place, as CUSTOM/system-memory heaps (OpenExistingHeapFromAddress1).
  • Its 174 MB heap at 0x34e10000 holds the constants ring and the skinning output.
  • In place, "nothing is tracked, sent up, fetched back or compared". So GPU skinning writes go into that memory with nothing ordering them against CPU-side work.
  • Views that sit off their elements at ring positions in this heap get CPU-side exact copies (shadow::exact): 4,600–5,150 askings a frame.
  • Those copies snapshot stale skinning output and constants. The draw then flings vertices out of the face.

Port off

  • The heap becomes an ordinary card copy (174 MB, under the 1024 MB cap).
  • Shader writes to it are declared, compared and landed.
  • CPU reads that overlap them wait.
  • The faces are clean.

GPU time follows the same cause

  • In place, every draw's constants and vertices cross PCIe: 202 ms with port 1 on vs 88 ms with it off.
  • The port-on run was at the lower 0.5 render scale, which should have made it faster.

Why reuse is not the cause

  • Reuse's gate waits for finished submissions plus 3 frames.
  • Holders keep COM refs.
  • Buffers are zeroed and get a new Shadow.
  • Guards and landings key on the Shadow id or the title address, never on the buffer.

Confirmed in game: port 1 off with reuse on gave clean faces. Port 1 stays opt-in (off) in code.

9. What changes for main (read before merging)

Because the merged tree is the v10/Belobug tree, these parts of main that came after a26859f are replaced by Belobug's equivalents, or removed.

main-only modules not in this tree (17 files)

  • crates/victory-gpu/src/: backreads.rs, cardmeter.rs, drvwatch.rs, fpsbox.rs, framelog.rs, heap_pass.rs, heap_worker.rs, plaincopy.rs, profile.rs (+ profile/tests.rs), queue2.rs, renderdoc.rs, shot.rs, spread.rs, stats.rs
  • crates/victory-shader/src/emit/: dispatch_threads.rs, halves.rs
  • With them go main's switches such as VICTORY_HEAP_WORKER, VICTORY_SHOT, the frame log, the FPS corner box, the driver watch, the card meter and the profiler.
  • Belobug's tree has its own HUD panel (VICTORY_PANEL), timeline and replay tooling instead.

main's changes inside shared files (for example card hashing a thread group a piece, 4 KiB dirty tracking, gather segments, main's texture fixes)

  • These are present only where Belobug's tree has its own version.
  • Where the two conflicted, Belobug's version was kept, because main's shader path renders black on our hardware.

Kept from main

  • diagnostics/, all of its history, and the five fixes in §5.

Diff vs 52ac4ec

  • 235 files changed, +88,342 / −33,966.
  • Of that, victory-shader, victory-pipeline and apps/victory account for 50 files, +10,714 / −2,847.

If you'd rather keep main's instrumentation: these features can be re-ported one at a time on top of this tree. They are diagnostics, and none of them is needed for correct rendering.

10. Verification

Setup

  • Windows 11, RTX 5070.
  • Branch pr/fxceless-full-v10 at fe703a0.
  • Isolated target dir: CARGO_TARGET_DIR=target-pr-full-v10.

Commands

cargo test  --locked --release --workspace --exclude xtask --no-fail-fast
cargo build --locked --release -p victory

Results

  • Tests: 1,039 passed, 0 failed, 45 ignored, across 28 suites.
    • The ignored tests are the tree's existing hardware/adapter-gated ones.
    • The count includes the ported tests descriptor::host::tests::dynamic_slots_are_given_back_only_to_the_heap_that_took_them and pipeline::make::tests::a_panicking_pipeline_is_refused_and_the_worker_continues, plus shadow::spare_tests.
  • Build: release build OK.
    • victory.exe is 11,577,856 bytes, SHA-256 05722876BE487967701DB599DCDE78F8DBD37CE860CDAC1E049A77F78DC07A45.
    • The one compiler warning (Spares::take is used only by tests) is harmless and was already in v10.
  • Conflicts: git merge-base --is-ancestor 52ac4ec HEAD is true, and git merge-tree --write-tree 52ac4ec HEAD is clean. Zero conflicts merging into main.
  • --locked: no lockfile drift.
  • In game: GTA VI on the v10 tree with the §6 settings renders correctly: ~9 fps, no face spikes.
**@⁠Alpacher** on GitHub · 2026-11-26 22:50 UTC · [original](https://github.com/fxceless/victory-fork/pull/1396) `Alpacher:pr/fxceless-full-v10` → `main` · +88342 −33966 · 235 files · 582 commits · open **From:** `Alpacher/victory-fork:pr/fxceless-full-v10` (head `fe703a0`) **Into:** `fxceless/victory-fork:main` (`52ac4ec`) > ## ⚠️ Why this PR > On our test PC (RTX 5070), shaders on `fxceless/victory-fork:main` (`52ac4ec`) **do not compile, and the game renders full black**. The tree in this PR renders GTA VI correctly on the same machine. > > This PR brings in: > 1. **The working shader translation + precompilation stack** from Belobug (`Belobug/VIctory-Belobug-AMD`, branch `a-publier`). This fixes the black screen and the shaders that don't compile on `main`. > 2. **All of our v7–v10 GPU/CPU performance work and diagnostics** for the RTX 5070 + Ryzen 7 5800X3D. In-game this took GTA VI from **~4 fps / 268 ms** to **~9 fps / 113.6 ms**, with GPU busy going from **33% to 86%**. > 3. **`main`'s later standalone fixes** (#1320, #1324, #1336, #1353), ported by hand with their authors kept. #1321 is already covered by an equivalent fix in this tree. > > **The branch merges into `main` with zero conflicts.** `52ac4ec` is an ancestor of this branch (via an explicit merge commit), so GitHub sees it as a clean merge. All **1,039 tests pass, 0 fail**, and the release build succeeds. --- ## Contents 1. [How the branch is built (merge strategy)](#1-how-the-branch-is-built-merge-strategy) 2. [Attribution](#2-attribution) 3. [Belobug's stack: shaders, precompilation, renderer](#3-belobugs-stack-shaders-precompilation-renderer) 4. [Our v7–v10 optimizations and diagnostics](#4-our-v7v10-optimizations-and-diagnostics) 5. [main's fixes ported on top](#5-mains-fixes-ported-on-top) 6. [Environment variables](#6-environment-variables) 7. [Benchmarks (RTX 5070 + 5800X3D, GTA VI)](#7-benchmarks-rtx-5070--5800x3d-gta-vi) 8. [Root cause: face spikes = PORT_CONSTANTS, not EXACT_REUSE](#8-root-cause-face-spikes--port_constants-not-exact_reuse) 9. [What changes for main (read before merging)](#9-what-changes-for-main-read-before-merging) 10. [Verification](#10-verification) --- ## 1. How the branch is built (merge strategy) **Shape** ``` a26859f (common ancestor) ├── fxceless main … 99 commits … 52ac4ec └── Belobug a-publier … 555 commits … + our v7–v10 (20) … 677880c (rework/v10-5070) │ b4143a9 Remove personal local launcher scripts │ 9d6da5c Merge fxceless/victory-fork main (52ac4ec) ◄─┘ (+ 52ac4ec as 2nd parent) 826a9c3 Keep main's diagnostics/ run logs and notes fe13d44 #1320 (cherry-pick -x, clean) dd95546 #1353 (by hand) e2489cc #1336 (by hand) fe703a0 #1324 (by hand) ``` **Why it is done this way** - A plain three-way merge of `main` into the v10 tree gave **39 conflicting files, about 440 conflict hunks**. They are in `host.rs` (98), `draw.rs` (39), `indirect.rs` (31), `shadow.rs` (29), `descriptor/host.rs` (25), `watch.rs` (24), `emit/lower.rs` (21) and others. - The two GPU layers took different paths after `a26859f`. Mixing them hunk by hunk would give a tree that neither side tested. - `main`'s shaders don't compile on the RTX 5070. So the maintainers' rule was: on any conflict in shader translation, precompilation or rendering, keep the v10/Belobug code. **What the merge commit does** - `9d6da5c` records `52ac4ec` as a parent but keeps the v10 tree (`git merge -s ours`). - This keeps the full history and authorship of both sides. - It makes the PR conflict-free against `main`. **What was then added on top** - `main`'s `diagnostics/` run logs and notes, which are pure additions (`826a9c3`). - `main`'s standalone fixes after its big Nov 26 commit, ported with their original authors (see §5). **Other changes** - Our personal PowerShell launchers were removed in their own commit (`b4143a9`): `Launch-Rework-v7..v10.ps1` and `Warm-v7.ps1`. - Belobug's `scripts/play.ps1` stays. ## 2. Attribution The **shader translation, precompilation ("warm"), `list::thin`, `host/card_steps`, the renderer ports and nearly all of the GPU layer** in this tree are the work of **Belobug** and the contributors merged into **[`Belobug/VIctory-Belobug-AMD`](https://github.com/Belobug/VIctory-Belobug-AMD), branch `a-publier`**. Commit counts on this branch that are not on `main` (`git shortlog -sne 52ac4ec..HEAD`): | Author | Commits | |---|---| | Belobug, committing as `local <local@localhost>` (and `beloooo <[email protected]>`) | 393 + 3 | | Contributors merged through Belobug's PRs (gomeaw, feanorsun, Vyacheslav Venglovsky, 给伊莉雅补魔, Duff, quaternion, Maraco91, Noname0202, fever308, AnoHunted, BastienRdz, EatCodeSleep2, TG0000, Tex, Yoshi-233, sawetco, Mumogg, slatefield, Fuzeofficial, Luiz Gustavo Benicio Neves, and more: 83 authors) | 162 | | cccw (#1320, #1324, #1336, ported from `main`) | 3 | | Filip Michalski (#1353, ported from `main`) | 1 | | Alpacher (v7–v10 RTX 5070 work, merge and packaging) | 20 | Every commit keeps its original author. The ports from `main` say `(cherry picked from commit …)` in their messages. ## 3. Belobug's stack: shaders, precompilation, renderer This section lists the parts of Belobug's work that matter most for the black screen. The full list is in the history. **Shader translation: "every shader the title uses translates"** - Merge `190a686`: 25,790 of 25,985 shaders translate. The 195 that don't are unused geometry shaders. - The shader store is versioned, and the shader cache is keyed by translator version (`1162d38`). - Fixes for wave64 programs on 32-lane hosts (NVIDIA): - LDS flag regions (#4); - thread counts of wave64 builder programs (#66, `06fe22a`); - exact tiled cascade shadows on wave32 (`4fd34fd`). - Mask operations, level queries and interpolation modes (`d1f883e`, `41d3184`, `0dc5d1b`). - Native code stored without its XBCH wrapper (`e70e031`). - Computed-index view addresses (`027e367`). - Hardware tests for scalar ops (`0fbec7e`, `9a0843d`, `2d30943`, `6fac561`). **Precompilation (`apps/victory/src/warm.rs`, `translate --warm`)** - Pipelines are built ahead of play by worker processes. - Worker startup failures are reported without marking pipelines as bad (#128, `c6ff045`). - Both host wave override names are honoured (#139). - A worker that exits records the failed pipeline and resumes. - A pipeline library keeps the "bad key" list of driver-compiler crashes. - Shader and driver work on pipeline workers is traced (#144). - File-scan outcomes are reported in `shader-info` / `shaders` (#117). - GPU selection is shared between runtime and shader validation (#7). **List translation (`crates/victory-gpu/src/list/thin.rs`, `VICTORY_THIN`)** - Title command lists are translated on a pool of threads. **Card steps (`crates/victory-gpu/src/host/card_steps.rs`)** - Copy, compare and land steps happen on the card. - `VICTORY_PLACED_ORDER`: a placed copy refuses a submission only for taken steps *behind* it, and `cut_for` splits the submission instead of waiting. **Renderer ports 1–7 (`port.rs`, all opt-in)** - In-place constants (`VICTORY_PORT_CONSTANTS`), descriptors, CBVs, guard plan and journal. - Port 1 must stay off: see §8. **Other** - Residency waits (`VICTORY_WAIT_RESIDENT`). - Card copies of title buffers (`VICTORY_CARD_BUFFERS_MB`, `…_MIN_MB`). - Page-write tracking, the HUD panel (`VICTORY_PANEL`), and replay and timeline tooling. ## 4. Our v7–v10 optimizations and diagnostics All of these were made and measured on the RTX 5070 + 5800X3D. Each one is behind an env var with an A/B fallback. The **code defaults** are listed in §6. ### 4.1 Memory notices: merge overlaps, rescan-all on overflow (v7, `a8f02d5`) - **File:** `crates/victory-gpu/src/watch.rs` - **Problem:** when the remap or page-write queue reached 32,768 entries, ranges were dropped. Completed uploads could then stay stale, which showed as black textures. - **Fix:** ported from DexNom/VIctory `record_remap` (`921d8d3b`). - Overlapping last ranges are merged. - The cap is raised to 2^18. - On overflow, a single `(0, u64::MAX)` rescan-all entry is kept. - **Safety:** this can only cause extra rescans; it never skips one. ### 4.2 Exact-copy buffer reuse: `VICTORY_EXACT_REUSE` (v7 `e1c2045`, hardened in v9 `f5c51f9`, v10 `69a259e`) - **File:** `crates/victory-gpu/src/shadow.rs`, in `exact()`, `Spares`, `spare_gate` and `spare_tests` - **Problem:** views that sit off their copy's elements get a byte-exact copy keyed by `(address, len)`. The title's ring positions move every frame, so there were **650–675 new committed buffers a frame** with about 6,000 alive. - Each one was made resident and mapped. - All of this happened under the `EXACT` lock that every list-translating thread takes. - On top of that, a scan of all the kept copies ran at every new one. - **Fix:** - Idle buffers are pooled by width, capped at 256 MB, oldest retired first. - Creation happens outside the lock. - The idle sweep runs every 32 new copies and does the cheap tests first: `Arc::strong_count`, then recent use, then the COM refcount (v10). - **Safety gate (v9):** a spare is reused only once **`STARTED + bury_lag()` (64; 16 when RAM is limited) submissions have *finished*** and **3 frames** have passed (`VICTORY_EXACT_REUSE_FRAMES`). - That is the same margin the codebase uses for retired buffers, because lists recorded but not yet sent may still name them. - Descriptor slots and per-list views hold COM refs (`Kept`), so a buffer they use is never idle. - A reused buffer is zeroed and gets a new `Shadow` (new id, no card side, no dirty state). - **Tests:** `shadow::spare_tests`. - **A/B:** - `VICTORY_EXACT_REUSE=0` gives the v7 path. - `VICTORY_EXACT_REUSE_SAFE=0` gives v8's weaker gate. ### 4.3 Mapping waits on a shared signal: `VICTORY_MAPPED_SHARED` (v7, `825e8e7`) - **File:** `crates/victory-gpu/src/host.rs`, in `mapped()` - **Problem:** with `VICTORY_WAIT_RESIDENT` on, every new heap or buffer sent a copy on an aside queue and waited for it while holding one global lock. Run `run-v7-20261126-212142` had **161,200 waits in a row**. - **Fix:** any copy sent after the memory was made covers it. So threads now wait for any such signal, using a null-event `SetEventOnCompletion` outside the lock. - **A/B:** `VICTORY_MAPPED_SHARED=0`. ### 4.4 Translated list calls by kind: `VICTORY_THIN_OPS` (v7, `7d7fde7`; diagnostic) - **File:** `crates/victory-gpu/src/list/thin.rs` - **Problem:** v7 translated 27,000–31,000 calls a frame in 1.0–1.7 s of thread time. That is 35–62 µs a call, against 6.4 µs in Belobug's runs. - **What it adds:** the thin line now also prints the eight heaviest kinds of call (calls, ms, µs each). - **A/B:** `VICTORY_THIN_OPS=0`. ### 4.5 Card-cap turn-down log (v9, `f5c51f9`; diagnostic) - **File:** `crates/victory-gpu/src/shadow.rs`, in `card_room_for` - **Problem:** once card copies reached `VICTORY_CARD_BUFFERS_MB` (512 MB by default on budgets ≤12 GiB), later big buffers were turned down **silently**. They stayed in system memory and were compared on the CPU: **161.9 MB a frame**. - **What it adds:** a rate-limited `info!` line on each turn-down (the first 16, then every 64th). Behaviour is unchanged. ### 4.6 Why submissions wait on card steps: `VICTORY_CARD_STEPS_WHY` (v9, `02d3724`; diagnostic) - **File:** `crates/victory-gpu/src/host/card_steps.rs` - **What it adds:** counts the reasons `plan()` leaves a submission to the wait, by cause. - That is what found the placed-copy refusal (1.0–1.8 a frame, each a 38–49 ms+ wait), which `VICTORY_PLACED_ORDER=1` fixes. - **A/B:** `VICTORY_CARD_STEPS_WHY=0`. ### 4.7 Bind-time split: `VICTORY_BIND_SPLIT` (v9 `c7732cb`, v10 `0f9722c`; diagnostic) - **Files:** `crates/victory-gpu/src/draw.rs` and `list/thin.rs` - **What it adds:** per frame, `State::bind` is split into the early texture pass, descriptor tables, title memory by address, and the rest. - In v10, the tables part is split further into slots made, list views and exact copies (`BIND_NS[8]`). - This is what pinned descriptor tables, and exact-copy creation inside them, as the hot spot. - **A/B:** `VICTORY_BIND_SPLIT=0`. ### 4.8 SHR breakdown line: `VICTORY_SHARED_LINE` (v10, `69a259e`; diagnostic) - **File:** `crates/victory-gpu/src/shadow.rs`, plus `inplace::in_place_bytes()` - **What it adds:** a breakdown of the HUD's "SHR" figure (non-local video memory). It counts: - the CPU sides of host copies; - windows; - in-place regions; - the upload pool; - staging and readbacks. - It shows that SHR is there by design, not spill. - It also counts exact copies over port-1 memory. - **A/B:** `VICTORY_SHARED_LINE=0`. ### 4.9 `.gitignore` for isolated target dirs (v7, `c1af2da`) - Ignores `/target-*/`, `/logs/` and root-level `*.log` files. ## 5. main's fixes ported on top | main commit | Author | Status here | |---|---|---| | `af23c65` #1320: split submissions give their tables' slots back | cccw | `fe13d44`, clean `cherry-pick -x` | | `46da5ee` #1353: finish a pipeline queue entry when its build panics | Filip Michalski | `dd95546`, by hand. The v10 `make.rs` doesn't use `get_or_init`, so the compiler guard's bad-key check stays first and the build is wrapped in `catch_unwind`. Test brought over. | | `a463dcb` #1336: pin the texture a placed view aliases while the copy uses it (use-after-free) | cccw | `e2489cc`, by hand. `alias_of` returns `Held`. The two callers that copy (`draw.rs readable`, `external.rs prepare_input`) hold it. The two callers that only check (`texture_at`, the texture-ahead pass) use a new `has_alias` that takes no reference, so a check can never be the last release while a lock is held. | | `e4245f3` / `52ac4ec` #1324: dynamic descriptor slots go back only to the heap that took them | cccw | `fe703a0`, by hand. `HostHeap::id` (`NEXT_ID`), `State::dynamic` keeps `(heap, id, first, n)`, and `release_dynamic` / `HostHeap::release` check the id. Test brought over. (On `main`, this change landed inside `e4245f3`, and `52ac4ec` carries only its message.) | | `2440c7b` #1321: a stale staging file no longer loses a translation | cccw | **Already covered.** This tree's `victory-pipeline/src/cache.rs` already retries up to 128 new names on `AlreadyExists`, and has the test `staging_retries_collisions_without_changing_existing_files`. | ## 6. Environment variables **Added or changed by our v7–v10 work** (code defaults; "on" means on unless set to `0`): | Variable | Default | What it does | A/B | |---|---|---|---| | `VICTORY_EXACT_REUSE` | on | Reuse exact-copy buffers | `=0`: always create (v7) | | `VICTORY_EXACT_REUSE_SAFE` | on | v9 gate: bury lag (64) finished submissions + frames | `=0`: v8 gate (in-flight only) | | `VICTORY_EXACT_REUSE_FRAMES` | `3` | Frames a spare waits before reuse | Raise to be more conservative | | `VICTORY_MAPPED_SHARED` | on | Mapping waits on a shared signal, outside the lock | `=0`: v7 | | `VICTORY_THIN_OPS` | on | Heaviest translated call kinds on the thin line | `=0`: not timed | | `VICTORY_CARD_STEPS_WHY` | on | Why submissions are left to the wait | `=0`: not counted | | `VICTORY_BIND_SPLIT` | on | Bind and descriptor-table time split | `=0`: not timed | | `VICTORY_SHARED_LINE` | on | SHR breakdown line | `=0`: not printed | **Belobug switches we measured with** (the defaults are Belobug's and unchanged; this is the set we ran): | Variable | Code default | We ran | Note | |---|---|---|---| | `VICTORY_PLACED_ORDER` | off | **`1`** | Removes the placed-copy refusals (§4.6) | | `VICTORY_PORT_CONSTANTS` | off | **off** | **Keep off**: it causes the face spikes and doubles GPU time (§8) | | `VICTORY_CARD_BUFFERS_MB` | 512 (≤12 GiB) | **`1024`** | With `…_MIN_MB=1`: CPU compare of ≥1 MiB copies goes from 161.9 MB to 0.0 MB a frame | | `VICTORY_CARD_BUFFERS_MIN_MB` | — | `1` | | | `VICTORY_WAIT_RESIDENT` | on | on | Required for safety on NVIDIA (see the device-loss notes in `host.rs`) | | `VICTORY_THIN` / `VICTORY_THIN_THREADS` | — | `1` / `6` | | | `VICTORY_PORT_GUARD`, `VICTORY_PORT_JOURNAL` | off | `1` | Ports 6 and 7 | | `VICTORY_JOIN_PARTS`, `VICTORY_UPLOAD_AHEAD` | — | `8`, `1` | | | Plus | | | `VICTORY_TEXTURE_NO_WAIT=1`, `VICTORY_RELAY=2`, `VICTORY_WIDE_BACK=1`, `VICTORY_CARD_REHASH_RUNS=1`, `VICTORY_JOIN_COPIES=1`, `VICTORY_INDIRECT_WINDOW=1`, `VICTORY_RELAY_COPY=1`, `VICTORY_CARD_STEPS=2`, `VICTORY_INDIRECT_BATCH=2`, `VICTORY_MAP_THREADS=1`, `VICTORY_TITLE_PRIORITIES=0`, `VICTORY_CARD_AWAKE=1`, `VICTORY_SHOW_AFTER=1`, `VICTORY_D3D12_DRED=light`, `VICTORY_DSTORAGE_STAGING_MB=256`, `VICTORY_MAP_LEAN=1`, `VICTORY_STREAM_PRIORITY=1`, `VICTORY_FRAME_INTERVAL_MS=16.667`, `VICTORY_D3D12_ADAPTER=NVIDIA`, `VICTORY_PANEL=1` (from Belobug's `scripts/play.ps1` stack) | ## 7. Benchmarks (RTX 5070 + 5800X3D, GTA VI) **Rig and settings** - RTX 5070 12 GB (budget 11,175 MB), Ryzen 7 5800X3D, 31.9 GB RAM, Windows 11. - GTA VI `game_scarlett_master.exe`, Series X mode. - Numbers come from the frame-line logs and the HUD. **End to end** | Build | FPS | Frame time | GPU busy | CPU | Visuals | |---|---|---|---|---|---| | v9 config (port 1 on, `PLACED_ORDER` off) | ~4 (4.4) | 225–268 ms | ~33% | ~89% | face spikes | | **v10 = this PR** + §6 settings (port 1 off, `PLACED_ORDER=1`, exact reuse on) | **~9** | **113.6 ms** | **~86%** | **~59%** | **spikes gone** | **Subsystems** | Measure | Before | After | Source | |---|---|---|---| | `descriptor tables` bind time per frame (all threads) | **1,073.1 ms** (reuse off) | **212.4 ms** (reuse on; 208–212 across frames) | `VICTORY_BIND_SPLIT` line, runs `225548` / `225146` | | Whole `bind` per frame | 1,132.9 ms over 9,325 binds | 250.2 ms over 9,589 binds | same | | New exact-copy buffers per frame | 650–675 | a few dozen | `exact` line | | Mapping/residency waits for new memory (cumulative) | 292,400 waits, 31.3 s at 22:58 CET; ~293,000 waits, **~59 s** over the session | 21,200 waits, 3.7 s | `WAIT_RESIDENT` line | | CPU compare of ≥1 MiB copies | **161.9 MB/frame** (cap 512 MB) | **0.0 MB/frame** (cap 1024 MB) | `shader writes looked for on the CPU` line, runs `215944` / `225146` | | GPU time, port 1 on vs off | 202 ms | 88 ms | §8 | | Placed-copy refusals | 1.0–1.8 a frame, each a 38–49 ms+ wait | 0.2 a frame and 0 ms settles with port off; none with `PLACED_ORDER=1` | `VICTORY_CARD_STEPS_WHY` line | **Caveat:** the two runs behind the bind numbers (`225548` / `225146`) also differ in render scale and in port 1. The table cost, though, is almost all exact-copy creation, which reuse removes directly. ## 8. Root cause: face spikes = PORT_CONSTANTS, not EXACT_REUSE **Symptom:** faces and skinned meshes showed vertex "spikes". The first A/B changed exact reuse, port 1 and render scale at once, so it looked as if reuse was to blame. **Mechanism** - `VICTORY_PORT_CONSTANTS=1` (renderer port 1) opens the title's 185 MB graphics region **in place**, as CUSTOM/system-memory heaps (`OpenExistingHeapFromAddress1`). - Its 174 MB heap at `0x34e10000` holds **the constants ring and the skinning output**. - In place, "nothing is tracked, sent up, fetched back or compared". So GPU skinning writes go into that memory with nothing ordering them against CPU-side work. - Views that sit off their elements at ring positions in this heap get CPU-side exact copies (`shadow::exact`): 4,600–5,150 askings a frame. - Those copies snapshot **stale** skinning output and constants. The draw then flings vertices out of the face. **Port off** - The heap becomes an ordinary card copy (174 MB, under the 1024 MB cap). - Shader writes to it are declared, compared and landed. - CPU reads that overlap them wait. - The faces are clean. **GPU time follows the same cause** - In place, every draw's constants and vertices cross PCIe: **202 ms with port 1 on vs 88 ms with it off**. - The port-on run was at the *lower* 0.5 render scale, which should have made it faster. **Why reuse is not the cause** - Reuse's gate waits for finished submissions plus 3 frames. - Holders keep COM refs. - Buffers are zeroed and get a new `Shadow`. - Guards and landings key on the `Shadow` id or the title address, never on the buffer. **Confirmed in game:** port 1 off with reuse on gave **clean faces**. Port 1 stays **opt-in (off)** in code. ## 9. What changes for main (read before merging) Because the merged tree is the v10/Belobug tree, these parts of `main` that came after `a26859f` are **replaced by Belobug's equivalents, or removed**. **`main`-only modules not in this tree (17 files)** - `crates/victory-gpu/src/`: `backreads.rs`, `cardmeter.rs`, `drvwatch.rs`, `fpsbox.rs`, `framelog.rs`, `heap_pass.rs`, `heap_worker.rs`, `plaincopy.rs`, `profile.rs` (+ `profile/tests.rs`), `queue2.rs`, `renderdoc.rs`, `shot.rs`, `spread.rs`, `stats.rs` - `crates/victory-shader/src/emit/`: `dispatch_threads.rs`, `halves.rs` - With them go `main`'s switches such as `VICTORY_HEAP_WORKER`, `VICTORY_SHOT`, the frame log, the FPS corner box, the driver watch, the card meter and the profiler. - Belobug's tree has its own HUD panel (`VICTORY_PANEL`), timeline and replay tooling instead. **`main`'s changes inside shared files** (for example card hashing a thread group a piece, 4 KiB dirty tracking, gather segments, `main`'s texture fixes) - These are present only where Belobug's tree has its own version. - Where the two conflicted, Belobug's version was kept, because `main`'s shader path renders black on our hardware. **Kept from `main`** - `diagnostics/`, all of its history, and the five fixes in §5. **Diff vs `52ac4ec`** - **235 files changed, +88,342 / −33,966.** - Of that, `victory-shader`, `victory-pipeline` and `apps/victory` account for 50 files, +10,714 / −2,847. **If you'd rather keep `main`'s instrumentation:** these features can be re-ported one at a time on top of this tree. They are diagnostics, and none of them is needed for correct rendering. ## 10. Verification **Setup** - Windows 11, RTX 5070. - Branch `pr/fxceless-full-v10` at `fe703a0`. - Isolated target dir: `CARGO_TARGET_DIR=target-pr-full-v10`. **Commands** ``` cargo test --locked --release --workspace --exclude xtask --no-fail-fast cargo build --locked --release -p victory ``` **Results** - **Tests:** **1,039 passed, 0 failed, 45 ignored**, across 28 suites. - The ignored tests are the tree's existing hardware/adapter-gated ones. - The count includes the ported tests `descriptor::host::tests::dynamic_slots_are_given_back_only_to_the_heap_that_took_them` and `pipeline::make::tests::a_panicking_pipeline_is_refused_and_the_worker_continues`, plus `shadow::spare_tests`. - **Build:** release build OK. - `victory.exe` is **11,577,856 bytes**, SHA-256 `05722876BE487967701DB599DCDE78F8DBD37CE860CDAC1E049A77F78DC07A45`. - The one compiler warning (`Spares::take` is used only by tests) is harmless and was already in v10. - **Conflicts:** `git merge-base --is-ancestor 52ac4ec HEAD` is true, and `git merge-tree --write-tree 52ac4ec HEAD` is clean. **Zero conflicts** merging into `main`. - **`--locked`:** no lockfile drift. - **In game:** GTA VI on the v10 tree with the §6 settings renders correctly: ~9 fps, no face spikes.
The host removes the device for a constant buffer view of more than 65,536
bytes. The title's view heap holds larger sizes in slots it does not use,
and the size went to the host as it was.
The console ignores blending on integer render targets and the title
leaves it on (the world has a mesh pipeline blending into an R8_UINT
target). D3D12 does not allow it: vkd3d-proton refuses such a pipeline
with E_INVALIDARG and its draws are lost. The host pipeline now turns
blending off on integer targets; with one description for all targets,
each target gets its own copy so the others keep theirs.
The guard on view memory sees no write made through another view of the
same pages; such a change was found only by the hash every eighth frame.
The boot logo video and the loading animation write their textures that
way every frame (a ring of three): each showed up to eight frames late
and in turns, so the presented picture cycled through three, a new one
every eight frames, and flickered. The six-star screen of the first
seconds changed before the hash ever caught it.

A guarded texture is now hashed at every check for its first 64 frames,
and for 64 frames after each change the guard missed; textures that stay
unchanged go back to every eighth frame.
VICTORY_TEXTURE_HOT=0: every eighth frame only, as before.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every indirect execution was followed by a move of the list's clamped
arguments back to the common state, and the next clamp moved them from
common to unordered access. Drivers may treat a barrier into or out of
the common state as a full wait, so even the window path
(VICTORY_INDIRECT_WINDOW=1), whose draws skip the clamp, still recorded
one barrier between every two draws.

The list now remembers that its scratch buffer was left readable as
indirect arguments: executions read it with no barrier of their own, the
next clamp moves it straight back to unordered access, and it returns to
common once, when the list closes or a bigger buffer replaces it. The
waits for earlier shader writes around the clamp are unchanged.

Tests: two windows of executions with no barrier between them, on WARP
and through a host list; the tracked state across clamps, growth and
reset; the existing clamp tests follow the new states. With
VICTORY_D3D12_DEBUG=1 in a diagnostics build, the host-list tests also
check that the debug layer reports nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A frame's worth (3,200) of one-record indirect draws of our own, clamped
one at a time and in windows of 32, recorded with the old barriers (back
to the common state after every execution) and the new ones, timed with
GPU timestamps around the list. Ignored by default; any machine with a
GPU runs it in seconds, no title files needed:

cargo test -p victory-gpu --release --lib indirect::bench -- --ignored --nocapture

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The clamp charged the list's budget record by record: an atomic read and
a compare-and-swap loop per record on one word, every thread of a window
racing for it, so a group of n records took n rounds and about n*n/2
atomics. The word is CPU-visible memory (zeroed on the CPU at
submission), so on a card of its own each of them crosses the bus. On an
RTX 5070 Ti the benchmark's windows of 32 took 46-50 ms for 3,200 draws
where draws clamped one at a time took 19 ms (#220).

Now the records' costs go to group-shared memory, one thread charges
their sum with one compare-and-swap (retried only if another group got
there first), simulating the same saturation record by record in lane
order, and every thread reads whether its record fitted. The mesh
diagnostics (largest group count asked, groups asked in all) are summed
in the group and added once. What a record costs and when it runs empty
are unchanged; which records of a group fit is now their lane order
instead of the order the GPU served the race.

Test: a group with 300 left of the budget keeps its first draw (100),
empties the second (250, which takes the rest) and the ones after it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- The clamp's charge per group walks the group's own records (one, for a
  record clamped alone) instead of all 64 slots.
- The host-list tests read the debug layer's messages after closing the
  list and before the submission, which moves them to the log (review).
- The benchmark lives in its own file and records five cases: what main
  records, one record at a time and in windows of 32; what this tree
  records, both ways; and windows with the new barriers but main's clamp,
  to tell the two changes apart. main's clamp is kept in the benchmark to
  measure against.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Two more cases, one record at a time and windows of 32, with this
tree's clamp and the budget words in a device-local buffer instead of
CPU-mapped memory: whether the clamp's atomics crossing the bus are
what a draw clamped alone still costs on a card.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The clamp charges the list's budget with atomics: at least an atomic
read and a compare-and-swap in a row for every clamp, so for every
indirect execution clamped on its own. The budget was in memory the CPU
maps (zeroed on the CPU at submission), so on a card of its own each of
those crosses the bus.

Now the words live in a device-local buffer of the list. The list zeroes
it before its first clamp (WriteBufferImmediate, as a copy), the clamps
charge it as before, and when the list closes the clamp's notes on mesh
records are copied to the mapped words, where the next submission reads
them for the frame line as before. VICTORY_INDIRECT_CARD_BUDGET=0 keeps
the old place, for an A/B; lists without ID3D12GraphicsCommandList2 keep
it too.

Test: a recording whose clamps spend the whole budget, then one with a
small record after the reset, which runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
An execution may ask for thousands of records with a count buffer that
counts a few: the clamp runs a group per 64 asked. Before the charge per
group, the threads past the count returned at once; with it, the first
thread of every group read the budget word, and for mesh records added
the group's notes to it, records or none. In memory the CPU maps that is
up to three atomics across the bus per empty group (on an RTX 5070 an
in-game A/B of 32c6229 ran slower, #220). Now a group without records
makes no atomic; the group's barriers stay in uniform control flow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Textures and staging cut from 64 MB blocks; a kept view per page section and
page lists read again until the title has filled them in; the GPU side told
when streamed bytes land; results fetched over the copy queue
(VICTORY_RELAY_COPY=1); the write-watch journal behind a reader-writer lock;
the shader cache keyed by the translator's sources and `victory shaders`;
helper lanes as in upstream 1733 (VICTORY_HELPER_OWN).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	apps/victory/src/main.rs
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The submitting thread stood 25-30 ms a frame for one 480-byte constant
buffer and one 20 KiB buffer copy a frame whose source lies in the title's
174 MB heap, which a pass of nearly every flight is declared to write whole
(a root view has no size). With VICTORY_CARD_STEPS=1 such a constant buffer,
with =2 such a copy too, is made on the card by a list of ours in front of
the submission's lists, behind the flights; anything the argument does not
hold for waits as before. Off by default.

Diagnostics: the five waits for flights that cost most, every second, by
what waited, why it was not done on the card, the declared write and the
shaders that declare it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	crates/victory-gpu/src/indirect.rs
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- An image or structured buffer whose descriptor is read for its size
  alone (the puddle passes, a water simulation step).
- The record count of a structured buffer is asked of the raw view the
  host makes of it: as a structured view's it was in bytes on AMD.
- Primitive-ordered pixel shading becomes rasterizer ordered views (the
  hair cards' layers).
- A 16-bit wave sum where not every lane runs, on 64-lane waves, bit for
  bit as the console's tree.
- "Some lane is left" of a mask operation as a number; scalars parked in a
  VGPR used before; a one-channel store into a counter texture (the
  upscaler).
- translate --list prints a hash of every emitted module.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
VICTORY_LIGHT_REFRESH (on): view memory nothing wrote since the last asking
is known by a bit a block, copies nothing of which changed wake no thread,
the ends of a range are not copied at every refresh, long copies are split.
VICTORY_LAND_WINDOW=1: what shaders wrote goes into guarded title memory
through a view of ours of the section, the guard stays.
VICTORY_SEND_CHANGED=1: pages taken again go up to the card where they differ.
VICTORY_HEAP_SPREAD (on): a sixteenth of the heap's slots at every pass.
Three log lines split the preparing, the askings and the heap pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The runtime maps a view and then tells the write watch. A refresh on another
thread could guard the new blocks in between, and the telling then forgot
them and left them read-only: the title's next write to one was an access
violation nobody takes. Told of a new view, the watch now gives the write
access back; before an unmapping it only forgets, as before.

The test binary's random crashes were d3d10warp.dll's own, with two tests on
the software adapter at once: they take turns now. The watch's tests forget
their guards before their memory is freed (another test's memory could get
the address and inherit them), and three more are no longer tied to other
tests' memory, the adapter's other work or a busy PC's timing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
One pass clamps the arguments of all indirect executions between two
points where they may change; its jobs are in upload memory that is filled
while the list is recorded. The replayed frame: 2,355 clamps become 980
passes, 86.1 -> 77.7 ms; with VICTORY_INDIRECT_BATCH=2 133 passes,
84.6 -> 75.3 ms.

Replay: --batch-clamps, --only-buffers, --listing; --compare runs turn by
turn.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The relay's thread merged some 1,500 pieces of 64 KiB (98 MB) a frame one
after the other: 45 ms in the frame's shape, of them 22 ms copying and
merging, 18 ms the kernel's faults on the first write to each page of memory
just made writable, 5 ms protection calls. Now one AVX2 pass a piece, in jobs
on four threads, through a view of ours of the title's pages that is never
guarded (VICTORY_LAND_BESIDE): 8 ms. The log splits a landing's time.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A buffer copy whose destination another step of the submission read was
refused and waited for flights (10 ms a frame in run steps-1). Copies and
fills that depend on a taken one, or it on them, are now taken too and done
level by level in the steps' order; a fill of a texture's upload buffer as
well. Reads on the CPU ahead of the copy are no reason to refuse.

The waits for title memory changed under shader writes that came up behind
it: pages of the title's constants have more changed runs than the 512 a
submission sent up (4096 with the switch), and where it still waits, it
waits for the flights that declared the range, not for everything.

Diagnostics: refusals name the kind of step, waits under shader writes their
reason and the host copy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Water transmission volumes and the rest of the upscaler translate.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
VICTORY_FETCH_CHECK=1 (off by default): with VICTORY_RELAY_COPY a piece is
fetched beside later submissions, and one of those that clears it and fills
it again with the same is not flagged by its compare: title memory and the
CPU's side kept what was in between, and the next refresh of the 64 KiB
sent it up over the right bytes. The compare now gives the piece's hash
with its flag; a fetch that is not that is made again by the next flight
that may write the piece. (The test shows 11-12 of 12 wrong without it.)

VICTORY_UPCOPY_CHECK=1 (diagnostics): at each send up, the words that the
title did not change and the card holds another value of; every few seconds
at rest, the words in which a copy's card side is not its CPU side, and
whether they were declared as written and fetched.

victory replay --upcopies: the same question of a captured frame, and which
pieces were written undeclared (replay1 and replay2: compute
82a2ad6d07417d36 through views picked by index, 73-75 pieces a frame).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	crates/victory-gpu/src/indirect.rs
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
What is landed beside the guards is an entry of the journal, after the
bytes are in: the blocks stay guarded, clean and known by their bits.
VICTORY_LAND_WINDOW goes, VICTORY_LAND_BESIDE does its work; the runtime
tells of a section it lets go, and our view of it goes too. A test of
landings, title writes and light refreshes at once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The runtime maps a view and then tells the write watch. A refresh on another
thread could guard the new blocks in between, and the telling then forgot
them and left them read-only: the title's next write to one was an access
violation nobody takes. Told of a new view, the watch now gives the write
access back; before an unmapping it only forgets, as before.

The test binary's random crashes were d3d10warp.dll's own, with two tests on
the software adapter at once: they take turns now. The watch's tests forget
their guards before their memory is freed (another test's memory could get
the address and inherit them), and three more are no longer tied to other
tests' memory, the adapter's other work or a busy PC's timing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A raw UAV buffer the program loads with GLC is globally coherent on the
host (the upscaler's waits for other groups, the ped blend shapes): a
load in a loop that only waits would be made once otherwise. Ten shaders
change by it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The check of fetched pieces (VICTORY_FETCH_CHECK) with the landing pool:
pieces are gathered and ordered as there; with the check whole pieces come
down and are hashed by the job that lands them. Off, the fetch is the
landing's own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title maps the pages of a batch, and fills in their page lists, in its
own submit (image +0xe88f0): first the batch's mapping list (+0xf2c470,
which writes the page lists at +0x55aa6a0), then the status entry, then
our Submit. A list is a piece of one table, a number per 64 KiB of address
range, that is only ever overwritten. Our queue submitted itself at half
its capacity (2,079 of 4,159), which the title's batches (up to 4,095)
pass three or four times a load: those requests ran up to 0.6 s before
the lists were filled in, on page 0 (waited for) or on the page numbers an
earlier mapping had left (known, so written: somebody else's memory).

- A queue submits itself only when it is full of commands nobody submitted.
  VICTORY_DSTORAGE_HALF=1: at half, as before.
- A list that changes during the write has its new pages written too.
- "page list was not filled in yet" is said (as a warning) only of lists
  that were not: nearly all of its lines were waits for the page table's
  lock.
- A read of a file the host refuses is logged and tried again, its
  destination opened again before.
- VICTORY_DSTORAGE_TRACE=1 (a line per batch, and per request something is
  wrong with), 2 (every request).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Off by default. A shader that stores through a view it picks by an index (37
compute programs of the title, 82a2ad6d07417d36 one of them) writes buffers
nobody declared. With a submission that has one, the buffers found written
that way are declared and landed as any; of the other buffers the heap shows
unordered views of 32 MB a frame are compared on the card, in turn, and one
that changed undeclared is found. Found late is not landed late.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- What the kernel is writing (file reads) is not guarded by a refresh before
  the call is done (`kernel_writing`): the read would have failed.
- A title thread that uses a page while the runtime remaps another page of
  the same view waits for that in the fault handler; it faulted on a page
  the title never gave up.
- Blocks being unmapped are not guarded again, memory the title frees leaves
  no notes of its blocks (its VirtualFree is taken over), and other memory at
  an address once guarded or absent keeps its protection.
- The second part of a submission's one asking has a number of its own.
- What shaders wrote waits for a change of mapping instead of being lost;
  what could not be written is counted and said; zeros into title memory
  that went are no fault.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
VICTORY_KNOWN_HOLES (on): a placeholder's holes are known until the runtime
tells of a mapping or an allocation there; other holes are asked about with
the guards' lock not held. VICTORY_LAND_TAKEN (on): a copy a landing went
through is noted as up to date with it. The split tells more of the askings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
One constant used by a comparison and an ordinary sample became a
comparison sampler for both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ports of 7d04943 (a signed 64-bit operand sign-extends its literal),
645391b (a normalized buffer format's ends load as exactly 1.0 and -1.0),
40f30be (FLAT offsets ignore bit 11), 3d71ad1, 344704e, 5d6889e, 78c1267,
c3a04e2, e3fe5bf and the tests 259ba31, 8610ffb, 41b2472, 45ed8e3, 8d67fa5.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ports of 6f36cdf (normalized attributes of rectangle lists), 97c8783
(A8_UNORM is not of the R8 typeless family), b956320 (copy footprints of
depth-stencil textures), c1c3281 (the descriptor ring's wrap), e6fe8ec and
e34cb53 (CreateSamplerX bounds), 691236d (appended elements are aligned).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- All 24 workers read each file through one handle, whose reads the host
  does one after the other: 48 KiB at random from levels.rpf gave 185 MB/s
  where a handle per worker gives 990 (5 GB/s against 14 from the cache).
  VICTORY_DSTORAGE_IO=one|handles|overlapped|direct (handles).
- xmem: the title's pages by number, and where it sees them, each have a
  lock of their own, apart from the one its mapping calls hold while the
  host maps, commits and unmaps. Looking pages up, filling one and telling
  of it, 24 threads beside one that maps: 2.7 million requests a second
  for 0.57, 145,000 maps a second for 60,000. A view is noted before the
  GPU side is told of it, so that a write between the two is not missed.
- Title memory is not touched with these locks held.

Benchmarks: read_bench (VICTORY_BENCH_FILE), map_bench, both ignored.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The pass that uploads textures picked by index asked the host for every
64 KiB of every texture it looked at, and twice for each block that was not
there (12,000 slots wait for their memory during a load, each looked at
again and again): 146 us for a texture of 22 MB, 721 us with 1 MB of it
there. The views of physical pages are known: 1.4 and 0.1 us. Memory that
is in no view is asked of the host as before. VICTORY_MAPPED_BY_VIEWS=0:
always. Measurement: cargo test --release -p victory-gpu --lib look_costs
-- --ignored --nocapture

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Blocks the kernel writes, or the runtime is unmapping, are no known holes
and not published; foreign blocks are never held; freed memory forgets its
known holes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
After each command that can change a texture, the texel under a point of
the picture is copied out; commands that changed one are named with their
pipeline and the values before and after. The listing names textures.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The scan was cut to the heap's length, which left out the slots past the
cursor a run that crosses it needs; upstream's corrected test (072fde0).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title's tile lists are dispatches of a group per tile: in the captured frame 2dc364df5d3278b8 asks for 67,440 groups (the one before it 67,272) and 940c2635dc1312f4 for 47,760, the 115,200 tiles of 2560x1440. The clamp cut the first to 65,535: 1,905 tiles at the list's end, the lowest of the picture, did not run. Up to 2^20 groups run as asked on AMD cards (a test on the card: every group once, under its number); more still runs 65,535.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit b856c46dd10bbb550157b255d113a3cca2f3f38a)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
On by default. Sends to card copies were copies out of their CPU sides made
when the card came to them, and later submissions had written those by then:
of three submissions that each copy a value to the same bytes and read them,
all read the last one's (test: 12 of 12 wrong). The bytes are taken into
memory of the submission's own at preparing; short runs go as one scatter per
copy. Title buffer copies go up whether our side changed or not.

VICTORY_CARD_ALL=1 (off): every title buffer's copy has two sides, so that
this holds for the small ones too (they are written in place now, under the
submissions in the air). VICTORY_PICKED_WRITES: 1 declares, 2 lands too.

The check (VICTORY_UPCOPY_CHECK): what a submission took twice is no longer
counted as older values sent; copies of the title's out of their place in a
submission; copies held for unchanged that are not title memory's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The console's syncs recorded nothing on the host, which orders nothing
between dispatches by itself. The ray-tracing structure builder has no
other wait between its stages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A shader that walks a structure takes its address out of the structure's
descriptor. The view has no resource, so the address came out 0 and every
ray missed. Also: only programs that store by raw address declare the
copies they reach that way as written.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A view D3D12 cannot place (a raw view off 16 bytes, a structured one off
16 and off its stride, a typed one off its element) was null, and the
shader read zeros: the colour-table bakes' parameter blocks are raw views
at byte 8. Such a view now gets a copy of its own bytes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit b2a3ce9ced69e669d2d56e20c2dca7011b7e405a)
Also: victory replay --images writes the bytes of buffers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
On by default. They were all done on the CPU when their submission was
prepared, ahead of its first draw: of copy, draw, copy, draw both draws read
the second, and a source a shader writes earlier in the submission was read as
it was before. The list copies now, in the destination's host copy, out of the
source's host copy where shaders write it, else out of upload memory filled at
submission; copies into textures take what shaders wrote too. Title memory and
the reference of the host copy take the bytes at submission as before, so the
landing finds only what the card made of them.

VICTORY_WINDOWS_OWN=1 (off): windows have two sides as well.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The fork's guard over every view of a physical page is kept on our own block
bits, known holes, kernel writes and changing blocks; what both had, ours.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
With VICTORY_TEXTURE_NO_WAIT=1 a refresh that met the runtime remapping
title memory read the whole chain or nothing. A texture the title holds
only the smaller levels of is never all there, so nothing was read, and
the upload recorded before put the staging buffer's zeros over the
levels on the card. A staging buffer never filled now takes the pages
that are there; what was away for the moment of a change is read after
it, and a filling with less than was mapped makes the slots due again
(at most 8 times in a row). VICTORY_TEXTURE_FILL=0: as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Descriptor records the title copies as bytes are mirrored before each
submission. Views off their copy's elements: our rule (raw views too, and
now typed views on 16 bytes), the fork's copies. Wave sums of halves: ours
(the fork's test passes with it). Sizes of descriptors nothing uses: ours,
then the fork's for 2D images. The fork's count of cut indirect groups is
left out: up to WIDEST groups run as asked here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
mirror() previously dropped the SHADER_HEAPS lock inside shader_slot() before using the returned &Heap, allowing a concurrent Heap::drop to free the heap while mirror() accessed it. Also guards copy_simple() against invalid descriptor kinds, rejects placed heaps whose address+size wraps u64, and checks offset+count*bytes in resolve_queries() against overflow (with a regression test).

(cherry picked from commit 628b95da5e)
A frame that ends in a packet where no frame begins (the tail of a frame that crossed packets, then padding) left the next frame pointing into that padding, which ended the stream early. Now the next frame is found by following each packet's skip to the next packet with frames.

(cherry picked from commit ba42db643c15c1b7fb17ba40464dddda36c1db60)
Our own completions looked their call up again by block address: after a
provider's DoWork returned, after a cancel, after a failed begin, and when
queued DoWork ran. A provider usually ends its call itself (XAsyncComplete
from DoWork or Cancel), and once it has, the title may begin a new call on
the same block, from its completion routine or from a thread that polls
the status. The lookup then found that new call:

- the old call's DoWork result (S_OK, size 0) or cancel (E_ABORT) ended
  the new call before it had done anything, ran its cleanup and fired the
  completion routine a second time;
- DoWork still queued for a canceled call ran the new call's DoWork.

Each queued DoWork now carries the call that scheduled it and runs only
while that call is still the block's, and DoWork, cancel and begin
complete that call. A call that is already over ignores a second
complete, so nothing reaches the next call. XAsyncComplete itself still
goes by block, as providers name their call by its block.

(cherry picked from commit d01b17070d)
Fail when a requested scan root cannot be opened. Report traversal errors below a readable root alongside the other skipped inputs.

(cherry picked from commit b1bdd8994a)
A callback submitted with a delay waited on a thread of its own and was
delivered when the delay ran out, whether or not the queue had been
terminated meanwhile. XTaskQueueTerminate only canceled what was already
in the ports, so a pending delayed callback was not canceled: it ran
later as live work (canceled = false), after the termination callback,
by which time a title may have freed what the callback uses.

The queue now keeps its delayed callbacks in a list until their delay
runs out. Terminate cancels them along with the queued ones, before it
calls the termination callback, and a delay that runs out after that
finds nothing to deliver. A submit racing Terminate checks `terminated`
under the list's lock, so the callback is either canceled or refused.

(cherry picked from commit b9ff219826)
`victory run GTA6.exe`, run from the game folder, gives an exe path with
an empty parent, and that empty folder was mounted as G:. An empty path
cannot be made absolute, so the root stayed empty and G:\x64\a.rpf
became \x64\a.rpf: the root of the current drive. The title then found
none of its files.

An empty root is now the current directory, which is what an empty
folder means everywhere else (`Path::new("").join("x")` is `x` in the
current directory). Passing a path with a folder in it is unaffected.

(cherry picked from commit 01ae55a3ba04c39a0e8851cc00da16af7a49adbd)
imdct_half worked out every pre- and post-rotation with sin_cos on each
call (n of them per subframe) and ran its FFT on two fresh Vecs. The
rotations, the bit-reversed order and the butterfly rotations now come
from a table built once for 128, 256 and 512 samples; the work buffers
live on the stack. Every value is computed with the same expression (the
butterflies with the same running product), so the output is bit for
bit what it was.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 4eb0898b3cbd6d0bbbffad540aca5d7e3531ac58)
Decoder::decode took the caller's bit count as the end of the frame. Past
the data the bit reader returns zeros, and a stereo tile header reading
only zeros gives the subframe to no channel, so it never moves on; with a
count beyond the data it never overreads either, and looped for good.
Clamp the end to the bits the data holds. A frame from read_frame always
holds its bits, so its decoding does not change.

Add deterministic noise tests (xorshift64, fixed seeds, as BCPack's):
buffers of noise packets, streams of noise frames with clean and damaged
headers, frames in mono and stereo at each sample rate, bit counts past the
data, and read_frame and packet at any offset. Every walk is bounded and
every decode must give one frame of samples. The bit-count test hangs
without the fix; the others pass on main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit d4d1822049fed053c6188ea0b016b0976a71bf41)
When a frame ended a loop, decode cut it at the loop's end subframe, set
the loop's skip (the subframes of the loop's first frame that lie before
the loop) and then took that skip out of the frame in hand: the loop's
last. So the head of the last frame was dropped instead, and the first
frame played from its start, with the audio before the loop in it. The
number of samples came out the same; the seam did not.

The pending skip is still applied to the frame in hand, and the loop's
skip is set after it, for the frame decoded next.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
(cherry picked from commit 985d8d4b025384b5f13a3177ef906c8b6cce6840)
The source resolver's rule (local files only) knew a share as `\..`,
`//..` or `file://server/..`. The host knows more spellings: any two
leading separators (`/\server\share`), the object manager's prefix
(`\??\UNC\server\share`), and a `file:` URL with no host whose path
starts with two separators (`file:////server/share`,
`file:\server\share`, also percent-encoded). Those fell through as
relative paths or drive-less local files and went to the host's
resolver unchanged.

They are refused now, naming the server. Paths with one leading
separator, a drive after the slashes or the prefix, and the path of a
URL that names this machine pass as before.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
(cherry picked from commit 11ca3ce492)
Based on #34 by ka1qux (commit faa0a9a), rebased over #45, which added the
same flag and register helpers for clwb loops; the duplicates are merged
into gpr/cmp_flags/CMP_FLAGS.

clzero: the two loops compilers build around it are done whole in one
exception, leaving registers and flags as the last pass would. Anything else
around it is one line and the next instruction.

rdpru: returns the time-stamp counter for MPERF and APERF, 0 for other
counters, and leaves the flags as they are: a Ryzen 7 5800X3D running it
natively in user mode changes none, for known counters or not.

Added over #34:
- loop 1 rejects cmp rax, rax (it fell into the loop and left wrong flags);
- tests that go through the emulation on any CPU (both loop shapes, the
  rax-rax and wrong-neighbour fallbacks, rdpru with both flag states), since
  on an AMD host the native tests never enter the handler.

(cherry picked from commit 0de9efced179dfb523748f21cf4bdbe0d3aa7533)
(cherry picked from commit e57e76a7b4)
Stack dumps (VICTORY_STACKS, diagnostics builds) read another thread's
TEB right after NtQueryInformationThread and suspended it only later: a
thread exiting in between frees its TEB, and the read faults. The
thread is now suspended first and resumed on every way out.

The dump times went through Duration::from_secs_f64, which panics on
`inf` or `1e20`, killing the dump thread (the crash hook logs it as a
crash). They are parsed by `schedule` now, which leaves out NaN and
times no Duration holds. 1 new test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit acdcc41687be2ecd2bf2efc43ab7449329483382)
Calls are filed by their block's address, and a call that succeeded with
a result stays filed until XAsyncGetResult takes it. XAsyncBegin refused
any block whose address had a call filed. So when a title never took a
result and freed the block, the next block it was given at that address
could not begin a call: E_INVALIDARG, every time, with the old call's
provider never cleaned up.

A zeroed block is a new one: the block of a result left behind holds the
result's size, so it never reads zero. XAsyncBegin now ends a finished
call filed under the address of a zeroed block (its provider gets its
cleanup) and begins the new one. A call still in flight keeps its
address, and a block still holding a result is refused as before.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
(cherry picked from commit 5cff0007a5)
The decoder fills an XMA voice's output ring until the write block
(word 0, bits 27-31) comes round to the title's read block (word 9,
bits 0-4). The write block wraps modulo the ring size (word 0, bits
22-26), and so does a read block moved on by command 18, but a read block
the title set up at or past the ring's end was compared as it was: no
write block ever equalled it. With a stream that loops forever the pass
never ended, holding that voice's lock, so the title's next command on
the voice (advance, disable) waited for good, and releasing the context
arrays did too.

Take the read block modulo the ring size as well, as the write side
already does. A test sets up read block 6 on a ring of four with an
endless loop and requires the pass to end within seconds, with blocks 0
and 1 filled.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 1054fe87de08038e887d6f7c6f44e5b07ac7a9f9)
No graphics object's interface list holds IUnknown, so QueryInterface
for it (and every call that hands out an object by interface id) said
E_NOINTERFACE and returned null. COM code asks for it to compare two
pointers for identity, to keep an object as a plain reference, or to
pass it on to an API that takes any object.

object::is, which all of those go through, now also matches IUnknown.
The DXGI device answers with the D3D12 device, which it already stands
for: one pointer whichever of the object's interfaces is asked.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
(cherry picked from commit 92f2c60c8159e34a47570aa81f3d25624cc6db5c)
XStoreQueryPackageIdentifier documents E_INVALIDARG for a store id that
has no installed package. We returned XPackage's 0x89245208 instead.

(cherry picked from commit e3bef08985)
host::module held the module cache's lock while it called
LoadLibraryExA. Loading a DLL that is not loaded yet takes the OS
loader lock, and title code runs under that lock too (a title DLL's
thread attach, TLS callbacks run as threads start), where it can need
the cache: any first use of a host! function, or a late-bound title
DLL. One thread holding the cache and waiting for the loader lock,
another holding the loader lock and waiting for the cache: the process
hangs, and cannot even exit, as ExitProcess needs the loader lock too.

The cache is now looked up, then unlocked for the load, then locked
again to keep the handle; a thread that loaded the same DLL meanwhile
got the same module, which stays loaded.

(cherry picked from commit c6959acba3)
(cherry picked from commit 93a24b7cdaeb0e7f132f711e9cbd9ba405b0f639)
The MicrosoftGame.config reader ended a tag at its first '>', but XML
allows '>' unescaped inside an attribute value. A value with one
(DefaultDisplayName="A > B") cut the tag short: its '/>' was never
seen, so the element stayed open and every element after it was read
as its child. Game/TitleId and the storage quota were then not found,
and the title ran as id 00000000 with no storage quota, its saves and
temporary files in that folder, without a warning.

A tag now ends at the first '>' outside quotes.

(cherry picked from commit d549b6397e)
Co-authored-by: Claude Opus 5.5 <[email protected]>
(cherry picked from commit e6ebec9ccf)
XGameUiShowTextEntryAsync documents a 1024-character maximum on console,
1024 for a maxTextLength of 0, and 1024 for the Password scope whatever
the title asks. 0 meant no limit here, larger limits were kept and the
scope was ignored.

(cherry picked from commit 936e5e51c9)
A slice may not start at null, even an empty one, so asking for a title
image's name with (NULL, 0) was undefined behaviour; a debug build
aborted the process. A null buffer is now no buffer: nothing is written,
0 is returned and the last error is ERROR_INSUFFICIENT_BUFFER.

(cherry picked from commit c000581df2)
(cherry picked from commit 2c22e2b2d2)
(cherry picked from commit a3f89eda54)
(cherry picked from commit 75fe6c02b2)
A refused XMemVirtualAlloc or XMemAllocDefault handed the title a null in
silence, and the title then writes at null plus an offset, which reads
like a title bug. In #289 the faulting write is at 0x217800, the
request's length 0x2173a0 rounded up to 2 KiB, so the base it built on
was most likely such a null.

At the commit limit, XMemVirtualAlloc now writes the same crashes.log
report the physical-page commit writes since #51 (the shared part is
`commit_refused`); other refusals, and a host heap out of memory, are
warnings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 65062e133c)
(cherry picked from commit b796c8b8b80cfa4506f254474ab9fd7260bfd8e6)
An instruction guard depends on its EXEC and the reachability of its block. Keep the most recent result, including an elided guard, rather than repeating the same BDD queries for consecutive vector instructions. Scalar instructions still bypass guard selection.

Cover EXEC changes across and within a branch with a synthetic shader. Add a CPU-only guard_runs benchmark for unmasked, short, and long masked runs.

(cherry picked from commit 81b81df351)
The run check split on every byte that is not alphanumeric or +/=, so
b"\x4d\x5a..." broke into 3-character pieces and an xxd -i style
[0x4d, 0x5a, ...] array into 4-character pieces. Either form of up to
about 100 KB of copied bytes passed the check and the pre-commit hook.

Also count the hex digits of \x escapes and 0x literals that have only
commas, whitespace or backslashes between them, and flag the file when
that passes the same 512 limit. The largest such run in the tree is 36
digits. Decimal arrays are still not caught.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit e950e81756)
Six diagnostic switches (VICTORY_D3D12_DEBUG, _GBV, _DRED, _WARP,
VICTORY_GPU_TIMING and VICTORY_DUMP_TARGETS) were on whenever their
variable existed, so VICTORY_D3D12_WARP=0 still selected the software
adapter. They now go through one helper that reads a value other than 0
as on and an unset variable or 0 as off; every other value keeps the
meaning it had. The README says so above its switch table.

(cherry picked from commit a4974e4c21)
The disassembly text showed operands that some instructions lack, and
dropped VOP3P negation that applies to one half only:

- s_memtime, s_memrealtime and s_get_waveid_in_workgroup printed the
  unused SMEM base and offset.
- A global or scratch access with no SGPR base printed `null`, not `off`.
- A MUBUF load with lds printed the unused vdata as a destination.
- VOP1 SDWA printed src1_sel, though VOP1 has no second source.
- VOP3P ops other than v_fma_mix with only neg_lo or only neg_hi set on
  a source printed as if the source were not negated. These now get
  LLVM's neg_lo:[..] and neg_hi:[..] suffixes; a source negated in both
  halves keeps `-src`.

Expected operands come from llvm-mc -mcpu=gfx1030 (gfx1010 for
s_get_waveid_in_workgroup). Only the text changes; translation reads
Fields and is unaffected.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 6325df752c5638365c3e5a2b2f827ba0f3f145cb)
translate writes emitted DXIL and validator reports to the
VICTORY_EMIT_DUMP directory. Both are derived from the game's shaders,
but the directory was never checked against the source tree. With
VICTORY_EMIT_DUMP=. run from the checkout, the .txt reports land in the
repo, and git and cargo xtask policy both let them through.

Check the directory once at the start of translate::run, as Config
already does for the cache and data directories.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 988fd9a647)
(cherry picked from commit 350f91c23a9402b2a556a84c208a80030910ae3f)
(cherry picked from commit 43e2ca9de2)
(cherry picked from commit efe102edac86f365a9951f3c92228413cbee8e46)
(cherry picked from commit 7216ab7113)
Preserve stale staging files left by interrupted writers and retry a bounded number of atomic create_new attempts. Propagate unrelated I/O errors immediately. Add deterministic CPU regressions. AI-assisted.

(cherry picked from commit a32eacdd5e)
(cherry picked from commit aaacc2dcfe)
Co-Authored-By: GPT 6.2 Sol <[email protected]>
(cherry picked from commit 64b80c3109)
(cherry picked from commit 121412bec21b0790d04d56399f49e2d140652864)
Co-Authored-By: GPT 6.2 Sol <[email protected]>
(cherry picked from commit 3e98bd7e0ce79762162ac958e3ab67cc85de00c9)
(cherry picked from commit 6d174aeeeb93669ab9f43ff01b24963933433af8)
(cherry picked from commit 131944d02d)
(cherry picked from commit 0be58e62d2)
The PE-specific export table stores one name per address-table slot, so when two names alias one ordinal the earlier name is silently dropped from ImageInfo and from victory inspect --exports. Use the generic Object::exports iterator instead, which yields every named export and then ordinal-only entries, and map its target and flags back to our representation. Add a synthetic PE regression with two names for one ordinal plus a separate export.

(cherry picked from commit d0dd9fc5c0)
write_if_changed used a shared <hash>.tmp file, so two concurrent cold launches of the same image could truncate each other's staging bytes or fail the rename after the other had published. Move publication into a portable module that stages under a unique pid/sequence name and removes it on failure. Two hermetic tests cover concurrent publishers and a failed rename.

(cherry picked from commit 1aac20aa8fd97237053c985b942225d54c0194a7)
elements() took field text up to the next '<', so a generator comment before the value made TitleId, StoreId or SizeMB empty. Skip comments while gathering the text. Add a regression with comments inside all three fields.

(cherry picked from commit ca362a4247)
runtime stores an absolute image path while relaunch_args searched raw CLI arguments for exact text, so a relative launch argument made XLaunchNewGame silently rerun the old title. Normalize the argument the same way runtime does before replacing it. Also split the title's quoted config args into proper arguments instead of split_whitespace. Add a regression covering a relative startup path, a different target and quoted/empty args.

(cherry picked from commit 71e88665c4)
`resolve` canonicalizes the longest existing prefix and re-appends the rest, but it walks up with
`Path::file_name()`, which is None for a trailing `..`. A path such as `<tmp>/a/../b` (nothing exists yet) hit the
`_` arm and returned PolicyError::Io, so a cache_dir or data_dir with a `..` in a directory that does not exist yet
was rejected, and `normalize`'s `..` handling for the missing tail was never reached.

A trailing `..` is now kept in `rest` so `normalize` resolves it lexically.

Test: resolves_dot_dot_in_a_path_that_does_not_exist_yet (fails before, passes after). cargo test -p victory-core,
cargo fmt --check and cargo clippy --tests are clean.

(cherry picked from commit 52f0a099ede8aa4d5bde61a0c46963a77a4378ba)
(cherry picked from commit fd44561ea1180aff5380285527fb8cac8195f4e8)
emulate_amd_only copies only the bytes left in the faulting page and
gated clwb_len on n >= 15 because clwb_len took a fixed [u8; 15]. A
4- to 10-byte clwb starting in the last 14 bytes of a page (or falling
back from a clwb_loop that straddles the page end) was therefore
skipped, leaving pre-Ice Lake Intel CPUs with an unhandled
STATUS_ILLEGAL_INSTRUCTION.

Change clwb_len to take &[u8], bounds-checking each byte read and
returning Some(len) only when len <= code.len(), and drop the n >= 15
guard in emulate_amd_only.

Fixes #924.

Co-Authored-By: Gemini 4 Neon <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 60d2cf9cbcf5a2abc773d5de10c3c892e77d3340)
(cherry picked from commit 246ecea963)
(cherry picked from commit 534e1dd74c)
Read complete payload bytes directly inside an XMA2 packet. Keep the bit reader for packet headers, interleaved stream skips and the final partial byte. Add coverage for all eight alignments at packet boundaries and EOF. On Windows x86-64, 36,720 synthetic reads matched the previous implementation, including returned bytes and the next frame position. A release microbenchmark of read_frame measured 1009 to 168 ns for 128-byte frames and 7977 to 1062 ns for 1 KiB frames (median of nine runs).

(cherry picked from commit 03a6f22906b4372ec08d003e9103997659647b0f)
(cherry picked from commit 8610ffb85baedbc7b8c4c9de1222b0911e00e589)
(cherry picked from commit e3c9dd0d53)
(cherry picked from commit ef0c3e9449)
With TdrLevel 0 Windows never resets a hung GPU: a slow or hung world
frame freezes the whole desktop, and the runtime never sees a device
removal it could report (#1054). With 1 the timeout is a blue screen.
Both are set by hand, often to keep slow frames from being reset, and
reports of "the PC froze" do not say so.

When the host device is made on a hardware adapter, read TdrLevel,
TdrDelay and TdrDdiDelay from HKLM\SYSTEM\CurrentControlSet\Control\
GraphicsDrivers, log them ("default" where a value is not set), and warn
for TdrLevel 0 or 1 with what to set instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 42961e8e57)
Closing the window never suspended Grand Theft Auto VI: its suspend
routine waits for a state that only its constrained-change routine
starts, and RegisterAppConstrainedChangeNotification bound to the host's
version, which never calls it. Every close ended in the one-second
deadline.

Register constrained-change routines here and run them (constrained)
before the suspend routines (quiesced), as the console does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit a7847a5201)
Getting started names Rust (pinned in rust-toolchain.toml) without saying
how to get it. Add rustup through winget or rustup.rs, that the pinned
toolchain then comes on the first cargo command, and the MSVC C++ build
tools the Windows target needs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 098a26aad5)
Microsoft's XAsyncCancel reference says: "If the XAsyncCancel function
is invoked for an asynchronous call that has already completed, nothing
happens."

A call that completed successfully with a nonempty result stays in
CALLS until the title reads the result via XAsyncGetResult, so
XAsyncCancel still found it and invoked the provider with OP_CANCEL
before XAsyncComplete returned early on call.done.

Check call.done under its lock in XAsyncCancel and return immediately
when the call is already complete, dropping the lock before invoking
the provider.

Co-Authored-By: Gemini 4 Neon <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 44ce06784b)
(cherry picked from commit 142ec8dd45)
(cherry picked from commit 643fc6dfecffbd06de7313897b7d4bc4ffef6564)
(cherry picked from commit 64a33ec757)
(cherry picked from commit 4f54c47755)
(cherry picked from commit 1ed26e50d860f328cd42c640bc12486f65603995)
(cherry picked from commit 32eb934959)
(cherry picked from commit 5c44562868df4c33cce60488132d83cf5ff02f30)
(cherry picked from commit 4e155a36ad728e1a21e7253ff4097af06582a45f)
(cherry picked from commit 2b13ae4192)
Check both mask widths, the condition code and the zeroed upper destination.

(cherry picked from commit e3fe5bf94f848c2a6ca36900c2dfa70342083109)
(cherry picked from commit a7636dd7b1)
(cherry picked from commit be3202de393b71c9385f74b587256b01b48f7f63)
(cherry picked from commit 711d651ccab7673e5ab4365bd692294e954c845f)
(cherry picked from commit 9ccb83c00a9b0ee5121e4a9b2f6c0ee223630c84)
(cherry picked from commit 274f6988c9779b0612186c3448123e5e157d56e4)
The layouts follow AMD's addrlib, but the tests only checked them
against themselves (every element on its own address) and a few
hand-worked offsets. Two tests now pin them to addrlib itself
(Mesa src/amd/addrlib at ed09d38, Navi 21 settings):

- layouts_match_addrlib: 21 descriptions over every mode Layout::offset
  addresses (linear, 256 B, 4 KiB and 64 KiB S and D; 1-16 byte
  elements, block compression, arrays, mip tails, 2D and 3D), each
  with addrlib's surface size, first tail mip and a hash of the
  address of every element.
- deep_volumes_keep_their_chain_in_each_slabs_tail: a 16x16x64 volume
  whose chain is all in the tail (addrlib's mipChainInTail), with
  explicit addresses: each 16-slice slab has its own tail block, and
  mip 1's 32 slices span two of them.

Over a wider sweep (about 20,000 descriptions, every mip count for
volumes up to 256 deep) main matches addrlib exactly in size, tail and
every address compared. A tail-entry rule that also requires a mip's depth to
fit one slab changes 5,456 of 14,780 volume layouts (5,087 grow, by
up to 5x) and moves their addresses; both tests fail with it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit f078008b112343b6e68c8ca72b884073064320c1)
fence.rs already implements ID3D12Fence1::GetCreationFlags at slot 11
(0x58), but FENCE_IIDS only listed ID3D12Fence and PAGEABLE_IIDS, so
CreateFence and QueryInterface rejected ID3D12Fence1 with E_NOINTERFACE.

Add ID3D12Fence1 (433685fe-e22b-4ca0-a8db-b5b4f4dd0e4a) to FENCE_IIDS
and add a unit test covering creation, QueryInterface, and
GetCreationFlags.

Co-Authored-By: Gemini 4 Neon <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit bbdc3ca7249948b7624ba65f4282615caef895b8)
A package copied without the DLLs that ship beside the executable leaves
every import from them unbound, and the title stops at its first call into
one: Grand Theft Auto VI 1.0.2.1 at +0x2237178 during System Init (#930,
#1553, #8), with nothing saying why.

After mapping the title DLLs, name the main image's static imports that
must come from the title's folder (neither the host nor our runtime serves
them) but were not mapped from it. Print them; when executing with the
default trap policy, stop before running title code. With
`--unimplemented zero` the title still runs (stubs were asked for).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit e9cb14ad3e)
save() releases LAST and library locks before calling write_atomically(), which always wrote to the same fixed host-pipelines.tmp path. Concurrent worker saves and shutdown save(true) can truncate or unlink each other's temp file on Windows.

- Serialize write_atomically() with a mutex and unique per-call temp filename (.tmp-<pid>-<n>), cleaning up the temp file on rename failure.
- Add a 4-thread concurrent write_atomically stress test.

(cherry picked from commit be824d9d218320c71f2623ed4b14045210785db5)
(cherry picked from commit eb7cc2d43711e806bbd8578d4ef75bde30326c20)
A title makes its window on one of its own threads and reads its messages
only when that thread reaches its PeekMessage loop. In slow frames and
loads that is seconds apart, so the system shows the busy cursor over the
window and a click turns it into a "Not responding" ghost.

A top-level title window is now made message-only (it can never be shown),
and a stand-in window with the title's text, style, icon and fitted size is
made on a thread of ours that does nothing but pump its messages. The
title's ShowWindow shows the stand-in, its window text follows, closing the
stand-in suspends and ends the title as before, the keyboard window menu is
still refused, and the stand-in goes when the title's window does. Frames
are presented to the process's visible window, now the stand-in; input is
unaffected, since titles read it through GameInput, not window messages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 9145d9d3da)
(cherry picked from commit 8d3a025df199e6e26ccb404d4cf0f172fdde8b1c)
A title that ends itself when its main loop has not ticked for a while
runs on through slower frames.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
(cherry picked from commit 532cb7cdfe)
Co-Authored-By: Claude Fable 5.2 <[email protected]>
(cherry picked from commit 70564ae08c)
`Instruction::name()` binary-searches the opcode table, and the pipeline
asks about every instruction eight times per translation: `ir::build`,
`structure`, `resource` (which has the most call sites), `io` and
`lower`. The answer cannot change - the encoding and opcode are decoded
from the words and never rewritten - so resolve it once when the
instruction is built and read the field after that.

Measured with the synthetic bench from #1002 (no game data), sixteen
interleaved rounds per arm, best of each, nanoseconds per instruction, at
256/1k/4k/16k instructions:

  resource     17 -> 9, 15 -> 7, 24 -> 16, 23 -> 15    (0.47-0.67)
  lower       511 -> 479, 428 -> 411, 440 -> 401, 477 -> 428  (0.90-0.96)
  io           27 -> 23, 26 -> 21, 26 -> 22, 30 -> 22   (0.73-0.85)
  whole       926 -> 881, 920 -> 874, 958 -> 921, 1019 -> 939 (0.92-0.96)

`decode` pays the one search it used to be spared (112 -> 115 at 16k,
inside the run-to-run spread); every stage after it reads a field. The
emitted DXIL is byte-identical at all four sizes.

cargo test --workspace --locked: 342 passed, 0 failed, 7 ignored.
Both clippy configurations clean; cargo xtask policy ok.

(cherry picked from commit 146dfef67a3ecd2c4fd8f9cff8de149c65dfe6f0)
Recovery took any name `v<digits>` as a version, so a leftover `v01`
next to a committed `v1` parsed as version 1, and the cleanup rebuilt
the name as `v1` and deleted the committed save (#870). A correctly
named but unreadable newer entry (an empty `v2`, a file, a broken
manifest) did the same: `v1` was pruned as older, the read failed, and
the next update committed a fresh `v1` holding only the changed blobs,
which the following read pruned again.

Now only `v<N>` exactly as `commit` writes it is a version. `current`
takes the newest version whose manifest reads, removes only versions
below it, and leaves unreadable newer entries alone. An update goes
above the highest version name present, so a stray entry neither hides
the save nor blocks writes. With no readable version at all, reads and
updates still fail and nothing is removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit b8dbcba260)
The fork's emulation of a clzero loop zeroed from the start to the end and
left rax at the end: the instruction zeroes whole lines and the test comes
after it (VIctory's own test of it failed here). The title's descriptor
heaps are held shared while their slots are written (VIctory 628b95d held
them alone, for every thread that writes descriptors).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Windows command lines quote only with double quotes. split_args treated an apostrophe as a quote too, so -name=O'Brien swallowed the following argument. Only toggle on ", and add the apostrophe case to the relaunch test (review note on #455).

(cherry picked from commit eb8067f2ea)
The write block (context word 0, bits 27-31) was used as it is for the first
block of a pass, so one at or past the ring size (bits 22-26) was written
past the ring's end, possibly into another APU allocation, before it wrapped
with (write + 1) % size. Take it modulo the ring first, as the read block is
taken, and as advance_read does.

(cherry picked from commit 7a5d85e6a2867081ed54515ce7f33bae3fcb643d)
16-bit interpolations write the half op_sel picks, with omod and clamp; the
device says whether it was removed; detiling ends with its staging buffer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This reverts commit 9820bdc45e.
A removed device is reported by whoever finds it first, and the list it
stopped in by its name. The window stand-in of VIctory 9145d9d is left out
until it has been tried.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The lamps' shadow maps write depth plus a slope bias, and the main pass takes
the normal's derivatives, from the quad's other lanes; a wave read of a helper
lane is undefined (0 on AMD): holes in shadows, dashed triangle edges.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- VICTORY_HEAP_SYNC=all mirrors every copied record at once, as before.
- VICTORY_DYNAMIC_SLOTS sets the table slots past the title's.
- Room kept for card copies of buffers is 1 GiB at most (was 5 GiB on 24 GB).
- VICTORY_TEXTURE_KEEP=0 lets idle textures go after 5 s, as before.
- VICTORY_TEXTURE_AWAY_MS: a texture whose memory went is shown 3 s longer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Both device losses of 2026-11-25 (play-1125-0203, n02) stopped at the same
place, found by the run of three indirect executions between barriers in the
captures: compute 0452fc2d2e2fc4c3 (meshlet culling), behind fc5e66f8f873d3bb.

- With device-removed data on (DRED=light too) each list keeps, per indirect
  execution, the pipeline and the first 16 dwords of user data; the report
  says them for the stopped commands, and what the heap slots they name hold.
- A dynamic slot that shows a constant buffer in a list's scratch chunk holds
  that chunk (n02: the fault was in the memory of three freed chunks).
  VICTORY_SLOT_HOLDS=0: not held, as before.
- A slot's resource is let go after its descriptor is written over, not
  before; the same resource again is not retired.
- indirect::tests::raw_loads_past_views (ignored, a measurement): on the RX
  7900 XTX raw loads through typed, structured and constant buffer views have
  no end: they read whatever lies after the view.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Both losses were reads in memory given back seconds before. Empty texture
blocks (up to 4 GiB) stay below 85 % of the card's budget, windows of title
memory and staging buffers stay for five minutes with 12 GiB of the PC's
memory free, and up to 1 GiB of scratch chunks stays. Nothing read past a view
or through a wrong slot finds the hole then. VICTORY_KEEP_FREED=0: as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A buffer a shader picks from the view heap by an index it computes is read as
raw bytes, whatever view the title has there, and the index and the offset
come from data. On AMD a raw load through a typed, structured or constant
buffer view has no end (measured), a texture's descriptor read as a buffer's
is a wild address, and an index past the title's slots (clamped to 2^21)
reaches the dynamic slots of other lists. Both device losses of 2026-11-25
stopped in the meshlet culling (0452fc2d2e2fc4c3), which does such reads.

View heaps now hold 2^22 views: past 2^21 a raw view of the same bytes for
every buffer view of a title slot (a constant buffer's view for a constant
buffer; a null raw view for everything else and every slot past the title's),
and picked raw and constant buffers are read there. Texture and typed picks
and tables stay as they were. A view that does not begin on 16 bytes cannot be
raw; its twin is the view as it is. Idea of a guard by kind: VIctory d71c3889.
VICTORY_RAW_VIEWS=0: as before. Every shader is translated again (8 min).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
After victory-amd bddfb4a5 (myokex).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Placed textures are read, kept on the card and uploaded from the first level their views show (VICTORY_HELD_LEVELS=0: whole;
after victory-amd 4436f8f1's spans). An upload of the bytes a host copy holds is left out (VICTORY_TEXTURE_SAME=0). A slot
shows its new view once that view's upload has run. A decoration bake takes slots due a few frames later too and waits for
memory being remapped (VICTORY_BAKE_EXACT=0). Host copies go only past 88 % of the budget, the longest idle first
(VICTORY_TEXTURE_KEEP=1: the rule before). A slot rewritten with other filler words keeps its view.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Samples the 28 busiest threads, whole stacks, with what the frame is at.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
All of the title's loading goes through one thread of its own, which maps
the pages of a batch and then submits it. Each page took up to four system
calls (unmap, split, map, commit), each waiting for the address-space lock:
200-400 us a page in the world. No split of a placeholder that is the
view's own, no commit of section pages that are committed
(VICTORY_MAP_LEAN=0: as before); the thread, below normal priority as the
title sets it, is lifted above it where it maps (VICTORY_STREAM_PRIORITY=0:
not). VICTORY_DSTORAGE_LOG=<file>: every request, status entry and the cost
of the mapping calls; VICTORY_STACKS names each thread's affinity.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
VICTORY_PROCESS_PRIORITY=normal and VICTORY_PIPELINE_LOWEST=0 for the old
ways.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The ray-tracing structure builder's 52 programs translate, validate and make
host pipelines on the 7900 XTX (its waves have 32-64 lanes). What kept it from
working, from a first run (light-1, VICTORY_BVH_QUARANTINE=1) and the code:
- a root view ends with the host copy (a 4 MiB window); structures of megabytes
  cross it. Programs with a spilled user-data table now reach what their root
  views name by address (USER_ROOT_ADDRESS), as upstream VIctory 0f637570 does.
- the list's upload memory (instance descriptions) came from the process heap,
  above 2^40, where shaders' addresses do not reach (upstream 0f637570, 6d021fe3).
- the 1,023 numbered copies of 4 MiB ran out in the first frame: pages come in
  windows of 256 KiB (4 MiB around what a dispatch names), 16,383 at most.
- what the builder stores came back to title memory; now only what it stores in
  small title buffers it names (sizes the title reads).
- the directory lay in the PC's memory and every access stored a fault note.
- a list without a view heap gets the title's; a dropped stage rests the builder
  for a frame, not for the run.
Off unless VICTORY_BVH_BUILDER=1, as before. VICTORY_UPLOAD_LOW=0,
VICTORY_LENT_HEAP=0, VICTORY_MEMORY_WINDOW_KB, VICTORY_MEMORY_CARD_MB.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run crash-1 held 5.2 GB of staging blocks (n02: 0.9): at most 8 empty ones
stay (512 MB of the PC's memory). With the frame line: raw twins made per
frame, and those that had to be views as the title's are.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
GPU_UPLOAD heaps, all off by default. Replayed yard frame (capture
play-1125-0127): 36.3 ms; windows in the card's memory 31.9, sends 32.7.
Replay: --pace, --breadcrumbs, copies counted by the memory they cross.
VICTORY_GPU_LOAD_MS: what the title's GPU timestamps show.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
VICTORY_RECHECK_SOON=0: after four frames, as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
One by one, every fill of the 2,800 a frame sorted the ranges again: the unmeasured 16 ms before a submission's preparing (profile cpu-1). Up to 12,288 steps a submission.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Words are pairs of one dispatch and are not counted against the 4,096 copies a submission sends up, at which it stood until the flights had landed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Made anew and given back all the time: 30 % of the submitting thread in the opening (profile cpu-1: allocations of snapshots 11, preludes 12, lists dropped 5, send memory 3).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Changed pages are compared sixteen records at a time.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
VICTORY_ASK_EARLY=0: no such thread.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
5 ms of the submitting thread.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
12 to 17 ms of one recording thread at the frame's first list that needs it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A captured frame whose lists take 28.6 ms sent in one go takes 37.8 ms with
1.2 ms between its submissions, as the game sends them; with one group of
threads counting on a compute queue it takes 28.6 ms again, and nothing
changes when sent in one go (36.1 against 36.3 ms with its copies).
=turns: 20 s on, 20 s off, to compare in one run. Replay: --awake,
--no-restore makes no copies to restore from.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Windows of title memory around every page took 8 GB (run light-2, 0.5-1 s a frame): structures are streamed in anywhere between other data. A 64 KiB page outside title buffers now has a page of its own in an arena on the card; only the title's GPU memory is taken; what instances in a list's upload memory name is there before the top level is built, 1 MiB from each root view before the rehydration stages unpack it in place.
VICTORY_MEMORY_DUMP=<folder> writes the arenas out (diagnostics).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
What the copy does not write was whatever the block of the pool held: the atlas of baked decorations (a 2048x2048 BC3 texture of
which a bake writes 256x256 at most) drew other textures' bytes over the waitress's face. VICTORY_COPY_OVER_TITLE=0: as before.
With a measurement of what a cold texture costs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The arenas of run light-3, read offline: 2,833 instances, valid top levels and dynamic structures, three quarters of the streamed ones unpacked right. The rest were unpacked a second time (the same bytes streamed in again do not differ from those last taken), into garbage over their neighbours. And the sizes the title reads of a structure (compaction) never came back where their small buffer lay in an arena's page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Measured on the RX 7900 XTX (indirect::tests::descriptors_written_under_readers):
a thread that makes texture views in a slot of a shader-visible heap lets the
card see a descriptor that is neither the old one nor the new one in 4 % of its
reads (35 of 822 million: the driver clears it and fills it step by step).
Copied from a CPU-only heap: none in 8,582 million reads, and three times as
fast (51 ns against 149). Title threads and our passes rewrite slots while
submissions run whose shaders pick them; three device losses of 2026-11-25
(play-1125-0203, n02, n03) were reads of memory no view names.

Every slot of the host heaps (views, raw twins, null views, constant buffers,
samplers) is now made in a slot of the thread's own in a heap the card does
not see and copied in. VICTORY_VIEW_COPY=0: made in place, as before.

A raw twin whose view begins between two multiples of 16 (35 a frame, left as
the title's unbounded view) is made from the 16 bytes below and its descriptor
moved on, if it is the one AMD's raw buffer descriptors are; null otherwise.

indirect::tests::textures_read_in_another_dimension (a measurement): a view
read in another dimension or level than its own gives zeros or its own texels:
not a cause.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
VICTORY_TITLE_PRIORITIES=0: as the title sets them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Mapping and unmapping a view wait for what every protection change of a
view takes too (about 100,000 a second, the guards'): 0.2-4 ms a page, all
on the one thread the title loads with. Scatter maps and the GPU's
page-mapping copies go in groups of up to 64 pages, noted before and after
on the caller's thread, the system calls on up to eight
(VICTORY_MAP_THREADS=1: one after the other, as before).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	crates/victory-shader/src/emit/mod.rs
Where the kernel or a landing names them; what is checked stays a page. VICTORY_ASK_EARLY=<ms> turns the early asking on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
580 a frame, 3.4 to 6.5 ms of the submitting thread.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every 4 ms while submissions come, on the thread for it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
13 % of the title's main thread while walking (profile cpu-1: two kernel calls for each 64 KiB page).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
xmem.rs is local/next's: its side-by-side mapping (VICTORY_MAP...) takes the place of 4180818's runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A directory entry says whether stores by address reach its page (translator and host). Faults take at most 128 pages a frame and 8,192 in all; every slot of the copies' run holds a null view until its copy is there; a page is looked at once a frame.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Runs n03 and n04 lost the device in the main pass. The pixel program
3711fdad456538a1, bound in both stopped lists, reads entry 35 of its big table
as raw bytes per lane, and that slot is a structured view of 8 byte elements
that begins at 8 mod 16 (capture play-1125-0127, all 766 draws): no raw view
begins there, so it stayed structured, and a raw load through it has no end on
AMD. So not only picked buffers: tables' buffers too, in title slots and in
the dynamic slots, which have twins now as well (a constant buffer of a fresh
table has a raw one of its bytes).

Measured with it: constant buffer loads, uniform and per lane, end with a
constant buffer's view. Loads by title address end with the raw view of the
copy, or read the null view for a page without one. VICTORY_RAW_VIEWS=0: as
before. Every shader is translated again (5 min).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
After victory-fork f85101b6, whose window checker found 90 records of 2^24 vertices in one list; ours
also run mesh records over 65,535 groups (all ones) empty instead of as 65,535 groups.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A bake's uploads waited for the lock the runtime holds while it remaps, and a staging buffer a draw kept waited at every later
refresh (29 to 239 ms a frame, all threads, run n04): gone, a read through the kernel gets every page. A staging buffer made for
one upload asks neither the write watch nor the guards (VICTORY_TEXTURE_ONCE=0: as before). blake3 makes way for a 128-bit digest
(0.035 against 0.2 ms a megabyte). While textures are kept for minutes the sweep looks at 8,192 a time (VICTORY_TEXTURE_SWEEP=whole).
The pass before a bake is made again only for something new.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
4 MiB for every constant that looked like an address took a third of the pages (run light-5). Which pages came for what is in the ten-second line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Pieces went through the title's address, guards opened, whenever the runtime was mapping pages, which is most of the time since they
are mapped in groups (28 of 1,620 pieces a frame beside the guards in run textures-4, 640 before): 5,000 blocks opened and 7,000
guarded a frame. VICTORY_LAND_ANYTIME=0: as before. The vertices of rectangle lists are read through the kernel at submission, not
under the lock the mapping holds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
monitorx and mwaitx raised an illegal instruction exception at every pass of
the title's wait loops. Diagnostics builds log the faulting console
instructions a second by kind and place.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The idea is fxceless/victory-fork's, commit f85101b6. Here one line holds
what all queues were given, presents too, in the order of the calls.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
VICTORY_COPY_OVER_TITLE=title: over what title memory holds; =0: over whatever the block of the pool held.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
4.6 twins a frame of run crash-3 were null because they begin off a dword (16
bit values at an odd one); the typed view they stand for begins there as well.
Measured (raw_loads_past_views): a raw view moved on by 8 bytes gives the
bytes from there and ends where it should, uniform and per lane.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	crates/victory-gpu/src/shadow.rs
An arena another list made while this one was being recorded was brought up by that list's submission alone: structures unpacked from zeros, then written over by the arena's first upload. In run light-8 half of the 470 structures unpacked in the frame with the most (1381) were wrong, 5-15 % in frames with few. A title buffer the builder stores in sends up only the dwords the title changed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dumps of runs light-8 and light-9: of structures of the same size some are unpacked right and some not, more of them in frames that stream much. The title's queue waits for its streaming, so a packed structure's bytes may come after the dispatch that unpacks it is recorded. Not run in the game yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run cpu-5: 25,000 exceptions a second at five clzero loops of one function
of the title, against 1,400-7,000 at the one monitorx/mwaitx pair (28,000
at the monitorx alone with only the mwaitx replaced, run cpu-6).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With device-removed data on, every buffer, texture and texture block stands in
a book with its address (a texture's is the base in its first descriptor) and
stays with the time it went. A device loss prints who has and had the faulting
address, newest first, and every slot of the view heap whose descriptor
reaches it, with what our books say of the slot. VICTORY_BOOK=0: not kept.

VICTORY_SLOT_CHECK=1 walks the view heap (2^22 slots, 3.8 s a round) and says
which slots name memory that is gone. Run crash-5 (opening, -Walk, 260 s): 1.7
million descriptors a round, 105,352 things alive, 27,342 gone, none of the
slots named anything gone or unknown in any round.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
cpu_sets and keep_on_fast_cores are fxceless/victory-fork's (framelog.rs,
commit 0b0074e0). Asked for by: submit, relay, late-wait, heap-sync, aside;
and the helpers of the wide copies (refreshes, fills, snapshots) and of the
landings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- The lists' notes for a lost device hold direct mesh dispatches too (pipeline,
  groups, user data): run n06c stopped among them.
- A mesh dispatch of more than 65,535 groups is cut to that (more is undefined
  on the host; said once). Vertex and index buffer views end with the copy they
  show.
- indirect::tests::loads_far_outside_views (a measurement): raw, typed,
  constant buffer and texture loads at the ends of 32 bits, uniform and per
  lane, samples at coordinates, levels and gradients that are no numbers: all
  198 ways end inside their views on the RX 7900 XTX.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lists already on the card read our descriptor heaps as they are; only lists sent later wait for a new
heap's mapping. Run n08's loss: a page fault in a texture made that instant, in a new block.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diagnostics only. VICTORY_TIMELINE=<file> records three frames (or
VICTORY_TIMELINE_FRAMES) after VICTORY_TIMELINE_AT seconds and writes a
Chrome trace and a text summary: spans of our work, the waits and wake-ups
of the title's threads (its imports) and of ours (our import table), long
kernel calls on the address space, and when each submission ran on the card.
The summary walks back from each present through who waited on whom.
Nothing is wrapped without the variable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 008de5f9ffcef132079b1af8b7f4f1c22235cee9)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Timeline waits-1 (dorm, 78 ms): the title's render thread stands 20 to 30 ms
a frame at one recording job and the rest at others; recording is the
critical path, and our list calls are 95 % of it. Profile waits-1, the five
recording threads: 21 % contended locks, 11 % HostHeap::keep, 17 % readable,
7 % the look-up of buffers, 8 % clocks and counters of ours.

VICTORY_QUICK_FIND=0 and VICTORY_READY_ONCE=0 go back; counters of the
diagnostics by thread, a coarse clock for what is noted per texture and slot.
VICTORY_AB=<s>,<switches> turns switches on and off while the title runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Runs n08 and n11 were lost to page faults in the first texture of a block made that instant: lists on the
card read the slots new textures are put in. 12 empty blocks are made ahead; textures up to a whole block
lie in them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The recording job the frame waits for last (24 of 65 ms, timeline waits-2) is
2,500 indirect dispatches, each with a table of its own that differs in a
constant buffer. VICTORY_AB can turn VICTORY_MAP_THREADS (8 or 1) too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Three losses were page faults in a texture made and shown in the last tenth of a second. With the switch the
texture pass, and a draw's table for the title's slots, put a neutral 1x1 texture (or the old view of the same
texture) there until the submission with the upload has finished. The book's report has the piece and its
block, the submissions at the making, the upload's submission, and what the slot showed before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
From DexNom/VIctory (GPL-3.0-or-later) bc3cd4b0 and 5f4c3df4:
- DispatchX's flag 0x20 says the counts are threads (bc3cd4b0). Taken for
  groups, a rehydration stage ran up to 64 times its threads and stored over
  the structures after its own. The lanes past the count leave at once, in
  every builder program of one dimension without a group barrier (there: in
  two, by digest). VICTORY_THREAD_DIMENSIONS=0: as before.
- A child that is not there may have inverted infinite bounds: it was entered
  at minus infinity, came first and ended the walk (bc3cd4b0).
- A node in a page without a copy reads zeros, a child and a box: no hit
  (bc3cd4b0).
- Signature rows in the order of their names; vertex outputs interpolated as
  the title's PSV0 says; an unread input packed beside a per-vertex one is
  constant too (5f4c3df4), with their tests.
Every shader is translated again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- VIctory da82e444: the host's division was a step off for some codes, and a
  material index cut from one was the code below.
- DexNom/VIctory 921d8d3b (its cube part, with its test): the level was taken
  from a natural logarithm DXIL does not have, 1.44 times too high; the
  instruction's least level was lost.
- VIctory 4243a96a, for buffers a program picks from the heap.
- VIctory a1a2077a.
Every shader is translated anew.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
White on black in the upper left corner of what is shown, twice a second, from the
counters of the frame-rate line, memory and textures; our own 5x7 characters. Copied
onto the swap chain's buffer out of a buffer in the card's memory: screenshots carry
it, saved frames and the frame recorder do not.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title's 45,000 to 60,000 list calls a frame append their arguments to a
stream; threads of ours translate it, several lists at a time, and the line of
submissions goes on with a submission when its recordings are translated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Its threads take turns through atomics; what one wrote before its atomic has to
be seen by the one after it. The console's waits for writes are not in the
translated code. After beloooo's 72e748ea (VIctory-Belobug-AMD).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title reads a new structure's compacted size a frame or two after it asked,
takes memory of that size and copies the structure there. It read the size the
slot held before: the copies wrote over their neighbours (run light-11).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
After beloooo's constant (VIctory-Belobug-AMD 06031237, 4f45ab88, cd9f78ce).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The thread that runs the line takes the Run entries that follow in the queue along, with
the waits they meet themselves and the signals between them (the idea: fxceless/victory-fork
39731795), as long as nothing of them reads on the CPU what those before them write; what
they refresh is brought up to date in one go in front (VICTORY_REFRESH_FRONT on its own:
measured at nothing); each part still goes to the queue in a call of its own.
Run submit-1, the dorm: 12 of 28 parts joined, 54.8 -> 51.4 ms a frame of that thread.

A copy at its place in a list is in the way of fills done on the card only from its place
on, and the submission is cut behind its list for those (opening, run n19: 40-60 ms a frame
of the submitting thread standing). Not seen in the dorm; not measured yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A book of the faults (VICTORY_FAULT_BOOK=<file>, diagnostics) says of the
dorm: 586 faults a frame on 900 blocks, 245 of them on a block that had
faulted in the same frame already, 220 within 3 ms of the refresh that made
the block read-only; 69 ms a frame of the title's threads, of which 6 with
the guards' lock and 63 waiting for it. What is held under it is mostly
VirtualProtect (5 us and more in the game's process, one at a time whoever
asks: a bench found 14 threads no faster than one).

- A block a write fault opened is left open by the refreshes of the next
  3 ms and told as written at each.
- The other views of its page stay read-only, not clean.
- The sets of guarded, clean, absent and aliased blocks are bits, a range is
  looked at by words; the lock is let go between the runs a refresh guards;
  a fault that finds its block open takes no lock; the record of the title's
  views is read by many threads at once; the kernel is not asked about memory
  known to be a guarded view.

Run faults-2 (A/B of both switches, 20 phases of 10 s in the dorm): faults
601 -> 391 a frame, blocks made read-only 928 -> 407, the title's threads
27.5 -> 15.8 ms a frame in them (69 before), frame 64.8 -> 62.5 ms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title's streaming thread spends 400 to 750 ms of a second in mapping calls
in the world's first minute (runs stream-1 to -4; DirectStorage itself answers
in 1 to 8 ms): each call waits a millisecond or two in the host's queue behind
the guards' protection changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The first run after a new translation (textures-d2: 2,500 pipelines being made,
594 draws a frame dropped in the world's first minute) had no lamps and no
colour in the shade to its end; the second (textures-d3) had them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
FPS, draws, the submitting thread, the card, waits, recording, MB a frame, memory; its own
microseconds a frame on the submitting thread. VICTORY_PLACED_ORDER can be one of
VICTORY_AB.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diagnostics: per copy what goes up and what is fetched (every five seconds, the eight that
move most), and the protections title memory is asked for with (write-combined and GPU bits).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Most of what faults is the runtime's memcpy (a third by time) and single
stores into objects that lie in memory some copy covers: flags, reference
counts, links of free lists. The bytes are put in through our own view of the
page, the block told as written at every view by a bit that the next asking
takes: no protection changes, for the write or for the next taking.

Copies: the title's imports are ours and look at the blocks' bits. Stores:
the instruction that faulted is decoded and done in the handler. Too many to
a block, or code that fills blocks: opened as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The console's v_max/v_min (seven host operations each, for the order of the
two zeros), v_mul_legacy (a product, two comparisons, an or and a select;
two thirds of all products of the lighting program), v_med3 and v_fract are
written as the one operation the driver makes the same instruction of, where
the host is an AMD card with waves of 32 and 64. Checked on the RX 7900 XTX
against the spelled-out forms with zeros, infinities and NaN (a legacy
product's zero may have the other sign).

RX 7900 XTX, yard capture replayed turn by turn with and without (12 loops
each): dispatches and draws 18.41 -> 17.58 ms, the lists' 29.2 -> 28.4 of a
36.6 ms frame; 0.4 of it without the legacy products. The picture is the same
(79 dB; two replays of one set differ by 68). A product that is only a
product would give 0.65 ms more and NaN where the console has 0.

Measured and left out (nothing): v_mad as one multiply-add, fast
reciprocals, scalar loads of four dwords at once, buffers picked from the
heap read without asking for their kind (0.12 ms), a wave size for every
compute program (32: +0.26 ms, 64: +0.1, the console's: +0.1), no barriers
at all (0). Changes the translator: every shader is translated again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
--shaders after local/models 098ec1d4. The capture's 1,266 containers are
collected from the title's files once (beside the capture) and translated by
this build in 15 s; a pipeline that is refused with them keeps the recorded
ones.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A submission whose lists are still being translated is unfolded where the
one before it may take it along.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A structure that was written over names gigabytes; the builder's copy of it
(CopyForBVHUpdate, 63 a frame in the dorm, 13.3 of 84 ms in the timing run
light-13) went through all other structures' memory.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Memory the kernel watches counts as written by the landing of what shaders wrote; the next
refresh copied those pages and sent them up again (run submit-2, the dorm: a copy of 90 MB,
write-combined for the title, 14.9 MB a frame fetched and 14.4 MB of the same pieces sent).
Pages a landing was noted in are compared with the CPU side, 4 KiB at a time, and left if
they are alike. Not run in the game yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A store that faults, or a part of a copy into a guarded block, whose bytes
are there already is left out (with VICTORY_STORE_BESIDE, VICTORY_COPY_BESIDE).
The places in the title's code where that is the rule and the instruction is
an `or` of a byte with a constant are written into the file, and made to look
before they write at the next start. The file holds offsets, no code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Yard capture, 423 passes a frame, turn by turn: 1.93 -> 1.69 ms (4 loops;
four at once 1.70, sixteen 1.71).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every pipeline the title creates goes to known-pipelines.bin beside the
pipeline library, its containers to known-shaders.bin (in the cache folder;
they are the title's code). `victory warm` makes their host pipelines in
idle-priority processes of 200 each and lets them go: the driver's cache on
disk keeps them. Those earlier runs drew with come first; what is done is
noted by translator and driver (warm-done.txt); a pipeline that ends or
hangs its process is named in warm-bad.txt and skipped. VICTORY_EARLY_ALL
does this in the running title and ended it inside the driver.

Not measured yet: how long, and how much the driver's cache grows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This reverts commit a50c7fdeb5.
VICTORY_UNDER_WIDE=0, VICTORY_UNDER_THREADS (6), VICTORY_FAST_CORES=3 (as before: all of them), VICTORY_WIDE_SPIN=<us> (0: off).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run shaders-1, the first with a changed translator (fresh shader and
pipeline caches): 3,020 pipelines started at creation, all 16 workers in
programs of seconds to tens of seconds each while the title loaded (97 made in 20 s),
then the quick ones at 100-190 a second, too late: 0.5-1.6 s a frame and up
to 2,900 draws a frame dropped from 60 to 150 s. A pipeline that took a
second is now noted (slow-pipelines.txt; `victory warm` notes them too) and
waits in a list of its own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A page shown at several addresses, and one more view of it being mapped: the
views that were to be opened were looked for before the lock was taken, so one
made clean in between stayed clean with a writable view beside it (a write of
the title's through that one was not told until its block's next told write),
and they were opened one range after another, so for some microseconds one was
writable while others were still known by their bits (told one asking late).
Both are older than the faults' work; VICTORY_OPEN_ONE_VIEW made the first
common. Also: what is known by its bits is not where bytes were just put in
beside the guard (VICTORY_COPY_BESIDE, VICTORY_STORE_BESIDE).

The test of writes through other views failed in 6 of 200 runs, then 4 of 380
with the first mended, 0 of 603 (four tests each) with both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A page shown at several addresses, and one more view of it being mapped: the
views that were to be opened were looked for before the lock was taken, so one
made clean in between stayed clean with a writable view beside it (a write of
the title's through that one was not told until its block's next told write),
and they were opened one range after another, so for some microseconds one was
writable while others were still known by their bits (told one asking late).
Both are older than the faults' work; VICTORY_OPEN_ONE_VIEW made the first
common. Also: what is known by its bits is not where bytes were just put in
beside the guard (VICTORY_COPY_BESIDE, VICTORY_STORE_BESIDE).

The test of writes through other views failed in 6 of 200 runs, then 4 of 380
with the first mended, 0 of 603 (four tests each) with both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Queue: passes over the screen first (local/next), then what draws asked
for, the early ones, and those known to take long by a quarter of the
workers. start() woke one worker, which could be one of the two that take
passes over the screen alone: the pipeline then waited for the next push.
All are woken now. victory warm goes through the pipelines no run drew with
in no order, 40 a process. victory translate: VICTORY_HOST_RDNA=1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dispatches declare the same few ranges again and again: 4,003 to 5,550
steps a frame of fork-b1-fast, each a flush of its copy's pending refreshes
and two locks on the thread that submits (the snapshots alone 1.7 to 2.0 ms
a frame). The ranges and their order stay what they were.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Two queries for an interface, three locks and a name looked up at every
change of pipeline; now one lookup by address.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Until the list next writes title memory, as for refreshes: up to 64 KiB of
fill less for every repeat. How often this title binds one was not measured.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Theirs compares the handles, which a title may write other views behind;
here the views themselves (resource, host texture, description) are compared.
A call with the same ones saves a host view per target and the driver's call.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Belobug (76387c2d) found draws flickering because the records past a list's
budget were not the same ones from frame to frame. Whether ours are refused
is not known: the count says it (atomics only when there is something to
say). Off by default; the records' order and costs stay what they were.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
What 53abe45a ("wip wide") brought in: opt bit 64, smem's loads through
raw_dwords, its test and switch test as they are there (the global loads of
this tree were wide already). Yard capture, turn by turn: 18.47 -> 18.45 ms
(12 loops) and 18.23 -> 18.16 (5): nothing, so not on. With the bit off the
code written is that of before.

Not run yet: scalar_buffer_loads_read_the_same_dwords_one_call_or_four and
the gpu tests on the second merge of local/next (2be0515c); the diagnostics
build of 393e74fb finished.

Belobug ae75a66a is this tree's own opt.rs (both from the fork at ba8697aa)
without its first-lane pass; 7263339c is a trace: nothing to take.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A console wave64 program with LDS in a group over 32 threads runs on a
32-lane host as two host waves that meet at group barriers on the edges of
each lane-branch region. A region that both reads and writes LDS was
refused, since a read inside it may miss the other half's write.

That changes nothing the region leaves behind when it only raises a flag:
every access is a ds_read_b32/ds_write_b32 at a constant address, every
write stores the same constant, at most one address is both read and
written, every write a lane can reach after a read goes to that flag, the
region has no other effect, and no register it writes is live (lane by
lane) where a lane leaves it. A missed write then only keeps a lane going
as if the flag were down, and what it writes is the constant already
there. VICTORY_LDS_FLAGS=0 turns this off.

sr_tracing:CS_Tiling_Generate_Opaque (2cc4c197ee29e291) now translates in
waves of 32 and its pipeline is created on an RTX 5070 Ti. Translating
the whole shader pack for a 32-lane host, it is the only program whose
outcome changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 8bc48bf7ef)
Adapt the selector and high-performance preference from fxceless/victory-fork#261. Prefer Shader Model 6.6 in the shared path and seed offline translation from the selected adapter.
Title memory has guard pages: stack guards, and guards the title sets up
itself. A copy of title memory (safecopy: victory_safe_copy, _put and
_merge, under the write-catch handler in watch.rs) that touched one got
STATUS_GUARD_PAGE_VIOLATION (0x80000001), and the OS cleared the page's
guard flag. on_write sent every fault inside a copy to the copy's failing
exit, whatever the code, and nothing set the flag again. The page stayed an
ordinary page, so the title's next touch of it no longer raised the guard
fault it was set up for. Under Proton the process then exits silently 1-3
minutes into a world; a traced run logged two 0x80000001 among three
million access violations. That the lost guard causes the exit is the
reading of that trace, not something reproduced here.

A guard fault inside a copy now sets the guard flag again on its page, with
the protection the page has, and fails the copy as before. A guard fault
outside a copy still goes on to the next handler (CONTINUE_SEARCH).

The direct copy (VICTORY_DIRECT_COPY) had the same bug; klbf-lab PR #34
(commit 478c6ef) fixed it there. This is the same fix for safecopy.

Test: safecopy::tests::a_guard_page_fails_the_copy_and_stays_a_guard_page.
Under Proton Experimental it fails without this change ("the guard flag was
consumed") and passes with it.
When a structured view starts on one of its elements but off the raw alignment, use the existing view-relative copy. This covers native NVIDIA descriptor heaps that cannot allocate a second raw slot for every view.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Switching VICTORY_LDS_FLAGS changes the required wave size for the affected shaders. Use the same cache fingerprint path as the other wave64 lowering switches.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The meter's 5 s block (sorting, VirtualQuery, some forty log lines) ran on
the presenting thread, the lane: about 30 ms once every 5 s. It now goes to
"victory-meter" through a channel; =0 keeps it where it was.

ask_ahead's runs (some 50 kernel askings a frame on the lane, 3 ms) can be
asked on the victory-under threads with all held, as before; off until
measured.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
pLastBreadcrumbValue is the count of completed breadcrumbs, so history[done]
is the first op that had not completed. The old "stopped at command {done}
of {count} (op X)" read like one-based numbering and was mistaken for the
last completed command (issue #22). Say the count, the last completed op
and the zero-based index of the first uncompleted one explicitly, and skip
the detail when the reported count is out of range.

Refs #22
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review of avatarmanz/VIctory-7900XTX#14 (itsonewi) asked for three things on
the guard path.

Destination: a copy, a put and a merge into a guard page each fail and leave
the page a guard page. The fix in the previous commit already does this; the
tests pin it. Without the fix they fail ("the copy's fault cleared the guard
flag", the same for put and merge).

Re-arm: rearm_guard checks that the page is still committed (VirtualQuery)
and that VirtualProtect succeeds. A failed re-arm, or a guard fault that
gave no address (NumberParameters < 2), is counted in NOT_REARMED; the first
is logged once as a warning, "guard not re-armed". Test:
a_page_that_cannot_be_guarded_again_is_counted (red against a stub that
always answers true, green with the checks).

Kernel retries: none. With safecopy on, no caller of copy, put or merge falls
back to ReadProcessMemory, NtWriteVirtualMemory, WriteProcessMemory or a
memcpy after a failed copy. The kernel calls are only on the
VICTORY_SAFE_COPY=0 branches (host.rs read and write_mapped). The retries go
through the same safecopy routine again, and each guard fault re-arms the
page. No code change for this.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
On a GPU with 32-lane waves a console wave64 program runs as two host
waves, and a v_readfirstlane where not every lane runs was refused (the
two halves cannot meet there to give each other their first lane). Three
programs of the ray-tracing structure builder stopped that way, so the
builder (all or none) could not run on NVIDIA at all (issue #4).

They read the first lane of a value every lane of the console wave holds
alike, inside a loop whose conditions are alike in the console wave too:
a prefix over wave totals, `if (id >> 6 != 0)` and lanes leaving at their
wave's own index. Then each host wave can take its own first lane.

lane_uniform now proves that: it runs to a fixed point; an instruction
under a condition whose atoms are compares of alike values (or uniform)
counts, over an old value that is alike too (waves the condition leaves
out keep that); LDS reads at an alike address count; phis count where
every predecessor is reached by whole console waves (past branches on
alike conditions only); and the thread id's x shifted right by 6 or more
is alike where console waves are runs of 64 ids along x. The result is
only used for v_readfirstlane in the two-host-wave form.

Checked: a GPU test of the same shape (256 threads, four console waves)
fails on the old analysis with the builder's refusal and passes with
this one on an RTX 5070 Ti (driver 621.40), every thread getting the
console's sum. Over the title's whole shader pack and the builder DLL
(VICTORY_HOST_WAVE=32), the only programs whose translation changes are
these three (now emitted and validated: compute 2,718 -> 2,721 of 2,734)
and one other builder program, whose first-lane read of `id >> 6` now
skips an exchange that gave the same value. victory-shader tests: 211
passed. In a world run with VICTORY_BVH_BUILDER=1 the builder now runs
(all 53 programs have host pipelines); the title still crashes within
seconds of it, with or without VICTORY_BVH_QUARANTINE, so it stays off by
default.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 3f2bcc7f2d)
(cherry picked from commit 9e24afa06d)
Reuse the control-flow region map during fixed-point analysis. Require all explicit register words and exclude partial LDS loads, GDS and implicit state from the proof. The LDS and operand restrictions draw on adriaespii’s review in fxceless/victory-fork#36.

Validate both a wave-uniform prefix scan and its lane-dependent counterpart and require a compute PSO when the hardware can exercise the wave32 program.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
FILL_TITLE=2 (small fills from title memory no shader landed in for 600
frames are done from the title's bytes): run fills-ab3, standing in a
street, A/B by 10 s: mean 88.8 ms a frame against 100.5, median 83.4
against 88.1, p90 104 against 154; fills on the card 20-40 a frame against
900-3,500. Walking (fills-ab1, fills-ab2) the picture held. =0 turns it off.

ASK_SPREAD (fills-ab2): the asking took 6.2-6.3 ms with it, 5.6-5.8
without: the kernel's askings do not go on side by side. Removed.

Timeline spans: "asking: ahead", "asking: the rest", "asking refused",
"steps on the card: whether in the way".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run fills-ab4 (VICTORY_THIN=1, submissions on our thread, A/B by 10 s,
walking): FILL_TITLE=2 60-71 ms a frame against 64-65 off. With it about
one submission a frame waited 8-15 ms for landings for "what a copy at its
place writes": the fills no longer stop blocked_by, which now reaches
place::read_by, and the card's steps take nothing. Off, the card does them.

ask_once holds everything once for both its parts: the second hold waited
for other threads' askings again (0.5 ms a time in run fills-ab3).
VICTORY_ASK_GAP=1 joins ranges up to 24 MB apart into one asking (off).

Diagnostics: the kind of step found reading a placed copy's destination.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Shadow::merge_under_writes, for a copy in the card's memory, found the
changed word runs of a page and then copied each run on its own into the
CPU's side: 190,000 runs in 400 pages a frame in session play-1125-1724.
Now each 32-byte block in which a word differs takes the title's bytes as
it is compared (the words of a block that do not differ are equal, so the
same bytes end up there; VICTORY_UNDER_FUSED=0: as before). The copies of
their own a page can need (runs of more than 256 bytes, at most n/260+1)
are taken from what the submission may send up before the pass and the
rest given back, so a page never has to be put back; where they cannot
be taken, the pass is as before. The runs of a range's pages go into the
copy's dirty list in one call, with room reserved.

A frame-rate line says where the time of this step goes: finding the
copies in the lists' refreshes, asking what was written, finding the
pages, waiting for the copy's locks, comparing (wall, and threads
together: reading title memory, comparing and putting in), noting runs.

Measured, city, lane on (VICTORY_THIN=1, JOIN_PARTS=8, UPLOAD_AHEAD=1):
- late-1 (no ray tracing, before this): 7-13 ms a frame on the lane, of
  them compare 3-6 wall (7-16 threads together), noting 1.4-3.6, asking
  1.0-1.7, the refreshes looked through 0.9, locks 0.0-0.2.
- late-3 (ray tracing, A/B of the switch in one run, world phases): 1.96
  -> 1.87 ms; compare and put 0.42 -> 0.27 (threads together), noting
  0.11 -> 0.06; frame unchanged within noise (110-121 ms both).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The structure builder's one-dimensional programs are dispatched by a count
of threads whose last group may be partial (USER_DISPATCH_THREADS_X). On a
host of 32-lane waves (NVIDIA) a console wave64 program that crosses halves
runs as two host waves that exchange through group barriers, so the lanes
past the count cannot leave at entry. `counted_in_threads` therefore skipped
these programs on 32-lane hosts, and their lanes past the count ran: they
counted in wave ops and stored.

Now the lanes stay for the barriers and `partial_active` leaves them out of
memory accesses, EXEC's ballots and the wave's reductions. Shuffles keep the
plain guard (they read other lanes, not memory).

Test: a spilled 64-thread wave64 program with s_bcnt1(exec) and a whole-wave
OR across halves, lowered through `lower::lower` on a 32-lane host; it must
take 32-lane waves and give the console's results for counts 45, 1, 33, 0.
It fails without the change (no USER_DISPATCH_THREADS_X) and passes with it
on an RTX 5070 Ti (Wine + vkd3d-proton).

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Check the previous destination of swaps and accumulators. A conditional select needs a proven uniform predicate, since a scalar bit pattern can select different inputs in different lanes. Leave relative register accesses and operations with an implicit VCC input outside the proof.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
What changed on the CPU's side of copies in the card's memory goes to a buffer of
ours in the card's memory on a copy queue of its own; the drawing queue waits for
it by a fence and copies from there, at the same place in its order as before.
The host list's D3D12 list is a Rec: state changes, aliasing and the title's
barriers wait there and go in one call at the next use of the list (every use
goes through its Deref). Replay of replay5: the PC-to-card copies 5-6 ms of the
drawing queue; joining barrier calls -2.4 of 79.5 ms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run card-ab1 showed the up queue unused: with VICTORY_SEND_OWN on, the bytes go
from the submission's own memory, not from the copies' CPU sides.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Adapt the far early-out and deep scalar-copy parts of fxceless/victory-fork#1002. This tree already tracks parked scalar pairs by lifetime. Retain that implementation and bring across the synthetic regressions, including the hardware gate.

Adapted from eaeb8f173a

Co-authored-by: Bruno Magalhães <[email protected]>
Run lane2-0: two write-watch askings of 11 and 13 ms on the submitting
thread each ended with one of the memory map walk's VirtualQuery calls
(16.6 and 13.1 ms, thread victory-memory-map); the walk asks about 250,000
regions in 0.9 s every 30 s and holds the process's memory map meanwhile.
Run ask-1 without it: no asking over 1.5 ms on that thread in 50 frames of
five timelines.

The 5 s lines' VirtualQuery for the kind of each busiest range (10 ms on
the submitting thread in lane2-0) is asked once per address.

Diagnostics: ranges a submission's asking asks about alone (askings, pages
found, time), the costliest.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Checked every VICTORY_* name in the Markdown files against the source.
One was dead: VICTORY_MERGE_RACE (its counter was taken out after
8dd30ab); the line keeps the finding and drops the switch.
VICTORY_LATE_WAIT (host.rs late_stage: 1, 2, 3) and VICTORY_WIDE_REFRESH
(host.rs wide_refresh: 0, 1, else on at four or more CPUs) are read, as
documented; VICTORY_LATE_WAITS in frame.rs is a different switch.

What the docs had wrong, by the code:
- VICTORY_RELAY (stage 2), VICTORY_LATE_WAIT (stage 3 with the relay)
  and VICTORY_WIDE_BACK are on by default, not off; the frame-rate line
  says these are now the defaults (#34 copied it and saw no change).
- VICTORY_CARD_ROOM_FOR_BUFFERS is on by default (=0 as before).
- VICTORY_PAGE_WRITES opens the guards by default (=0 counts only).
- VICTORY_CARD_BUFFERS_MIN_KB, when above 0, wins over _MIN_MB: said
  in both places that name them.

xtask: a test that every VICTORY_* name in a tracked Markdown file is
quoted in at least one Rust file outside xtask, as every switch is read.

Fixes #49

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The file holds places in the title's code, which is game-derived, and was
opened wherever the variable pointed: with scripts/play.ps1's working
directory a relative name landed in the checkout, and cargo xtask policy
accepts a small .txt of that shape. The path now goes through
victory_core::ensure_outside_repo, as every other writer's does. It is
looked at once, on the thread that writes and not under the title's fault,
and kept in a OnceLock: a refused file is said once with a warning, and no
thread is started for it again.

victory-gpu depends on victory-core directly now (no cycle: victory-core
has no workspace dependencies, and it was already built through
victory-pipeline).

Fixes #33

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The per-second part of the meter took about 3 ms on the submitting thread
(run ask-1). VICTORY_METER_THREAD=0 keeps all of it there.

Built and tested (329 victory-gpu tests pass); the A/B run ask-3 was stopped
before the game ran (the user plays).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Refs #29
Suggested by sharan104 in #88.
Every device loss with the pool in the report (n08, n11, n15, steps-ab2,
start-3, the user's play-1125-2107 without ray tracing) was a page fault
at the first byte of a texture in a block made that millisecond, its title
slot changed "at once" (mirror) while lists sent before read it by index;
VICTORY_SHOW_AFTER covered only some paths. mirror() now holds such a slot
on what it showed (or the neutral texture) and flips it when every
submission begun before the texture was made has finished.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Backport the capture conversion and regression test from fxceless/victory-fork#910.
With VICTORY_GPU_TIMING each list runs and is timed on its own, preludes and
the compare of copies in the card's memory included, and the frame line sums
them: the title's lists (their noted commands and the rest), preludes, steps on
the card, compares, others of ours, and the least a list took.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Whether the submission's asking holds a range was asked two or three times
per refresh (10,000 a frame), each a walk through all its ranges (a few
hundred). They are now kept by their starts with the furthest end so far:
the same answers in a few steps.

Measured and left out (run ask-3b, A/B in one city run, no ray tracing):
VICTORY_ASK_NORESET lane asking 7.2 ms a frame against 5.4 off, kernel
3.7 against 4.4 ms; VICTORY_ASK_SPREAD kernel askings 17 ms against 4.4
(they wait for each other in the kernel), lane 6.5; both 8.1 ms and frames
74 ms. Both stay off.

Tried and dropped (run ask-4): askings within one reservation only (the
refused askings stayed at 280-300 a frame: they are not the ahead runs'; and
VirtualQuery of the pieces stalled the lane 100-1100 ms every 5 s), and
askings of the refreshed ranges only (they are 99% of the copies' spans).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Tests: victory-gpu 330 pass. Replay of captures\replay5\capture-1 (3 loops)
ran to its picture.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Refs #30
The executable's three debug-text shaders (TextVSQuad, TextPS_Tex,
TextPS_Sdf) carry their FSSM blob unpacked, under XDAT kind 0x0c
instead of 0x0d; they were read as containers without a program.
All three now translate and validate. `victory shaders --list <file>`
writes every shader that does not translate, one line each.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The ray-traced shadow tracers (CS_TraceShadowRays_*) take their
structure's address out of an SRV they pick from a table by an index
from a constant buffer, read its header at +48 and build the BVH
descriptor themselves. Only views at a fixed table place had their
address from the host (USER_VIEW_ADDRESS); these were refused as a
descriptor read only as data.

The host's table of strides by view heap slot (root SRV t255) now has a
second part after the strides: per slot the title address of the buffer
view or ray-tracing structure there (VIEW_ADDRESSES, two dwords, entered
where the stride is). Such a load reads dwords 0 and 1 from there;
dwords 2 and 3 stay without a value (a program that reads them still
stops). Pages the address reaches are found by the existing fault notes.
Four of the five tracers now translate and validate (FullAdaptive stops
later, at a lane mask).

shortcut: tables made afresh in dynamic slots have no entry (read 0), as
for strides; dword 1 holds the address bits only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title's routine at image+0x1e86440 reserves 185 MB of graphics memory
below 4 GiB, splits it into five pieces, takes all their physical pages
in one XMemAllocatePhysicalPages and maps them in order: one stretch of
one section. Its 174 MB buffer at 0x34e10000 (the ring of constants, and
what the skinning passes write through one view of all of it) had a host
copy in the card's memory, ~17 MB a frame sent up in ~600 pieces, shader
writes fetched back and compared, and ~6,000 constant fills a frame.

With the switch the stretch is mapped once more at an address of ours and
opened as a host heap there (OpenExistingHeapFromAddress1); title buffers
and windows in it are buffers placed in that heap, the existing in-place
form of a host copy: nothing tracked, sent up, fetched back or compared.
The title's own views stay free to change; when it maps other pages
there the region is forgotten. A line on the frame-rate report counts
the CPU fills and buffer copies of ours that still read or write it.

Replay (play-1125-0127, heap in the PC's memory): the title's own work
+~3 ms on the card; the 30 ms added there are our compare passes, which
do not run over memory in place.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
DXIL wants one interpolation mode per signature row; the console packs a
nointerpolation float beside an int or a system value (the front face)
in one row, and our signatures declared the float linear: 48 pixel and
mesh programs were rejected by the validator ("interpolation mode that
differs from another element packed into the same row"). Float elements
nothing decides (unread inputs, outputs) now take the mode the row's
other elements agree on: same_mode_per_row from VIctory 13091f6e, ported
by hand (the whole commit conflicts in 18 places with what local/next
already took of it). All 48 now validate.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
image_get_lod of a 2D array passed the slice as CalculateLOD's third
coordinate, which DXIL wants undefined: three pixel programs
(PS_DeferredTextured_AlphaClip, PS_MirrorReflectionDeferredTextured_
AlphaClip, PS_VfxVBuffer_AlphaClip) were refused by the validator
("out of bound coord must be undef"). The level does not depend on the
slice, so the result is unchanged where a driver took the module.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run port1-1: the title maps the five pieces of its 185 MB heap in another
order than their addresses, so the heap was views of one section in a
scattered order ("not one stretch of a section: Scattered") and nothing
was placed. With VICTORY_PORT_CONSTANTS=1 xmem now gives the page numbers
mapped into a 32-bit graphics reservation the slices at their offset in
it, when the reservation is all one section and both slices are fresh
(never mapped or written: no commit bit), which the title cannot observe.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run port1-2: nothing was arranged and the heap was still scattered. The
title reserves it with kind 0x42000 (reserve, 0x40000), without the
64 KiB page bits, so it was not taken for a placeholder and was never
recorded. Any 32-bit reservation without commit is recorded now; the
test reserves the way the title does. A warning says once why pages
mapped there are left where they are.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit e278bc8091a0cb61a100caef6dff646d4b3b9e6f)
(cherry picked from commit 25b1bf3b5fa5f27998b3b3bcfaad58c79fef7423)
members() tested all 385 register slots to return the few that are live,
twice for every block of a program: 1.27 M tests for a 1,651-block
shader. Walk the seven set words by their lowest set bit instead, in the
same register order. The IR build is 4.5% faster on a synthetic GFX10
program of 12k and 24k instructions, and range::build 4.1% faster.

Co-authored-by: slatefield <[email protected]>
(cherry picked from commit 129a9ba2d5bed98004e373aa49804734ed0882ee)
Extend bfe_signed_and_unsigned_match_rdna2 in valu_tests with scalar unsigned s_bfe_u32 (SOP2 0x27), literal src1 operands, ignored src1[15:5]/[31:23] bits, 7-bit widths >= 32 (32, 64, 127), v_bfe_u32 5-bit width wrap, and SCC conditional selection for both s_bfe_u32 and s_bfe_i32 (#803).

(cherry picked from commit 23446978c24640c10a0fe3c6e94d8e097e48a914)
CS_TraceShadowRays_FullAdaptive reuses SGPRs between saved lane masks
and constant-buffer fields: a join of a mask and a number (lowered as
the number it is) is cut with s_and_b32 / s_or_b32, which
structurisation takes for lane masks, and the result is compared per
lane as a number. Its ballot holds lanes outside EXEC, so the program
was refused ("a lane mask holding lanes elsewhere read as data").

Such a read now takes the number the bit operations compute from their
operands (constants, root constants, values lowered as numbers, such
operations again; console lanes only, where the joined mask is the
console's number). Only on a second try, as first halves of
interpolations: with it on for every program, 69 compute programs that
already translated came out changed (CS_RaytracingResolve, ...); now
none does. `victory translate` makes the same second tries as runs
(emit_with_retries). FullAdaptive now translates and validates.

The test runs the joined register through both paths on the hardware
device (WARP takes no declared wave size); it found that a join read
only through such operations must be marked read, or its mask's edge
brought 0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title's placed shader-visible view heap is its frame allocator's memory
(image +0x4d9f400); draws' and dispatches' tables are filled by six 32-byte
stores in +0x4d9efd0 and +0x4eec8e0. With the switch, the launcher patches
those stores (original bytes checked, a site that differs is left alone and
logged) to jump to code that does the store and marks the slot and its 4 KiB
chunk in maps of ours; our own mirroring marks too. sync_heaps takes the
marked slots in place of the write watch's changed pages. Fallback: every 8
frames the watch is asked, and 16 of its pages a frame are looked at whole;
a view record no mark told of is made, counted and logged with the place in
the title's code that last faulted on its block.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every rebuild of the translator translated every shader again into a
new set of entries (the key held the BLAKE3 of the translator's
sources): 16 GB of sets of earlier builds in victory-fork-cache\shaders.
The key is now victory_shader::TRANSLATOR_VERSION (bump it with any
change of what the translator makes), the entries' format and the
settings, plus the container: a rebuild that leaves the version keeps
every translation, and the store grows only by shaders that newly
translate.

Each entry (VSH2) also names the translator build that made it. An
entry of an earlier build is served as it is (counted, said once in the
log); `victory shaders` translates such entries again in place and
prints how many came out different, which tells whether the version
should have been bumped. VICTORY_SHADER_FRESH=1 refreshes in a run;
VICTORY_SHADER_KEY=source keys by the source as before. The pipeline
warm-up's fingerprint follows the same key.

Checked: all shaders translated into a fresh cache (25,790), then the
translator rebuilt with a comment added: 25,790 entries refreshed in
place, 0 different, no new files. Entries of the old key (VSH1) are
not read and not deleted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run port2-2's fallback found ~250 view records a frame on its 16 pages that
the six patched stores had not told of; the runtime's memcpy was among the
last writers of their blocks. With the switch, the title's memcpy/memmove
imports mark each slot of the marked heap whose first word they copied is a
view record's. The fallback now also says how many of the missed records a
draw read through a table lately (made by the draw anyway).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
From codec-d/cool_fox (Graham): compose.rs (two planes drawn as one,
the second premultiplied over the first, each scaled to the screen),
Host::present_planes, the second plane read at the retail PresentX
stride of 72 bytes and checked to be a resource of ours, the overlay
carried through the submit lane's present job. Barriers from and to
COPY_SOURCE are left out when the texture is in it already.

Off by default: without VICTORY_PLANES=1 the first plane is shown alone
as before. Either way the first present with more than one plane is
logged once with what its second plane is. Left out of the fork's
commit: WakeByAddressAll on memory writes (the title never waits with
WaitOnAddress; only our threads do).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
From codec-d/cool_fox (Graham). TablePlan: what a shader's descriptor
tables hold (slots, CBV/UAV, last dword, entries by descriptor) is
grouped once when the pipeline is translated, not searched in the
declarations at every bind (State::tables). Same tables made, same
order of entries.

Fallback heaps: with VICTORY_FALLBACK_HEAPS=1 a list always has a view
heap and a sampler heap bound, a host heap of one slot (a null view, a
point sampler) for the one the title did not set, as a root signature
with directly indexed heaps wants. Off by default: only the heaps the
title set, as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The IR can retain an old destination on ordinary instructions that overwrite it. Only require implicit VGPR values on swaps and accumulators, where lowering consumes them.
Separate renderer-side shader translation and lock acquisition from D3D12 load and create calls. Also trace first-use waits and library serialization so a Present dependency trace can attribute worker time with the existing diagnostics.
From codec-d/cool_fox (641835a4, fabb872a, c64fc9b4, 08e4574d, e94d277a,
the values of the last): residency.rs asks the system's memory once a
second (the sweep). Under pressure (3 GiB of free RAM or 4 GiB of commit;
out again above 5 / 6) texture prefetch is limited to 64 MiB a frame,
idle scratch chunks are let go and the texture and staging pools keep
fewer empty blocks; below 1.5 GiB of commit 16 MiB a frame and no
spare staging block; the texture pass stops below 512 MiB of commit and
no new staging block or upload-ahead is made for textures picked by
index below 1 GiB (those a draw samples still get one). With 32 GiB of
RAM or less (or VICTORY_RESIDENCY_LIMITED=1): 128 MiB a frame, 32 MiB
on its way ahead, 16 submissions before objects are let go, fewer
spare chunks. Off by default.

Always (only after a failure): a pool whose new block was refused does
not ask again for 500 ms (it still uses its blocks), and an
E_OUTOFMEMORY from an upload buffer, texture heap or host texture stops
the texture pass for 500 ms, leaving its slots due. Tests from the fork
for the back-off and the reclaim.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
From codec-d/cool_fox (Graham). What the bindless buffer pass keeps of a
view heap (its passes, the ranges of its slots, and for
VICTORY_UNWATCHED_FRAMES > 1 the last refresh of each unwatched copy with
the span it covered) now lives on the host heap, so a heap made at the
address of one let go starts afresh instead of taking the old one's
ranges. With the default interval of 1 nothing else changes.

VICTORY_SWEEP_PER_HEAP=1 (off by default): the pass runs once a frame for
each view heap, not once for all of them, a list holds each heap's table
of strides by its own key, and a pass put off to submission time is left
out if the heap at that address has another table by then.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
From codec-d/cool_fox (Graham). VICTORY_XMA_REFILL=1 (off by default):
an XMA voice that ran out of input goes on when the title gives it a
valid buffer again, and the pump publishes only whole blocks (but the
padded tail) after at most 8 decoding steps. (The fork clears 6 bits at
word 2 bit 26 where the field read is 5 bits; 5 here.)

VICTORY_DSTORAGE_STAGING_MB=<n>: the DirectStorage staging buffer is at
least that big; unset, what the title asks for (32 MiB). The fork makes
it 256 MiB by default.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
From codec-d/cool_fox (Graham): the COPY_DEST -> NON_PIXEL_SHADER_RESOURCE
transitions after the card's copies of dirty ranges are made once for
each buffer; two shadows in one buffer gave two transitions of the same
subresource in one ResourceBarrier call.

Tests: victory-gpu --lib 343 ok, victory-hle ok, victory-shader --lib
286 ok, victory-loader --lib 42 ok.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
On a Ryzen with two core complexes of which one has the stacked cache
(7900X3D, 7950X3D, 9900X3D, 9950X3D) every core reports the same efficiency
class, so `fast_of` found no fast cores and no thread of ours asked for
any. Where the classes are alike and the last-level caches differ in size,
the sets on the largest one now count as the fast ones (at least eight of
them); processors with two kinds of cores still go by their class, and
those whose caches are all alike are left as they were. In diagnostics
builds `VICTORY_AB` can switch it while the title runs.

Measured on a 9950X3D + Radeon AI PRO R9700, diagnostics build,
VICTORY_AB=20,VICTORY_CACHE_CORES, 10 pairs of phases of matched draws
(within 15 %): median frame -1.3 % (noise), p90 -12.2 %, better in 8 of
10. In the steady part (about 3,900 draws) every phase with it had a lower
p90 (69-79 ms) than every phase without (81-86 ms).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	crates/victory-shader/src/emit/wave64_tests.rs
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	crates/victory-shader/src/emit/wave64_tests.rs
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	crates/victory-shader/src/emit/wave64_tests.rs
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	apps/victory/src/translate.rs
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	apps/victory/src/warm.rs
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	apps/victory/src/main.rs
#	apps/victory/src/translate.rs
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	docs/README-fxceless.md
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title asks for 33,333 us (SetFrameIntervalX) because its graphics
settings hold a frame rate of 30 (settings +0x210): +0x1e0fb30 and
+0x22434a0 turn it into a frame time (+0x98f84ac), +0x247ab10 picks the
interval from it and the display's 60/120 Hz (a 120 Hz mode alone changes
nothing at 30), and +0x120530 is a QueryPerformanceCounter limiter of its
own at the same rate.

VICTORY_FRAME_INTERVAL_MS=<ms> (16.667, 8.333, 0 = no wait): frame.rs ticks
at that interval whatever the title sets; the loader makes the two loads of
the setting "mov eax, rate; nop" (rate = 1000/ms rounded, 0 = the title's
own "no limit"), with the original bytes checked. VICTORY_TITLE_FPS=<n>|off
overrides the rate or leaves the title alone. Diagnostics:
VICTORY_TIMER_LOG=1 logs the title's timers once a second and frame pacing
bands every 5 s.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run fps-1 (our clock at 16.667 ms, the title left at 30): the menus ran at
16.7 ms until the title's own limiter came up at 30 s (then 33.3 ms), and
meanwhile five of its seven timers stepped 33.3 ms a frame: game time ran
at twice the wall clock. The timer update (+0x2226040) takes the real time
since the last frame but at least 1/rate (+0x6849844), and that rate comes
from +0x2241fd0, a third read of the same setting. It now returns the rate
asked for (1000 for no limit), the original bytes checked first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- lightprobe.rs (VICTORY_LIGHT_PROBE=<csv>): a line a frame of what the
  title's exposure (PS_CalculateExposure) and lux factor
  (ComputeLuxCompressionInfo[Smooth]) programs read and write, and of the
  stand-in for the indirect light (its slow mean; the sampled mean of the
  title's resolve, the estimate and what was written).
- texlate.rs: how long textures take to be shown (slot written to
  uploaded, with or without waiting for memory; upload to the slot showing
  it; first part view to whole level 0; last look that found memory away
  to the upload), a line with the memory lines.
- ambient.rs: VICTORY_AMBIENT_SETTLE=<ms>[,<jump>[,<fresh s>]]: the slow
  mean of the light around (20% of every pixel's estimate) follows by a
  time constant instead of 0.04 a frame (25 frames: 2-4 s at 7-13 fps),
  takes a change by more than <jump> at once, and optionally bounds the
  title's leftover by the estimate for <fresh> s after such a jump.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- texstore.rs: a texture uploaded whole from level 0 is kept (memory, up to
  4 GB, and the folder) under keys of its shape and the digest of its
  smaller levels (>= 32 KiB of them, the start of its memory). A texture
  later first viewed from such a level with those bytes gets a whole host
  copy: the larger levels are copied from the store by its first upload's
  list, and its views show from level 0.
- draw.rs heap_textures: the backoff of looks at slots whose memory is
  away was 'about four seconds' counted in passes (several a frame): up to
  256 frames, 13-18 s; VICTORY_TEXTURE_LOOK_MS=<ms> caps it by frame time.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	crates/victory-gpu/src/draw.rs
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title takes its output size from its settings (settings.xml video/resolutionFullscreen,
3840x2160 as a Series X wrote it) and applies it at +0x224352b (+0x22434a0) through the one
screen size setter +0x2478130; the back buffers follow (+0x247ad10). VICTORY_OUTPUT=<w>x<h>
(one of the title's own modes) makes that block write the size into the settings, then take
the title's own path. VICTORY_RENDER_SCALE=<0.5..1.0> replaces the title's own upscaler's 2/3
(+0x28f1e78) and FidelityFX's scale (+0x28ef680, as pull request #53); VICTORY_UPSCALER=<6|7>
is pull request #53's picker patch (+0x7e93f0). Each site's bytes are compared first; another
build is left alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title makes its back buffers in a 64 MB pool (Series X) and stops at an int3 unless less
than 2 MB of it is left over; at 1920x1080 49 MB are (run res-1 stopped there 2 s in).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Heaps are made without sharing across adapters, so the resources placed in them
cannot ask for it: the buffers renderer port 1 places in the heap opened from the
title's graphics memory (and every other heap opened from memory) were refused
("parameter incorrect", 1,326 to 3,576 a capture). With `--timing detailed`, a
list that runs no shader but ours (the host's state preludes, copies of what
the CPU sent up, the card copies' passes) has its commands summed under
"... (lists of ours)".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The console takes constant buffers on 16 bytes, D3D12 views on 256, so every
constant buffer a draw's tables name was copied at each submission into upload
memory of ours (~23,000 a frame of the city, ~9 MB, out of the title's graphics
memory that renderer port 1 already has the card read in place), and each root
one not on 256 bytes (64 KiB each).

With the switch, translated shaders read constant buffers as raw bytes
(victory_shader::emit::constants_raw): a table's (or one picked from the heap)
through the raw twin of its slot, a root one as a root SRV. The host makes a
table's constant buffer in title memory in place a raw view of the title's
bytes in that twin (descriptor::host::constant_raw_at): no copy, no step at
submission. Others are copied as before (their twin is a raw view of the copy);
a title slot's constant buffer view gets a raw twin (a raw read through a
constant buffer view has no end on AMD). The shader cache keys on the switch
(only when on: translations cached without it keep their key, so the
translator version stays). VICTORY_PORT_CBV_PLACE=0 copies again while reading
raw; with VICTORY_AB=<s>,VICTORY_PORT_CBV_PLACE both sides in one run.
Per-second line: "renderer port 5 (VICTORY_PORT_CBV=1) per frame: ...".
Test: emit::tests::table_constant_buffers_read_as_raw_bytes_through_their_twins
(WARP: the twin is read, the slot's own view is not).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Series S renders through FidelityFX (+0x28ef680). With its scale at 0.5 (run res-6) FidelityFX's
jitter phase count came back 0 and the title divided by it at +0x28f03e8, 49 s in. The title's
own upscaler (Series X) ran at 1.0 (run res-4). The FidelityFX patch stays, behind its own switch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The sets of guarded blocks are of atomic words and GUARDS is a reader-writer
lock. With the switch a write fault, a refresh guarding its range and a block
made known by its bits take the lock shared and the claims (BUSY bits) of the
blocks they change: faults wait only for whoever changes the same block, not
for one another, and refreshes do not wait for faults. Faults wait for claims
in block order, refreshes only try for theirs (a block they cannot claim stays
written, told so at the next asking), so no two wait for each other. What
changes more than single blocks (mappings, kernel reads, freed memory, holes)
still holds the lock alone, as before. Blocks known as view memory (VIEWS) go
to the guards at once instead of a kernel asking that is refused.
VICTORY_GUARD_HOT=<ms> (off): blocks written again soon after each taking
rest longer. End-of-run line: renderer port 6 per frame.
Tests: three stress tests of the view writes with the switch on (all
threads, half of them, resting and hot blocks).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
One submission a frame spent up to 6 ms in that look alone (run guard-3,
the timeline at 100 s: 5.8 ms with nothing else on the lane) while the six
threads beside it waited; with more than 256 refreshes it was already done
beside them, as each one's first step.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run guard-4's timeline: the submission with most of the frame's steps spent
2.9 ms gathering them and 3.9 ms on the spans, alone. Each list's steps are
now folded per copy beside it (fold_touches: the span of its refreshes
before its first write by shaders, whether it writes it) and the folds
joined in list order (join_keys), which gives what front_spans gives of the
whole submission, span for span and in order: front_tests, 3,000 random
submissions of lists, parts, refreshes and writes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The heaps' records: a round of the heap-sync thread is asked for when the
title submits, and the lane waits for that round, or for one begun after a
wait of its queue went or a step of ours wrote a heap's memory
(port/lane 97033e5a; its plans part is left out, port 6 plans beside the
lane already).

The journal: the pages' notes are in 64 parts, each under a lock of its
own. With the switch an answer is noted holding the journal shared and its
pages' parts for writing (writes, landed_beside, a submission's asking
before its ranges and number are set alone); what has nothing to change
(wrote with no asking standing, ask_once_end, ask_ahead_done) looks shared
first. A fresh number to answer with is taken holding the range's parts,
switch or not, so an A/B run mixes both safely; a page's note only goes up.

End-of-run line each second: renderer port 7 (heaps' waits with and
without the switch, rounds asked at submit; the journal's waits, the
lane's own among them). Tests: parts and ranges, notes out of order, a
fresh number sees every lower note with no deadlock (8 threads), no write
lost with the switch on in all threads and every other one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run p7-1 (in-run A/B): with part 1 alone the lane still waited 4.1 ms of
5.3 for the heaps' records; 2.4 of 16 preparings a frame found their round
asked earlier. A wait that goes now asks for its round at once (as patch 4's
part 2 did), and one met by the card's own write raises no floor. Counted:
preparings that had to ask at the preparing, and those with no mark.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
`cargo test --target-dir target-v7` leaves build objects under
target-v7/, and the asset policy / git status should not treat them
as game data. Ignore /target-*/, /logs/, and root `*.log` files.
When the remap or page-write queue hit 32,768, Belobug dropped the
ranges. Completed uploads could stay stale (black textures). Port
DexNom/VIctory record_remap (commit 921d8d3b43b44f3a6ca4b44095edd3c4baf10a87):
merge overlapping last ranges, raise the cap to 2^18, and on overflow
keep a single (0, u64::MAX) rescan-all entry. Belobug already joined
ranges at consume time (join); this fixes the producer path.

Co-authored-by: Codex <codex@localhost>
Warm-v7 pre-translates C:\Users\Alpacher\Downloads\GTA\shaders.rpf into
cache-rework-v7. The launcher defaults to NVIDIA-safe high-ROI switches
(PORT_CBV off), with -Safe for Belobug defaults and -PortCbv to A/B the
constant-buffer path. Logs are UTF-8 (no BOM) with a 64 KiB buffered
StreamWriter.
v7 on the RTX 5070 made ~300 committed shared buffers a frame for buffer views off their copy's elements (ring positions change every frame), each made resident and mapped, all under the EXACT lock that every list-translating thread takes, plus a scan of all ~3,200 kept copies at every new one. Buffers are now kept by width once nothing names them, used again after the submissions in flight at their release have finished, zeroed; the idle scan runs every 32 new copies. VICTORY_EXACT_REUSE=0 restores v7 behaviour.
With VICTORY_WAIT_RESIDENT on, every new heap/buffer sent a copy on an aside queue and waited for it while holding one global lock: 161,200 waits in a row in run-v7-20261126-212142. A copy sent after the memory was made covers it, so threads now wait for any such signal, with a null-event SetEventOnCompletion outside the lock. VICTORY_MAPPED_SHARED=0 restores v7 behaviour.
v7 translated 27-31k calls a frame in 1.0-1.7 s of thread time (35-62 us a call vs 6.4 us in Belobug's runs). The thin line is now followed by the eight heaviest kinds of call with calls, ms and us each, so the next run names the cost. VICTORY_THIN_OPS=0 turns the timing off.
The two trees diverged at a26859f (575 commits on the Belobug/v10 side,
99 on main) and their GPU layers conflict in 39 files and about 440
hunks. main's shaders do not translate on the RTX 5070 (full black); this
tree's do. So the merged tree keeps the v10 code; main's history is a
parent, its diagnostics logs are kept, and its later standalone fixes are
applied on top where they apply (following commits).
`submit_split` runs the lists before its first unmet wait at once with
`host.execute`, as `submit_cut` does. `submit_cut` then calls
`list::tables_done` for those lists; its comment says why: the lists are
not detached on that path, so nothing gives their fresh per-draw tables'
dynamic slots back until the title resets them, and the ring of 262,144
slots ran out (run 45: 3,143 of 15,942 tables refused in one frame).
`submit_split` had no such call: with `VICTORY_CUT_WAITS=0` (the
documented switch that holds whole lists, as before) every submission
leaks the slots of its first lists the same way, and later draws are
dropped once the ring is full.

The call is added after the same `host.execute`, mirroring `submit_cut`.

`cargo test -p victory-gpu --lib`: 217 passed, 0 failed, 6 ignored;
`cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. No
game run: the two branches differ only in that call, and nothing without
a host GPU drives `submit_split`.

(cherry picked from commit af23c6529d)
Adapted to the v10 make.rs (no get_or_init there: the compiler guard's
bad-key check stays first; the build is caught with catch_unwind).

(cherry picked from commit 46da5ee, by hand)
alias_of returned the bare pointer of the texture it found under
TARGETS_AT's lock; the copy used it after the lock was gone, when the
title may have dropped its last reference: a use-after-free. It now adds a
reference under the lock and hands back a Held that drops it.

Adapted to the v10 tree: callers that only ask whether there is such a
texture (texture_at, the texture-ahead pass) use has_alias, which does not
take a reference; the two copy callers (draw.rs readable, external.rs
prepare_input) use the Held.

(cherry picked from commit a463dcb, by hand)
A list may outlive the title heap it took dynamic slots from, and a later
heap can be made at the same address; the old list's reset then freed
slots of the new heap that other lists hold. Each host heap gets an
identity (NEXT_ID), recorded with the range; release frees only when it
is the heap's.

Adapted to the v10 tree (draw.rs State::dynamic, descriptor.rs
release_dynamic, descriptor/host.rs HostHeap::release); the test
dynamic_slots_are_given_back_only_to_the_heap_that_took_them is brought
over. (On main this landed inside e4245f3; 52ac4ec carries its message.)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:03:18 +00:00
Author
Owner

@⁠akimfomin on GitHub · 2026-11-26 23:15 UTC · original

The clean merge reported for 52ac4ec no longer holds against main a42b627e78476d691042a2a12e8cd5fcf5e49d77. I ran a three-way check of exact head fe703a0b0c6396c4621b2c82f2a3d994dbc8602b: conflicts in draw.rs, host.rs, indirect.rs, list.rs, pipeline/make.rs, texture.rs and console_insn.rs.

I would resolve and test pipeline/make.rs first. Current main waits for an unready compute pipeline by default; this matters for dispatches that run only once at a scene change. Exact upstream guard · Independent scene transition measurements from #1312. One cold-cache transition with compute wait ON/OFF on the integrated head, logging dropped dispatches, would catch a resolved merge silently losing that behavior. The check is Git/source-only. PortBridge · AI-assisted comparison.

**@⁠akimfomin** on GitHub · 2026-11-26 23:15 UTC · [original](https://github.com/fxceless/victory-fork/pull/1396#issuecomment-7205389775) The clean merge reported for `52ac4ec` no longer holds against main `a42b627e78476d691042a2a12e8cd5fcf5e49d77`. I ran a three-way check of exact head `fe703a0b0c6396c4621b2c82f2a3d994dbc8602b`: conflicts in `draw.rs`, `host.rs`, `indirect.rs`, `list.rs`, `pipeline/make.rs`, `texture.rs` and `console_insn.rs`. I would resolve and test `pipeline/make.rs` first. Current main waits for an unready compute pipeline by default; this matters for dispatches that run only once at a scene change. [Exact upstream guard](https://github.com/fxceless/victory-fork/blob/a42b627e78476d691042a2a12e8cd5fcf5e49d77/crates/victory-gpu/src/pipeline/make.rs#L179-L204) · [Independent scene transition measurements from #1312](https://git.gtahub.st/github/fxceless--victory-fork/pulls/1312). One cold-cache transition with compute wait ON/OFF on the integrated head, logging dropped dispatches, would catch a resolved merge silently losing that behavior. The check is Git/source-only. [PortBridge](https://github.com/akimfomin/PortBridge/issues/98) · AI-assisted comparison.
This pull request has changes conflicting with the target branch.
  • README.md
  • crates/victory-gpu/src/descriptor/host.rs
  • crates/victory-gpu/src/draw.rs
  • crates/victory-gpu/src/heap_worker.rs
  • crates/victory-gpu/src/host.rs
  • crates/victory-gpu/src/indirect.rs
  • crates/victory-gpu/src/lib.rs
  • crates/victory-gpu/src/list.rs
  • crates/victory-gpu/src/pipeline/host.rs
  • crates/victory-gpu/src/pipeline/library.rs
  • crates/victory-gpu/src/pipeline/make.rs
  • crates/victory-gpu/src/queue.rs
  • crates/victory-gpu/src/shader_cache.rs
  • crates/victory-gpu/src/shadow.rs
  • crates/victory-gpu/src/texture.rs
  • crates/victory-gpu/src/tiles.rs
  • crates/victory-gpu/src/watch.rs
  • crates/victory-loader/src/console_insn.rs
  • crates/victory-shader/src/emit/host.rs
  • crates/victory-shader/src/emit/intersect.rs
  • crates/victory-shader/src/emit/lower.rs
  • crates/victory-shader/src/emit/mod.rs
  • crates/victory-shader/src/emit/wave64_tests.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1396/head:github-bot/gh-1396'
git switch 'github-bot/gh-1396'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1396'
git switch 'github-bot/gh-1396'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1396'
git switch 'github-bot/gh-1396'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1396'
git switch 'main'
git merge --squash 'github-bot/gh-1396'
git switch 'main'
git merge --ff-only 'github-bot/gh-1396'
git switch 'main'
git merge 'github-bot/gh-1396'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.