Skip to content

Card copies: a census, and an opt-in switch that leaves write-combining memory on the card (−11…−20 % frame, 3 GPUs) - #868

Open
Chipsraine wants to merge 4 commits into
fxceless:mainfrom
Chipsraine:pr/wc-copyback-census
Open

Chipsraine wants to merge 4 commits into
fxceless:mainfrom
Chipsraine:pr/wc-copyback-census

Conversation

@Chipsraine

@Chipsraine Chipsraine commented Nov 25, 2026 •

Copy link
Copy Markdown

Summary

Two opt-in additions about the card copies of title buffers (crate::shadow::cards). Nothing changes without the switches. Rebased on 0b0074e.

  • VICTORY_CENSUS=1 (logging only): every 10 s (VICTORY_CENSUS_SECONDS) a census of those copies: the XMemVirtualAlloc reservation each lies in with the flags the title asked for (the runtime drops write-combining, uncached and the GPU access bits; the census keeps them), how much of it is physical-page views and how much shows a page at more than one address, and per frame the bytes sent up, pieces compared and bytes fetched back; plus host resources made per frame by kind.
  • VICTORY_SKIP_WC_BACK=1 (experiment): what shaders wrote to copies of write-combining title memory is not fetched back into title memory. Declared ranges that cross a reservation boundary or touch ordinary memory still take the normal path (fix by @iGoldenNinja, f9c43fa).
  • VICTORY_SKIP_WC_COMPARE=1 (implies it; marked UNSAFE): those copies are not hashed or compared on the card either. One device removal was reported with it (see below); kept only for measurement.

Why

The census found ~100 copies (~1 GB) on the card, and per frame ~100 MB fetched back of which 97–99 % comes from memory the title reserved write-combining, i.e. memory the console's CPU writes but does not read back. About half of the uploads were an echo: a fetched piece makes title memory differ from the CPU side, and the next submission sends it up again.

Results for VICTORY_SKIP_WC_BACK=1 (independent testers)

All on 0b0074e-era trees with the author's speed set (ASYNC_SUBMIT QUEUE2 INDIRECT_WINDOW TEXTURE_NO_WAIT COPY_PLAIN), warm caches, Series X profile.

