Skip to content

specs: restore the 2544 lines a counter overwrote (Refs #2713) - #2722

Open
gHashTag wants to merge 1 commit into
masterfrom
w699-unscar
Open

specs: restore the 2544 lines a counter overwrote (Refs #2713)#2722
gHashTag wants to merge 1 commit into
masterfrom
w699-unscar

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

4639b38cd"fix(l3-purity): replace all Unicode with ASCII in 160 .t27 files", on master since April — did not transliterate anything. It replaced the i-th non-ASCII character of each file with the ASCII digits of i.

-    fn ternary_not(a: i32) → i32 {
+    fn ternary_not(a: i32) 257 i32 {

Reported with full evidence in #2713. This is the repair.

The transform is an exact oracle, and that is what makes this safe

The commit's rewrite is reproducible from the pre-image. I built the model and verified it reproduces the commit's output byte for byte on specs/isa/ternary_gates.t27 before writing anything.

A line is restored only when the line at HEAD is byte-identical to the transform of its pre-image line. Any line edited in the four months since is left alone. That rule is the whole safety argument: this is not a revert, and it never overwrites later work.

141 files, 2544 lines.

Measured

Deliberately with the master binary, so this is isolated from the compiler fixes in #2720:

before after
specs that parse 603 610
regressions 0

The seven are exactly the Expected LBrace, got Number ('257') cluster. Note the mechanism: they failed not because they lost an arrow was never a token, the lexer discards it — but because they gained an integer literal.

One line, as a sample of the other 2543

-    assert jones_trefoil_at_phi() 1222 PHI + PHI * PHI within 0.1
+    assert jones_trefoil_at_phi() ≈ PHI + PHI * PHI within 0.1

That file's 1222nd non-ASCII character was the comparison operator of an invariant. The spec compiled, sealed and passed every gate for four months with the operator replaced by its index.

Why restore rather than transliterate

#2713 asks the owner which branch to take. This PR takes restore, on two grounds:

  1. The pre-image is exact. A transliteration is a fresh authoring decision on 2544 lines — to -> is easy, but , φ, ² and the box-drawing runs are not, and getting them wrong is a second silent rewrite of the source of truth.
  2. The L3 ASCII rule is enforced by nothing today. 320 of 747 tracked .t27 files carry 88,033 non-ASCII characters at HEAD and no gate objects — while TASK.md:128 records "0 non-ASCII remaining" and the dashboard shows L3 PURITY green.

scripts/repair/unscar_4639b38cd.py is committed, so the operation is reproducible and the transliterate branch stays available: run it, then transliterate the restored text with the originals in hand rather than gone.

Still open, and not for me to decide

  • TASK.md:128 and docs/META_DASHBOARD.md:89 record a completed milestone that did not happen. Correct them, or annotate them?
  • Is the L3 ASCII rule wanted at all? If yes it needs a gate, and the gate needs to be one a counter cannot satisfy.

Note on CI

This PR will show a green two-check list and sit BLOCKED, like every PR opened since 2026-08-24 11:06. That is #2721, not this change.

Refs #2161, #2713

… (Refs #2161)

`4639b38cd` -- "fix(l3-purity): replace all Unicode with ASCII in 160 .t27
files" -- did not transliterate. It replaced the i-th non-ASCII character
of each file with the ASCII digits of `i`:

    -    fn ternary_not(a: i32) → i32 {
    +    fn ternary_not(a: i32) 257 i32 {

That transform is exactly reproducible from the pre-image, which is what
makes the repair safe rather than a guess. The model was verified to
reproduce the commit's output BYTE FOR BYTE before anything was written.

A line is restored only when the line at HEAD is byte-identical to the
transform of its pre-image line, so every line edited in the four months
since is left untouched. 141 files, 2544 lines.

Measured with the MASTER binary, so this is isolated from the compiler
fixes in #2720:

    specs that parse    603 -> 610
    regressions                  0

The seven are exactly the "Expected LBrace, got Number ('257')" cluster.
They failed not because they LOST an arrow -- `→` was never a token, the
lexer discards it -- but because they GAINED an integer literal.

One restored line, as a sample of what the other 2543 are:

    -    assert jones_trefoil_at_phi() 1222 PHI + PHI * PHI within 0.1
    +    assert jones_trefoil_at_phi() ≈ PHI + PHI * PHI within 0.1

The comparison operator was that file's 1222nd non-ASCII character.

This takes the RESTORE branch of the question in #2713 rather than
transliterating, on two grounds. The pre-image is exact and a
transliteration is a fresh authoring decision on 2544 lines. And the L3
ASCII rule is enforced by nothing today: 320 of 747 tracked .t27 files
carry 88,033 non-ASCII characters at HEAD and no gate objects -- while
TASK.md:128 records "0 non-ASCII remaining".

scripts/repair/unscar_4639b38cd.py is committed, so the transliterate
branch stays available and the operation is reproducible.
@github-actions

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

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

@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-26 17:22:27 UTC

Summary

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

Seal Status

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