Skip to content

feat(ternary): spec-first 2-bit ripple-carry adder — multi-bit arithmetic datapath - #1776

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

gHashTag merged 1 commit into
masterfrom
feat/spec-first-ripple-adder

Conversation

@gHashTag

@gHashTag gHashTag commented Aug 6, 2026

Copy link
Copy Markdown
Owner

specs/ternary/ternary_ripple_adder.t27, add2(a0,a1,b0,b1): a 2-bit ripple-carry adder = two full adders (each = XOR + majority) with the carry threaded between them, over trit-embedded binary bits {0→N, 1→P}. Output packs sum0 in bits[1:0], sum1 in [3:2], carry-out in [5:4].

Closes #1774

Extends the spec-first stack from a single full adder into a multi-bit arithmetic datapath — the shape of a real ALU, built entirely from the ternary neural primitives.

Verification

  • typecheck 0 err; icarus-simulate 5/5 test blocks; seal 3 backends MATCH.
  • New tests/ternary_ripple_adder.rs exhaustively drives all 2^4 = 16 input pairs vs binary addition = ALL_PASS 16.

Related: filed #1773 (no cross-module imports → each spec re-defines the primitives).

🤖 Generated with Claude Code

specs/ternary/ternary_ripple_adder.t27: add2(a0,a1,b0,b1) -- a 2-bit
ripple-carry adder = two full adders (each XOR + majority) with the carry
threaded between them, over trit-embedded bits {0->N,1->P}. Output packs
sum0[1:0]+sum1[3:2]+carry-out[5:4]. Extends the stack from a single full adder
into a multi-bit arithmetic datapath.

Verified: typecheck 0 err; icarus-simulate 5/5; seal MATCH; new
tests/ternary_ripple_adder.rs exhaustively drives all 2^4=16 input pairs vs
binary addition = ALL_PASS 16. No compiler change.

Closes #1774

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 10:20: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 eba5d3c into master Aug 6, 2026
18 checks passed
@gHashTag
gHashTag deleted the feat/spec-first-ripple-adder branch August 6, 2026 10:20
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 2-bit ternary ripple-carry adder — multi-bit arithmetic datapath

1 participant