Skip to content

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

Open
Alpacher wants to merge 582 commits into
fxceless:mainfrom
Alpacher:pr/fxceless-full-v10
Open

Alpacher wants to merge 582 commits into
fxceless:mainfrom
Alpacher:pr/fxceless-full-v10

Conversation

@Alpacher

Copy link
Copy Markdown

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 (GPU: the lists a split submission runs at once give their descriptor tables' slots back #1320, GPU: dynamic descriptor slots go back only to the heap that took them #1324, GPU: pin the texture a placed view aliases while the copy uses it #1336, GPU: finish a pipeline queue entry when its build panics #1353), ported by hand with their authors kept. Shader cache: a staging file a killed process left behind no longer loses the translation #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 <belobug69@gmail.com>) 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"

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

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.

local and others added 30 commits November 25, 2026 12:36
…ds and the buffer views picked by index are made on several threads (VICTORY_VIEW_THREADS)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d for while it is off

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 <noreply@anthropic.com>
… and what the title asks its memory to be

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 <noreply@anthropic.com>
…mcpy, memmove and memset (VICTORY_COPY_BESIDE=1) and single stores that fault (VICTORY_STORE_BESIDE=1); both off

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 <noreply@anthropic.com>
…wn (VICTORY_RDNA_FLOAT, on; 0: spelled out as before)

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 <noreply@anthropic.com>
…s, --shaders-b turn by turn), times per pass as medians

--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 <noreply@anthropic.com>
…CTORY_JOIN_PARTS, off), fills cut free of copies

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 <noreply@anthropic.com>
…not be one counts as none (VICTORY_BVH_BOUNDS=0: neither)

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 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ND_ECHO=0: sent)

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 <noreply@anthropic.com>
…es and copies beside the guards, and flags it sets that are set (VICTORY_WRITE_SITES=<file>: places changed at load to look first; off without it)

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 <noreply@anthropic.com>
…p in three runs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… build)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…p no more pages than one in the dorm, and a frame takes longer

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… made ahead of a run, each batch in a process of its own (victory warm)

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 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…escriptors copied onto themselves are not written (VICTORY_SAME_RECORDS=0: they are); of tracked pages the parts written are taken (VICTORY_TAKE_PARTS=0: pages); waits for the trackers' locks and the heap sync's parts counted

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…1 turns it on): it mended nothing and costs some 20 ms a frame (light-15)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
local and others added 29 commits November 26, 2026 06:43
…the title's submit and the journal's notes in 64 parts with locks of their own (VICTORY_PORT_JOURNAL=1, off by default; lane -2.4 ms, frame 45.8 -> 45.1 ms, reports/PORT-PATCH-7.md)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`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 921d8d3):
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.
…ock (VICTORY_EXACT_REUSE)

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.
…_MAPPED_SHARED)

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.
…Y_THIN_OPS)

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.
…+3 frames; VICTORY_EXACT_REUSE_SAFE=0 = v8) and log card-copy cap turn-downs
… waits on, CARD_BUFFERS_MB=1024, A/B switches
…ies over port-1 memory, cheap tests first in the exact sweep
…PortConstants), PLACED_ORDER=1 (-NoPlacedOrder), target-v10
… tree

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).
…tables' slots back (fxceless#1320)

`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 af23c65)
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)
…celess#1336)

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)
…fxceless#1324)

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.)

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.