Skip to content

feat(ternary): spec-first ternary majority gate (named function, exhaustive) - #1766

Merged
gHashTag merged 1 commit into
masterfrom
feat/spec-first-ternary-majority
Aug 6, 2026
Merged

gHashTag merged 1 commit into
masterfrom
feat/spec-first-ternary-majority

Conversation

@gHashTag

@gHashTag gHashTag commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

A recognizable, interpretable function computed by the spec-first ternary stack: maj3(a,b,c) = ternary majority of three trits = sign of (a+b+c).

Closes #1765

Realized as a single BitNet neuron: pack the 3 input trits, dot with an all-+1 weight chunk (so the dot product is exactly a+b+c over the active lanes), quantize at threshold 0. Shows the stack computes a meaningful named function, not just random vectors.

Verification

  • typecheck 0 err; icarus-simulate 7/7 test blocks; seal 3 backends MATCH.
  • New tests/bitnet_majority.rs drives all 3^3 = 27 input combinations vs an independent reference (decode {N=-1,Z=0,P=+1}, sum, sign) = ALL_PASS 27. Exhaustive.

Related: filed #1764 — the spec-first .t27 path is combinational-only; clocked/streaming (Phase 2) needs a compiler clocked-process construct or the hand-written engine.

🤖 Generated with Claude Code

…ustive)

specs/ternary/bitnet_majority.t27: maj3(a,b,c) = ternary majority of three
trits = sign of (a+b+c), realized as a single BitNet neuron (pack3 -> dot27
with an all-+1 weight -> quantize at 0). First recognizable named function
computed by the spec-first stack.

Verified: typecheck 0 err; icarus-simulate 7/7 test blocks; seal 3 backends
MATCH; new tests/bitnet_majority.rs drives all 27 input combinations vs an
independent sign-of-sum reference = ALL_PASS 27 (exhaustive). No compiler change.

Closes #1765

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.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-06 09:52:00 UTC

Summary

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

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=9393a1c6258f != 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).

@gHashTag
gHashTag merged commit b20f126 into master Aug 6, 2026
18 checks passed
@gHashTag
gHashTag deleted the feat/spec-first-ternary-majority branch August 6, 2026 09:53
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.

feat: spec-first ternary majority gate — a named function computed by the BitNet stack

1 participant