Skip to content

GPU: parallelize CARD_COMPARE (64 threads per 64 KiB piece) - #71

Open
MartinIndra02 wants to merge 1 commit into
fxceless:mainfrom
MartinIndra02:perf/fxceless-parallel-card-compare
Open

MartinIndra02 wants to merge 1 commit into
fxceless:mainfrom
MartinIndra02:perf/fxceless-parallel-card-compare

Conversation

@MartinIndra02

Copy link
Copy Markdown

Summary

Two targeted GPU/relay performance improvements in \�ictory-gpu:

  1. *Dedicated D3D12 \COPY\ queue for \Host::relay_card_back* (\VICTORY_RELAY_COPY_QUEUE=0\ disables it, graceful fallback to the direct queue):

    • Previously,
      elay_card_back\ submitted its \CopyBufferRegion\ readback list onto the main \DIRECT\ graphics queue (\Host::queue) behind all queued in-flight rendering submissions and blocked on \WaitForSingleObject.
    • Because the landed flights have already finished on \Host::queue, their \card_before\ sends (<= plan.order_after) are already visible in VRAM, and any later flight's \card_before\ sends have \s.2 > completed_order\ and are already skipped by \Shadow::card_merge_relay.
    • Running the readback on a dedicated \D3D12_COMMAND_LIST_TYPE_COPY\ queue executes the PCIe DMA transfer in parallel with graphics work without waiting behind queued submissions.
  2. Parallelize \CARD_COMPARE\ (one 64-thread group per 64 KiB piece):

    • Previously, \CARD_COMPARE\ assigned 1 thread per 64 KiB piece, executing 4,096 serial 16-byte loads per thread with uncoalesced strided reads across pieces.
    • Each 64 KiB piece is now hashed by a 64-thread group (\Dispatch(pieces, 1, 1), chunked at 65,535 groups in \dispatch_card_compare), with 64 coalesced 1024-byte strided iterations per lane, lane-salted initial state, and a 6-step \groupshared\ mixing tree reduction.

RTX 3080 A/B Measurement (Windows 11, 10 GB)

Same runtime switches (\VICTORY_RELAY=2, \VICTORY_CARD_BUFFERS_MIN_MB=1, \VICTORY_CARD_BUFFERS_MB=2048, \VICTORY_CARD_REHASH_RUNS=1, \VICTORY_WIDE_BACK=1, \VICTORY_WIDE_MERGE=1, \VICTORY_LATE_WAIT_LISTS=256, \VICTORY_SHADER_LOOP_LIMIT=256):

Metric \4e17478\ (DIRECT queue) This PR (COPY queue + parallel \CARD_COMPARE)
Frame rate / time \4.1–4.6 fps\ (\216–242 ms) \5.4 fps\ (\186.0–186.5 ms)
Relay card-copy fetch waits \121.4 ms/frame\ (63.6 MB) \6.8–7.0 ms/frame\ (56.2 MB) (17.5x faster)
Total relay landing (\copying back) \150.5–154.5 ms/frame\ *\35.5–38.7 ms/frame* (4x faster)
\on the GPU\ \111.8 ms/frame\ *\80.5 ms/frame*
Submitting thread wait (\ itle memory read) \115.4 ms/frame\ *\66.0–86.1 ms/frame*
GPU idle (\
othing queued) \71.5 ms/frame\ (70% busy) \47.1 ms/frame\ (76% busy)

Verification

  • \cargo test -p victory-gpu --lib -- --test-threads=1: 110 passed, 0 failed, 1 ignored (expanded \warp_card_compare_stores_the_hash_it_made_when_told\ to verify lane 0, lane 63, piece tail, and cross-lane 16-byte swap detection on WARP).
  • \cargo clippy -p victory-gpu --all-targets -- -D warnings\ (default and --features diagnostics): 0 warnings.
  • \cargo xtask policy: 169 files ok.

AI-assisted contribution (code and tests authored/verified with an AI coding assistant).

@dkdknight

Copy link
Copy Markdown

Tested on an RTX 5080, merged with #81, #77 and #38: 3.7 → 4.9 fps at the same spot, GPU time halved. One correctness concern about the copy queue below.

Setup: NVIDIA GeForce RTX 5080 16 GB, driver 621.14, i9-13900KF, 64 GB, Windows 11 26200, release build, Series X profile. VICTORY_DISPLAY_MODE=1920x1080 VICTORY_RELAY=2 VICTORY_LATE_WAIT=3 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024. Both runs loaded the same save, and the character stood still at the same spot. Medians over 20 frame lines (~2 min) once texture uploads had settled.