Who GPU / CPU Method Frame Copy-back Device loss
@xunbreakablex RTX 4070 / Ryzen 5 5600 A-B-A-B, 480 s each 184 → 148 ms (−20 %); per 1,000 draws 38.6 → 31.7 ms 76–100 → ~20 ms none
@Chipsraine RTX 5080 / Ryzen 5 5600 two long runs to chapter 1, draw-matched −11 to −13 % (e.g. 194 → 172 ms at 5,500–7,000 draws) 65–68 → 22 ms none (22.6 min)
@Chipsraine RTX 5080 / Ryzen 5 5600 short pair, same room 192 → 149 ms (−22 %) 71 → 21 ms none
@iGoldenNinja RTX 5080 / Ryzen 9 5900X pair, 90 s each 2.84 → 3.82 fps 200 → 99 ms none
@ExoCalibra (#770) RTX 3080 Ti integration stack (with SKIP_WC_COMPARE) — 40 → 5 ms none reported

Uploads to the card fall by about half in every report (e.g. 161 → 77 MB/frame here, 140 → 27 MB/frame for @iGoldenNinja).

Known issues and caveats

  • This is an experiment, not a fix. It assumes the title's CPU never reads write-combining memory the card wrote, and never writes part of a 64 KiB piece the card wrote (the next upload would send stale bytes there; GPU/shadow: write only GPU-changed byte runs in relay_merge, card_merge, and card_merge_relay #786 is related). A correct form would keep such pieces on the card and fetch one on the CPU's first touch (a no-access guard) instead of every frame.
  • VICTORY_SKIP_WC_COMPARE=1: one device removal ~75 s into the world on a 5080 (@Ym1r1710); none in other runs. Cause unknown; do not use for play.
  • Picture: no difference spotted by eye or by simple frame measures (@xunbreakablex), which is a weak check.
  • Game logic: on long runs the story script broke in two places (control back in a police car after its cutscene; a switch to Jason in a barely streamed world). A control run without the switch broke at the same places, so this is not the switch; most likely scripts advancing while streaming lags at 3–7 fps.
  • Present timing: @iGoldenNinja saw a worse P99 in one pair (composed flip); per-present WPR analysis here found no interval over 500 ms in either flip mode with the switch (p50 130 ms, p99 223 ms).

Verification

cargo build --release -p victory; cargo clippy -p victory-gpu -p victory-hle --all-targets (no new warnings); cargo test --release -p victory-gpu --lib (census, shadow, inplace; @iGoldenNinja's reservation tests included); cargo xtask policy (180 files ok). Numbers only; no game data, captures or screenshots.

🤖 Generated with Claude Code

Chipsrain and others added 3 commits November 25, 2026 12:52
…memory on the card

Both are off by default; without the switches nothing changes.

VICTORY_CENSUS=1 logs every 10 s (VICTORY_CENSUS_SECONDS) the title
buffers whose host copies are in the card's memory: the XMemVirtualAlloc
reservation each lies in with the flags the title asked for (the runtime
drops write-combining, uncached and the GPU access bits; the census keeps
them), how much of it is physical-page views and how much shows a page at
more than one address, and per frame the bytes sent up, the pieces
compared and the bytes fetched back. A second line counts the host
resources made per frame by kind (read-back, upload, shared, UAV,
textures, depth twins, placed, host lists).

On an RTX 5080 in the prologue's first room it found 100 copies (about
1 GB); per frame some 100 MB fetched back, 97 to 99 % of it from memory
the title reserved write-combining, which the console's CPU does not read
back either.

VICTORY_SKIP_WC_BACK=1, an experiment: what shaders wrote to copies of
write-combining title memory is not fetched back into title memory.
VICTORY_SKIP_WC_COMPARE=1 (implies it): those copies are not hashed or
compared on the card at all. The CPU's changes are still sent up, and
pending ranges are still closed by the flights' declared writes.
Expect wrong bytes where the CPU writes part of a piece the card wrote, or
reads what the card wrote: a correct form would fetch such a piece on the
CPU's first touch (a no-access guard) instead of every frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Ym1r1710

Copy link
Copy Markdown

Tried this on a 5080 (16 GB, Win11, Series X profile), on top of f85101b with VICTORY_RELAY=2, VICTORY_ASYNC_SUBMIT=1 and VICTORY_QUEUE2=1.

With VICTORY_SKIP_WC_COMPARE=1 I got a device removed about 75 s into the world (first cell). Breadcrumbs say it died in the middle of a list, 247 of 516 done, and the next one 0/1. The driver recovered by itself, no black screen. My tree without this PR has done several runs on the same settings with no removals (~6 fps).

Only one run, so I can't say for sure it's the switch. But your caveat about the CPU writing part of a 64 KiB piece the card wrote would fit. I haven't tried SKIP_WC_BACK=1 on its own.

FYI there's a small conflict in host.rs against current main, next to the VICTORY_CARD_WHOLE_MB loop. I kept both blocks, whole-compare first and then your WC filter.

ExoCalibra added a commit to ExoCalibra/victory-exo that referenced this pull request Nov 25, 2026
e4glevlr added a commit to e4glevlr/victory-fork that referenced this pull request Nov 25, 2026
@MamaLeVrai

Copy link
Copy Markdown

Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present. I merged this PR's head 4e34eb0 into main f85101b in a throwaway tree (no conflict). cargo clippy --workspace --all-targets --locked -- -D warnings fails with exactly the errors main itself has on this machine (placed_filler_twins, depth_written, a sort; PR #841 fixes them), also with --all-features; this PR adds none. cargo test --workspace --locked: run 1: 555 passed, 0 failed, 11 ignored; run 2: stopped at indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields (the one that fails on main itself most runs here (PR #849 and #847 fix its assertion)) (main alone: 555 passed, 0 failed, 11 ignored). The title was not run, so this says nothing about in-game effect. No game data.

AI-assisted (Claude Code); no game data.

@Chipsraine

Copy link
Copy Markdown
Author

Thanks both for testing. @Ym1r1710: a device removal is exactly the failure the caveat predicts (stale bytes sent up over a piece the card wrote, e.g. indirect arguments), so I'd treat SKIP_WC_COMPARE as unsafe until shown otherwise. My own 12-min run on a 5080 had no removal, but that was on 9376fd6 without ASYNC_SUBMIT/QUEUE2/windows. If you have time, a run with VICTORY_SKIP_WC_BACK=1 alone would tell whether the compare skip is the trigger. I'll rebase onto 0b0074e (resolving the VICTORY_CARD_WHOLE_MB conflict), re-measure against VICTORY_QUEUE2=1, which attacks the same copy-back wait without the assumption, and report back. Converting to draft meanwhile; the census part (VICTORY_CENSUS) is logging only and safe. @MamaLeVrai: thanks for the build/test check.

@Chipsraine
Chipsraine marked this pull request as draft November 25, 2026 12:52
A tester's RTX 5080 lost its device about 75 s into the world with it;
VICTORY_SKIP_WC_BACK=1 alone has had no device loss in any reported run.
The switch stays for measurement, with the warning in its comment and log
line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@iGoldenNinja

iGoldenNinja commented Nov 25, 2026 •

Copy link
Copy Markdown

Chipsraine, we reproduced a separate census accounting gap on PR head 4e34eb042e781bc046ca4f06858da1ee0302fe2d. With VICTORY_CENSUS=1, relay_card_inflight adds usable landed bytes to the global in-flight total but omits them from the per-copy fetched counters. The correction credits each accepted span to its shadow copy after duplicate and superseded ranges have been excluded.

The CPU-only regression on Windows 11 25H2 (26200.9974) exercises the production landing loop with synthetic slot buffers and a stub merge. On the parent, copy A records 0 fetched bytes despite 17 bytes landing. On the correction, A records 17 bytes across two spans and B records 14 bytes in one span, matching the global 31 bytes. The stub reports zero title bytes changed. The rejected batch records zero on both revisions. Both regression cases pass with the correction.

Correction commit · Reproduction fixture

Reservation-range correctness

Two CPU regressions expose a separate classification defect on the same PR head. In a synthetic 4 MiB card window spanning two adjacent 2 MiB reservations, the parent classified a 64 KiB write in the ordinary reservation using the write-combining flag at the start of the window. The correction classifies each declared guest interval. Declarations that cross a reservation boundary or include ordinary memory use the normal comparison and readback paths. Writes entirely inside a write-combining reservation still qualify for the experiment. Both regressions pass, covering exact end boundaries, adjacent reservations and integer overflow. Synthetic checks also exercised the direct, relay and compare gates.

The separate local RTX 5080 control used default card-window settings. All 99 recorded exact buffer extents fit inside individual observed reservations. The synthetic tests establish the classifier defect, and its effect on the rendered scene remains unmeasured.

Reservation-range correction and CPU tests

Live RTX 5080 back-only comparison

Following Chipsraine’s back-only request, we ran one control-first pair at the same 2542 × 1396 prison window, about 90 seconds per arm, with no replay input during measurement. Both used dc3c191953f0c8e4adfad5260331ddbc6ec21910 (early-depth integration plus 4e34eb0), a warm cache, Series X profile, ASUS ROG Astral RTX 5080 16 GB / 617.14, Ryzen 9 5900X, 32 GB, Windows 11 Pro 25H2 build 26200.9974. The census and comparisons were on, in-flight fetch was off, and only VICTORY_SKIP_WC_BACK changed from 0 to 1. Median draws were 4,985 and 4,996.

  • Fetched MB/frame fell from 96.07 to 3.59, with the WC portion 92.52 to 0. Uploads fell from 140.08 to 27.33 MB/frame. Compared pieces were 16,780 and 16,763 per frame.
  • Median renderer copy-back fell from 199.7 to 98.9 ms and average displayed application FPS rose from 2.839 to 3.818.
  • Full-sample P99 display interval worsened from 429.25 to 1,217.15 ms. Five consecutive back-only intervals over one second started in composed-flip mode. The control had no intervals over 500 ms. The cause of the presentation-mode change is unknown. A diagnostic subset with independent-flip on both endpoints gave 429.25 to 305.77 ms (256 and 337 intervals).

Sampled geometry and lighting looked similar and dark areas remained. We stopped both runs deliberately without a logged device removal. This pair measures traffic and display timing in one stationary scene. Guest CPU reads of skipped GPU-written data and later gameplay remain untested.

Pinned comparison report

November 25 follow-up. A retrospective check of four matched-view bottom-fifth crops per arm from our single 90-second RTX 5080 pair on dc3c191 found zero pixels meeting our light-grey or cyan definitions, with a different metric, shorter observation window and earlier build than the RTX 4070 comparison. Pinned report

@Chipsraine

Copy link
Copy Markdown
Author

Rebased onto 0b0074e (no conflicts there; new head 7e64279) and re-measured on the RTX 5080 (Ryzen 5 5600, Win11, Series X profile), same room, release build, with the author's speed set: VICTORY_ASYNC_SUBMIT=1 VICTORY_QUEUE2=1 VICTORY_INDIRECT_WINDOW=1 VICTORY_TEXTURE_NO_WAIT=1 VICTORY_COPY_PLAIN=1 (+ VICTORY_TEXTURE_CATCHUP=0).

Steady world frames (≥3,000 draws, no pipelines being made), p50:

author's set + VICTORY_SKIP_WC_BACK=1
frame 192 ms (5.3 fps) 149 ms (6.7 fps)
copy-back 71 ms / 63 MB 21 ms / 3 MB
sent up to the card 159 MB 73 MB
copy-back thread waiting for fetches 12 ms 1 ms
submitting thread waiting for the card 50 ms 19 ms
draws per frame ~5,600 ~6,100

So QUEUE2 and this switch add up: QUEUE2 removes the wait for the fetch, this removes the fetch itself and the echo upload that follows it.

SKIP_WC_BACK=1 alone (no SKIP_WC_COMPARE) ran ~8.5 min on top of windows/async/queue2 with no device removal and no display-driver events in the System log. One run each (55 and 65 steady samples), so treat as indicative. SKIP_WC_COMPARE I still consider unsafe after @Ym1r1710's report; staying in draft until the lazy (first-touch) form exists.

@Chipsraine

Copy link
Copy Markdown
Author

@iGoldenNinja thanks — both fixes are right and I've taken your two commits as they are (b57479c, f9c43fa, authorship kept): the in-flight path was simply not credited per copy, and classifying by the copy's start address was wrong for windows spanning two reservations (on my runs all ~100 copies sat inside one reservation, so my numbers are unaffected, but the experiment must not depend on that). Your 5080 pair matches mine in direction (fetch −93 MB, uploads −110 MB/frame, copy-back halved) — thanks for the independent check.

On the P99 / composed-flip regression: from one 30 s WPR trace of my SKIP_WC_BACK=1 run (author's speed set on 0b0074e) I classified each of the title's 202 presents by whether an MMIO overlay flip from the process followed it before the next present: 67 independent, 134 composed, interval p50 150 / 155 ms, p99 234 / 241 ms, no interval over 500 ms in either mode. So it does not reproduce here in that window; I'll keep logging every frame (VICTORY_FRAME_LOG=1) and the flip mode in the next runs.

AlexMiu2083 added a commit to AlexMiu2083/victory-MBT that referenced this pull request Nov 25, 2026
…r runs across the cursor, snapshots flushed before a copy goes, changed runs reused, texture checks side by side, the card-copy census and its write-combining experiment

From fxceless/victory-fork's open pull requests:

- fxceless#911 (douline): a constant buffer view is at most 64 KiB; the title names
  larger ones and NVIDIA removes the device for them.
- fxceless#932 (avt0m4t48): the search for free dynamic descriptor slots finds a run
  that lies across its starting point.
- fxceless#936 (faycalbaklouti): queued snapshots are taken before a host copy is
  dropped (a use after free); its test's imports added for this tree.
- fxceless#925 (alpz1000): changed-byte runs are found into one buffer reused across
  pages, the merge gap joined in the same pass.
- fxceless#768 (KyleS98): a submission's texture checks run several at a time
  (`VICTORY_WIDE_TEXTURES=1`, off by default).
- fxceless#868 (Chipsraine): a census of the card copies (`VICTORY_CENSUS=1`) and an
  EXPERIMENT, off by default: `VICTORY_SKIP_WC_COMPARE=1` leaves copies of
  write-combining title memory out of the compare and the copy-back. Here
  (RTX 4070, first gameplay scene) it took the median from 213 to 186 ms a
  frame, best 150 ms; not exact (the title must never read that memory
  after the card wrote it).

With them gameplay went from a median of 233 to 213 ms a frame here.

Tried and left off: `VICTORY_CARD_REHASH_RUNS=1` (1,735 passes a frame
joined to about 220, no gain).

victory-gpu: 174 tests pass (`inplace::...shows_its_bytes_at_its_offset`
fails now and then, as before these); victory-hle: 99 pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dkdknight added a commit to dkdknight/victory-fork that referenced this pull request Nov 25, 2026
…d victory-lod14.exe

Same build and passage: ~7.0 fps without it, 8.0-8.9 with it; copy-back
69-88 -> 10-14 ms, preparing 74-81 -> 45-55 ms, card 80-91% busy; picture
checked right in screenshots. PR fxceless#916 (only address-storing shaders mark
title memory written) is in the build, on by default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dkdknight added a commit to dkdknight/victory-fork that referenced this pull request Nov 25, 2026
…-8.0 back to back), run spread, timestamps and viewports

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@xunbreakablex

