Skip to content

specs/base/types.t27: compile again at 4 trits per byte, seal v2 (Closes #8303) - #8177

Merged
gHashTag merged 3 commits into
masterfrom
claude/types-4-trits-4817
Oct 9, 2026
Merged

gHashTag merged 3 commits into
masterfrom
claude/types-4-trits-4817

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Closes #8303.

Taken over on 2026-10-09 (an idle draft since 13:15Z): merged current master, resealed specs/base/types.t27 as seal v2 (66 of 66, 0 vacuous), and all three seal files naming it carry the same v2 record. That clears the stale-seal failures in coverage and spec-guards.

Refs #4817
Refs #8095

Owner decision 2026-10-09: the packed format is 4 trits per byte (2 bits per trit in a u8).

specs/base/types.t27 did not compile: pack_position_bounds still asserted TRITS_PER_BYTE == 8 while the constant is 4. Nearly every spec imports it, so under t27c frontier (#8110) about 405 specs could never be REUSE.

This PR makes the module compile and fixes the bugs that compiling exposed:

  • the invariant and test_pack_trit_all_positions now use positions 0..3;
  • ternary_word_unpack returned a slice of a local array and indexed the trit within its byte with i instead of i % 4. It now writes into the caller's buffer and returns the count. No other spec calls it;
  • array literals that the codegen lowers to anonymous tuples ([_]Trit{...} becomes .{...}) are written as typed arrays filled in a loop. That codegen bug deserves its own issue.

t27c test-report: BLOCKED -> 40 pass, 27 fail, 0 vacuous.

Draft, because 27 tests still fail. Their tables and their bodies disagree:

  • trit_and and trit_or: the tests expect Kleene min and max, but the bodies are not.
  • trit_xor: neither side is a standard function.
  • packed_trit_*: the helpers have the same mismatch.

Choosing which side is right is a semantics decision; it is not made here.

🤖 Generated with Claude Code

Owner decision 2026-10-09: TRITS_PER_BYTE is 4 (2 bits per trit in a u8).

- pack_position_bounds asserted TRITS_PER_BYTE == 8, so the module never
  compiled and every importer had no verdict (about 405 specs under
  t27c frontier, #8095).
- test_pack_trit_all_positions walked positions 0..8; now 0..4.
- ternary_word_unpack returned a slice of a local array and indexed the
  trit inside its byte with i instead of i % 4; it now writes into the
  caller's buffer and returns the count. No other spec calls it.
- array literals the codegen lowers to anonymous tuples are written as
  typed arrays filled in a loop.

test-report: BLOCKED -> 40 pass, 27 fail, 0 vacuous. The 27 failures are
the truth tables of trit_and/or/xor and the packed_trit_* helpers, whose
tests and bodies disagree; that is the next decision.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-09 12:56:20 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 48
PRs with All Checks Green 2
READY 0
FAILING 48
PENDING 0
NO CHECKS YET 0

These columns do not partition: 0 + 48 + 0 + 0 = 48, and there are 50 open PRs. A PR is being counted twice or not at all.

Seal Status

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

Owner decision 2026-10-09: balanced ternary logic.
- trit_and/or are Kleene min/max; trit_xor is -(a * b); XNOR negates it.
- pack_trit: the codegen drops the parens of ~(x << n) (#6549), so the
  shifted field is named first. This was the root of most failures.
- packed_trit_shift_right moves i to i - shift, as rotate_right does.
- ternary_word_negate starts from a zeroed word, not undefined bytes.
- tests written for 8 trits per byte now use positions 0..3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-09 13:30:56 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 46
PRs with All Checks Green 4
READY 1
FAILING 46
PENDING 0
NO CHECKS YET 0

These columns do not partition: 1 + 46 + 0 + 0 = 47, and there are 50 open PRs. A PR is being counted twice or not at all.

Seal Status

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

This was referenced Oct 9, 2026
…8303)

Takes over #8177, which had been an idle draft since 13:15Z: merges
current master and reseals specs/base/types.t27 as v2 (66 of 66 tests
pass, 0 vacuous). Its three seal files (BaseTypes, base_tritype-base,
tritype-base) carry the same v2 record.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gHashTag gHashTag changed the title specs/base/types.t27: compile again at 4 trits per byte (Refs #4817) specs/base/types.t27: compile again at 4 trits per byte, seal v2 (Closes #8303) Oct 9, 2026
@gHashTag
gHashTag marked this pull request as ready for review October 9, 2026 19:39
@gHashTag
gHashTag enabled auto-merge (squash) October 9, 2026 19:39
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-09 19:40:49 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 47
PRs with All Checks Green 3
READY 0
FAILING 47
PENDING 0
NO CHECKS YET 0

These columns do not partition: 0 + 47 + 0 + 0 = 47, and there are 50 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=557cd271f4e3 != 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 b813cca into master Oct 9, 2026
30 of 33 checks passed
gHashTag added a commit that referenced this pull request Oct 9, 2026
…loses #8371) (#8372)

After the hubs (#8177, #8209) every spec that imported them compiles
again. t27c seal --save ran on the 1203 specs missing a v2 seal:
- 31 were refused (failing tests);
- of the 1172 written, only v2 seals with 0 failed tests and at least one
  test were kept;
- blocked and zero-test seals were reverted (#8354).
727 specs remain, and each one's twin seal files carry the same record.

t27c frontier on this branch: 1109 of 1743 reused (636 permille), up from
424 (243 permille) on master; closure 73, missing 520.

Co-authored-by: Claude <claude@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

specs/base/types.t27 does not compile, so 340 specs rebuild on closure (#8095)

2 participants