You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extends the spec-first BitNet neuron (#1747) to an arbitrary chunk count using packed-array parameters and a real loop — now possible because both gen-verilog fixes landed: local-decl hoisting in loops (#1741) and packed-array element indexing (#1748).
specs/ternary/bitnet_neuron_nchunk.t27:
pub fn neuronN(acts: [8]u64, weights: [8]u64, nchunks: u32, threshold: i16) -> u8 {
var acc : i16 = 0; var c : u32 = 0;
while (c < nchunks) { acc = acc + dot27(acts[c], weights[c]); c = c + 1; }
return quantize(acc, threshold);
}
acts[c]/weights[c] lower to element part-selects (acts[c*64 +: 64]); the loop and its locals lower cleanly. The prior neuron (#1747) had to pass chunks as separate scalar params — this is the fully-parameterized form.
New integration test tests/bitnet_neuron_nchunk.rs — cross-checks neuronN vs an independent reference on 200 random inputs (random valid-trit chunks packed into 512-bit vectors, random nchunks 0..8, random threshold): ALL_MATCH.
Note: test-block array-literal args with 0/Z elements materialize wrong in the sim harness (#1749), so neuronN is verified by the Rust cross-check (direct-packed) rather than array-literal test blocks.
Activity
spec(t27f): the graph view backdrop is brand black #000000 (Closes #1…