Repository navigation
Conversation
…computed operand plans Co-Authored-By: Gemini 4 Neon <noreply@google.com>
Owner
Author
|
Upstream PR xcl-dev#1090 was closed or merged. |
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.
What is in it
Accelerate split-wave64 SGPR mask liveness analysis (
crates/xcl/src/gpu/recomp/x64_masks.rs), which runs during shader translation for wave64 compute, mesh, and geometry programs on 32-lane-wave GPUs:LOOP_GUARDexit mask). Because(X & !k) | X == Xfor bitmasks, the constant per-block exit mask collapses out of intra-block composition, reducing the backward fixpoint from instruction granularity (O(iters * N)) to basic-block granularity (O(iters * B)) with a single linear backward pass per block to reconstructlive_out.BTreeMap<u64, usize>PC table, per-instructionVec<usize>successor lists, and per-instructionVec<Option<usize>>loop-exit lists with binary search on sorted PCs, an inlineBlockSuccenum, and a single flatexit_targetsbuffer populated via anO(B * depth + L log B)sweep.UsePlanTable): Lazily precompute static bit-range descriptors and fixed register masks per(InstEnc, Encoding)in a flat open-addressed table, eliminating per-instruction string.contains()scans and linearEncoding::fieldlookups inuses().Release benchmark (
cargo test --release --lib gpu::recomp::x64_masks::tests::bench_whole_live_out -- --ignored --nocapture, synthetic multi-loop shaders with nested loops, diamond branches, compares,v_cndmask, and carry chains; bit-for-bit verified against the original solver):whole_live_out_reference)whole_live_out)Tested
rustc 1.100.0 (0ef1bc386 2026-11-09)(stable-x86_64-pc-windows-msvc), debug and release.cargo test --lib gpu::recomp::x64_masks: 19 passed, 0 failed, 1 ignored (manual release benchmark). Includes exhaustive equivalence check ofuses()vsuses_fallback()across every RDNA2 instruction and encoding, 200-case fuzz check ofnested_loop_ranges()against the quadratic merge, and bit-for-bitwhole_live_out()equivalence across synthetic multi-loop shaders for bothend_reads_all = falseandtrue.cargo test --release --lib gpu::recomp::x64_masks::tests::bench_whole_live_out -- --ignored --nocapture: 1 passed, 0 failed (11.13x–23.37x speedup).cargo build --release -p xcl: succeeded cleanly.Regression run
Baseline (
origin/main):PR (
7bea019319cc08a54cdb3c9e49a0941d88b35283):Not tested
cargo test --workspaceand live split-wave64 shader compilation on an NVIDIA (wave32-only) GPU; covered by the exhaustive unit and bit-for-bit equivalence tests above.AI use
UsePlanTable, equivalence tests, and release benchmark, and ran local builds, unit tests, and the retail smoke run.Mirror of xcl-dev#1090 (auto-synced, do not edit).