gpu(native): hash big texture syncs on the rayon pool #603
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T11:51:37Z.
Refs #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 onlyImported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T11:59:44Z.
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.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T12:49:14Z.
Note for review: #603, #604, #605, #608, #610 and #609 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 #603/#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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.