GPU: the compare of card copies hashes each 64 KiB piece with a group of threads (a pass 0.2-0.8 ms -> 0.002-0.11 ms on an RTX 5090) #990

Closed
PiloteCode wants to merge 5 commits from upstream-pr/992 into main
PiloteCode commented 2026-11-25 15:20:02 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by PiloteCode on 2026-11-25T15:20:02Z.


Based on 0b0074e0. Three commits:

  • Two clippy fixes for main, without which cargo clippy --workspace --all-targets -- -D warnings fails on 0b0074e0, with or without --all-features:

    • the first is #854's and #855's first commit, applied here unchanged: unnecessary_sort_by in draw.rs, the bench's depth_written never read, placed_filler_twins unused without diagnostics;
    • the second is manual_is_multiple_of in shadow.rs, which came with main's later sessions.

    Our other open PRs carry the same two changes, so they merge in any order.

  • The change, in host.rs (CARD_COMPARE) and the tests in indirect.rs.

What was wrong

The hash and compare passes over host copies in the card's memory (CARD_COMPARE: the pieces sent up before each submission, and the declared ranges after it) gave each 64 KiB piece one thread. That thread walked the piece's 4,096 steps of 16 bytes one after the other, so a pass took as long as one such walk, however few pieces it had.

The gameplay runs some 270-350 hash passes and about 100 compares a frame, around its ~34 submissions, each behind barriers (1,240-1,380 barriers a frame in timing runs). The timing run's command times never included these passes, so this card time did not show anywhere.

What changes

A group of 256 threads takes a piece:

  • each thread hashes the steps 4 KiB apart from its own: 17 rounds, since a piece widened by 16 bytes at both ends spans 4,097 steps;
  • the group folds the 256 hashes in a fixed order;
  • a pass dispatches one group per piece.

Both forms flag a piece whose widened bytes changed. VICTORY_CARD_WIDE_HASH=0 keeps the one-thread form; every pass of a run uses the same form.

Measured

RTX 5090, a bench of the shader as it was against this form:

Pass One thread a piece A group a piece
a pass over 2 pieces 0.219 ms 0.002 ms
a compare of 92 pieces 0.564 ms 0.003 ms
580 hash passes in one list 0.44 ms 0.02 ms
a whole 174 MB copy 0.79 ms 0.11 ms
16 compares 0.79 ms 0.02 ms

In the bench on the card, one changed byte flagged its own piece only. The frame time was not measured with this change alone.

Switches

  • VICTORY_CARD_WIDE_HASH=0: one thread a piece, as before.

Tested

The branch was checked as it is, on 0b0074e0, on the software adapter (the card was taken by other work):

  • cargo test -p victory-gpu --features diagnostics -- --test-threads=1 with VICTORY_D3D12_WARP=1: 185 passed, 3 failed, 6 ignored. None of the three is near this change:

    • depth_bounds_pipeline_loads_and_filters_draws: WARP does not reject the pixels outside the depth bounds;
    • warp_budget_saturates_without_wraparound_and_preserves_draw_fields: main's test that #849 and #970 fix, in which the two groups may charge the budget in either order. Run alone three times, it failed twice;
    • profile::tests::the_sampler_finds_threads_and_writes_its_files: run alone three times, it passed each time.

    Every card-compare test passed, among them the two that run both forms.

  • cargo clippy --workspace --all-targets --locked -- -D warnings, and the same with --all-features: clean.

  • cargo build --release -p victory, cargo build --profile diag -p victory --features diagnostics and cargo xtask policy pass.

