Repository navigation
Conversation
Cache loaded 4-dword USER_DATA CBV rows (index / 4) and extracted dwords (index) in the entry block so repeated or same-row user-data accesses reuse the existing cbufferLoadLegacy.i32 and extractvalue instructions. Replaces the previous hand-written bitcode reader test with a small #[cfg(test)] Module::cbuf_load_stats hook on Module (matching Module::written_calls). Measured on 13f91ca (--release bench_user_data_cache, 32 dwords / 8 rows read 4x = 128 reads): - DXIL size: 4,460 -> 2,616 B (-41.3%) - cbufferLoadLegacy.i32 ops: 128 -> 8 (-93.8%) - extractvalue ops: 128 -> 32 (-75.0%) - Lowering time: 411.7 -> 306.3 us/run (1.34x, -25.6%) Assisted-by: T3 Code (Antigravity, gemini-4-neon)
…ort scans in Lower with O(1) dense Vec tables Replace per-lookup HashMap hashing and linear scans over block.insts in Lower with O(1) dense Vec tables built once in Lower::new (identical DXIL): - def_block: Vec<Option<usize>> and def_site: Vec<Option<Site>> indexed by Value.0, eliminating linear scans in def_inst, pair_high, mask_dword, mask_number, and whole. - done_export: Vec<bool> per block, replacing has_done_export's scan. (Dropped the earlier resource::track HashMap change after benchmarking showed SipHash insertion overhead outweighed scanning out.scalar.) Measured (--release bench_o1_lookups_large_shader, 2,821-inst PS): - emit::lower: 3,571.7 -> 2,939.8 us/run (1.21x, -17.7%) Trimmed lower.rs tests to a single equivalence check comparing the new tables against the old linear scans. Assisted-by: T3 Code (Antigravity, gemini-4-neon)
… on Translated Trimmed per triage feedback (removed the GraphicsState escaper and library/early-list key rewrite so only the zero-risk savings remain): - Reuse the single blake3::hash(bytes) in pipeline::shader() instead of re-hashing inside Shader::new, and allocate Arc<Shader> outside SHADERS. - Compute dxil_atomics64(&host.dxil) once inside with_resources() and cache atomics64: bool on Translated instead of re-parsing the DXIL container on every HostPipeline creation. Assisted-by: T3 Code (Antigravity, gemini-4-neon)
…k reuse in finish(), and FxHash in meet_in() Replace Bools::given()'s O(|b| * |vars(b)|) mutating implies loop with an O(|known|) read-only forced() sweep over reduced OBDD edges, make Bools::implies() read-only without allocating BDD nodes or evicting memo entries, reuse forced(cond[n]) across guards and exits per block in finish(), and switch meet_in()'s refuted set from SipHash to FxHash. Measured on bench_bools (--release): given() drops from 20.43 us -> 0.22 us (93x) at n=8 and 655.25 us -> 0.54 us (1,213x) at n=13. Assisted-by: T3 Code (Antigravity, gemini-4-neon)
…tor LUT Speed up XMA2 frame decoding without changing decoded bits: - Bits::peek32 reads a single unaligned u64::from_be_bytes word on the hot path (>= 8 bytes left) with a 5-byte tail fallback. - Vlc::new builds a 10-bit primary lookup table (Box<[(i32, u8); 1024]>) covering >99% of Huffman symbols in O(1), falling back to a prefix-bounded binary search for codes longer than 10 bits. - quant_factor caches 10^(exp / 16) in a bit-exact OnceLock<[f32; 384]> LUT for exp in -128..256 (matching 10.0_f32.powf(exp as f32 / 16.0) to_bits). Measured (--release vlc_and_quant_throughput): - vlc coef0: 28.09 -> 6.30 ns/sym (4.46x) - vlc coef1: 23.47 -> 5.86 ns/sym (4.00x) - vlc vec4: 23.76 -> 5.58 ns/sym (4.26x) - quant: 10.69 -> 1.18 ns/op (9.05x) Assisted-by: T3 Code (Antigravity, gemini-4-neon)
…n RegSet
Avoid redundant heap allocations and O(REGS) / O(n^2) scans during GFX10
instruction decoding and SSA IR construction (identical IR output):
- gfx10/fields.rs: rewrite valu_dwords without split('_').collect::<Vec<_>>()
and move the VOP3B lookup into Encoding::Vop3 only.
- ir.rs: add stack-allocated Exit::succs() (Succs { to: [usize; 2], len })
and use it across reverse_postorder, link, irreducible_edge,
split_irreducible, multi_entry_loop (also borrowing preds without clone),
and liveness, keeping pub Exit::successors() intact.
- ir.rs: scan only set bits via trailing_zeros() / w &= w - 1 in members().
- ir.rs: replace Vec::contains O(n^2) dedup in effects() with a stack RegSet
bitset, and write (Reg, NONE) directly to avoid a second Vec alloc per inst.
Measured (--release ir::tests::bench_ir_build):
- valu_cfg (2048 insts, 128 blocks): 2310.3 -> 1966.9 us/run (1.17x, -14.9%)
- movrel (64 insts, 128 vgprs): 602.0 -> 139.3 us/run (4.32x, -76.9%)
Assisted-by: T3 Code (Antigravity, gemini-4-neon)
…ar constants, and zero-copy bitcode Writer Speed up DXIL module construction and LLVM 3.7 bitcode emission while producing bit-for-bit identical output (all written_bytes_unchanged FNV-1a hashes unchanged): - shader.rs: cache dx.op.<name> declarations in Shader::op_funcs (FxHash), skipping per-call Vec<Ty>/format!/type_ids/func_ids work, and move the arg Vec into Module::call when sampler_choices does not match. - bitcode.rs: switch internal type/constant/func interning maps to FxHash, cache primitive Ty ids (void/f32/i1/i8/i32/i64), split scalar constant interning (int/float/undef/aggregate) to avoid cloning on lookup hits while preserving replace_const semantics. - bitcode.rs: write bitstream directly into a pre-sized Vec<u8> (zero-copy Writer::finish), cache active abbreviation width, specialize vbr6, stream variable-length records/strings directly without temp Vec<u64> buffers, and replace vec![Vec::new(); blocks] predecessor lists in Module::plan with a flat Pred enum. Measured on 13f91ca (--release emit::bitcode::tests::bench_write, median of 3x5 runs, bit-for-bit identical FNV-1a hashes): - 64x64 ( 4,417 insts, 38,956 B, 0xf0d59e83b39da635): 214.8 -> 161.3 us (1.33x) - 128x256 ( 33,569 insts, 252,532 B, 0x59610d0b12c34414): 2.811 -> 1.978 ms (1.42x) - 256x512 (132,865 insts, 1,232,736 B, 0x82d39ac2b67ccb9f): 21.11 -> 19.32 ms (1.09x) Assisted-by: T3 Code (Antigravity, gemini-4-neon)
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Owner
Author
|
Verification complete (Run 45666985023 green; Marvisak#2207, Marvisak#2210, Marvisak#2211 updated and Marvisak#2662-Marvisak#2665 opened). |
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.
Draft fork CI run verifying Windows MSVC clippy (-D warnings, default & --all-features), xtask policy, victory-formats, victory-shader (dxil.dll + WARP SM 6.6), and victory-gpu (WARP SM 6.6) across all 7 standalone branches rebased onto
13f91ca:rvzo/cache-user-data(Shaders: cache USER_DATA CBV rows and extracted dwords in Lower::user_at Marvisak/VIctory#2207)rvzo/shader-o1-lookups(Shaders: replace HashMap/linear scans in Lower with O(1) dense Vec tables Marvisak/VIctory#2210)rvzo/pipeline-startup-fast(GPU: hash shaders once in pipeline::shader() and cache SFI0 atomics64 on Translated Marvisak/VIctory#2211)rvzo/structure-bdd-fast(Wave 4 [CI] RVZO6 VIctory FPS Stack (4 standalone PRs) #1)rvzo/xma-hot-luts(Wave 4 [CI] Wave 2 + Wave 3a Combined Verification (8 standalone PRs) #2)rvzo/ir-decode-zero-alloc(Wave 4 [CI] Wave 3b: 3 victory-gpu FPS optimizations (draw-state-dedup + cache-texture-meta + list-reset-keep-dedup) #3)rvzo/bitcode-emit-fast(Wave 4 [CI] Rebased merge-candidates (#2167, #2208, #2168) on 13f91ca #4)