Repository navigation
feat(ternary): 2-neuron spec-first BitNet layer with packed trit output - #1754
Merged
Merged
Conversation
specs/ternary/bitnet_layer.t27: layer2(acts, w0, w1, nchunks, threshold) runs two neuronN units over shared activations and per-neuron weights, packing the two output trits into a byte ((t1<<2)|t0). Array params pass straight through to neuronN -- no new backend work. First spec-first BitNet layer producing multiple output trits, composing quantizer (#1738) + MAC (#1743) + N-chunk neuron (#1752). Verified: typecheck 0 err; icarus-simulate 4/4 scalar test blocks; seal 3 backends MATCH; new tests/bitnet_layer.rs drives layer2 over direct-packed uniform chunks (ALL_PASS). No compiler change, no reseal. Closes #1753 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Composes the parameterized N-chunk neuron (#1752) into a spec-first BitNet layer.
Closes #1753
specs/ternary/bitnet_layer.t27:Two
neuronNunits over shared activations + per-neuron weights; the two output trits pack into a byte (trit0 in bits[1:0], trit1 in bits[3:2]). Array params pass straight through toneuronN— no new backend work.Verification
typecheck: 0 errors;icarus-simulate: 4/4 scalar dot27/quantize test blocks;seal: 3 backends MATCH.tests/bitnet_layer.rs— driveslayer2over uniform chunks packed directly into 512-bit vectors:w0=P,w1=N→2,P,P→10,N,P→8,allZ→5,0-chunks→5=ALL_PASS.The first spec-first BitNet layer producing multiple output trits — completing the spec-first stack quantizer(#1738) → MAC(#1743) → neuron(#1747/#1752) → layer. A ternary-native spec-first RTL flow no competitor (Ternary-NanoCore) has.
🤖 Generated with Claude Code