New and changed tests:

  • Both forms flag the same pieces for the same bytes, and exactly the pieces whose bytes (widened to 16 at both ends) changed. The copy has 16 pieces and starts 40 bytes into its first piece. It is hashed, then goes through 48 rounds of a few random byte changes, some at the pieces' edges, each compared and stored by both forms. This test runs on the host device, here the software adapter.
  • A copy that starts 40 bytes into its first piece: a byte in the last widened step of a piece (also the next piece's first step) flags both pieces, in both forms; a byte in a piece's middle flags that piece alone; two equal rows swapped flag the piece.
  • The existing test of the compare's modes runs for both forms.

Overlaps with open pull requests

  • #688 also gives each piece a group (64 threads), and adds staging in the card's memory, readback on a copy queue and a parallel relay merge.
  • #889 also hashes a piece with a 64-thread group, and changes the hash's fold, among other changes.

This PR changes only the hash and compare pass: 256 threads a piece, the old form kept behind a switch, and no change to what is fetched or how.

Not tested

  • A frame-time measurement of this change on its own.
  • GPUs other than the RTX 5090 (bench) and WARP (tests); AMD, Intel, Linux/Proton.
<!-- greyfinch-sync:fxceless/victory-fork:issue:5494150124 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/992). Originally posted by [PiloteCode](https://github.com/PiloteCode) on 2026-11-25T15:20:02Z. --- Based on `0b0074e0`. Three commits: - Two clippy fixes for `main`, without which `cargo clippy --workspace --all-targets -- -D warnings` fails on `0b0074e0`, with or without `--all-features`: - the first is #854's and #855's first commit, applied here unchanged: `unnecessary_sort_by` in `draw.rs`, the bench's `depth_written` never read, `placed_filler_twins` unused without diagnostics; - the second is `manual_is_multiple_of` in `shadow.rs`, which came with `main`'s later sessions. Our other open PRs carry the same two changes, so they merge in any order. - The change, in `host.rs` (`CARD_COMPARE`) and the tests in `indirect.rs`. ## What was wrong The hash and compare passes over host copies in the card's memory (`CARD_COMPARE`: the pieces sent up before each submission, and the declared ranges after it) gave each 64 KiB piece one thread. That thread walked the piece's 4,096 steps of 16 bytes one after the other, so a pass took as long as one such walk, however few pieces it had. The gameplay runs some 270-350 hash passes and about 100 compares a frame, around its ~34 submissions, each behind barriers (1,240-1,380 barriers a frame in timing runs). The timing run's command times never included these passes, so this card time did not show anywhere. ## What changes A group of 256 threads takes a piece: - each thread hashes the steps 4 KiB apart from its own: 17 rounds, since a piece widened by 16 bytes at both ends spans 4,097 steps; - the group folds the 256 hashes in a fixed order; - a pass dispatches one group per piece. Both forms flag a piece whose widened bytes changed. `VICTORY_CARD_WIDE_HASH=0` keeps the one-thread form; every pass of a run uses the same form. ## Measured RTX 5090, a bench of the shader as it was against this form: | Pass | One thread a piece | A group a piece | |---|---|---| | a pass over 2 pieces | 0.219 ms | 0.002 ms | | a compare of 92 pieces | 0.564 ms | 0.003 ms | | 580 hash passes in one list | 0.44 ms | 0.02 ms | | a whole 174 MB copy | 0.79 ms | 0.11 ms | | 16 compares | 0.79 ms | 0.02 ms | In the bench on the card, one changed byte flagged its own piece only. The frame time was not measured with this change alone. ## Switches - `VICTORY_CARD_WIDE_HASH=0`: one thread a piece, as before. ## Tested The branch was checked as it is, on `0b0074e0`, on the software adapter (the card was taken by other work): - `cargo test -p victory-gpu --features diagnostics -- --test-threads=1` with `VICTORY_D3D12_WARP=1`: 185 passed, 3 failed, 6 ignored. None of the three is near this change: - `depth_bounds_pipeline_loads_and_filters_draws`: WARP does not reject the pixels outside the depth bounds; - `warp_budget_saturates_without_wraparound_and_preserves_draw_fields`: `main`'s test that #849 and #970 fix, in which the two groups may charge the budget in either order. Run alone three times, it failed twice; - `profile::tests::the_sampler_finds_threads_and_writes_its_files`: run alone three times, it passed each time. Every card-compare test passed, among them the two that run both forms. - `cargo clippy --workspace --all-targets --locked -- -D warnings`, and the same with `--all-features`: clean. - `cargo build --release -p victory`, `cargo build --profile diag -p victory --features diagnostics` and `cargo xtask policy` pass. New and changed tests: - Both forms flag the same pieces for the same bytes, and exactly the pieces whose bytes (widened to 16 at both ends) changed. The copy has 16 pieces and starts 40 bytes into its first piece. It is hashed, then goes through 48 rounds of a few random byte changes, some at the pieces' edges, each compared and stored by both forms. This test runs on the host device, here the software adapter. - A copy that starts 40 bytes into its first piece: a byte in the last widened step of a piece (also the next piece's first step) flags both pieces, in both forms; a byte in a piece's middle flags that piece alone; two equal rows swapped flag the piece. - The existing test of the compare's modes runs for both forms. ## Overlaps with open pull requests - #688 also gives each piece a group (64 threads), and adds staging in the card's memory, readback on a copy queue and a parallel relay merge. - #889 also hashes a piece with a 64-thread group, and changes the hash's fold, among other changes. This PR changes only the hash and compare pass: 256 threads a piece, the old form kept behind a switch, and no change to what is fetched or how. ## Not tested - A frame-time measurement of this change on its own. - GPUs other than the RTX 5090 (bench) and WARP (tests); AMD, Intel, Linux/Proton.
Flyander commented 2026-11-25 20:12:05 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Flyander on 2026-11-25T20:12:05Z.

Review: COMMENTED


I compared the exact CARD_COMPARE shader from c2d576c against main (085ee7c) and the parallel variants in #1014 (5557224), #997 (8f8b117), and #253 (3b0521a), all in one D3D12 executable. This reproduces the small-pass advantage of the 256-thread shader on a second Blackwell GPU (RTX 5070 Ti, driver 621.40, Windows 11 build 26300).

GPU time in µs per dispatch, mode 0 (store hashes). Each cell is the median of three run medians, with 30 timed dispatches per variant per run after four warmups. Execution order rotates between variants.

64 KiB pieces Main #1014 This PR #997 #253
1 211.65 10.00 2.02 9.84 9.50
4 238.94 10.24 2.11 9.98 9.70
16 361.39 10.43 2.24 10.11 9.81
64 554.62 10.66 3.01 10.37 10.08
256 558.77 11.33 6.75 10.78 10.34
1,024 763.46 81.38 71.09 67.79 68.21

Mode 2 (compare and store) showed the same pattern. At 16 pieces, main took 361.57 µs, #1014 took 10.53 µs, and this PR took 2.34 µs. At 1,024 pieces, the run ranges for the faster variants overlap.

Method: compiled all five shaders with D3DCompile (cs_5_1), used the same GPU-local 64 MiB synthetic input and scratch buffers, and timestamped immediately before and after each dispatch on a direct queue. This measures the dispatch itself. In-game frame time, readback, and copy-back were outside the experiment.

<!-- greyfinch-sync:fxceless/victory-fork:review:6064281191 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/992#pullrequestreview-6064281191). Originally posted by [Flyander](https://github.com/Flyander) on 2026-11-25T20:12:05Z. **Review:** COMMENTED --- I compared the exact `CARD_COMPARE` shader from c2d576c against main (085ee7c) and the parallel variants in #1014 (5557224), #997 (8f8b117), and #253 (3b0521a), all in one D3D12 executable. This reproduces the small-pass advantage of the 256-thread shader on a second Blackwell GPU (RTX 5070 Ti, driver 621.40, Windows 11 build 26300). GPU time in µs per dispatch, mode 0 (store hashes). Each cell is the median of three run medians, with 30 timed dispatches per variant per run after four warmups. Execution order rotates between variants. | 64 KiB pieces | Main | #1014 | This PR | #997 | #253 | |--:|--:|--:|--:|--:|--:| | 1 | 211.65 | 10.00 | **2.02** | 9.84 | 9.50 | | 4 | 238.94 | 10.24 | **2.11** | 9.98 | 9.70 | | 16 | 361.39 | 10.43 | **2.24** | 10.11 | 9.81 | | 64 | 554.62 | 10.66 | **3.01** | 10.37 | 10.08 | | 256 | 558.77 | 11.33 | **6.75** | 10.78 | 10.34 | | 1,024 | 763.46 | 81.38 | 71.09 | 67.79 | 68.21 | Mode 2 (compare and store) showed the same pattern. At 16 pieces, main took 361.57 µs, #1014 took 10.53 µs, and this PR took 2.34 µs. At 1,024 pieces, the run ranges for the faster variants overlap. Method: compiled all five shaders with `D3DCompile` (`cs_5_1`), used the same GPU-local 64 MiB synthetic input and scratch buffers, and timestamped immediately before and after each dispatch on a direct queue. This measures the dispatch itself. In-game frame time, readback, and copy-back were outside the experiment.
Flyander commented 2026-11-25 20:26:37 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Flyander on 2026-11-25T20:26:37Z.

Review: COMMENTED


I followed up on the dispatch microbenchmark with two full D3D12 title launches on the RTX 5070 Ti (driver 621.40, Windows 11 build 26300, Ryzen 7 5800X3D). Base 085ee7c + this PR's shader commit c2d576c, one diagnostics binary, Series X, same seed save and copied 179,981,420-byte host pipeline library for each run. Only VICTORY_CARD_WIDE_HASH was changed. Both modes and the loaded library size were confirmed in the logs.

Frame-log batches fully inside 270–332 s with at least 500 mean draws. GPU times are from card timestamps, per frame.

Metric Serial (=0) Wide (=1)
Frames 105 140
Mean draws/frame 5,314 5,311
Send-and-hash lists 22.69 ms (5.80 lists) 9.64 ms (5.69 lists)
Compare lists 6.38 ms (6.91 lists) 1.16 ms (7.04 lists)
Other GPU lists 129.40 ms 122.36 ms
Frame median / p95 325 / 1,757 ms 299 / 1,205 ms
Mean FPS 1.96 2.40

The two kinds of lists went from 29.07 to 10.80 ms/frame (−63%) at similar list counts. The in-game comparison is one run per setting. Scene progression, remaining pipeline wait (55.93 vs 65.77 ms/frame) and submission work (223.32 vs 169.58 ms/frame) varied, so I would treat the card-list reduction as the confirmed result and the FPS numbers as observations from this pair.

Common switches: LEVELS_ON_DEMAND=1 ASYNC_SUBMIT=1 QUEUE2=1 INDIRECT_WINDOW=1 TEXTURE_NO_WAIT=1 MERGE_GAP=64 MERGE_RUNS=4096 STAGING_POOL=0 COPY_PLAIN=1 JOIN_PARTS=1 BACK_OWN_VIEW=1 INDIRECT_GATHER=1 CARD_REHASH_RUNS=1 FRAME_LOG=1 CARD_METER=1 (all prefixed VICTORY_). Both runs reached their timed deadline.

<!-- greyfinch-sync:fxceless/victory-fork:review:6064474265 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/992#pullrequestreview-6064474265). Originally posted by [Flyander](https://github.com/Flyander) on 2026-11-25T20:26:37Z. **Review:** COMMENTED --- I followed up on the dispatch microbenchmark with two full D3D12 title launches on the RTX 5070 Ti (driver 621.40, Windows 11 build 26300, Ryzen 7 5800X3D). Base `085ee7c` + this PR's shader commit `c2d576c`, one diagnostics binary, Series X, same seed save and copied 179,981,420-byte host pipeline library for each run. Only `VICTORY_CARD_WIDE_HASH` was changed. Both modes and the loaded library size were confirmed in the logs. Frame-log batches fully inside 270–332 s with at least 500 mean draws. GPU times are from card timestamps, per frame. | Metric | Serial (`=0`) | Wide (`=1`) | |---|---:|---:| | Frames | 105 | 140 | | Mean draws/frame | 5,314 | 5,311 | | Send-and-hash lists | 22.69 ms (5.80 lists) | **9.64 ms** (5.69 lists) | | Compare lists | 6.38 ms (6.91 lists) | **1.16 ms** (7.04 lists) | | Other GPU lists | 129.40 ms | 122.36 ms | | Frame median / p95 | 325 / 1,757 ms | 299 / 1,205 ms | | Mean FPS | 1.96 | 2.40 | The two kinds of lists went from 29.07 to 10.80 ms/frame (−63%) at similar list counts. The in-game comparison is one run per setting. Scene progression, remaining pipeline wait (55.93 vs 65.77 ms/frame) and submission work (223.32 vs 169.58 ms/frame) varied, so I would treat the card-list reduction as the confirmed result and the FPS numbers as observations from this pair. Common switches: `LEVELS_ON_DEMAND=1 ASYNC_SUBMIT=1 QUEUE2=1 INDIRECT_WINDOW=1 TEXTURE_NO_WAIT=1 MERGE_GAP=64 MERGE_RUNS=4096 STAGING_POOL=0 COPY_PLAIN=1 JOIN_PARTS=1 BACK_OWN_VIEW=1 INDIRECT_GATHER=1 CARD_REHASH_RUNS=1 FRAME_LOG=1 CARD_METER=1` (all prefixed `VICTORY_`). Both runs reached their timed deadline.
PiloteCode commented 2026-11-25 23:09:54 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by PiloteCode on 2026-11-25T22:11:38Z.


Merged main (c36971b) into the branch: a merge commit on top of the commits already here (cf761c5), then one lint commit. No conflict.

Where both sides changed the same code. main's c36971b and this branch both change the two hash and compare passes of host.rs, two lines apart. main gives the pass the bytes its hashes cover (Shadow::card_hashed: the copy's whole buffer, or the title buffer's own bytes with VICTORY_CARD_HASH_LEN=1). This branch dispatches a group a piece (card_groups). The merge has both, and both forms of the compare read that length the same way: a piece ends at it, widened to 16 bytes. VICTORY_CARD_HASH_LEN=1 has not been run with the group form: it is off by default, and the tests hash whole buffers.

main's notes for c36971b name the cost this PR is about: with every buffer's copy on the card (VICTORY_CARD_BUFFERS_MIN_KB=64), each small copy is hashed over a whole 64 KiB, and the send-and-hash lists rose from 11.6 to 23.0 ms a frame. In the group form, such a piece is 17 loads for each of 256 threads, not 4,096 loads of one thread in a row. How much of the 23.0 ms that takes back is not measured: this branch has not run on the card since the merge.

Added after the merge: one lint commit for main's newer code, the same as on our other open branches: map_entry in fpsbox.rs, collapsible_if in pipeline/library.rs, manual_is_multiple_of in queue.rs, shadow.rs, draw.rs and watch.rs. Without it cargo clippy --workspace --all-targets --locked -- -D warnings fails on c36971b, with or without --all-features.

Checked, the branch as it is (ad50dc6), every test on the software adapter:

  • cargo clippy --workspace --all-targets --locked -- -D warnings, and the same with --all-features: clean.
  • cargo xtask policy, cargo build --release -p victory and cargo build --profile diag -p victory --features diagnostics: pass.
  • cargo test -p victory-gpu --features diagnostics -- --test-threads=1 with VICTORY_D3D12_WARP=1: 202 passed, 1 failed, 6 ignored. The failure is depth_bounds_pipeline_loads_and_filters_draws, as on main (200 passed, 1 failed, 6 ignored): WARP does not reject the pixels outside the depth bounds. The card-compare tests pass (card_compare_forms_flag_alike_on_the_card, warp_card_compare_sees_each_step_of_a_widened_piece, warp_card_compare_stores_the_hash_it_made_when_told). The two other failures of the description's run (warp_budget_saturates_without_wraparound_and_preserves_draw_fields and the profile sampler's test) did not come back in this run.
  • cargo test -p victory-shader -- --test-threads=1 with VICTORY_WARP=1: 212 passed, 4 failed, 3 ignored, the same four as on main on the software adapter.
  • cargo test -p victory-hle -- --test-threads=1: 100 + 1 passed, as on main.
  • cargo test -p victory -p victory-loader: passed.
