Repository navigation
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
sagouindupm wants to merge 1 commit into
Conversation
… a page and a cheap fingerprint sync_heaps looked at about 180,000 slots a frame in the world, and for each took the heap's fingerprint lock and hashed its 32-byte record with BLAKE3: 35.6 ms a frame on an i5-12400F (its own counter), the frame about 20 ms longer than with VICTORY_HEAP_SYNC=0. The slots of a page are now compared under one lock, and the fingerprint is four multiply steps (each a bijection of the state, so records one word apart never share one). What is mirrored, and when, is unchanged.
|
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 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. |
|
Superseded by AI-assisted: Claude Code. |
What
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.