Repository navigation
Conversation
…E=1) The hash pass over copies in the card's memory walked each 64 KiB piece on one thread: 4,096 dependent steps, neighbouring threads 64 KiB apart, so a pass over a few pieces took the time of a whole piece on one lane (514 such passes a frame in run 102). The wide form gives each piece a group of 256 threads: lane l takes the piece's 16-byte blocks l, l + 256, ... (16 steps for a whole piece, 4 KiB of side-by-side loads per step), and the lane hashes are joined in a fixed tree. Same root signature, constants and results; the hash values differ, but nothing outside the shader reads them and one form is used per run. A change confined to one 16-byte block always changes the hash, as before. Off by default. If the wide shader does not compile, the narrow one is used and a warning logged, so the switch cannot turn card copies off. Checked: Windows target builds and passes clippy; the HLSL compiles with DXC (cs_6_0); a Rust model of the shader's arithmetic is tested (every block read once, any one changed byte shows, dispatch covers every piece within the group limits). Not yet run on a card or measured in the game. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YYNyBknqrxMVw1v7HYK6J4
|
Is this a duplicate of #253? Both parallelize CARD_COMPARE hashing across a thread group per 64 KiB piece. The group size and default differ; please clarify whether this is intended as an alternative or a superseding implementation. This is an automated message. If you believe it is incorrect, please reply with the relevant technical differences. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The hash pass over copies in the card's memory (
CARD_COMPAREinhost.rs) walks each 64 KiB piece on one thread: 4,096 dependent 16-byte steps, with neighbouring threads 64 KiB apart. A pass over a few pieces therefore takes the time of a whole piece on one lane, and run 102 had 514 such passes a frame (the comment onrehash_runsnotes no timing names them yet).What this adds
crates/victory-gpu/src/card_hash.rs, a wide form of the same shader, behindVICTORY_CARD_HASH_WIDE=1(off by default):ltakes the piece's blocksl, l+256, ...: 16 steps for a whole piece, with each step's loads 4 KiB side by side.cs_5_1.A change confined to one 16-byte block always changes the hash, as before: the lane round is bijective in its state and in the block, and the join is bijective in each side.
host.rs: picks the shader once inmake_card_work; both dispatch sites usecard_hash::groups.Checked
cs_6_0); FXC was not available.Not checked
Not yet run on a card or measured in the game. To compare, run a
diagbuild withVICTORY_GPU_TIMING=1, with and withoutVICTORY_CARD_HASH_WIDE=1. Look forcard compare: a group per piecein the log, and watch for stale or flickering geometry, which would mean missed shader writes.