Copy link
Copy Markdown

Second machine with the same CPU class, for VICTORY_SKIP_WC_BACK=1 only (AI-assisted, Claude; runs on my machine): RTX 4070 (undervolted, 100 W limit), Ryzen 5 5600 at 3.95 GHz, Windows 11, driver 621.01, Series X profile, diagnostics build of this PR's head f9c43fa (on 0b0074e), warm cache. Both arms use the same binary and the set ASYNC_SUBMIT=1 QUEUE2=1 INDIRECT_WINDOW=1 MERGE_GAP=64 MERGE_RUNS=4096 COPY_PLAIN=1 TEXTURE_NO_WAIT=1; 480 s runs in A-B-A-B order, steady window world +300..+480 s. SKIP_WC_COMPARE was not used.

run frame (mean ± sd) ms per 1,000 draws copy-back copies
A1 195.8 ± 10.1 ms 40.6 99.6 ms 80.6 ms
B1 SKIP_WC_BACK=1 140.2 ± 5.0 ms 30.1 20.2 ms 46.3 ms
A2 172.1 ± 10.3 ms 36.6 76.2 ms 61.8 ms
B2 SKIP_WC_BACK=1 155.8 ± 7.3 ms 33.3 19.0 ms 49.1 ms
  • B faster in both pairs: -28% and -9%, -20% over the two (148 vs 184 ms); per 1,000 draws 31.7 vs 38.6 ms. Copy-back drops from 76-100 ms to ~20 ms every time, which matches your numbers; the default arm itself moves a lot between runs here, which is why the second pair is smaller.
  • No device removal, no driver-watch entry, no error line in either B run (2 x 480 s).
  • Picture: I compared the captured world frames of each pair by simple measures (black-pixel ratio, brightness, a block/stair-edge measure on a character's shoulder) and found no difference that stands out; frames are hard to match one to one because the scene timing differs between runs, so this is a weak check, not a clean bill. I did not look for the specific failure the caveat describes (stale bytes over something the card wrote).

@Chipsraine

Copy link
Copy Markdown
Author

Long runs on the RTX 5080 (Ryzen 5 5600), from the prologue to the start of chapter 1, on 0b0074e + this PR (with @iGoldenNinja's fixes) + #911 #916 #834, author's speed set (ASYNC_SUBMIT QUEUE2 INDIRECT_WINDOW TEXTURE_NO_WAIT COPY_PLAIN), warm caches:

  • with VICTORY_SKIP_WC_BACK=1: 22.6 min, no device removal, no display-driver events;
  • control without it, same route: 30.3 min, also no removal.

Draw-matched comparison (the scenes differ a lot in draws, so frames are binned by draws per frame; steady world frames, no pipelines being made), p50:

draws per frame SKIP_WC_BACK=1 without
4,000–5,500 190 ms 219 ms −13 %
5,500–7,000 172 ms 194 ms −11 %
copy-back 22 ms 65–68 ms
sent up to the card 76–78 MB 161–163 MB −52 %

So on top of the author's set the gain is ~11–13 %, smaller than the 22 % of my earlier short pair: with ASYNC_SUBMIT/QUEUE2 much of the copy-back already overlaps other work (−43 ms of copy-back gave ~−20 ms of frame).

Game logic: in the switch run the story broke twice (control returned to Lucia in the police car after the cutscene, a scene that does not exist on console; later a switch to Jason in a barely streamed world). The control run without the switch broke at the same two places, so these are not caused by SKIP_WC_BACK; most likely the mission scripts advance on time while streaming/cutscenes lag at 3–7 fps.

Present timing from WPR (flip mode per present, ~30 s windows in the cell): with the switch p50 130 ms, p99 223 ms, no interval over 500 ms in either independent or composed flip, so the P99 regression reported above did not reproduce here.

@xunbreakablex

Copy link
Copy Markdown

Correction to my comment above, after looking at the captures properly (AI-assisted, Claude; same RTX 4070 / Ryzen 5 5600 machine).

Picture: I wrote that I found no difference that stands out. That was wrong. In the cell-window shot (world +300, +600, +900), two of the three SKIP_WC_BACK=1 runs show light-grey rectangular patches with stair-stepped edges in the lower part of the frame (to the sides of and below the character, roughly the bottom fifth of the screen), and one of them also small cyan specks at the right edge. Neither of the two runs without the switch has them (same binary, same set, same capture method). A simple measure of strong 8-pixel-aligned edges in that region: without the switch 0.001 and 0.051; with it 0.163, 0.089 and 0.174. That looks like the failure your caveat predicts (bytes the card wrote into write-combining memory not coming back, and something later reading the stale copy), but I have not proven the mechanism; it is 3 vs 2 runs on one machine.

Speed: the third SKIP_WC_BACK run (with VICTORY_CENSUS=1) gave 156.1 ms, so B is 140.2 / 155.8 / 156.1 ms (mean 150.7) against 195.8 / 172.1 ms without the switch. An earlier run of the same set on plain 0b0074e gave 159.0 ms, so against that the gain is only ~5%; against the two A runs of this binary it is ~18%. The direction is consistent (every B run faster than every A-type run), the size is not: please read it as 5-18%, not 20%.

Census in the B run, world part: per frame about 22-24 MB sent up and 5.5-5.9 MB fetched back, of which 0.0 MB from write-combining memory (as expected with the switch on). I have not run the census with the switch off yet, so I cannot say yet how much write-combining read-back the switch skips; that run is queued.

@Chipsraine

Copy link
Copy Markdown
Author

@xunbreakablex thank you — A-B-A-B at 480 s on a 4070 with the same CPU class is the cleanest measurement in this thread; I've put it at the top of the summary table in the description, next to the other reports. VICTORY_SKIP_WC_COMPARE is now marked unsafe in its comment and log line (fef9592), and with four independent SKIP_WC_BACK reports and no device loss I'm taking this out of draft for review, as an opt-in switch, off by default.

@Chipsraine
Chipsraine marked this pull request as ready for review November 25, 2026 15:59
@Chipsraine Chipsraine changed the title Card copies: a census, and an opt-in experiment that leaves write-combining memory on the card (−24 % frame on RTX 5080) Card copies: a census, and an opt-in switch that leaves write-combining memory on the card (−11…−20 % frame, 3 GPUs) Nov 25, 2026
@xunbreakablex

Copy link
Copy Markdown

One more caveat on the speed numbers above (AI-assisted, Claude): on this machine the first game run after each new build looks systematically slow. In two separate chains the first run of the default arm came out at 195.8 and 195.4 ms, while the later default runs of the same binaries were 172.1, 160.1 and 159.0 ms. Both of my comparisons started with such a first run, so the "about 18%" is inflated; against the later default runs the SKIP_WC_BACK=1 gain is closer to 5%. The picture finding (grey stepped patches in 2 of 3 runs with the switch, none without) is unaffected by this.

@xunbreakablex

Copy link
Copy Markdown

@Chipsraine thanks. Before it goes in on my numbers, please see my two follow-ups just above yours: (1) two of my three SKIP_WC_BACK=1 runs showed light-grey stepped rectangular patches in the lower part of the cell-window shot (one also cyan specks at the right edge), and neither run without the switch did — same binary, same capture method; (2) my first default run was a first-run-after-build outlier, so against the later default runs the gain here is nearer 5% than 18%. Your draw-binned 11-13% from long runs is the better speed number. The patches are 3 vs 2 runs on one machine, so not proof, but it is the failure your caveat describes, so it may be worth a look in your own captures of that shot (around the bottom fifth of the screen, beside and below the character) before review. (AI-assisted, Claude.)

@xunbreakablex

Copy link
Copy Markdown

@Chipsraine a further correction, in your favour: I can no longer attribute the grey stepped patches to SKIP_WC_BACK. On 465b94f (no #868 in that binary at all) I ran five more captures of the same cell-window shot with the default speed set and with JOIN_PARTS/BACK_OWN_VIEW/INDIRECT_GATHER, and the same kind of light-grey stepped blocks with cyan specks in the lower part of the frame show up in a run without any of these switches (and in some of the others), at random. So my earlier "2 of 3 with the switch, 0 of 2 without" split was most likely the run-to-run randomness the README mentions, not this PR. Sorry for the noise; the speed numbers in my last note stand (gain nearer 5% than 18% on my machine, your long-run 11-13% is the better figure). (AI-assisted, Claude.)

@Ym1r1710

Copy link
Copy Markdown

Did the run you asked for, SKIP_WC_BACK=1 alone (no COMPARE), on the current head merged into my tree (ca8829f + #1043), RTX 5080 + 7800X3D, Win11. Base switches RELAY=2, QUEUE2, ASYNC_SUBMIT, INDIRECT_WINDOW, TEXTURE_NO_WAIT, COPY_PLAIN.

Three runs to world+800 on the same binary: one with DRED armed (no removal, no warnings), then without DRED with and without the switch. With it: 105 ms median, copy-back ~11 ms. Without: 116.8 ms, copy-back ~49 ms. So about 10% here, close to your draw-binned number.

Looked at the captures at world+250, +400 and +800 next to the control run: same picture, no grey blocks or specks. Only the first cell scene though, I haven't played further with it yet. Keeping it on in my build for now.

ExoCalibra added a commit to ExoCalibra/victory-exo that referenced this pull request Nov 25, 2026
RyanCase94 added a commit to RyanCase94/victory-Rycas that referenced this pull request Nov 25, 2026
…ear u32::MAX)

On top of fork PRs fxceless#911 (constant buffer views at most 64 KiB) and fxceless#868 (card
copies census, VICTORY_SKIP_WC_BACK), both merged here.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@Exopus-0x65f7ad0

Copy link
Copy Markdown

Tested on RTX 5060 Ti 8 GB, 16 GB RAM, Windows 11. The base was fork main d510ee4 plus #911/#1006/#1014/#1043/#1058/#1059/#1067/#1007/#188, Series S, with VICTORY_SKIP_WC_BACK=1 only (not SKIP_WC_COMPARE). Copy-back fell from 63 to 5 MB per frame and the frame line's "copying back" from ~100 to ~20 ms. No visible defect in the first room or the cutscenes, and no device loss over 4 runs of 8-10 min. First room, standing: median 8.6 fps.

🤖 Generated with Claude Code

KomanderDG88 added a commit to KomanderDG88/VIniVIdiVIci that referenced this pull request Nov 25, 2026
…less#868), one view per section (fxceless#231)

- Input (diagnostics builds): a key of VICTORY_KEYS is held until the
  title's reads have seen it down, with repeats and a log line per press.
- fxceless#868 (Chipsrain, iGoldenNinja): VICTORY_CENSUS=1
  logs what each card copy sends, compares and fetches back;
  VICTORY_SKIP_WC_BACK=1 is an experiment that leaves on the card what
  shaders wrote to write-combining title memory. Both off.
- fxceless#231 (HailLucifer666):
  VICTORY_XMEM_PERSISTENT_VIEW=1 keeps one view of a physical-page
  section instead of a view per write. Off.

Nothing changes with the switches unset. Tested as ce18a1a: victory-gpu
library suite three runs clean (198 passed, 5 ignored), victory-hle 116
of 116 with and without diagnostics. The build measured next is of that
commit; this merge differs from it in the README only.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
KomanderDG88 added a commit to KomanderDG88/VIniVIdiVIci that referenced this pull request Nov 25, 2026
…ess#231) and scripted keys held until read

Three rows under what this fork adds, all off by default or diagnostics
only, none measured here yet. English and Spanish.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
rcioletti added a commit to rcioletti/victory-gta6 that referenced this pull request Nov 25, 2026
@HLVM04

HLVM04 commented Nov 25, 2026 •

Copy link
Copy Markdown

A Series S data point on an RTX 5070 Ti (Ryzen 7 9800X3D, Windows 11 build 26200), first gameplay scene, on our own stack: an older fork main plus several open PRs and local changes, including the 2 MiB section patch from #1089. VICTORY_SKIP_WC_BACK=1 only, not SKIP_WC_COMPARE:

without SKIP_WC_BACK=1
copy-back per frame 18 ms 2 ms
median frame 73 ms 71–72 ms
  • No crash or device loss in 2 runs of 200 s with the switch, and nothing visibly broken compared with the run without it (see the correction below).
  • So on this stack, 16 ms less copy-back gave only 1–2 ms on the median frame.

It's few runs in one scene, so read the frame-time difference as small, not as measured exactly.

Edit (2026-11-26), correction: on our stack VICTORY_SKIP_WC_BACK=1 does break the picture: the room's lamp light goes missing and rooms render dark. Our earlier runs were judged only by the character, not by the room lighting, so the "nothing visibly broken" above was wrong.

triippywhale pushed a commit to triippywhale/victory-fork that referenced this pull request Nov 25, 2026
…le memory (VICTORY_CENSUS, VICTORY_SKIP_WC_BACK)

All off by default; without the switches nothing changes.

VICTORY_CENSUS=1 logs every VICTORY_CENSUS_SECONDS (10) the title buffers
whose host copies are in the card's memory: the XMemVirtualAlloc
reservation each lies in with the flags the title asked for (kept before
the runtime drops write-combining and the GPU bits), how much is
physical-page views, and per frame the bytes sent up, the pieces compared
and the bytes fetched back; plus host resources made per frame by kind.
On an RTX 5080 it found 97-99 % of the bytes fetched back came from
memory the title reserved write-combining, which the console's CPU does
not read back either.

VICTORY_SKIP_WC_BACK=1, an experiment: what shaders wrote to card copies
whose declared range lies wholly in write-combining title memory is not
fetched back (all three fetch paths: pushed parts, relay fetch, card_back).
VICTORY_SKIP_WC_COMPARE=1 also leaves those copies out of the compare; its
author marks it unsafe (one device removal reported), so test
VICTORY_SKIP_WC_BACK=1 alone first.

Port of fxceless#868 (Chipsrain 7e64279, iGoldenNinja
b57479c + f9c43fa, Chipsrain fef9592) onto the fork's card-back paths,
which cut pieces into 4 KiB parts (card_piece_parts) where fxceless#868 had whole
pieces.

(cherry picked from commit 7e64279)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017V7WBBU55HJVgqSgZRhMqc
PiloteCode added a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
…celess#24/fxceless#104), null CBVs (fxceless#304), tables at list cuts (fxceless#742), heap entries (fxceless#589), barriers (fxceless#787), depth-stencil UAV barriers (fxceless#214), windows ending at recorded writes (fxceless#663), sRGB views (fxceless#644), wide accesses across pages (fxceless#846), view-guard costs (fxceless#812/fxceless#853), the fill latch (fxceless#860), pipeline waits (fxceless#709), robustness; opt-in fxceless#868/fxceless#845
Tissma95 pushed a commit to Tissma95/victory-fork that referenced this pull request Nov 26, 2026
@milesah3ad

Copy link
Copy Markdown

@Chipsraine a data point from a setup that isn't in this thread yet: RTX 5080 without ASYNC_SUBMIT / QUEUE2 (every 5080 report above has them on), and the PR on current main.

Tree. This PR (fef9592) merged onto main 988aa41: milesah3ad:pr868-on-988aa41 (c686ab8). The only conflict was in host.rs, against main's three-step send-and-hash: I kept main's version and added this PR's census::sent(...) call before synced.push. Builds; cargo test -p victory-gpu 206 passed; clippy clean. Feel free to take the merge if it saves you a rebase.

Machine. RTX 5080 16 GB (driver 621.24, 32-lane), Ryzen 7 9800X3D, 64 GB, Windows 11 26300, Series X profile, release build with diagnostics. Settings in every run: RELAY=1 TEXTURE_BACK=1 TEXTURE_NO_WAIT=1 COPY_PLAIN=1 JOIN_COPIES=1 CARD_REHASH_RUNS=1 LEVELS_ON_DEMAND=1 D3D12_DRED=faults. The only difference between arms is VICTORY_SKIP_WC_BACK=1 (not SKIP_WC_COMPARE).

Runs. A-B-A-B, same binary, 10 minutes each from launch, scripted Enter from the same prologue save (world after 60-120 s). Steady world frames only (≥1,000 draws, no pipelines being made), medians:

run copy-back copied back / frame usual frame fps at 4-6k draws
1 off (first run after the build) 178 ms 67 MB 234 ms 4.4
2 SKIP_WC_BACK=1 91 ms 5 MB 181 ms 5.5
3 off 172 ms 46 MB 233 ms 4.3
4 SKIP_WC_BACK=1 96 ms 4 MB 212 ms 5.3

So on this machine: copy-back about −45 %, the usual frame −9 to −22 %, about +22 % fps at 4-6k draws. No device removal in any of the four runs. In two screenshots from run 4 (the cell door with the guard, the common room) there are no grey stepped blocks or specks; the scripted input carried the runs to different scenes, so I don't have same-frame comparisons. Two pairs on one machine, so take the size of the gain as approximate.

AI-assisted (Claude Code); the numbers are from the run logs.

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.

8 participants