feat(ternary): parameterized N-chunk spec-first BitNet neuron over packed arrays - #1752
Merged
Merged
Conversation
…cked arrays specs/ternary/bitnet_neuron_nchunk.t27: neuronN(acts: [8]u64, weights: [8]u64, nchunks, threshold) loops dot27 over the first nchunks chunk pairs then quantizes. The direct payoff of both gen-verilog fixes composing: acts[c] -> part-select acts[c*64 +: 64] (#1748) and the loop + its locals lower cleanly (#1741). The prior neuron (#1747) used separate scalar params; this is fully parameterized. Verified: typecheck 0 err; icarus-simulate 6/6 scalar test blocks; seal 3 backends MATCH; new tests/bitnet_neuron_nchunk.rs checks neuronN over uniform-chunk inputs across several nchunks/threshold settings (ALL_PASS). Array-literal test-block args with 0/Z elements are wrong in the sim harness (#1749) -- verified by direct-packed inputs instead. No compiler change. Closes #1750 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ron-nchunk # Conflicts: # docs/NOW.md
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
This was referenced Aug 6, 2026
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.
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).
Closes #1750
specs/ternary/bitnet_neuron_nchunk.t27: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.Verification
typecheck: 0 errors;icarus-simulate: 6/6 scalar dot27/quantize test blocks;seal: 3 backends MATCH.tests/bitnet_neuron_nchunk.rs— drivesneuronNover uniform chunks packed directly into 512-bit vectors across severalnchunks/threshold settings:allP×8→P,allP×N×4→N,allN×8→P,allZ→Z,1-chunk-band→Z,0-chunks→Z=ALL_PASS.Note:
test-block array-literal args with 0/Z elements materialize wrong in the sim harness (#1749), so neuronN is verified by directly-packed inputs rather than array-literal test blocks.neuronNitself is correct.🤖 Generated with Claude Code