gpu/shadow: opt-in VEH lazy GPU-to-CPU copy-back (4/4 of #51) #59

Closed
Vladimir-Human wants to merge 88 commits from upstream-pr/59 into main
Vladimir-Human commented 2026-11-26 00:48:05 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by Vladimir-Human on 2026-11-26T00:48:05Z.


Split 4/4 of #51 cleanly on top of beta (78ad5711, independent of #56, #57, and #58).

Summary of Changes (host.rs, watch.rs, shadow.rs)

  • Opt-in VEH lazy GPU-to-CPU copy-back (VICTORY_LAZY_COPYBACK=1, default OFF):
    • Defers 64 KiB aligned copy-back pieces (PAGE_NOACCESS) across GPU-to-GPU workloads so steady-state frames touch zero PCIe readback bytes, flushing individual pages on demand inside watch's vectored exception handler (on_fault) on first CPU read/write.
    • Supports both MEM_MAPPED physical views (atomic dual-view flush before restoring PAGE_READWRITE) and MEM_PRIVATE | MEM_WRITE_WATCH buffers (serialized via FlushWait), leaving unaligned/pinned/fence ranges eager.
    • Preserves DirectStorage / kernel title_memory_written partial-page complements, captures idempotent FlushedBaseline for in-flight relay/merge paths (card_merge_relay, relay_merge, stale_under_writes, merge_under_writes), and holds scoped lazy_flush_and_hold / Remapping barriers across remaps and host copies.
    • Maintains strict acyclic lock hierarchy (Level 0: watch/Shadow -> Level 1: LAZY_TABLE -> Level 2: LAZY_GPU -> Level 3: FlushWait).
  • Tests & opt-in microbenchmark: 11 shadow::lazy_copyback_tests::lazy_copyback_* unit and live-GPU coherence/stress/F1-F5 regression tests (scoped with lazy_opted_in test isolation so parallel non-lazy tests never inherit deferred state) + #[ignore] bench_lazy_copyback.

Verification (VICTORY_D3D12_DEBUG=1)

  • cargo test -p victory-gpu (run 1 & run 2 parallel, plus serial --test-threads=1) -> all passed
  • cargo test -p victory-gpu --all-features -> passed
  • cargo run -p xtask -- policy --staged -> asset policy: 3 files ok (host.rs = 367,393 B, watch.rs = 81,104 B, shadow.rs = 345,266 B)

Related: #51, #56, #57, #58

<!-- greyfinch-sync:PastiiJay/klbf-lab:issue:5501843384 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/59). Originally posted by [Vladimir-Human](https://github.com/Vladimir-Human) on 2026-11-26T00:48:05Z. --- Split 4/4 of #51 cleanly on top of `beta` (`78ad5711`, independent of #56, #57, and #58). ### Summary of Changes (`host.rs`, `watch.rs`, `shadow.rs`) - **Opt-in VEH lazy GPU-to-CPU copy-back (`VICTORY_LAZY_COPYBACK=1`, default OFF)**: - Defers 64 KiB aligned copy-back pieces (`PAGE_NOACCESS`) across GPU-to-GPU workloads so steady-state frames touch zero PCIe readback bytes, flushing individual pages on demand inside `watch`'s vectored exception handler (`on_fault`) on first CPU read/write. - Supports both `MEM_MAPPED` physical views (atomic dual-view flush before restoring `PAGE_READWRITE`) and `MEM_PRIVATE | MEM_WRITE_WATCH` buffers (serialized via `FlushWait`), leaving unaligned/pinned/fence ranges eager. - Preserves DirectStorage / kernel `title_memory_written` partial-page complements, captures idempotent `FlushedBaseline` for in-flight relay/merge paths (`card_merge_relay`, `relay_merge`, `stale_under_writes`, `merge_under_writes`), and holds scoped `lazy_flush_and_hold` / `Remapping` barriers across remaps and host copies. - Maintains strict acyclic lock hierarchy (`Level 0: watch/Shadow -> Level 1: LAZY_TABLE -> Level 2: LAZY_GPU -> Level 3: FlushWait`). - **Tests & opt-in microbenchmark**: 11 `shadow::lazy_copyback_tests::lazy_copyback_*` unit and live-GPU coherence/stress/F1-F5 regression tests (scoped with `lazy_opted_in` test isolation so parallel non-lazy tests never inherit deferred state) + `#[ignore] bench_lazy_copyback`. ### Verification (`VICTORY_D3D12_DEBUG=1`) - `cargo test -p victory-gpu` (run 1 & run 2 parallel, plus serial `--test-threads=1`) -> all passed - `cargo test -p victory-gpu --all-features` -> passed - `cargo run -p xtask -- policy --staged` -> `asset policy: 3 files ok` (`host.rs` = 367,393 B, `watch.rs` = 81,104 B, `shadow.rs` = 345,266 B) Related: #51, #56, #57, #58
PastiiJay commented 2026-11-26 10:42:51 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by PastiiJay on 2026-11-26T10:42:51Z.


Thanks @Vladimir-Human for the last piece of the #51 split. We'll test the lazy copy-back on its own in game.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7189734418 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/59#issuecomment-7189734418). Originally posted by [PastiiJay](https://github.com/PastiiJay) on 2026-11-26T10:42:51Z. --- Thanks @Vladimir-Human for the last piece of the #51 split. We'll test the lazy copy-back on its own in game.
Proudnoob4 commented 2026-11-26 15:45:10 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by Proudnoob4 on 2026-11-26T15:45:10Z.


@PastiiJay @Vladimir-Human Full 10-minute live GTA 6 visual + performance + coherence audit of #59 (VICTORY_LAZY_COPYBACK=1) ported onto Proudnoob4/VIctory-NVIDIA (nvidia-hybrid-v2, commit f42d67b, RTX 4080 16 GB / i5-13600K / Windows 10 WDDM 2.7, VICTORY_CARD_BUFFERS_MIN_KB=64 + VICTORY_FETCH_CHECK=1 + VICTORY_SKIP_WC_MIN_KB=1024 + VICTORY_SECTION_MB=2).

1. Unit / Live-GPU Coherence Tests & Stability: 100% PASS

  • 14/14 lazy_copyback_* live-GPU + VEH tests passed on RTX 4080 (0.44s), plus 3/3 batch11_shadow_tests, 2/2 land_tests, and reads_in_place_and_remappings_wait_for_each_other.
  • 10-minute live GTA 6 world run (n=105 settled frames, entry=101.3s, 4,550 draws/frame):
    • Zero crashes, zero VEH hangs/deadlocks, zero ERROR/panic/device-removal lines, 0 pages not there in landing, worst frame stall 112.9 ms (0 stalls >55 ms in tail-40).
  • Porting notes for VICTORY_LAND=1 / CopiedPages trees:
    1. Shadow::watched uses GUARDED = 3 as well as 1, so try_defer_piece / lazy_resync_range / resync_pages_from_title need matches!(watched_flag, 1 | GUARDED).
    2. Shadow::land_card and Shadow::land_back (VICTORY_LAND=1 / VICTORY_LAND_BESIDE=1) need lazy_flush_and_hold around land::piece (otherwise beside alias writes bypass a PAGE_NOACCESS title VA) plus lazy_apply_flushed_baseline when resync_count > 0.
    3. lazy_prepare_update / update_free clearing copied[idx] = 0 must also invalidate self.ranged, and copy_stale must skip self.ranged updates while deferred_count > 0.

2. Visual Verification (Same Cell Scene, VICTORY_LAZY_COPYBACK=0 vs =1): 100% CLEAN

  • Automated scan over t=140..600s (n=230 frames at 0.5 fps): BLACK=0/230 (0.0%), BRIGHT=229, DARK=1 (140s transition).
  • Side-by-side manual inspection of full-res frames (t=240s, t=540s) and two 60-frame 4 fps burst contact sheets (t=420..435s, t=520..535s, 120/120 frames): visually indistinguishable from VICTORY_LAZY_COPYBACK=0 — frosted/refracted cell window glass behind Lucia's hair, yard inmates visible through chain-link fence, warm golden lighting, wall photos/bunk intact, zero flicker, zero tearing, zero missing geometry.

3. Live 10-Minute Performance Comparison (VICTORY_LAZY_COPYBACK=0 vs =1)

Metric (settled TAIL40 median) LAZY=0 (Pass 15 baseline) LAZY=1 (Pass 17) Delta
FPS 32.00 fps (31.3 ms) 21.45 fps (46.7 ms; ALL 21.80) -10.55 fps (+15.4 ms)
Landed pieces / frame 317 (4.5 MB 4K, 0.84 MB dwords) 225 (2.2 MB 4K, 0.42 MB dwords) -92 pieces (-29%)
Merging fetched pieces (CARD) 3.99 ms 0.92 ms -3.07 ms
Gather (which pieces to fetch) < 1 ms 13.73 ms +~13 ms
Prep / Copies 23.9 ms / 7.1 ms 34.1 ms / 21.6 ms (42.7 MB) +10.2 ms / +14.5 ms
victory-submit worked 32.8 ms 36.3–39.0 ms +3.5–6.2 ms
GPU busy 61% 58% (15.4 ms idle behind submit) CPU-bound

Steady-state lazy copy-back per frame telemetry (TAIL40 medians):

  • 126.5 pages armed steady-state (73.4 steady hits/frame — these truly stay GPU-resident!)
  • 22.7 newly armed/frame vs 22.7 total flushes/frame (4.3 VEH read faults + 11.2 VEH write faults + 7.2 explicit flushes = 1.42 MB/frame flushed!)
  • VICTORY_FETCH_CHECK=1: 218.2 checked, 8.09 torn, 8.03 recovered whole.

4. Exact Root Cause of the Regression & 2 Clear Fixes for v2

The mechanism is 100% coherent and visually clean, and it genuinely cuts copy-back pieces by -29% (317 -> 225) and merge time by -3.07 ms (3.99 -> 0.92 ms). All of the +15.4 ms overhead comes from two measurable hot spots:

  1. Per-frame thrashing of ~23 hot CPU-touched pages (22.7 armed/frame = 22.7 flushes/frame): The same ~23 hot pages get armed on frame N, then immediately hit a VEH read/write fault (15.5/frame) or explicit host flush (7.2/frame) on frame N+1, triggering ~23 synchronous single-page LAZY_GPU ExecuteCommandLists + WaitForSingleObject roundtrips AND resetting copied[idx]=0 / ranged (causing copies to jump 7.1 -> 21.6 ms!).
  2. which pieces to fetch (13.73 ms/frame): try_defer_piece_relay runs VirtualQuery + watch::is_guarded + inplace::pages_of + VirtualProtect + GetWriteWatch on every non-deferred piece (~225 pieces/frame) on the relay thread, every frame!

Suggested v2 improvements:

  1. Thrash-cooldown / blacklist per page: Track fault/flush strikes per page — after 1–2 faults within a short frame window, mark lazy_state[idx] = LAZY_PINNED_HOT (cooldown or permanent for that shadow) so newly_armed and synchronous GPU readback flushes drop from 22.7/frame -> ~0/frame while keeping the ~126 genuinely cold GPU-only pages armed!
  2. Cache LAZY_INELIGIBLE (O(1) fast reject): Skip VirtualQuery / pages_of / GetWriteWatch on pages already known ineligible (partial/unwatched/aliased/hot) in 1 atomic load so which pieces to fetch drops back from 13.73 ms -> < 0.5 ms.

Keeping VICTORY_LAZY_COPYBACK OFF by default on our branch (f42d67b, pushed to Proudnoob4/VIctory-NVIDIA nvidia-hybrid-v2) and happy to re-run the exact same 10-minute test as soon as a thrash-cooldown + fast-reject patch lands!

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7196701108 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/59#issuecomment-7196701108). Originally posted by [Proudnoob4](https://github.com/Proudnoob4) on 2026-11-26T15:45:10Z. --- @PastiiJay @Vladimir-Human Full 10-minute live GTA 6 visual + performance + coherence audit of **#59 (`VICTORY_LAZY_COPYBACK=1`)** ported onto `Proudnoob4/VIctory-NVIDIA` (`nvidia-hybrid-v2`, commit `f42d67b`, RTX 4080 16 GB / i5-13600K / Windows 10 WDDM 2.7, `VICTORY_CARD_BUFFERS_MIN_KB=64` + `VICTORY_FETCH_CHECK=1` + `VICTORY_SKIP_WC_MIN_KB=1024` + `VICTORY_SECTION_MB=2`). ### 1. Unit / Live-GPU Coherence Tests & Stability: **100% PASS** - **`14/14` `lazy_copyback_*` live-GPU + VEH tests passed** on RTX 4080 (`0.44s`), plus `3/3` `batch11_shadow_tests`, `2/2` `land_tests`, and `reads_in_place_and_remappings_wait_for_each_other`. - **10-minute live GTA 6 world run (`n=105` settled frames, `entry=101.3s`, `4,550` draws/frame):** - **Zero** crashes, **zero** VEH hangs/deadlocks, **zero** `ERROR`/`panic`/device-removal lines, **`0` pages not there** in landing, worst frame stall `112.9 ms` (`0` stalls `>55 ms` in tail-40). - **Porting notes for `VICTORY_LAND=1` / `CopiedPages` trees:** 1. `Shadow::watched` uses `GUARDED = 3` as well as `1`, so `try_defer_piece` / `lazy_resync_range` / `resync_pages_from_title` need `matches!(watched_flag, 1 | GUARDED)`. 2. `Shadow::land_card` and `Shadow::land_back` (`VICTORY_LAND=1` / `VICTORY_LAND_BESIDE=1`) need `lazy_flush_and_hold` around `land::piece` (otherwise `beside` alias writes bypass a `PAGE_NOACCESS` title VA) plus `lazy_apply_flushed_baseline` when `resync_count > 0`. 3. `lazy_prepare_update` / `update_free` clearing `copied[idx] = 0` must also invalidate `self.ranged`, and `copy_stale` must skip `self.ranged` updates while `deferred_count > 0`. ### 2. Visual Verification (Same Cell Scene, `VICTORY_LAZY_COPYBACK=0` vs `=1`): **100% CLEAN** - Automated scan over `t=140..600s` (`n=230` frames at 0.5 fps): **`BLACK=0/230` (`0.0%`)**, `BRIGHT=229`, `DARK=1` (140s transition). - Side-by-side manual inspection of full-res frames (`t=240s`, `t=540s`) and two 60-frame 4 fps burst contact sheets (`t=420..435s`, `t=520..535s`, `120/120` frames): **visually indistinguishable from `VICTORY_LAZY_COPYBACK=0`** — frosted/refracted cell window glass behind Lucia's hair, yard inmates visible through chain-link fence, warm golden lighting, wall photos/bunk intact, zero flicker, zero tearing, zero missing geometry. ### 3. Live 10-Minute Performance Comparison (`VICTORY_LAZY_COPYBACK=0` vs `=1`) | Metric (settled TAIL40 median) | `LAZY=0` (Pass 15 baseline) | `LAZY=1` (Pass 17) | Delta | |---|---:|---:|---:| | **FPS** | **`32.00 fps`** (`31.3 ms`) | **`21.45 fps`** (`46.7 ms`; ALL `21.80`) | **-10.55 fps (+15.4 ms)** | | **Landed pieces / frame** | `317` (`4.5 MB` 4K, `0.84 MB` dwords) | **`225`** (`2.2 MB` 4K, `0.42 MB` dwords) | **-92 pieces (-29%)** | | **Merging fetched pieces (`CARD`)** | `3.99 ms` | **`0.92 ms`** | **-3.07 ms** | | **Gather (`which pieces to fetch`)** | `< 1 ms` | **`13.73 ms`** | **+~13 ms** | | **Prep / Copies** | `23.9 ms` / `7.1 ms` | `34.1 ms` / `21.6 ms` (`42.7 MB`) | **+10.2 ms / +14.5 ms** | | **`victory-submit` worked** | `32.8 ms` | `36.3–39.0 ms` | **+3.5–6.2 ms** | | **GPU busy** | `61%` | `58%` (`15.4 ms` idle behind submit) | CPU-bound | **Steady-state `lazy copy-back per frame` telemetry (`TAIL40` medians):** - **`126.5` pages armed steady-state** (`73.4` steady hits/frame — these truly stay GPU-resident!) - **`22.7` newly armed/frame** vs **`22.7` total flushes/frame** (`4.3` VEH read faults + `11.2` VEH write faults + `7.2` explicit flushes = `1.42 MB/frame` flushed!) - `VICTORY_FETCH_CHECK=1`: `218.2` checked, `8.09` torn, `8.03` recovered whole. ### 4. Exact Root Cause of the Regression & 2 Clear Fixes for v2 The mechanism is **100% coherent and visually clean**, and it genuinely cuts copy-back pieces by `-29%` (`317 -> 225`) and merge time by `-3.07 ms` (`3.99 -> 0.92 ms`). All of the `+15.4 ms` overhead comes from two measurable hot spots: 1. **Per-frame thrashing of ~23 hot CPU-touched pages (`22.7 armed/frame` = `22.7 flushes/frame`):** The same ~23 hot pages get armed on frame `N`, then immediately hit a VEH read/write fault (`15.5/frame`) or explicit host flush (`7.2/frame`) on frame `N+1`, triggering ~23 synchronous single-page `LAZY_GPU` `ExecuteCommandLists` + `WaitForSingleObject` roundtrips AND resetting `copied[idx]=0` / `ranged` (causing `copies` to jump `7.1 -> 21.6 ms`!). 2. **`which pieces to fetch` (`13.73 ms/frame`):** `try_defer_piece_relay` runs `VirtualQuery` + `watch::is_guarded` + `inplace::pages_of` + `VirtualProtect` + `GetWriteWatch` on every non-deferred piece (~225 pieces/frame) on the relay thread, every frame! **Suggested v2 improvements:** 1. **Thrash-cooldown / blacklist per page:** Track fault/flush strikes per page — after 1–2 faults within a short frame window, mark `lazy_state[idx] = LAZY_PINNED_HOT` (cooldown or permanent for that shadow) so `newly_armed` and synchronous GPU readback flushes drop from `22.7/frame -> ~0/frame` while keeping the `~126` genuinely cold GPU-only pages armed! 2. **Cache `LAZY_INELIGIBLE` (O(1) fast reject):** Skip `VirtualQuery` / `pages_of` / `GetWriteWatch` on pages already known ineligible (partial/unwatched/aliased/hot) in 1 atomic load so `which pieces to fetch` drops back from `13.73 ms -> < 0.5 ms`. Keeping `VICTORY_LAZY_COPYBACK` OFF by default on our branch (`f42d67b`, pushed to `Proudnoob4/VIctory-NVIDIA` `nvidia-hybrid-v2`) and happy to re-run the exact same 10-minute test as soon as a thrash-cooldown + fast-reject patch lands!
PastiiJay commented 2026-11-26 15:47:12 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by PastiiJay on 2026-11-26T15:47:12Z.


Thanks @Proudnoob4, a 10-minute coherence check with zero faults plus a clean visual A/B is exactly the evidence this PR needed, and pinning the slowdown on the ~23 hot pages re-armed every frame and the gather cost gives a clear target. @Vladimir-Human, the two fixes in section 4 look like the v2 plan; once they are in, the same A/B on the same scene would tell us whether lazy copy-back can pay off.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7196748462 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/59#issuecomment-7196748462). Originally posted by [PastiiJay](https://github.com/PastiiJay) on 2026-11-26T15:47:12Z. --- Thanks @Proudnoob4, a 10-minute coherence check with zero faults plus a clean visual A/B is exactly the evidence this PR needed, and pinning the slowdown on the ~23 hot pages re-armed every frame and the gather cost gives a clear target. @Vladimir-Human, the two fixes in section 4 look like the v2 plan; once they are in, the same A/B on the same scene would tell us whether lazy copy-back can pay off.
Proudnoob4 commented 2026-11-26 16:50:24 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by Proudnoob4 on 2026-11-26T16:50:24Z.


@PastiiJay @Vladimir-Human Quick cross-machine follow-up on #59 (VICTORY_LAZY_COPYBACK=1): @d0dev just tested our audited port (f42d67b, Proudnoob4/VIctory-NVIDIA) on RTX 4070 Ti SUPER 16 GB / Ryzen 7 5800X3D / 32 GB / Windows 11 26200 (first boat mission, reported in fxceless/victory-fork#1268) and hit a real VEH escape crash ~2.5 min after launch right after entering the world:

  • Crash: 0xc0000005 at victory-image-…dll+0xc4b94e (write 0xfaff804: no access), then the same at 0xfaffc04
  • Last stats line right before crash: 27.5 newly armed, 61.8 steady hits, 1.3 VEH read faults, 16.0 VEH write faults, 9.8 explicit flushes (1.70 MB), 160 pages armed now

Worth flagging for v2 alongside the hot-page churn / gather cost — on Win 11 / 5800X3D a title write to an armed page escaped the VEH handler (possible race between re-arming/unarming or PAGE_NOACCESS window across concurrent title threads). Passing along the exact numbers so it's on your radar before merge!

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7198161763 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/59#issuecomment-7198161763). Originally posted by [Proudnoob4](https://github.com/Proudnoob4) on 2026-11-26T16:50:24Z. --- @PastiiJay @Vladimir-Human Quick cross-machine follow-up on `#59` (`VICTORY_LAZY_COPYBACK=1`): `@d0dev` just tested our audited port (`f42d67b`, `Proudnoob4/VIctory-NVIDIA`) on **RTX 4070 Ti SUPER 16 GB / Ryzen 7 5800X3D / 32 GB / Windows 11 26200** (first boat mission, reported in `fxceless/victory-fork#1268`) and hit a real VEH escape crash ~2.5 min after launch right after entering the world: - Crash: `0xc0000005 at victory-image-…dll+0xc4b94e (write 0xfaff804: no access)`, then the same at `0xfaffc04` - Last stats line right before crash: `27.5 newly armed, 61.8 steady hits, 1.3 VEH read faults, 16.0 VEH write faults, 9.8 explicit flushes (1.70 MB), 160 pages armed now` Worth flagging for v2 alongside the hot-page churn / gather cost — on Win 11 / 5800X3D a title write to an armed page escaped the VEH handler (possible race between re-arming/unarming or `PAGE_NOACCESS` window across concurrent title threads). Passing along the exact numbers so it's on your radar before merge!
PastiiJay commented 2026-11-26 16:58:28 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by PastiiJay on 2026-11-26T16:58:28Z.


Thanks @Proudnoob4, a write escaping the handler on a second machine is exactly the kind of thing v2 needs to know before anyone enables it. @Vladimir-Human, the crash address and the stats line above are worth a regression test on the re-arm path.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7198329282 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/59#issuecomment-7198329282). Originally posted by [PastiiJay](https://github.com/PastiiJay) on 2026-11-26T16:58:28Z. --- Thanks @Proudnoob4, a write escaping the handler on a second machine is exactly the kind of thing v2 needs to know before anyone enables it. @Vladimir-Human, the crash address and the stats line above are worth a regression test on the re-arm path.
Vladimir-Human commented 2026-11-26 18:50:06 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by Vladimir-Human on 2026-11-26T18:50:06Z.


@PastiiJay @Proudnoob4 Thanks for the exact crash details from @d0dev (0xc0000005 on writes at 0xfaff804 / 0xfaffc04 under concurrent re-arm / guard transitions). Pushed c0ccb1b to perf/split-lazy-copyback-veh addressing the VEH escape and adding the requested regression coverage:

  1. VEH escape on concurrent re-arm / guard transition & arming rollback (watch.rs, shadow.rs):
    • Added monotonic LAZY_TABLE_EPOCH tracking around LAZY_TABLE state changes and bounded epoch retry in watch::on_fault (MAX_EPOCH_RETRIES = 32 gated on committed_protect(at).is_some(), zero spinning on unrelated faults).
    • Updated lazy_on_fault's Err(Some(epoch_before)) branch to handle PageAccess::Accessible whenever LAZY_FLUSH_TOTAL > 0 || LAZY_TABLE_EPOCH > 0 (covering READ faults during arming rollbacks before any flush has completed) and retry PageAccess::NoAccess when LAZY_TABLE_EPOCH advances.
  2. Split-4 KiB VAD sub-region unprotect (shadow.rs):
    • Added unprotect_split_subregions / copy_subregion_bytes so partial 4 KiB VAD splits inside an armed 64 KiB block unprotect every committed PAGE_NOACCESS sub-region and populate trailing offsets (+0xf804, +0xfc04) without touching adjacent non-NOACCESS sub-regions.
  3. v2 hot-page thrash cooldown & O(1) ineligible fast-reject (shadow.rs):
    • Added strike escalation (>= 2 flushes within 60 frames -> 300-frame cooldown -> 1800 -> permanent LAZY_INELIGIBLE sentinel u32::MAX, with timed cooldowns clamped to u32::MAX - 1), immediate LAZY_INELIGIBLE caching for non-MEM_WRITE_WATCH private allocations / pinned / unsupported VAD types (while keeping virgin Frame-1 MEM_WRITE_WATCH demand-zero pages LAZY_EAGER for Frame 2), monotonic fetch_max on Aliased LAZY_HOT, and LAZY_RESYNC Acquire ordering before lazy_post_resync_state.
  4. Regression tests & local verification (VICTORY_D3D12_DEBUG=1 on WARP / unit & GPU-compute harness):
    • Added lazy_copyback_veh_rearm_and_guard_transition_race_never_escapes, lazy_copyback_split_subpage_unprotect_restores_all_4k_subpages (2A MEM_PRIVATE VEH, 2B MEM_MAPPED lazy_flush_range, 2C lazy_release_range & lazy_release_written_range), and lazy_copyback_v2_hot_page_cooldown_and_ineligible_fast_reject.
    • cargo clippy -p victory-gpu --all-targets: 0 warnings in shadow.rs / watch.rs.
    • cargo test -p victory-gpu -- --test-threads=1: 171 passed; 0 failed; 4 ignored.

Ready for Pass 18 cross-machine verification.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7200903850 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/59#issuecomment-7200903850). Originally posted by [Vladimir-Human](https://github.com/Vladimir-Human) on 2026-11-26T18:50:06Z. --- @PastiiJay @Proudnoob4 Thanks for the exact crash details from `@d0dev` (`0xc0000005` on writes at `0xfaff804` / `0xfaffc04` under concurrent re-arm / guard transitions). Pushed `c0ccb1b` to `perf/split-lazy-copyback-veh` addressing the VEH escape and adding the requested regression coverage: 1. **VEH escape on concurrent re-arm / guard transition & arming rollback (`watch.rs`, `shadow.rs`)**: - Added monotonic `LAZY_TABLE_EPOCH` tracking around `LAZY_TABLE` state changes and bounded epoch retry in `watch::on_fault` (`MAX_EPOCH_RETRIES = 32` gated on `committed_protect(at).is_some()`, zero spinning on unrelated faults). - Updated `lazy_on_fault`'s `Err(Some(epoch_before))` branch to handle `PageAccess::Accessible` whenever `LAZY_FLUSH_TOTAL > 0 || LAZY_TABLE_EPOCH > 0` (covering READ faults during arming rollbacks before any flush has completed) and retry `PageAccess::NoAccess` when `LAZY_TABLE_EPOCH` advances. 2. **Split-4 KiB VAD sub-region unprotect (`shadow.rs`)**: - Added `unprotect_split_subregions` / `copy_subregion_bytes` so partial 4 KiB VAD splits inside an armed 64 KiB block unprotect every committed `PAGE_NOACCESS` sub-region and populate trailing offsets (`+0xf804`, `+0xfc04`) without touching adjacent non-`NOACCESS` sub-regions. 3. **v2 hot-page thrash cooldown & O(1) ineligible fast-reject (`shadow.rs`)**: - Added strike escalation (`>= 2` flushes within 60 frames -> `300`-frame cooldown -> `1800` -> permanent `LAZY_INELIGIBLE` sentinel `u32::MAX`, with timed cooldowns clamped to `u32::MAX - 1`), immediate `LAZY_INELIGIBLE` caching for non-`MEM_WRITE_WATCH` private allocations / `pinned` / unsupported VAD types (while keeping virgin Frame-1 `MEM_WRITE_WATCH` demand-zero pages `LAZY_EAGER` for Frame 2), monotonic `fetch_max` on `Aliased` `LAZY_HOT`, and `LAZY_RESYNC` `Acquire` ordering before `lazy_post_resync_state`. 4. **Regression tests & local verification** (`VICTORY_D3D12_DEBUG=1` on WARP / unit & GPU-compute harness): - Added `lazy_copyback_veh_rearm_and_guard_transition_race_never_escapes`, `lazy_copyback_split_subpage_unprotect_restores_all_4k_subpages` (2A `MEM_PRIVATE` VEH, 2B `MEM_MAPPED` `lazy_flush_range`, 2C `lazy_release_range` & `lazy_release_written_range`), and `lazy_copyback_v2_hot_page_cooldown_and_ineligible_fast_reject`. - `cargo clippy -p victory-gpu --all-targets`: 0 warnings in `shadow.rs` / `watch.rs`. - `cargo test -p victory-gpu -- --test-threads=1`: **171 passed; 0 failed; 4 ignored**. Ready for Pass 18 cross-machine verification.
PastiiJay commented 2026-11-26 18:57:02 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by PastiiJay on 2026-11-26T18:57:02Z.


Thanks @Vladimir-Human, that was quick, and the split sub-region case at +0xf804 / +0xfc04 matches the crash addresses exactly. @Proudnoob4, could @d0dev rerun the same first boat mission on c0ccb1b with VICTORY_LAZY_COPYBACK=1 and post the last stats line plus how long it held? That run decides whether v2 is ready for us to try.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7201028251 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/59#issuecomment-7201028251). Originally posted by [PastiiJay](https://github.com/PastiiJay) on 2026-11-26T18:57:02Z. --- Thanks @Vladimir-Human, that was quick, and the split sub-region case at `+0xf804` / `+0xfc04` matches the crash addresses exactly. @Proudnoob4, could `@d0dev` rerun the same first boat mission on `c0ccb1b` with `VICTORY_LAZY_COPYBACK=1` and post the last stats line plus how long it held? That run decides whether v2 is ready for us to try.
Proudnoob4 commented 2026-11-26 20:24:58 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by Proudnoob4 on 2026-11-26T20:24:58Z.


@PastiiJay passed on to @d0dev in fxceless/victory-fork#1268 (their crash came from that run): rerun of the first boat mission on c0ccb1b with VICTORY_LAZY_COPYBACK=1, last stats line to be posted here. We can't reproduce it ourselves yet: our runs haven't reached the boat.

AI-assisted (Claude Code).

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7202651621 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/59#issuecomment-7202651621). Originally posted by [Proudnoob4](https://github.com/Proudnoob4) on 2026-11-26T20:24:58Z. --- @PastiiJay passed on to @d0dev in fxceless/victory-fork#1268 (their crash came from that run): rerun of the first boat mission on `c0ccb1b` with `VICTORY_LAZY_COPYBACK=1`, last stats line to be posted here. We can't reproduce it ourselves yet: our runs haven't reached the boat. AI-assisted (Claude Code).
PastiiJay commented 2026-11-26 20:27:13 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by PastiiJay on 2026-11-26T20:27:13Z.


Thanks @Proudnoob4 for passing it on. We'll wait for @d0dev's line here before touching v2.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7202701024 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/59#issuecomment-7202701024). Originally posted by [PastiiJay](https://github.com/PastiiJay) on 2026-11-26T20:27:13Z. --- Thanks @Proudnoob4 for passing it on. We'll wait for `@d0dev`'s line here before touching v2.
d0dev commented 2026-11-27 09:43:40 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by d0dev on 2026-11-27T09:43:40Z.


@PastiiJay @Vladimir-Human Rerun on c0ccb1b with VICTORY_LAZY_COPYBACK=1, same first boat mission and save as the crash. No crash: it held 12 minutes in the world, 5 of them on the boat (yesterday's run crashed ~2.5 min in), 0 0xc0000005 in the log.

Setup: RTX 4070 Ti SUPER 16 GB (driver 616.92), Ryzen 7 5800X3D, 32 GB, Windows 11 26200, ReBAR on. Your tree as is (not Proudnoob4's port), release build, pipelines pre-built with translate --cache --pipelines, --console series-s with FidelityFX SDK 2.4.0. Switches from the README minus the AMD-only ones: LATE_WAIT=1 WIDE_BACK=1 PIPELINE_WAIT_MS=24 RELAY_COPY_QUEUE=0 LAZY_COPYBACK=1.

Last stats line on the boat:

6.1 fps, 163.5 ms/frame (74.7 preparing: copies 41.9 ms 69.0 MB, textures 5.0 ms 12.6 MB; 72.7 on the GPU; 29.5 copying back 9.2 MB), 3980 draws/frame, dropped 193 without a host pipeline (0 being made) and 3 indirect

(This tree has no lazy-copy-back counters like the port's "newly armed / VEH faults" line, so that's the frame line.)

Picture: water looked right while turning the camera and accelerating; faces were broken, which on NVIDIA we also see without lazy copy-back, so probably not from this PR.

One run only, no A/B without the switch.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7215023263 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/59#issuecomment-7215023263). Originally posted by [d0dev](https://github.com/d0dev) on 2026-11-27T09:43:40Z. --- @PastiiJay @Vladimir-Human Rerun on `c0ccb1b` with `VICTORY_LAZY_COPYBACK=1`, same first boat mission and save as the crash. **No crash: it held 12 minutes in the world, 5 of them on the boat (yesterday's run crashed ~2.5 min in), 0 `0xc0000005` in the log.** Setup: RTX 4070 Ti SUPER 16 GB (driver 616.92), Ryzen 7 5800X3D, 32 GB, Windows 11 26200, ReBAR on. Your tree as is (not Proudnoob4's port), release build, pipelines pre-built with `translate --cache --pipelines`, `--console series-s` with FidelityFX SDK 2.4.0. Switches from the README minus the AMD-only ones: `LATE_WAIT=1 WIDE_BACK=1 PIPELINE_WAIT_MS=24 RELAY_COPY_QUEUE=0 LAZY_COPYBACK=1`. Last stats line on the boat: ``` 6.1 fps, 163.5 ms/frame (74.7 preparing: copies 41.9 ms 69.0 MB, textures 5.0 ms 12.6 MB; 72.7 on the GPU; 29.5 copying back 9.2 MB), 3980 draws/frame, dropped 193 without a host pipeline (0 being made) and 3 indirect ``` (This tree has no lazy-copy-back counters like the port's "newly armed / VEH faults" line, so that's the frame line.) Picture: water looked right while turning the camera and accelerating; faces were broken, which on NVIDIA we also see without lazy copy-back, so probably not from this PR. One run only, no A/B without the switch.
PastiiJay commented 2026-11-27 10:50:25 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by PastiiJay on 2026-11-27T10:50:25Z.


Thanks @d0dev, this is the most useful report on the lazy copy-back so far: 12 minutes, 0 0xc0000005, with the exact switches and driver. Could you run the same setup on the current beta-amd build (v12, commit 84a4f67) and post the result, so we can compare against the crash you had yesterday?

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7216367200 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/59#issuecomment-7216367200). Originally posted by [PastiiJay](https://github.com/PastiiJay) on 2026-11-27T10:50:25Z. --- Thanks @d0dev, this is the most useful report on the lazy copy-back so far: 12 minutes, 0 `0xc0000005`, with the exact switches and driver. Could you run the same setup on the current `beta-amd` build (v12, commit 84a4f67) and post the result, so we can compare against the crash you had yesterday?
PastiiJay commented 2026-11-27 10:52:06 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by PastiiJay on 2026-11-27T10:52:06Z.


Could you run a new test on the current beta-amd build (v12, commit 84a4f67), same scene, with -More @{ VICTORY_LAZY_COPYBACK = '1' }, and post the last stats line? That will let us compare directly with yesterday's run.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7216401741 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/59#issuecomment-7216401741). Originally posted by [PastiiJay](https://github.com/PastiiJay) on 2026-11-27T10:52:06Z. --- Could you run a new test on the current `beta-amd` build (v12, commit 84a4f67), same scene, with `-More @{ VICTORY_LAZY_COPYBACK = '1' }`, and post the last stats line? That will let us compare directly with yesterday's run.
Vladimir-Human commented 2026-11-27 11:36:46 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by Vladimir-Human on 2026-11-27T11:36:46Z.


Thanks @d0dev for re-testing c0ccb1b — great to see 12 minutes crash-free with zero 0xc0000005!

Also pushed 7311cab to add the missing periodic lazy copy-back telemetry line you noted (for both release and diagnostics builds, zero overhead / no output when VICTORY_LAZY_COPYBACK is off):

  • crates/victory-gpu/src/shadow.rs: added LAZY_STATS[6] (self_bypassed, counting LAZY_HOT / LAZY_INELIGIBLE fast-rejects in try_defer_piece) and lock-free monotonic interval deltas via shadow::lazy_stats().
  • crates/victory-gpu/src/host.rs: logs lazy copy-back per frame: ... newly armed, ... steady hits, ... VEH read faults, ... VEH write faults, ... explicit flushes, ... MB read back, ... self-bypassed; ... pages armed now alongside the 5s frame/card stats lines whenever VICTORY_LAZY_COPYBACK=1.

Verified under VICTORY_D3D12_DEBUG=1: shadow:: 45/45 passed (default & --features diagnostics, HW), shadow::lazy_copyback 17/17 passed (WARP), 0 clippy warnings in touched files, and clean merge against beta (6cce57e). @PastiiJay ready whenever you want to take a look.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7217275631 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/59#issuecomment-7217275631). Originally posted by [Vladimir-Human](https://github.com/Vladimir-Human) on 2026-11-27T11:36:46Z. --- Thanks @d0dev for re-testing `c0ccb1b` — great to see 12 minutes crash-free with zero `0xc0000005`! Also pushed `7311cab` to add the missing periodic lazy copy-back telemetry line you noted (for both release and diagnostics builds, zero overhead / no output when `VICTORY_LAZY_COPYBACK` is off): - **`crates/victory-gpu/src/shadow.rs`:** added `LAZY_STATS[6]` (`self_bypassed`, counting `LAZY_HOT` / `LAZY_INELIGIBLE` fast-rejects in `try_defer_piece`) and lock-free monotonic interval deltas via `shadow::lazy_stats()`. - **`crates/victory-gpu/src/host.rs`:** logs `lazy copy-back per frame: ... newly armed, ... steady hits, ... VEH read faults, ... VEH write faults, ... explicit flushes, ... MB read back, ... self-bypassed; ... pages armed now` alongside the 5s frame/card stats lines whenever `VICTORY_LAZY_COPYBACK=1`. Verified under `VICTORY_D3D12_DEBUG=1`: `shadow::` `45/45` passed (default & `--features diagnostics`, HW), `shadow::lazy_copyback` `17/17` passed (WARP), 0 clippy warnings in touched files, and clean merge against `beta` (`6cce57e`). @PastiiJay ready whenever you want to take a look.
PastiiJay commented 2026-11-27 11:37:37 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by PastiiJay on 2026-11-27T11:37:37Z.


Thanks @Vladimir-Human, noted. We'll look at the telemetry together with the lazy copy-back itself.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7217291755 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/59#issuecomment-7217291755). Originally posted by [PastiiJay](https://github.com/PastiiJay) on 2026-11-27T11:37:37Z. --- Thanks @Vladimir-Human, noted. We'll look at the telemetry together with the lazy copy-back itself.
d0dev commented 2026-11-27 12:49:59 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by d0dev on 2026-11-27T12:49:59Z.


@PastiiJay Ran beta-amd v12 (84a4f67) as asked, same PC, save and boat scene, play.ps1 -Fsr (Series S, FidelityFX SDK 2.4.0), diag build, -More @{ VICTORY_LAZY_COPYBACK = '1' }.

One thing first: 84a4f67 doesn't contain #59. VICTORY_LAZY_COPYBACK isn't in its source (nor in beta-amd or beta heads; c0ccb1b isn't an ancestor of either), so the switch did nothing in this run and there was no lazy copy-back line in the log. So this is a v12 baseline, not a lazy copy-back result. If you meant v12 with #59 on top, tell me which commit and I'll run it.

v12 baseline on the boat (no crash, 0 0xc0000005):

16.9 fps, 59.2 ms/frame (27.3 preparing: copies 11.4 ms 57.2 MB, textures 1.0 ms 37.1 MB; 0.0 on the GPU; 5.7 copying back 2.0 MB), 4768 draws/frame, dropped 145 without a host pipeline (0 being made) and 0 indirect

For comparison, c0ccb1b this morning in the same scene was ~6 fps (163.5 ms/frame, 72.7 ms on the GPU, 29.5 ms copying back), so v12 is a big step up here.

Picture on the boat: black rectangles on the water, purple patches on the mangrove roots at the waterline, and the NPC next to Jason has no face.

v12 on the boat

Notes for others on NVIDIA: v12 needs D3D12\D3D12Core.dll 1.620 beside victory.exe (else 0x887E0003 at device creation), and the first run with an empty cache shows only subtitles/HUD for ~4 minutes while ~1,300 pipelines are made.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7218727548 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/59#issuecomment-7218727548). Originally posted by [d0dev](https://github.com/d0dev) on 2026-11-27T12:49:59Z. --- @PastiiJay Ran `beta-amd` v12 (`84a4f67`) as asked, same PC, save and boat scene, `play.ps1 -Fsr` (Series S, FidelityFX SDK 2.4.0), diag build, `-More @{ VICTORY_LAZY_COPYBACK = '1' }`. One thing first: **`84a4f67` doesn't contain #59.** `VICTORY_LAZY_COPYBACK` isn't in its source (nor in `beta-amd` or `beta` heads; `c0ccb1b` isn't an ancestor of either), so the switch did nothing in this run and there was no lazy copy-back line in the log. So this is a v12 baseline, not a lazy copy-back result. If you meant v12 with #59 on top, tell me which commit and I'll run it. v12 baseline on the boat (no crash, 0 `0xc0000005`): ``` 16.9 fps, 59.2 ms/frame (27.3 preparing: copies 11.4 ms 57.2 MB, textures 1.0 ms 37.1 MB; 0.0 on the GPU; 5.7 copying back 2.0 MB), 4768 draws/frame, dropped 145 without a host pipeline (0 being made) and 0 indirect ``` For comparison, `c0ccb1b` this morning in the same scene was ~6 fps (163.5 ms/frame, 72.7 ms on the GPU, 29.5 ms copying back), so v12 is a big step up here. Picture on the boat: black rectangles on the water, purple patches on the mangrove roots at the waterline, and the NPC next to Jason has no face. <img width="1729" height="832" alt="v12 on the boat" src="https://github.com/user-attachments/assets/f06d0bed-1d31-4655-b7a9-aa9558c054b3" /> Notes for others on NVIDIA: v12 needs `D3D12\D3D12Core.dll` 1.620 beside `victory.exe` (else `0x887E0003` at device creation), and the first run with an empty cache shows only subtitles/HUD for ~4 minutes while ~1,300 pipelines are made.
PastiiJay commented 2026-11-27 12:58:37 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by PastiiJay on 2026-11-27T12:58:37Z.


You're right, thanks for spotting it: #59 isn't on the AMD line yet, so the switch did nothing. Your run is a clean v12 baseline (16.9 fps, 59.2 ms), which is useful in itself. We'll ping you here with the exact commit once the lazy copy-back is ported onto beta-amd.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7218906590 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/59#issuecomment-7218906590). Originally posted by [PastiiJay](https://github.com/PastiiJay) on 2026-11-27T12:58:37Z. --- You're right, thanks for spotting it: #59 isn't on the AMD line yet, so the switch did nothing. Your run is a clean v12 baseline (16.9 fps, 59.2 ms), which is useful in itself. We'll ping you here with the exact commit once the lazy copy-back is ported onto beta-amd.
Vladimir-Human commented 2026-11-28 18:39:50 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by Vladimir-Human on 2026-11-28T18:39:50Z.


Superseded by https://github.com/PastiiJay/klbf-lab/pull/190 cleanly ported onto origin/stable-amd (75022ba).

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7243962029 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/59#issuecomment-7243962029). Originally posted by [Vladimir-Human](https://github.com/Vladimir-Human) on 2026-11-28T18:39:50Z. --- Superseded by https://github.com/PastiiJay/klbf-lab/pull/190 cleanly ported onto `origin/stable-amd` (`75022ba`).
PastiiJay commented 2026-11-29 18:54:11 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by PastiiJay on 2026-11-29T18:54:11Z.


Reposted from @d0dev (13:49) with the game names taken out. no worries, we just keep content and names from any game out of this repo, thanks for understanding!

@PastiiJay Ran beta-amd v12 (84a4f67) as asked, same PC, save and boat scene, play.ps1 -Fsr (Series S, FidelityFX SDK 2.4.0), diag build, -More @{ VICTORY_LAZY_COPYBACK = '1' }.

One thing first: 84a4f67 doesn't contain #59. VICTORY_LAZY_COPYBACK isn't in its source (nor in beta-amd or beta heads; c0ccb1b isn't an ancestor of either), so the switch did nothing in this run and there was no lazy copy-back line in the log. So this is a v12 baseline, not a lazy copy-back result. If you meant v12 with #59 on top, tell me which commit and I'll run it.

v12 baseline on the boat (no crash, 0 0xc0000005):

16.9 fps, 59.2 ms/frame (27.3 preparing: copies 11.4 ms 57.2 MB, textures 1.0 ms 37.1 MB; 0.0 on the GPU; 5.7 copying back 2.0 MB), 4768 draws/frame, dropped 145 without a host pipeline (0 being made) and 0 indirect

For comparison, c0ccb1b this morning in the same scene was ~6 fps (163.5 ms/frame, 72.7 ms on the GPU, 29.5 ms copying back), so v12 is a big step up here.

Picture on the boat: black rectangles on the water, purple patches on the mangrove roots at the waterline, and the NPC next to the second character has no face.

v12 on the boat

Notes for others on NVIDIA: v12 needs D3D12\D3D12Core.dll 1.620 beside victory.exe (else 0x887E0003 at device creation), and the first run with an empty cache shows only subtitles/HUD for ~4 minutes while ~1,300 pipelines are made.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7260849982 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/59#issuecomment-7260849982). Originally posted by [PastiiJay](https://github.com/PastiiJay) on 2026-11-29T18:54:11Z. --- Reposted from @d0dev (13:49) with the game names taken out. no worries, we just keep content and names from any game out of this repo, thanks for understanding! @PastiiJay Ran `beta-amd` v12 (`84a4f67`) as asked, same PC, save and boat scene, `play.ps1 -Fsr` (Series S, FidelityFX SDK 2.4.0), diag build, `-More @{ VICTORY_LAZY_COPYBACK = '1' }`. One thing first: **`84a4f67` doesn't contain #59.** `VICTORY_LAZY_COPYBACK` isn't in its source (nor in `beta-amd` or `beta` heads; `c0ccb1b` isn't an ancestor of either), so the switch did nothing in this run and there was no lazy copy-back line in the log. So this is a v12 baseline, not a lazy copy-back result. If you meant v12 with #59 on top, tell me which commit and I'll run it. v12 baseline on the boat (no crash, 0 `0xc0000005`): ``` 16.9 fps, 59.2 ms/frame (27.3 preparing: copies 11.4 ms 57.2 MB, textures 1.0 ms 37.1 MB; 0.0 on the GPU; 5.7 copying back 2.0 MB), 4768 draws/frame, dropped 145 without a host pipeline (0 being made) and 0 indirect ``` For comparison, `c0ccb1b` this morning in the same scene was ~6 fps (163.5 ms/frame, 72.7 ms on the GPU, 29.5 ms copying back), so v12 is a big step up here. Picture on the boat: black rectangles on the water, purple patches on the mangrove roots at the waterline, and the NPC next to the second character has no face. <img width="1729" height="832" alt="v12 on the boat" src="https://github.com/user-attachments/assets/f06d0bed-1d31-4655-b7a9-aa9558c054b3" /> Notes for others on NVIDIA: v12 needs `D3D12\D3D12Core.dll` 1.620 beside `victory.exe` (else `0x887E0003` at device creation), and the first run with an empty cache shows only subtitles/HUD for ~4 minutes while ~1,300 pipelines are made.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
PastiiJay/klbf-lab!59
No description provided.