Repository navigation
The card compare hashes a piece with a group of 64 threads: our passes on the card from about 35 to about 10 ms a frame - #1014
Conversation
…s on the card from about 35 to about 10 ms a frame
The compare of copies in the card's memory (`CARD_COMPARE`) gave each
64 KiB piece one thread, which walked it 16 bytes at a time, 4,096 loads
one after the other: a pass took the time of one piece however few pieces
it had, and the card ran next to nothing else meanwhile. The passes run
before every submission's lists (hashes after ranges are sent up, 300 to
450 a frame here) and after them (compares, about 100).
`CARD_COMPARE_WIDE` gives a piece a group: thread t hashes the 16-byte
steps t, t + 64, t + 128... (neighbouring threads read neighbouring
bytes) and the first thread folds the 64 lane hashes in lane order. It is
another hash, so a process uses one form for everything it stores and
compares: VICTORY_CARD_HASH_WIDE=0 keeps the thread a piece. A copy is
under 1 GiB, so a pass has at most 16,385 pieces, a group each, within
one dispatch.
Tests: the existing WARP test of the compare's modes runs both forms, and
a new one changes single bytes at offsets 0 to 65,535 of pieces of a copy
that does not start on a piece boundary, from a span that does not start
at piece 0: each change is flagged in its piece alone, in both forms.
Measured on an RTX 3060 12 GB (Ryzen 5 5600GT), first rooms, with
VICTORY_TEXTURE_NO_WAIT, VICTORY_INDIRECT_WINDOW, VICTORY_ASYNC_SUBMIT,
VICTORY_QUEUE2 and VICTORY_COPY_PLAIN on, four runs of 330 s, the median
of the frame log's usual-frame lines after the first third:
thread a piece group a piece
our send-and-hash lists 22.3 / 29.4 ms 5.5 / 8.5 ms
our compare lists 11.9 / 13.6 ms 2.3 / 3.3 ms
usual frame 197 / 231 ms 163 / 183 ms
The title's own lists differ between runs with the scene (74 to 129 ms),
so the frame's share of the gain is not exact; the card's time in our
lists is. Pieces fetched after the compare: 7.6 % and 8.1 % of those
compared with the old form, 7.2 % and 7.3 % with the new one (as many
compared in the second pair); no device loss.
|
Tested in-game on Windows 10 Pro (22H2), Intel i5-13600K (6P+8E), RTX 4080 16 GB (driver 621.01, Series X profile), 420 s run in the prison cell scene (ca8829f + #1014 + #1015 + #1016 + #1029 + #1032 stacked, compared against our 600 s 465b94f run with the same base switches VICTORY_ASYNC_SUBMIT=1 VICTORY_QUEUE2=1 VICTORY_COPY_PLAIN=1 VICTORY_INDIRECT_WINDOW=1 VICTORY_JOIN_PARTS=1 VICTORY_BACK_OWN_VIEW=1 VICTORY_INDIRECT_GATHER=1 plus VICTORY_RELAY=2 VICTORY_LATE_WAIT=3 VICTORY_GROUP_SYNC=2 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024).
Zero artifacts beyond main's bottom mosaic strip and clean completion (exit 0). Note this was a stacked run with #1015/#1016/#1029/#1032 active as well. AI-assisted (Gemini 4 Hydrogen). |
|
A second RTX 3060 12 GB, A/B in one build with only Machine: RTX 3060 12 GB, Ryzen 7 5700X (8 cores / 16 threads), 32 GB, Windows 11, Series X profile.
AI-assisted (Claude Code); the runs and observations are mine. |
|
I tested the two card hash shaders on an RX 6800 with RADV 26.2.5 and VKD3D-Proton (build
Both existing hash correctness tests exercised both shaders and passed on RX 6800 and Lavapipe. I directed the harness to the selected DXGI adapter because Proton's Tested-on: RX 6800 and Lavapipe, Fedora Linux 45 In-game follow-up on RX 6800I ran the same executable for 420 s with each hash mode, cloning the same prefix for each run. Both reached 3D work. Among logged long frames with at least 200 draws and a measured compare pass, GPU time divided by compare lists was 2.727 ms/list for serial (19 frames) and 0.221 ms/list for wide (63 frames). The runs reached 3D at different times and had different draw counts (median 4,037 and 1,577). The game-level measurements therefore corroborate cheaper compare lists but do not isolate an FPS gain. The GPU idle counter still accounted for over 90% of the median logged frame in both runs. |
…group a piece Upstream fxceless#1014 (by @martindevbr) gives the card compare (`CARD_COMPARE`) a group of 64 threads to a 64 KiB piece, behind VICTORY_CARD_HASH_WIDE. Our tree already does this, unconditionally, since e3962cc ("use D3D12 COPY queue for relay card-copy fetches and parallelize CARD_COMPARE"): lanes stride the piece 1024 bytes at a time and the group folds the 64 lane hashes in shared memory, dispatched a group a piece (`dispatch_card_compare`, chunked at 65,535 groups). So there is no thread- a-piece form left to switch from, and no switch is added: an off-by-default VICTORY_CARD_HASH_WIDE would bring the slow form back. What is taken from fxceless#1014 is its new WARP test: single bytes changed at offsets 0 to 65,535 of pieces of a copy that does not start on a piece boundary, from a span that does not start at piece 0, each must be flagged in its own piece alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e log lines that show them fxceless#1014 (@martindevbr), fxceless#1068, fxceless#1066 and fxceless#1059 (@UwUCammie) as ported on feature/overhead-ports; fxceless#1043 comes by its own hand port. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
An RTX 5080 data point on Windows. I ran an A/B in one build, changing only Machine: RTX 5080 16 GB (driver 621.24), Ryzen 7 9800X3D, Windows 11, Series X profile. Build: diagnostics build of Settings: Results: means of the frame log's usual-frame lines over the last ~3 minutes of each run, and the profiler's mean frame.
The card's time in our own lists drops about tenfold here, as on the 3060. The whole-frame gain is small and within the scene-to-scene noise of these runs: the world-frame medians go either way between pairs. No device loss and no errors in the four runs. |
|
RTX 5080 Series X comparison at the boat and prison cell. Thanks to Martin Hartfelder for
In the archived moving windows, all 14 displayed gaps above 500 ms clustered between 27.6 and 37.2 seconds of throttle, with no further such gaps through the full 52-second input. The specific host wait remains open. The checks cover these two scenes and a synthetic native parity fixture. Pinned six-run report · Native and WARP test source |
|
Data point from a 6-core CPU with an NVIDIA card (AI-assisted, Claude; run on my machine): RTX 4070 (undervolted, 100 W limit), Ryzen 5 5600 at 3.95 GHz (6 cores), Windows 11, driver 621.01, Series X profile, With the switch (together with three other switches in the same run, so the frame number below is for the package): our send-and-hash lists 26.4 → 4.5 ms and compare lists 12.2 → 3.8 ms per frame on the card meter, i.e. ~38 → ~8 ms, in line with your ~35 → ~10 ms. The frame went 162.5 → 144.9 ms for the whole package; the card's 'all other lists' (the title's) stayed at ~140 ms, so on this machine the gain in our own passes does not fully reach the frame. No device loss, no visible change in the cell-window shot. A run with this switch alone is queued. |
|
AI-assisted testing (Gemini in OpenCode); measured locally on my own machine. RTX 4080 follow-up:
|
Metric (framelog usual frame / cardmeter) |
Prior stack (ca8829f + #1014, MIN_MB=1, CARD_BUFFERS_MB=1024) |
9c184b3 + #1014 (MIN_KB=64, CARD_BUFFERS_MB=1536, CARD_HASH_LEN=1) |
|---|---|---|
| Title buffers on card | ≥1 MiB only | 3,896 buffers (1,210 MB); 0 in PC RAM |
| CPU shader-write compare | 28.8 MB/frame |
0.0 MB/frame |
send-and-hash lists (GPU) |
4.1 ms (7 lists) |
6.9 ms (6 lists) (vs 19.7 ms in run 275 without #1014) |
compare lists (GPU) |
1.5 ms (7 lists) |
1.4 ms (6 lists) |
Title's own lists (all other lists / cardmeter) |
59.8 ms / 60.0 ms |
36.4 ms / 42.0 ms (-39% / -30%) |
Total GPU time (send-and-hash + compare + lists) |
65.4 ms |
44.7 ms (22.4 fps GPU ceiling; card 47% busy, 66.8 ms idle) |
Important caveat (CARD_BUFFERS_MB cap): with VICTORY_CARD_BUFFERS_MIN_KB=64 and the default VICTORY_CARD_BUFFERS_MB=1024, 3,381 small 64 KiB buffers filled the entire 1024 MB cap (1025 MB used) and evicted 17 large ≥1 MiB buffers (151 MB) back to PC RAM (122.6 MB/frame CPU shader-write compare, GPU lists blew up to 129.5 ms). Raising VICTORY_CARD_BUFFERS_MB=1536 fit all 3,896 buffers (1,210 MB) on the card with zero eviction.
…OMPARE_WIDE) Co-Authored-By: Antigravity <noreply@google.com>
…SH_WIDE=1); changed card copies from a list (VICTORY_CARD_CHANGED_LIST); notes about unmapped blocks kept until told (VICTORY_ABSENT_MS=told) - VICTORY_CARD_HASH_WIDE=1: the hash of pull request #1014 is used only when asked, says so in the log, and takes the hash length of VICTORY_CARD_HASH_LEN like the thread-a-piece form. - VICTORY_CARD_CHANGED_LIST=1|alt: a copy in the card's memory is put on a list when its changed offsets go from none to some, and the pass before a submission takes that list instead of walking every copy (about 3,900 with every title buffer on the card). - VICTORY_ABSENT_MS=told (with VICTORY_ABSENT_ONCE): a block found uncommitted is asked about again only after the runtime mapped or committed memory there (XMemVirtualAlloc now tells). - All off by default; none has run in a game yet. The software-adapter tests of both hash forms and the device-free guard test passed in the tree these came from; this tree's diagnostics build finishes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…sh, CHANGED list & VICTORY_ABSENT_ONCE Integrates upstream commits 44bff61..6d20eed cleanly: - Preserves CHANGED / changed_kept() / changed_list() / take_dirty() while retaining lockfree has_dirty/has_sent tracking inside take_dirty() and Shadow::card_changed(). - Keeps fxceless#1014 64-thread card compare hash (VICTORY_CARD_HASH_WIDE=1) and VICTORY_ABSENT_ONCE / VICTORY_ABSENT_MS=told intact. - Populates Card.me in test helper make_test_shadow.
|
RTX 3050 Laptop (4 GB), synthetic D3D12 microbenchmark of the two CARD_COMPARE shaders in main 6d20eed. Both use the project compiler path (D3DCompile, cs_5_1, flags 0), device-local input and UAVs, and identical 64 KiB pieces. Both passed the same readback checks across 128 pieces: no flags on unchanged data, exactly piece 51 flagged after changing one byte, no flags on the next compare after mode 2 updated the stored hash. Median GPU timestamp time in microseconds per compare dispatch (baseline / wide): 1 piece: 230.4 / 7.0; 8 pieces: 296.3 / 7.0; 32 pieces: 783.4 / 14.2; 128 pieces: 814.8 / 48.0. Seven timed rounds per size after one discarded round, alternating pipeline order, eight dispatches per sample with UAV barriers. Buffers were reused and warmed; recording, setup, transfers and CPU fence waits are outside the timestamps. The 64-thread group works on this 32-lane card. These measurements cover the compare kernel only; no frame-time, residency or visual result. AI-assisted. |
|
Correction to my comment above (AI-assisted, Claude): the frame numbers I gave for the package (162.5 -> 144.9 ms) were run-to-run drift; a base-set run today without any of the four switches came out at 143.6 ms. What stands is the card-meter drop of our own send-and-hash/compare lists with |
Conflicts resolved with both sides kept: - descriptor/host.rs: main's constant_view_size (CBV cap, fxceless#1206/fxceless#1260) and made_now records; the stack's tiled-slot bookkeeping (5181f96: record_tiled, forget_tiled, tiled_stale) with made_now stored after the slot is made and kept. - drvwatch.rs: fxceless#1101's query (every driver entry, the Display source from warning up) kept with its test; main's QUERY (fxceless#1255) dropped as the same filter; its Auto HDR note moved into the comment. - host.rs: main's batched hash passes (CARD_SYNC_BATCH) with the stack's census::sent; the view-set line beside main's video memory line. - pipeline/host.rs: the stack's host_blend and main's integer_targets_do_not_blend both stay (main's clears blending when the state is read, the stack's at creation). - texture.rs: Last keeps fxceless#768's motion and main's ahead; the hash turn honours both. - watch.rs: known_view asks main's light-refresh bits first, then the stack's view set; one title_memory_committed doing both (parked/absent blocks back to unclean, and ABSENT_ONCE notes and their hole bits forgotten). - xmem.rs: main's on_commit with fxceless#1185's caller address. - tiles.rs: the stack's kept-by-a-list test and main's resident-view LOD test (fxceless#1210). - emit/mod.rs: the stack's paired-form-first closure and main's WAVE_WIDE=last; its result keeps the stack's (shader, groups) return type. - indirect.rs, resource.rs, lib.rs: main's. - README.md ours; README-upstream.md from main with fxceless#1057's wording. Two main watch tests assumed no view set (fxceless#812 parks placeholder holes until the runtime tells): the ABSENT_ONCE test's silent-mapping expectations depend on view_set(), and the light-refresh hole test runs with VICTORY_VIEW_SET=0; both pass unchanged there. NB: fxceless#1014's 64-thread hash is opt-in now (VICTORY_CARD_HASH_WIDE=1). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Measured results from another CachyOS + RTX 5090 setup: small buffers in the card's memory (CARD_BUFFERS_MIN_KB=64, +33.5 %), the view-tree wineserver (CachyOS/wine-cachyos#50 by ajsem1337, after neonbyte1), the title's pool-empty breakpoint on new games (Marvisak#698), TEXTURE_BACK for the Chapter 1 boat (fxceless/victory-fork#999), the ambient tint that matched the PS5 reference, and frame-rate switches measured on fork main (fxceless/victory-fork#1014, Marvisak#1188, 5d659e0). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
The compare of copies in the card's memory (
CARD_COMPAREinhost.rs) gives each 64 KiB piece one thread, which walks it 16 bytes at a time: 4,096 loads one after the other. A pass takes the time of one piece however few pieces it has, and the card runs next to nothing else meanwhile. These passes run before every submission's lists (hashes after ranges are sent up: 300 to 450 a frame here) and after them (compares: about 100 a frame). The comment onrehash_runsalready notes the per-pass cost; on a card that is the frame's limit it shows.On an RTX 3060 12 GB, first rooms, with the frame-rate switches on, the card was about 85 % busy and the frame log's card meter gave our own lists about 35 ms of each frame (send-and-hash 22–29 ms, compare 12–14 ms).
VICTORY_CARD_REHASH_RUNS=1did not change that here.Change
CARD_COMPARE_WIDE: one group of 64 threads per piece. Thread t hashes the 16-byte steps t, t + 64, t + 128… of the piece (neighbouring threads read neighbouring bytes, so the loads coalesce), and the first thread folds the 64 lane hashes in lane order into the piece's 16-byte hash. Same root signature, same constants, same outputs; only the dispatch changes (card_compare_groups: a group per piece). A copy is under 1 GiB (shadow::card_for), so a pass has at most 16,385 pieces, within one dispatch.It is a different hash from the old one, so a process uses one form for every hash it stores and compares; the choice is made once.
VICTORY_CARD_HASH_WIDE=0keeps the thread-a-piece form.Tests
warp_card_compare_stores_the_hash_it_made_when_toldruns on both forms.warp_card_compare_finds_every_byte_with_skew: a copy that does not start on a piece boundary (skew), a span that does not start at piece 0; single bytes changed at offsets 0 to 65,535 of the pieces; each change is flagged in its own piece and nowhere else, and changing it back flags nothing — both forms.cargo test -p victory-gpu cardpasses; clippy adds no warnings in the changed code.Measured
RTX 3060 12 GB, Ryzen 5 5600GT, 32 GB, Windows 11; first rooms;
VICTORY_TEXTURE_NO_WAIT,VICTORY_INDIRECT_WINDOW,VICTORY_ASYNC_SUBMIT,VICTORY_QUEUE2andVICTORY_COPY_PLAINon; four runs of 330 s (old, new, old, new — the second pair in reverse order); median of the frame log's usual-frame lines after the first third of each run:The title's own lists vary between runs with the scene (74 to 129 ms), so the frame's share of the gain is approximate; the card's time in our lists is not. Pieces fetched after the compare: 7.6 % and 8.1 % of those compared with the old form, 7.2 % and 7.3 % with the new one (the second pair compared as many pieces); captured frames at the same point of the first room look alike; no device loss.