4e17478 4e17478 + #71 + #81 + #77 + #38
frame 269.9 ms (3.7 fps) 202.1 ms (4.9 fps)
on the GPU 145.7 ms 70.0 ms
copying back 187.0 ms 65.5 ms
relay: waiting for fetches 140.0 ms 9.4 ms
preparing 109.5 ms 115.7 ms
card busy (card's clock) 72 % 79 %
draws / dropped without a host pipeline 4,989 / 348 4,980 / 344
  • The four merged without conflicts. I did not measure them one by one, so this run does not split the gain between the copy queue and the parallel CARD_COMPARE.
  • An earlier A/B of mine on 1684989, without the parallel compare, kept the fetches in queue order and removed their wait (copying back 189 → 50 ms). The frame did not get faster (269 → 286 ms), because the card became the limit (73 → 91 % busy). So on this card the frame gain above most likely comes from the parallel compare.

Concern: the copy queue can read a piece a later flight is still writing

  • The fetch on the copy queue runs beside the flights sent after the ones being landed. order_after keeps later sends of title bytes out of the merge. It does not cover later flights' shader writes: the fetch can read a piece that a running flight has only partly written.
  • card_merge_relay takes those bytes as shader writes, and they go into title memory and into the CPU side.
  • That flight's compare then checks the piece against the hash the landed flight's compare stored (mode 2). If the flight leaves the piece's bytes as they were before, its compare does not flag the piece and nothing fetches it again. Two examples: a buffer cleared and refilled with the same values, or a counter incremented then decremented. Title memory then keeps the half-written bytes until the piece changes again.
  • On the direct queue a fetch only ever sees whole flights.
  • I have not seen an artefact I could attribute to this. It comes from reading the code.

An alternative that keeps the queue order: the flight copies the pieces its compare flagged into a PC-memory ring itself, behind the compare in its own list (a one-group scan that hands out slots, then a 64-thread group per piece). The landing thread then reads them with no fetch at all, and falls back to the fetch when the ring is full. On 1684989 this was the 189 → 50 ms above, at the cost of about 15 ms more GPU time. With the compare now cheap, that cost may matter less. I can open it as a separate PR on top of this one.

AI use: Claude Code, Claude Opus 5.5. It merged and built the branches and ran the in-game measurements on the machine above (the person at the machine played). It read this PR's code and wrote this comment.

@ryotdev

ryotdev commented Nov 24, 2026

Copy link
Copy Markdown

I reproduced a missed GPU buffer change in the new hash reduction on e3962cc. In a 64 KiB piece, flip the sign bit of the first 32-bit component at byte offsets 64,512 and 65,024. Each edit alone is detected. Together they cancel when lanes 0 and 32 meet at the first XOR. These are each lane's last loads, so both sign changes produce the same XOR difference in the partial hashes. The dirty flag stays zero and the runtime can skip copying changed data back.

I added this case to the existing D3D12 WARP test. On Windows, the PR returned [0, 0, 0] instead of [1, 0, 0]. Mixing the right partial hash with fmix32 before combining the pair made the test pass, including the existing lane, tail and block-swap checks. A separate CPU comparison kept the old serial hash as a control: it detected the paired edit. The asset-policy check passed on 169 files. I haven't measured the frame-time cost of the fix or tested the relay copy queue.

The 15-line fix and regression test are available to cherry-pick: ryotdev@49e4a90 . AI-assisted. Synthetic data only.

@MartinIndra02

Copy link
Copy Markdown
Author

Thanks @ryotdev and @dkdknight for the thorough reviews and RTX 5080 A/B!

  • Fixed the paired sign-bit cancellation (@ryotdev): Mixed the right-hand partial hash \�\ with \ mix32\ (distinct per-component multipliers) + \�.zwxy\ component swizzle before combining with \�\ in the \CARD_COMPARE\ tree reduction, and added the exact paired sign-bit flip regression test at offsets \64,512\ and \65,024\ to \warp_card_compare_stores_the_hash_it_made_when_told. Re-verified on WARP, \clippy\ (default + --features diagnostics), and \cargo xtask policy.
  • On the \COPY\ queue ordering note (@dkdknight): Great catch — you're right that \order_after\ protects against concurrent \card_before\ sends, not a later flight that clears and refills a piece back to its previous value mid-copy. \VICTORY_RELAY_COPY_QUEUE=0\ already opts back into the direct queue, and if @fxceless prefers strict queue-order semantics by default (especially if your inline-ring PR lands on top of the parallel \CARD_COMPARE), happy to flip \VICTORY_RELAY_COPY_QUEUE\ to opt-in (=1) or split the PR — just say the word!

@ryotdev

ryotdev commented Nov 24, 2026 •

Copy link
Copy Markdown

Retested the paired-edit fix on c57c9b0. The PR’s Windows WARP regression passed. An independent CPU model of the revised reduction detected all 24,192 paired sign changes in the synthetic fixture set. The earlier reduction missed 388 of those cases.

I also ran the updated shader on an RTX 5070 (driver 610.88, Windows, Ryzen 7 7800X3D). Both main 4e17478 and the PR reached the same restored 3D checkpoint. I used the direct queue, late-wait stage 3, wide-back, 1 MiB minimum / 1024 MiB budget and rehash-run joining on both. Relay was off, so this tests the hash change in this profile.

Over the interval from 300 to 600 frames after the first 500-draw frame, the subset reporting 4,000–4,999 draws/frame and zero pipelines compiling had median window-average frame times of 240.6 ms on main (7 windows) and 236.4 ms on the PR (9 windows). One run each; cameras and dropped-draw counts differed. That’s enough to confirm the revised shader runs through the scene here. I couldn’t establish a frame-rate improvement in this queue mode.

RTX 5070, compare shader isolated at 1cd8f73. I ported the shader and dispatch geometry to a local f85101b diagnostics build behind a switch. I kept the executable, warm cache, Series X checkpoint and queue configuration identical. The native Windows WARP regression passed for paired edits, skew and compare/store modes.

The completed pair gave 6.37 FPS serial and 6.76 FPS parallel over 280 host-present intervals in the first room. Median frame time went from 163.3 to 151.5 ms and p95 from 188.6 to 173.9 ms. The submitter's reported GPU wait fell from 58.8 to 49.4 ms/frame. Matching by draw and dispatch count covered 62% of frames and gave 6.45 vs 6.67 FPS. Three pairs of captures showed the same camera and room.

One earlier parallel attempt ended with DXGI_ERROR_DEVICE_HUNG before the measurement window. A parallel retry with DRED completed at 6.07 FPS. The subsequent run without DRED produced the 6.76 FPS result above. The failing command remains unidentified. This tests the compare change alone. AI-assisted.

@SkillIssueXO

Copy link
Copy Markdown

I measured actual GPU copy time separately from wall time on the stock DIRECT queue. RTX 5070 Ti (621.24), Series X, 2119b0e with VICTORY_RELAY=2 and diagnostic timing only. Across 61 consecutive gameplay frames (f1860–1920, median 5,200 draws), 428 fetch batches carried a median 36.17 MiB per frame.

  • GPU timestamps around CopyBufferRegion totalled 0.81 ms/frame median (1.00 ms p95). The queries were resolved behind the copies and read after the existing fetch fence.
  • CPU wall time from submitting those fetches until the fence returned was 184.24 ms/frame median (234.09 ms p95), measured as the union of the spans inside each frame.
  • The presenting thread spent a median 119.57 ms/frame in relay waits. A median 96.58 ms/frame of relay wait overlapped the fetch worker’s readback spans.

This isolates the queue/fence cost from the GPU copy execution cost on this card. It gives a baseline for testing a queue-ordered readback change. Counts and timings only. AI-assisted instrumentation and analysis (Codex).

1984742628 added a commit to 1984742628/VIctory that referenced this pull request Nov 24, 2026
justlovett0 added a commit to justlovett0/victory-gta6 that referenced this pull request Nov 24, 2026
…OMPARE_PARALLEL

VICTORY_PERMLANE=0 refuses v_permlane16/x16 as before (default on).
VICTORY_CARD_COMPARE_PARALLEL=0 uses the original one-thread-per-piece
CARD_COMPARE_SERIAL (default on = parallel group reduction). The COPY queue
already has VICTORY_RELAY_COPY_QUEUE. Verified intertwined: geometry/models/
lighting load properly, 230-240ms; fetch wait 86->6ms, copy-back 186->34ms,
GPU 172->140ms; refusals 21->9 (permlane hash a929109552ce1e84 now translates).
@ericomeehan

Copy link
Copy Markdown

dkdknight's RTX 5080 A/B and the quick fix for ryotdev's paired-edit case make the hashing part look solid.

A heads-up on overlap: #253 makes the same group-per-piece change to the card-copy compare passes (a group-per-piece CARD_COMPARE shader and the loop in card_before in host.rs, with tests in indirect.rs), measured with an ABBA A/B. The two don't merge textually (host.rs and indirect.rs), so it may be worth agreeing with TG0000 which PR carries that part. Separately, since dkdknight's copy-queue case can leave half-written bytes in title memory, taking up your own offer to make VICTORY_RELAY_COPY_QUEUE opt-in (=1) and splitting it into its own PR would let testers try the speed-up without that risk by default.

Written with an AI assistant (Claude).

@Pin0d1

Pin0d1 commented Nov 25, 2026

Copy link
Copy Markdown

I reproduced a stale CPU word on c57c9b0 with ordered submissions. DIRECT produced 17, a later DIRECT write of 29 completed, and the delayed COPY read returned 29 for the first submission. I then restored 17 and ran the GPU comparison again. Its change flag was zero and the CPU word stayed at 29. This happened twice each on WARP and an RTX 2060 SUPER. The fixture waits for the later write to complete before starting the COPY read.

Capturing the changed range on its producing DIRECT queue gave 17 in the earlier comparison. The candidate keeps COPY asynchronous by reading that capture and has a bounded fallback. The pr71 replay case runs the failing fixture directly on this PR head. Probe and transcripts · Snapshot patch and prerequisites

Prepared with the help of Codex 6.2 Astra Max.

@larelgit

Copy link
Copy Markdown

In-game artefacts that follow the copy queue, and numbers on the current main (310c6eb with its new defaults), for the queue question above.

Setup. RTX 5080 16 GB (driver 610.88), Ryzen 7 7800X3D, 32 GB, Windows 11 Pro 22631, diag build, rustc 1.98.1. This PR's head (c57c9b0) merged onto 310c6eb without conflicts; no switches other than the ones in the table, so relay stage 2, wide copy-back and the card buffers are on as main now has them. Each run loads the autosaved checkpoint at the cell window and nobody touches the pad. Frame time is the spacing of the recording per frame lines over 260-355 s of the run (median of 16-17 intervals), the other columns are means of the frame, card and relay lines over the same window. The scene is judged from screenshots at 300 and 350 s. One run at a time, alternating; the first run of the new binary (translating its shaders) is listed apart.

Build Runs ms/frame On the GPU Copying back Relay: waiting for fetches Window mesh Shirt print
310c6eb 2 165, 166 90-91 ms 126-128 ms 100-105 ms there, 2 of 2 there, 2 of 2
+ this PR 3 152 (first run), 141, 144 67-76 ms 39-48 ms 10-11 ms (19 in the first run) missing in 1 missing in 1
+ this PR, VICTORY_RELAY_COPY_QUEUE=0 2 159, 151 74-79 ms 107-114 ms 78-86 ms there, 2 of 2 there, 2 of 2

What went missing, with the copy queue on: in the first run the print on the back of the character's shirt (the shirt plain dark red at 300 and 350 s); in the second the chain-link mesh in the window (the window showed bare glass at 300 and 350 s); the third was intact. On 310c6eb without this PR the mesh and the print were there in all 13 runs I have of this scene today (this series and two earlier ones, the earlier ones with a binary of mine that copies out of title memory through the kernel or with plain loads, see #154), and in all of this PR's runs with the copy queue off. The cell walls are lost now and then in every configuration (main's own intermittent defect), so they are left out of the table.

That fits @dkdknight's reading and @Pin0d1's fixture: a fetch beside later flights can land bytes a later flight wrote, and if those bytes later go back to what the compare stored, nothing fetches the piece again. I have not traced which piece it was; both things that went missing are thin alpha-tested surfaces, and each stayed missing from 300 to 350 s, so whatever went wrong was not put right by later frames.

So on this machine the parallel compare alone is worth about 10 ms a frame (151-159 against 165-166) with nothing lost, and the queue about 12 ms more (141-144). If the queue goes behind a switch (VICTORY_RELAY_COPY_QUEUE=1) as @ericomeehan suggested, or is replaced by a capture in queue order (@dkdknight's ring, @Pin0d1's snapshot), I can run the same series on it.

(Runs, measurements and this note by Claude Code with Claude Opus 5.5 on the hardware above, at the account owner's request.)

@Pin0d1

Pin0d1 commented Nov 25, 2026

Copy link
Copy Markdown

@larelgit, thanks for tracking the window mesh and shirt print separately. I rebased the DIRECT-queue snapshot onto your 310c6eb + c57c9b0 build (Pin0d1/victory-fork@ef4f510). With COPY enabled, the forced-order test read back 29 on #71 and 17 with the snapshot. The producer wrote 17. This repeated twice each on WARP and an RTX 2060 SUPER.

Could you alternate the original #71 build and the snapshot build at the same checkpoint, with COPY enabled for both? Three runs of each, if practical, would let us compare how often the mesh and print are present at 300 and 350 seconds. The per-run frame time and relay fetch wait would also show what the snapshot costs. Please mark the shader-compilation run separately as before.

Prepared with the help of Codex 6.2 Astra Max.

@larelgit

Copy link
Copy Markdown

@Pin0d1, yes, I'll run that alternation next: #71 as it is and your ef4f510, COPY on for both, three runs each plus the first run of each binary listed apart.

First, a correction to my comment above: the screenshots there are weaker evidence against the copy queue than I made them.

  • The shirt print. It went missing in the first run of this PR's binary, while that binary was translating its shaders. Every first run I have of a new binary in this scene draws differently: the hair is shaded bright in all three, and in victory-gpu: 64-thread CARD_COMPARE with per-plan VRAM staging and COPY queue readback #688's first run the print is faint as well. Later runs of the same binaries are normal. So the missing print most likely came from the first run, not from the copy queue.
  • The window mesh. It is not a clean sign either. One later run of the base (310c6eb, same binary and settings as that row) lost the mesh at 300 and 350 s too.

Leaving first runs out, the mesh was missing in 1 of 14 runs without this PR (on 310c6eb, #154's plain copies on or off) and in 1 of 2 with this PR's copy queue on, and the print in none. That is one event on each side, so the pictures neither show nor rule out the fetch hazard. What stands is the reading of relay_card_back (the copy-queue fetch runs beside later direct-queue flights) and the frame times as given. With odds like these, three runs a side will say more through frame time and fetch wait than through the pictures. Your forced-order readback (29 against the producer's 17) is the stronger evidence.

One more detail on that row: the "310c6eb" binary is 310c6eb with #154's two commits and VICTORY_USER_COPIES=0, which copies through the kernel as main does.

(Claude Code with Claude Opus 5.5, at the account owner's request.)

@larelgit

Copy link
Copy Markdown

@Pin0d1, the alternation you asked for. #71 as it is (c57c9b0 merged on 310c6eb) against your ef4f510, COPY on in both, same machine, checkpoint and method as my comment above. The first run of your binary, which translated its shaders, is listed apart; #71's binary was already warm.

Build Runs ms/frame On the GPU Copying back Relay: waiting for fetches Card busy Window mesh Shirt print
#71 3 142, 140, 147 65-71 ms 40-45 ms 10-15 ms 80-81% missing in 1 (the third) there 3 of 3
ef4f510 3 200, 197, 198 (first run 200) 120-123 ms 30 ms 3-4 ms 60-61% there 3 of 3 there 3 of 3

So the snapshot takes the fetch wait from about 11 ms to 4, but the frame goes from about 143 to about 198 ms, almost all of it on the card (on the GPU about +55 ms) and in the submitting thread (the card idle behind it 50-52 ms against 16-18).

The likely reason is in the allocation, not the copies. Each flown plan with something to compare gets a new card buffer for its snapshot (self.uav_buffer(snapshot_bytes), a committed resource), and it goes with the plan when the plan is done. The memory line's "made so far" at the end of each run:

Build Card buffers made in the run Their bytes
#71 28,785-34,206 3.0-3.3 GB
ef4f510 8,093-8,745 82-90 GB

Making and dropping about 85 GB of committed buffers in a six-minute run likely means the driver zeroing and paging in fresh memory all the time, besides the creation calls themselves. A pool (buffers kept by size and handed back when the plan is done, within your 64 MB limit), or a ring like #688's per-plan staging, should keep the order guarantee without that cost. #688 also snapshots only the pieces the compare found different, written by the compare itself in flight order.

On the pictures: #71's copy queue has now lost the window mesh in 2 of its 5 warm runs here (one of the two in my first series, one of the three in this one; at 300 and 350 s both times), against 1 of 14 runs without it. The snapshot lost neither in its 3 warm runs, nor in its first. That leans the way of your forced-order readback, though it is still few runs. In every run the cell wall left of the window comes and goes as on main.

(Runs, measurements and this note by Claude Code with Claude Opus 5.5 on an RTX 5080 / Ryzen 7 7800X3D, at the account owner's request.)

@VibeClauding

Copy link
Copy Markdown

Numbers for the compare part alone, without the copy queue, since the artefact question here is about the queue. RTX 3070 8 GB (driver 610.88), Ryzen 7 5700X3D, 16 GB, Windows 11, Series S.

I wrote the same idea separately before seeing this PR: one 64-thread group per piece, each thread hashing a sixty-fourth, with the first thread folding the 64 parts in order. It sits behind a switch, VICTORY_CARD_HASH_WIDE=1, with no other change (VibeClauding/victory-fork@79d22ec, on 9376fd6). The WARP compare test runs both forms, plus a change in the first and the last byte of a piece. Use it for an A/B of the shader on its own if that helps; otherwise yours is the one to keep.

run compare fps ms/frame submitting thread waiting for the card card busy
54 one thread a piece 7.3–7.9 126–138 ~29 ms ~86%
67 one thread a piece, VICTORY_CARD_REHASH_RUNS=1 7.8–7.9 126–129 ~31 ms ~80%
69 group a piece 8.0–8.7 115–124 ~12 ms ~74%
70 group a piece 8.1–9.0 112–123
71 group a piece 8.3–8.9 112–120
72 group a piece, + rehash runs 8.2–8.8 113–122

So on this card the parallel compare alone is worth about +10%. Most of it is the ~270 hash passes a frame after ranges are sent up, each with only a few pieces. Joining them (REHASH_RUNS) barely changes their count here (279 → 267), because the ranges rarely touch.

Picture, at the window. I can't see the mesh well enough at 960×540 to count it the way @larelgit does. What I do see in some runs is the yard washed out in haze instead of the inmates. I measure it as the mean brightness of the window's lower part in frame 2400:

  • One thread a piece: hazy in 3 of 21 runs (28, 38 and 53; run 53 is the same stack as 54).
  • Group a piece: hazy in 2 of 4 (69 and 72).

It happens without the change too, and four runs prove nothing. But it's the same window, so I'm noting it in case it's the race you're chasing rather than the queue.

AI-assisted (Claude Code); runs on my machine with my own copy, counts and timings only.

@Pin0d1

Pin0d1 commented Nov 25, 2026 •

Copy link
Copy Markdown

@larelgit, thanks for alternating the builds. Your 197–200 ms/frame result on ef4f510 made me revisit the per-flight allocation. I kept the DIRECT copies and the 64 MiB cap and changed when their buffers can be reused. Pooled build on the same base.

After warm-up, 48 flights cycling through 1, 2, 4 and 8 MiB went from 48 new device-local buffers (180 MiB) to zero. Both builds still copied 180 MiB and returned the expected word in every flight. This repeated three times each on WARP and an RTX 2060 SUPER. Test patches and transcripts.

If you have time for another pair at the same warm checkpoint, could you alternate ef4f510 and 981eaae with COPY on and report ms/frame, GPU time and cumulative card-buffer bytes? That would show how much of the RTX 5080 regression comes from allocation.

Prepared with the help of Codex 6.2 Astra Max.

@MartinIndra02
MartinIndra02 force-pushed the perf/fxceless-parallel-card-compare branch from c57c9b0 to 1cd8f73 Compare November 25, 2026 10:42
@MartinIndra02 MartinIndra02 changed the title GPU: use D3D12 COPY queue for relay card-copy fetches and parallelize CARD_COMPARE GPU: parallelize CARD_COMPARE (64 threads per 64 KiB piece) Nov 25, 2026
@MartinIndra02

Copy link
Copy Markdown
Author

Rebased onto \main\ (\ 85101b) and narrowed this PR to only the parallel 64-thread \CARD_COMPARE\ shader + \ mix32\ asymmetric reduction + WARP tests (dropping the copy-queue portion now that \ 85101b\ ships \VICTORY_QUEUE2=1).

Verified on \ 85101b:

  • \warp_card_compare_stores_the_hash_it_made_when_told\ (including lane 0/63, tail, block swap, and @ryotdev's paired sign-bit flip at \64,512/\65,024): passed
  • \warp_card_fetch_copies_flagged_pieces_to_their_slots: passed (updated dispatch from \1\ to \pieces)
  • \cargo xtask policy: ok
    (The single unrelated failure in \warp_budget_saturates_without_wraparound_and_preserves_draw_fields\ is pre-existing on \ 85101b.)

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