gpu(native): hash big texture syncs on the rayon pool #607
No reviewers
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS!607
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-603"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@AnastasisKon on GitHub · 2026-11-28 11:51 UTC · original
AnastasisKon:vibe/blake3-rayon-1705ac→main· +78 −6 · 3 files · 1 commits · openRefs #179
What
The texture sync hashed every watched texture with
blake3::hashon a single core — the scanner thread, each submission'sJob::read, and the GPU-written copy-back all serialized there while the other 10 cores idled. On a 4K streamed texture set that is the dominant per-frame CPU cost of the sync.Textures at or above 1 MiB now hash with
blake3::Hasher::update_rayon, which splits the input over the rayon pool. Below the cutoff the single-shotblake3::hashis kept (no pool overhead for small textures).blake3gains therayonfeature (Cargo.lock adds rayon + crossbeam-deque and deps).scan_roundaccumulates the read into one buffer for big textures and hashes it withhash_of; small ones keep the incremental per-chunk hash.Job::readand the two hashes in the GPU-written copy-back path callhash_of.Correctness
The hash value is unchanged —
update_rayonis the same BLAKE3 tree hash. A unit test assertshash_of(bytes) == blake3::hash(bytes)for sizes straddling the 1 MiB cutoff (0, 1, 63..65, 1 MiB-1/+1/+63, 3 MiB+7).Testing
cargo test -p victory-hle -p victory -p victory-gpu -p xtask(host arm64) — all pass, incl.hash_of_matches_blake3_across_the_parallel_thresholdcargo test --target x86_64-apple-darwin -p victory-gpu --lib— 448 pass; 1-2native::testsremap tests flake under the full Rosetta run, reproducible on cleanupstream/main(pre-existing, unrelated to this change); each passes in isolationcargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings— cleancargo xtask policy— 404 files okChecklist
vibe/blake3-rayon-1705acfromupstream/main, pushed to my fork only@AnastasisKon on GitHub · 2026-11-28 11:59 UTC · original
CI green (check + macos-scripts SUCCESS), marked ready. Host 4-crate tests, x86_64-apple-darwin victory-gpu tests, windows-target clippy --locked -D warnings and cargo xtask policy all pass locally; the two native::tests remap flakes under the full Rosetta run reproduce on clean upstream/main and are unrelated.
@AnastasisKon on GitHub · 2026-11-28 12:49 UTC · original
Note for review: #607, #608, #609, #612, #614 and #613 were cherry-picked together onto a local integration branch off main; host 4-crate tests, x86_64-apple-darwin tests (victory-gpu/victory-loader/victory-hle), windows-target clippy --locked -D warnings and cargo xtask policy all pass on the composed result (the scan_round hunks of #607/#605/#608 resolve to: par_iter scan_one, big textures via read_into + hash_of). Happy to rebase any of these onto another once it merges.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.