1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! Tier 2.5 bitset primitives — `and`/`or`/`not`/`xor`/`popcount`/
//! `any`/`contains` over packed u32 bitsets. These are the LEGO
//! blocks every higher-level graph/taint composition reaches for
//! when combining two NodeSets.
//!
//! All primitives operate on the same bitset shape: a u32 buffer
//! with `word_count` slots, where bit `i` of word `w` represents
//! element `w * 32 + i`. Sizes are declared at `Program` build
//! time so the backend can allocate + validate layout up front.
/// Stochastic computing primitive (#59) — bitstream multiplication
/// via AND. Power-efficient inference substrate.
/// Words needed to hold a bitset over `n` elements.
///
/// Overflow-safe — `(n + 31) / 32` wraps to 0 for `n > u32::MAX - 31`;
/// `div_ceil` handles the overflow correctly. Per AUDIT_2026-04-24
/// F-CT-01 / F-LBL-01 (kimi).
pub const