GPU: the pass over byte-copied descriptor records takes its lock once a page and a cheap fingerprint (36 to 24 ms a frame) #774
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!774
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/774/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@sagouindupm on GitHub · 2026-11-25 07:14 UTC · original
sagouindupm:heap-sync-fast→main· +117 −31 · 2 files · 1 commits · closed without mergingWhat
The pass over descriptor records the title copies into its heap as bytes (
sync_heaps, new ina26859f) compares a page's slots under one lock and with a cheap fingerprint. What is mirrored, and when, is unchanged.Why
On an i5-12400F in the Series S world its own counter read 35.6 to 39.3 ms a frame (about 180,000 slots looked at, about 38,000 mirrored), and the settled frame was about 20 ms longer than with
VICTORY_HEAP_SYNC=0(numbers in #616). For each slot looked at it took the heap's fingerprint lock and hashed the 32-byte record with BLAKE3; most slots on a changed page have not changed.How
crates/victory-gpu/src/descriptor/host.rs,crates/victory-gpu/src/descriptor.rs:HostHeap::mirror_copiedtakes a page's records as an iterator: the fingerprints are compared under one lock for the page, the changed slots are then mirrored as before (outside that lock, as before).fingerprint: word by word, each step a rotation, an exclusive or with the word and a multiplication by an odd number. Every step is a bijection of the state, so two records of one length that differ in a single 8-byte word never share a fingerprint; others share one with the chance of any 64-bit hash, which is what the first 8 bytes of BLAKE3 gave. It is never 0 ("never looked at"), and the length is mixed in.record_changed: not the one last seen; a never-seen empty slot stays as it was) is now a function of its own with a test.Measured
RTX 3050 8 GB, i5-12400F, Windows 11, release build, Series S, first room of the world,
VICTORY_TEXTURE_DROP_MIPS=1. Tree:a26859f+ #188 + #640 + #610 + #467 + #518 + #51, with and without this commit. The pass's own line, last three of a five-minute run each:Settled frame time (last five readings of the window title): 264, 260, 260, 248, 266 ms before; 239, 237, 249, 248, 251 ms with it. One run each, so the frame times are an indication; the pass's own counter is the measurement. The first room's walls and the picture are as before.
What is left in the pass (about 24 ms) is the mirroring of the about 38,000 records that did change and the reads of the pages; not touched here.
cargo test --release -p victory-gpu --libona26859f+ this commit: 139 passed, 0 failed, 3 ignored (2 new: the change rule; every single-bit change of a 12-, 16- and 32-byte record gives another fingerprint).Not tested: Series X, AMD and Intel cards, Linux/Proton, runs longer than five minutes.
AI-assisted: Claude Code (Claude Fable 5.2) wrote the change and ran the measurements, under my direction.
@iGoldenNinja on GitHub · 2026-11-25 07:47 UTC · original
Independent RTX 5080 result on Windows 11 Pro 25H2 build 26200.9974, driver 617.14, Ryzen 9 5900X and 32 GB RAM. I compared base
a26859fwith PR head0941c0din the same Series X diagnostics replay with the default relay. Both started with zero shader-cache hits and reached controllable prison gameplay. The candidate reused the shared host pipeline library after it grew during the base run.Median mirroring time fell from 57.15 to 36.31 ms/frame, with median mirrored records per frame falling from 48,168 to 44,950 across 257 and 261 periodic samples. PresentMon averaged 3.27 to 3.42 FPS over the five-minute route. P99 increased 523.28 to 558.55 ms and the worst interval increased 664.42 to 1,058.38 ms. The walls and ceiling rendered in both comparable interior views, with the same stepped shoulder artifact visible. DRED logged no removal. This was one run per build.
Replay and counters. OpenAI Codex (GPT-6) ran the replay and drafted this report.
@sagouindupm on GitHub · 2026-11-25 08:22 UTC · original
Superseded by
9376fd6onmain, which takes the same cheap fingerprint and goes further (draw-table slots left to their draws: the pass at about 3 ms a frame where this PR left it at about 24). Closing. @iGoldenNinja thank you for the independent run: 57 to 36 ms a frame of mirroring on your 5080 matches what I saw here.AI-assisted: Claude Code.
Pull request closed