Skip to content

CI verification stack: #2207/#2210/#2211 polish + Wave 4 (4 branches) on 13f91ca - #5

Closed
RVZO6 wants to merge 7 commits into
mainfrom
rvzo/wave4-and-polish-ci
Closed

RVZO6 wants to merge 7 commits into
mainfrom
rvzo/wave4-and-polish-ci

Conversation

@RVZO6

@RVZO6 RVZO6 commented Nov 25, 2026

Copy link
Copy Markdown
Owner

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:

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)
@coderabbitai

coderabbitai Bot commented Nov 25, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@RVZO6

RVZO6 commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

Verification complete (Run 45666985023 green; Marvisak#2207, Marvisak#2210, Marvisak#2211 updated and Marvisak#2662-Marvisak#2665 opened).

@RVZO6 RVZO6 closed this Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant