Skip to content

specs/port: four ported types stop colliding with corpus types (types ratchet) - #5812

Merged
1 commit merged into
masterfrom
fix/types-ratchet-port-conflicts
Oct 4, 2026
Merged

1 commit merged into
masterfrom
fix/types-ratchet-port-conflicts

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Closes #5810

Description

Corpus Ratchet, step "A type name may not gain a second definition", is red on master at 17f09865a (run https://github.com/gHashTag/t27/actions/runs/37147322541): ledger 77 name(s), observed 81, four NEW conflicts. Every open PR inherits it.

All four come from the 2026-10-03 batch of automated trinity ports (merged 18:31-18:33 UTC, each with this job already red). tri types ratchet walks specs/ only (not compiler/), so compiler/*.t27's TestCase definitions play no part.

Name Older definition (kept) Newer definition (renamed) Introduced by Renamed to
CounterState specs/port/fpga/vivado/uart_echo_top.t27:43 {value: u32} specs/port/trinity/fpga/openxc7-synth/d_f19_test.t27:17 {value: u32, cycles: u32} #5797 (03a9a0a) F19CounterState
CounterState (same) specs/port/trinity/fpga/openxc7-synth/d_slow_blink.t27:29 {value: [24]u32} #5798 (188884e) SlowBlinkCounterState
LRUCache specs/tri/collections/lru_cache.t27:13 specs/port/trinity/src/tri/gen_cache.t27:3 #5794 (aa59672) GenLRUCache
TestCase specs/port/tools/wp18_gate_selfconsistent_selftest.t27:36 specs/port/trinity/src/tri/gen_test_runner.t27:3 #5792 (8bcc41b) GenTestCase
TestRunner specs/test_framework/runner.t27:90 specs/port/trinity/src/tri/gen_test_runner.t27:8 #5792 (8bcc41b) GenTestRunner

The repair follows #5504 (Refs #5497): rename the newer definition inside its own file and leave the ledger alone. Nothing is blessed -- none of the four is a deliberate shared type; each pair is two unrelated concepts on one name. Function and test names (LRUCache_init, TestRunner_run, ...) stay as ported, as #5504 left BezierCurve_eval.

The porter will not undo this: tools/queen/feed_roadmap.py pick() skips any target that already exists or is already named by an issue, so these files are not regenerated.

Changes

  • specs/port/trinity/fpga/openxc7-synth/d_f19_test.t27 -- CounterState -> F19CounterState (every use in the file)
  • specs/port/trinity/fpga/openxc7-synth/d_slow_blink.t27 -- CounterState -> SlowBlinkCounterState
  • specs/port/trinity/src/tri/gen_cache.t27 -- LRUCache -> GenLRUCache
  • specs/port/trinity/src/tri/gen_test_runner.t27 -- TestCase -> GenTestCase, TestRunner -> GenTestRunner
  • docs/now/2026-10-04-four-ported-types-stop-colliding-with-corpus-types.md -- NOW entry
  • Not changed: docs/reports/type_conflicts.json, docs/reports/type_conflicts_classified.json, docs/TYPE_CONFLICTS.md (none of the four names was in them); .trinity/seals/ (none of the four specs had a seal -- t27c seal --verify answers "No saved seal found" -- and minting them is not this change: d_f19_test.t27 and d_slow_blink.t27 are both module trinity_top and would write the same openxc7-synth_trinity_top.json); nothing under gen/.

Testing

Fresh worktree off origin/master (17f09865a); cargo build -p tri, cargo build --release -p t27c.

./target/debug/tri types ratchet
#   before: ledger 77 name(s), observed 81; + CounterState + LRUCache + TestCase + TestRunner NEW conflict; rc 1
#   after:  ledger 77 name(s), observed 77; RATCHET: CLEAN; rc 0
./target/debug/tri types classified
#   classification: 77 name(s) -- 44 DRIFT, 33 DISTINCT; tree today: 77; OK; rc 0
./target/debug/tri types redef        # 0 names in any class; rc 0
python3 tools/dupe_scan.py            # 588 of 4723 in 168 group(s); ok: no new duplicate body; rc 0
python3 tools/check_seal_currency.py  # 1433 scanned, 1278 current, STALE generated-code hash 0; rc 0
./target/release/t27c parse-complete --specs-dir specs/port/trinity/src/tri               # 36/36 consume all; rc 0
./target/release/t27c parse-complete --specs-dir specs/port/trinity/fpga/openxc7-synth   # rc 0; 2 DISCARD (d_simple_ff 165, d_slow_blink 182) -- same before and after, see Review Notes

Codegen equivalence: for each of the four files, t27c gen, gen-rust, gen-c and gen-verilog were run on the pre-rename and post-rename copy. All 16 runs exit 0 both times, and the outputs are byte-identical once the new name is mapped back to the old one (the new names do appear in every output: 4 to 24 hits per file).

L3: grep -P '[^\x00-\x7F]' over the five touched files prints nothing.

Review Notes

This PR turns the types step green; the Corpus ratchet (expected-failure ledger) check will still be red, one step later. On master the step "Run the corpus ratchet" was skipped behind the types failure, so nobody has seen its verdict. Locally on this branch:

./target/release/t27c suite --repo-root . --ratchet --corpus-only
  ledger: 95 / 126 cap   observed (primary): 98
  UNEXPECTED FAILURES: 3
    + specs/port/trinity/fpga/openxc7-synth/d_simple_ff.t27 [parse-no-discard]   (#5793)
    + specs/port/trinity/fpga/openxc7-synth/d_slow_blink.t27 [parse-no-discard]  (#5798)
    + specs/xilinx7/packets.t27 [parse]                                          (#5795)
RATCHET: FAIL

None is caused by this change: two files are untouched, and d_slow_blink.t27 discards the same 182 tokens before and after the rename (parse-complete on isolated copies). All three landed in the same 2026-10-03 batch with this check already red. Causes: the two openxc7-synth ports write tests as var (a, b) = f(...) tuple bindings, which the parser drops, so those test clauses (and one d_simple_ff invariant) never reach codegen; packets.t27 uses a C-style for (var i = 0; i < 37; i += 1) at line 137. They want a spec fix or a ledger entry with a reason, which is a separate decision from this one and is left out of this PR on purpose.

Title deliberately not fix(<compiler scope>) (tools/check_fix_carries_source.py): no compiler source changes.

φ² + 1/φ² = 3 | TRINITY

🤖 Generated with Claude Code

… ratchet)

`tri types ratchet` was red on master at 17f0986: ledger 77, observed
81, four NEW conflicts from the 2026-10-03 trinity port batch.

Rename the newer definition inside its own file, as #5504 did, instead
of blessing the ledger:

  CounterState  d_f19_test.t27 (#5797)      -> F19CounterState
  CounterState  d_slow_blink.t27 (#5798)    -> SlowBlinkCounterState
  LRUCache      gen_cache.t27 (#5794)       -> GenLRUCache
  TestCase      gen_test_runner.t27 (#5792) -> GenTestCase
  TestRunner    gen_test_runner.t27 (#5792) -> GenTestRunner

All four backends emit byte-identical output for each file once the new
name is mapped back. Ledger, classification and TYPE_CONFLICTS.md are
unchanged (none of the names was in them); ratchet CLEAN at 77,
classified OK. No seal existed for any of the four specs.

Closes #5810

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

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-03 19:53:18 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 42
PRs with All Checks Green 8
READY 7
FAILING 42
PENDING 0
NO CHECKS YET 0

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

Seal Status

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

@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

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

@dmitrii-f-t27 dmitrii-f-t27 closed this pull request by merging all changes into master in a9e6c76 Oct 4, 2026
gHashTag added a commit that referenced this pull request Oct 4, 2026
The three red checks on this PR (corpus ratchet types, emit-bitexact on
specs/xilinx7/packets.t27, spec-guards) were measured on 2026-10-03 against a
master that was red for the same reasons; #5812 and the packets fixes have
since landed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gHashTag added a commit that referenced this pull request Oct 4, 2026
#5853)

* feat(tri pr ready): ask a check's own workflow when the commit window missed it

`tri pr ready 5826` said CANNOT TELL (exit 3) on fpga-conformance: "did not
run on any recent master commit". It had: master's newest run of FPGA E2E
Build at e7ed379 failed that job, 21 commits back; the walk reads 15.

Only for a failure neither the walk nor the merged-PR baseline observed:
details_url -> run -> workflow -> its newest completed default-branch runs
(page 10, page-fill guarded), read one at a time until a job of the same
name reached success/failure/timed_out. Cancelled and skipped are passed
over. Red there is pre-existing, green there is new here, nothing there
stays NO BASELINE and says how far it looked. An API error leaves the
check without a baseline: CANNOT TELL, never safe. The walk is unchanged.

Real run: tri pr ready 5826 -> exit 0, citing e7ed379 and its age.
8 new tests (53 in prcheck), 7 mutations each red.

Census: fetches moved 69 -> 72 lines, fetch sites 28 -> 31 (--paginate
7 -> 9, page-fill guarded 10 -> 11) -- the three new reads, every one
complete or guarded; unguarded buckets unchanged. Blessed here.

Closes #5837
Refs #5786

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

* feat(tri pr ready): --why compares what a pre-existing failure printed

A check red on master under the same NAME was called pre-existing,
whatever its step printed. A pull request that adds a fifth conflicted
type name to the Corpus ratchet read exactly like one that adds nothing.

--why (off by default) fetches the failing step's own output from both
jobs -- this pull request's and the one the baseline used -- masks
timestamps, colour codes, durations, shas and long ids, and compares
each side's last 60 lines against the other side's whole output. A line
not found as itself is looked for by its shape (digits read as #): it is
printed for a person, not judged, because a count moves when the cause
does not (#5663: observed 78 vs 81, a subset of master's names).

NEW REASON is exit 7; precedence 2 > 3 > 1 > 7 > 0; --merge refuses.
Live: #5781 NEW REASON (+ ModuleInterface), exit 7; #5663 SAME REASON,
fewer, exit 0; #5812 NEW REASON (another step), exit 7.

Tests: 6 new in prcheck::why_tests + the verdict test now calls the
real verdict_code (59 in prcheck). 16 mutations, each red.

Census: fetches 72 -> 74 lines, 31 -> 33 fetch sites, --paginate
9 -> 11 (failing_jobs_on, failing_job_in_run). Blessed here.

Closes #5852
Refs #5837 #5839

Co-Authored-By: Claude Opus 5.5 <noreply@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.

types ratchet red on master: four ported types collide with corpus types (CounterState, LRUCache, TestCase, TestRunner)

2 participants