<!-- greyfinch-sync:fxceless/victory-fork:comment:7176054963 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/992#issuecomment-7176054963). Originally posted by [PiloteCode](https://github.com/PiloteCode) on 2026-11-25T22:11:38Z. --- Merged `main` (`c36971b`) into the branch: a merge commit on top of the commits already here (`cf761c5`), then one lint commit. No conflict. **Where both sides changed the same code.** `main`'s c36971b and this branch both change the two hash and compare passes of `host.rs`, two lines apart. `main` gives the pass the bytes its hashes cover (`Shadow::card_hashed`: the copy's whole buffer, or the title buffer's own bytes with `VICTORY_CARD_HASH_LEN=1`). This branch dispatches a group a piece (`card_groups`). The merge has both, and both forms of the compare read that length the same way: a piece ends at it, widened to 16 bytes. `VICTORY_CARD_HASH_LEN=1` has not been run with the group form: it is off by default, and the tests hash whole buffers. `main`'s notes for c36971b name the cost this PR is about: with every buffer's copy on the card (`VICTORY_CARD_BUFFERS_MIN_KB=64`), each small copy is hashed over a whole 64 KiB, and the send-and-hash lists rose from 11.6 to 23.0 ms a frame. In the group form, such a piece is 17 loads for each of 256 threads, not 4,096 loads of one thread in a row. How much of the 23.0 ms that takes back is not measured: this branch has not run on the card since the merge. **Added after the merge:** one lint commit for `main`'s newer code, the same as on our other open branches: `map_entry` in `fpsbox.rs`, `collapsible_if` in `pipeline/library.rs`, `manual_is_multiple_of` in `queue.rs`, `shadow.rs`, `draw.rs` and `watch.rs`. Without it `cargo clippy --workspace --all-targets --locked -- -D warnings` fails on `c36971b`, with or without `--all-features`. **Checked**, the branch as it is (`ad50dc6`), every test on the software adapter: - `cargo clippy --workspace --all-targets --locked -- -D warnings`, and the same with `--all-features`: clean. - `cargo xtask policy`, `cargo build --release -p victory` and `cargo build --profile diag -p victory --features diagnostics`: pass. - `cargo test -p victory-gpu --features diagnostics -- --test-threads=1` with `VICTORY_D3D12_WARP=1`: 202 passed, 1 failed, 6 ignored. The failure is `depth_bounds_pipeline_loads_and_filters_draws`, as on `main` (200 passed, 1 failed, 6 ignored): WARP does not reject the pixels outside the depth bounds. The card-compare tests pass (`card_compare_forms_flag_alike_on_the_card`, `warp_card_compare_sees_each_step_of_a_widened_piece`, `warp_card_compare_stores_the_hash_it_made_when_told`). The two other failures of the description's run (`warp_budget_saturates_without_wraparound_and_preserves_draw_fields` and the profile sampler's test) did not come back in this run. - `cargo test -p victory-shader -- --test-threads=1` with `VICTORY_WARP=1`: 212 passed, 4 failed, 3 ignored, the same four as on `main` on the software adapter. - `cargo test -p victory-hle -- --test-threads=1`: 100 + 1 passed, as on `main`. - `cargo test -p victory -p victory-loader`: passed.
PiloteCode commented 2026-11-25 23:09:59 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by PiloteCode on 2026-11-25T22:54:57Z.


@Flyander thanks, this is the measurement the description did not have: the pass on a second Blackwell GPU against main and the three other parallel forms in one executable, and then in the title.

For the record of this PR:

  • a dispatch of 1 to 256 pieces: 2.0–6.8 µs here against 9.5–11.3 µs for the 64-thread forms and 212–559 µs on main; at 1,024 pieces the parallel forms meet (67.8–81.4 µs);
  • in the title on an RTX 5070 Ti, one run each way: the send-and-hash lists 22.69 → 9.64 ms a frame and the compare lists 6.38 → 1.16 ms at the same number of lists.

As you say, the card-list times are the confirmed part and the frame rate of one pair of runs is an observation. VICTORY_CARD_WIDE_HASH=0 stays as the switch back to the serial form.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7176933577 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/992#issuecomment-7176933577). Originally posted by [PiloteCode](https://github.com/PiloteCode) on 2026-11-25T22:54:57Z. --- @Flyander thanks, this is the measurement the description did not have: the pass on a second Blackwell GPU against `main` and the three other parallel forms in one executable, and then in the title. For the record of this PR: - a dispatch of 1 to 256 pieces: 2.0–6.8 µs here against 9.5–11.3 µs for the 64-thread forms and 212–559 µs on `main`; at 1,024 pieces the parallel forms meet (67.8–81.4 µs); - in the title on an RTX 5070 Ti, one run each way: the send-and-hash lists 22.69 → 9.64 ms a frame and the compare lists 6.38 → 1.16 ms at the same number of lists. As you say, the card-list times are the confirmed part and the frame rate of one pair of runs is an observation. `VICTORY_CARD_WIDE_HASH=0` stays as the switch back to the serial form.
PiloteCode commented 2026-11-27 00:04:37 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by PiloteCode on 2026-11-27T00:04:37Z.


