GPU: merge shadow write-back bytes in AVX2 vectors with scalar fallback #1865
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1867"
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 Marvisak/VIctory. Originally posted by VlREX on 2026-11-24T23:49:40Z.
Vectorize CPU-side GPU shadow write-back merging with AVX2, processing 32 bytes per iteration with runtime CPU detection and scalar fallback. Native C AVX2 equivalent verified against all 16,777,216 possible byte triples and 4,416 alignment/length cases, zero mismatches. Three Rust regression tests included. Native Rust integration and GPU performance benchmarks pending. No new dependencies or game assets. AI-assisted (ChatGPT).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T00:32:39Z.
Review: COMMENTED
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
Shadow write-back bytes merged in AVX2 (docs+gpu): SIMD merge of shadow ranges — pairs with #1382's batched barriers.
Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-25T00:10:55Z.
Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at
eabd870:cargo test -p victory-gpu --lockedgives 79 passed, 2 failed, 1 ignored. The two failures are the NVIDIA heap-cap onesmainalso has (descriptor::host::tests::dynamic_slots_are_held_until_releasedandmemory::tests::lists_share_a_table_and_copies_keep_their_views, #1744), so there is nothing new on this hardware. Not run: a title.AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T07:18:41Z.
Automated triage for the maintainers.
Needs rebase. This PR no longer merges cleanly into
main(conflict incrates/victory-gpu/src/shadow.rs). It will be reviewed again once it is rebased.From the earlier needs-work note, still open: post before/after copy-back timings from a release build, and update the title, description and test name, which still describe AVX2 vectors.
Generated by Claude Code
upstream-sync referenced this pull request2026-11-25 08:06:38 +00:00
upstream-sync referenced this pull request2026-11-25 12:03:44 +00:00
Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-26T17:46:30Z.
Release-build copy-back timings: std-only bench, bodies copied verbatim, workspace
[profile.release]. Ns per call net of a memcpy baseline, median of 41 interleaved samples. Scalar = the loop this PR replaces (70564ae0), PR =mergeatea57fd91.Asm (baseline SSE2): the old loop is only partly vectorized. LLVM does the compares 16 bytes at a time, but it scalarizes the conditional
*t = *hinto 16 test/branch/byte-store sequences per block.mergecompiles to a branch-free pcmpeqb/pand/pandn/por loop.However,
mainalready has a branch-freemerge_writeback(#2054). It runs 2-8 % faster than this PR'smergein 35 of 36 session-case pairs, so after a rebase this PR adds no speed.A second session kept the ratios, but its absolute times ran up to 64 % higher (loaded machine).
Ryzen 9 5950X with AVX2, rustc 1.98.1, high priority, pinned to one core. Inputs are synthetic.
AI-assisted (Claude Code, Claude Opus 5.5).
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.