Repository navigation
feat(spec): BitNet x GF-T layer of 3 neurons — M inputs to N packed trits (Refs #1764) - #1799
Merged
Merged
Conversation
…its)
specs/ternary/gft_layer3.t27 (GftLayer3): four shared GF-T16 activations feed
three neurons, each with its own ternary weight vector {N=0,Z=1,P=2}; every
neuron is sign(sum_i w_i * a_i) in signed GF-T (RNE, zero-aware) -> a trit, and
the three trits are packed low->high 2 bits each (result = n0 | n1<<2 | n2<<4).
One full BitNet layer (M->N); composes with gft_mlp2's inter-layer re-embed.
Bit-exact to the ideal oracle over 400 vectors (tests/gft_layer3_vectors.txt),
checked in bootstrap/tests/gft_layer3.rs via iverilog $fscanf. The vectors are
doubly-grounded: generated only where a faithful integer transcription of the
GF-T arithmetic AND an independent exact-float64 dot-product sign agree (0/400
disagreements -> the conformance is non-circular).
No compiler change (on_comb, 16 ports). Fresh seal (seal --verify MATCH).
Refs #1764
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
PR DashboardGenerated at: 2026-08-06 15:20:39 UTC
Summary
Seal Status
|
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.
What
specs/ternary/gft_layer3.t27(GftLayer3) — a spec-first BitNet×GF-T layer of 3 neurons, the natural next layer above the singlegft_neuron_full.Four shared real-valued GF-T16 activations (
a0..a3) feed three neurons, each with its own ternary weight vector{N=0→−1, Z=1→0, P=2→+1}. Every neuron issign(Σ w_i·a_i)evaluated in signed GF-T (RNE, zero-aware) → a trit. The three trits are packed low→high, 2 bits each:This is one full BitNet layer (M inputs → N trit outputs); it composes directly with
gft_mlp2's inter-layer trit→GF-T re-embed.Verification
tests/gft_layer3_vectors.txt), checked inbootstrap/tests/gft_layer3.rsvia iverilog$fscanf.float64sign of the true dot product agree — 0/400 disagreements at generation.tests (lanes,all_zero) additionally cross-checked against the Python oracle.on_comb, 16 ports). Fresh seal.trinity/seals/ternary_GftLayer3.json(seal --verify→ all MATCH). New integration test passes 400/400.Refs #1764
🤖 Generated with Claude Code