Repository navigation
GPU: VICTORY_COLD_SKIP=1: refreshes pass over 2 MiB chunks with no write since (off by default) - #1358
GPU: VICTORY_COLD_SKIP=1: refreshes pass over 2 MiB chunks with no write since (off by default)#1358TG0000 wants to merge 1 commit into
Conversation
…ite since (off by default) A refresh of a host copy walks every 64 KiB page of its range, comparing the page's last copy with its last noted write. A large copy refreshed by many submissions is walked whole each time, mostly to find nothing. With the switch the write journal numbers every page it notes and keeps, per 2 MiB chunk, the number of the last one (its mark). A copy remembers per chunk the mark it saw when a walk last left every page of the chunk fresh; while the mark has not moved, the chunk is passed over. Marks are read under the same lock as the written pages. A page still stale after its copy (taken in part, or numbered after a standing asking) keeps its chunk walked, so the same pages are copied as without the switch. VICTORY_COLD_SKIP=alt takes it in turns of 20 s. Off by default: no marks are kept and every page is looked at as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ite since (off by default) A refresh of a host copy walks every 64 KiB page of its range, comparing the page's last copy with its last noted write. A large copy refreshed by many submissions is walked whole each time, mostly to find nothing. With the switch the write journal numbers every page it notes and keeps, per 2 MiB chunk, the number of the last one (its mark). A copy remembers per chunk the mark it saw when a walk last left every page of the chunk fresh; while the mark has not moved, the chunk is passed over. Marks are read under the same lock as the written pages. A page still stale after its copy (taken in part, or numbered after a standing asking) keeps its chunk walked, so the same pages are copied as without the switch. VICTORY_COLD_SKIP=alt takes it in turns of 20 s. Off by default: no marks are kept and every page is looked at as before. Port (upstream fxceless/victory-fork fxceless#1358 on our pile, which has no VICTORY_DIRTY_4K): the 4 KiB sub-page parts of the pull request (`Journal::sub`, `subpages`, the narrow copy in `copy_stale`) left out; the marks threaded through our `writes_in` (VICTORY_GUARD_RUNS) as a sixth argument instead of the pull request's `writes_marking`, and the answer still read under the journal's lock before our GUARD_OUTSIDE arming is finished. Every note of the journal (kernel write watch, guards, guard runs, light refresh, `wrote`/`wrote_own`) goes through `Written::insert`, and no path of our pile lowers a copy's `copied` stamps, so a chunk is passed over only where the walk would have copied nothing. (cherry picked from commit 6be3efb) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ure fixes), cascade shadows, render-target snapshots, and switches for rays, memory and input Twenty-two commits, tested as fe2ede8 (cargo check of the workspace with diagnostics clean; victory-gpu --lib 356 passed, 0 failed) and built by Codex as fe2ede8-diagnostics. On by default, each with a way back: - the original's fifth merge up to e4245f3 with 93db653: VICTORY_PAGE_WRITES now also sends back to pending the textures written by slots and by plain reads (1|2|8; =guards is the default of before), textures without room on the card are asked for again (VIctory #3198), a released view heap forgets its run of title memory (fxceless#589), shader fixes (fxceless#1112, fxceless#702, mesh corners, samplers behind a uniform branch, sampleLevel); - fxceless#1002: exact cascade shadows on cards of 32 lanes (VICTORY_SHADER_CASCADE_EXACT=0 goes back); - fxceless#1371: render targets replayed from a copy taken at SetRenderTargets (VICTORY_RT_SNAPSHOT=0 goes back). Off by default: VICTORY_RT_SKIN_SKIP, VICTORY_RT_RESOLVE_SKIP, VICTORY_ACTIVATE_RAYS_SKIP, VICTORY_HAIR_VB_SKIP (with a census of such programs), VICTORY_ALT_FLIP (fxceless#1341), VICTORY_RAM_TRIM, VICTORY_WINDOW_REUSE (fxceless#1362), VICTORY_COLD_SKIP (fxceless#1358), the worker chain of fxceless#1290, VICTORY_KEYS_FILE, VICTORY_NULL_SAMPLES, and the merge's CARD_HASH_WIDE=alt, GATHER_SEGMENTS, GATHER_DISPATCHES, DIRTY_4K, MERGE_RUNS_ALT, HEAP_RECHECK_EVERY and WAVE_WIDE_ONLY. The profiler test walks only modules that never unload. Left out: diagnostics/translate-water-5dc3-6f22-2026-11-26.txt, a translation diagnostic of the original's run that lists offsets and instructions of two of the title's shaders. Measured by Codex on fe2ede8, the ten switches of Status, screenshots every second, one pair of sessions of 480 s, the same binary: in the opening's cafeteria two faces were drawn with their features with the new default, and one of them came out without features and the background washed out with VICTORY_PAGE_WRITES=guards, at different moments and poses; in the reverse pair a face came out almost all black with the new default (the guards session was stopped by the memory guard at 391 s), so these fixes are not the whole answer to black faces. Not measured for frame rate yet. Neither session crashed; frames of a second or more between 150 and 450 s: 49 (longest 5.7 s) with guards, 52 (6.8 s) with the default. A first session with a cold shader cache was ended at 388 s by the title itself after a frame of 21.5 s spent waiting for the runtime's remapping. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…x3060-n Kept j.written.noted(first, last, marks) with guard_outside drop(held) + arming.finish ordering in watch.rs. Co-Authored-By: Antigravity <noreply@anthropic.com>
…o exp/rtx3060-n Kept j.written.noted (from fxceless#1358) inside reservation::covered, combined title_memory_committed with ask_once_end(), and updated reservation test Journal to Written::new(). Co-Authored-By: Antigravity <noreply@anthropic.com>
|
Tested
Both reached the matched cell camera at about 209 s. The enabled arm skipped a median 76.6% of page checks over 50 samples in the scoring window. Forward-copy timing moved from 58.0 to 55.8 ms/frame at the median, and reported forward bytes were 164.3 and 159.3 MB/frame. This is one replay per mode. Streaming activity varied, and an earlier 50% run without the PR gave 5.86 FPS, so the test does not establish a net gain over main. The nine cold-skip regressions passed on the Windows-target binary under Proton with the feature off and on. The stale-page regression passed. The wider watch filter matched the control exactly at 17 passes, two inherited Wine capability failures and one ignored. The two failures were the Event Log subscription stub and the missing placeholder query. Assisted by Codex (GPT-6.2-Sol High). |
|
CI status: the only failing check is #1357 fixes this by moving those test modules into their own files. Depends on: #1357 I'll re-run CI (or rebase) once #1357 lands. (AI-assisted comment.) |
AI-assisted (Claude). Off by default. This branch has not been run in the game: the numbers below come from an earlier version of the change on a local stack. Reports from other GPUs and CPUs are very welcome.
What
A refresh of a host copy walks every 64 KiB page of its range and compares the page's last copy with its last noted write (
Shadow::copy_stale). A large copy that many submissions refresh is walked whole each time, mostly to find nothing.With
VICTORY_COLD_SKIP=1:Marks are read under the same lock as the written pages. A page still stale after its copy (taken in part, or numbered after a standing asking) keeps its chunk walked, so the same pages are copied as without the switch.
VICTORY_COLD_SKIP=altturns it on and off every 20 s. A log line with the frame-rate line says how many pages were passed over. With the switch unset no marks are kept and every page is looked at as before.Measured
AMD Radeon RX 6800 16 GB (RDNA2), Adrenalin 26.11.2, Ryzen 9 5900X, Windows 11, 1440p internal. One 240 s launch alternating the switch, 43 paired blocks, on a local stack with many other switches on (older base than this branch).
VICTORY_REFRESH_CHECK=1: no "stale after its refresh" line. That check samples the first 256 bytes of each 64 KiB block, so it is evidence, not proof.Difference from the measured version: while porting I found that it could remember a chunk holding a page that was still stale (written after a standing asking), and so not take that page again as the walk without the switch does. This PR keeps such a chunk walked; there is a test for it. The fixed version has not been measured.
Checks (on this branch, rebased on
52ac4ec0)Built on macOS (Apple M3 Pro), cross-targeting Windows where noted:
cargo clippy --workspace --all-targets --locked -- -D warnings, with and without--all-features, targetx86_64-pc-windows-msvc: clean.victory-gpuandvictory-shaderWindows test binaries build. They were not run.cargo testforvictory-core,victory-formats,victory-pipeline,victory-shader: pass.cold_skip.rs(standard library only): 9 of 9 tests pass withrustc --test, including a randomized comparison of the copied runs with and without the skip, with standing askings and partly held pages. These tests model the walk; they do not driveShadow::copy_staleitself.cargo xtask policyreports two files over the size limit (host.rs,lower.rs). Both already are onmain, and this PR touches neither.Related
VICTORY_LIGHT_REFRESH=1already returns early for a range with nothing new. This works per 2 MiB chunk, so it also helps when part of a range changed, and it does not need that switch. The two together are untested, as isVICTORY_DIRTY_4K.copy_stale.To try it
VICTORY_COLD_SKIP=altand compare the two phases; once,VICTORY_COLD_SKIP=1 VICTORY_REFRESH_CHECK=1and look for "stale after its refresh". Please report GPU, CPU, driver, the "passed over" percentage and both phases' preparing and frame times.🤖 Generated with Claude Code