Closing this one: main now does what it did.

  • #1014 (martindevbr, merged 25 Nov) hashes each 64 KiB piece with a group of threads (CARD_COMPARE_WIDE, 64 threads a piece). Since e4245f3c it is the default; VICTORY_CARD_HASH_WIDE=0 keeps one thread a piece. That was the whole change here.
  • What would be left is the group's size: 256 threads a piece here, 64 in main. We never measured 256 against 64, so we have no reason to offer to change main's form. Our bench only compared one thread a piece with a group (RTX 5090: a pass of 0.2–0.8 ms became 0.002–0.11 ms), which is the gain main already has.
  • main's test warp_card_compare_finds_every_byte_with_skew covers what ours checked: a copy that does not start on a piece, single bytes changed across a piece, each flagged in its own piece, with both forms.

Thanks to martindevbr for #1014 and for the in-title numbers there.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7206149245 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/992#issuecomment-7206149245). Originally posted by [PiloteCode](https://github.com/PiloteCode) on 2026-11-27T00:04:37Z. --- Closing this one: `main` now does what it did. - #1014 (martindevbr, merged 25 Nov) hashes each 64 KiB piece with a group of threads (`CARD_COMPARE_WIDE`, 64 threads a piece). Since e4245f3c it is the default; `VICTORY_CARD_HASH_WIDE=0` keeps one thread a piece. That was the whole change here. - What would be left is the group's size: 256 threads a piece here, 64 in `main`. We never measured 256 against 64, so we have no reason to offer to change `main`'s form. Our bench only compared one thread a piece with a group (RTX 5090: a pass of 0.2–0.8 ms became 0.002–0.11 ms), which is the gain `main` already has. - `main`'s test `warp_card_compare_finds_every_byte_with_skew` covers what ours checked: a copy that does not start on a piece, single bytes changed across a piece, each flagged in its own piece, with both forms. Thanks to martindevbr for #1014 and for the in-title numbers there.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork!990
No description provided.