Skip to content

feat(spec): BitNet x GF-T layer of 3 neurons — M inputs to N packed trits (Refs #1764) - #1799

Merged
gHashTag merged 1 commit into
masterfrom
feat/gft-layer3
Aug 6, 2026
Merged

gHashTag merged 1 commit into
masterfrom
feat/gft-layer3

Conversation

@gHashTag

@gHashTag gHashTag commented Aug 6, 2026

Copy link
Copy Markdown
Owner

What

specs/ternary/gft_layer3.t27 (GftLayer3) — a spec-first BitNet×GF-T layer of 3 neurons, the natural next layer above the single gft_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 is sign(Σ w_i·a_i) evaluated in signed GF-T (RNE, zero-aware) → a trit. The three trits are packed low→high, 2 bits each:

result = n0 | (n1 << 2) | (n2 << 4)

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

  • 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 oracle is doubly-grounded / non-circular: each vector is emitted only where a faithful integer transcription of the GF-T arithmetic and an independent exact-float64 sign of the true dot product agree — 0/400 disagreements at generation.
  • Two representative in-spec tests (lanes, all_zero) additionally cross-checked against the Python oracle.
  • No compiler change (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

…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>
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@gHashTag
gHashTag merged commit ff1eef4 into master Aug 6, 2026
16 checks passed
@gHashTag
gHashTag deleted the feat/gft-layer3 branch August 6, 2026 15:17
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-06 15:20:39 UTC

Summary

Status Count
Total Open PRs 2
PRs with Failing Checks 1
PRs with All Checks Green 1
READY 1
FAILING 1
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=d3cc184cb614 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant