Skip to content

fpga: elaboration ratchet back to 176 -- ternary_isa (W459), uart (spec), adapter (NEW-clean) (Closes #5908) - #5948

Open
gHashTag wants to merge 2 commits into
masterfrom
fix/fpga-elab-ratchet
Open

gHashTag wants to merge 2 commits into
masterfrom
fix/fpga-elab-ratchet

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

Closes #5908
Part of #5906

FPGA Build / fpga-conformance failed at the elaboration ratchet with 178 (baseline 176). After this PR it prints 176 (baseline 176) OK and exits 0. This was reproduced exactly with master's t27c and iverilog 12.0.

(c) iverilog version: it moved no row

  • The baseline header said iverilog-version 13.0. CI does not pin iverilog: it runs apt-get install -y iverilog, which on ubuntu noble is 12.0-2build2.
  • The last green master run, 35677509145 on 6b15994, logged Unpacking iverilog (12.0-2build2) and 176 (baseline 176) OK. The 13.0-taken numbers therefore matched 12.0 row for row.
  • The baseline is now re-taken under 12.0 and its header says so. The total is unchanged at 176.

(a) Per row: cause, commit, proof

row before -> after cause proof
ternary_isa 7 -> 6 901ed4f (#4594) added a test with a test-local given stages = [...]. W459 binds a [N]T parameter to the identifier at its call sites, test blocks included, and took that local for a module array. pipeline_total_latency lost input [263:0] stages; and indexed an undeclared name: Unable to bind wire/reg/memory stages[...]. master t27c: git show 901ed4fcc^:specs/fpga/ternary_isa.t27 -> 6 errors; git show 901ed4fcc:specs/fpga/ternary_isa.t27 -> 7. The only Verilog diff is the lost input line.
uart 1 -> 0 942a001 (#4651, whose message closed issue 2364) applied the issue's reproduction patch to the spec. It replaced fn on_comb(data: u8) -> bool { return uart_tx_send(data); } with an on_clock body: uart.v:175: Could not find variable on_clock in ZeroDSP_UART. restoring the line gives 0 errors. Ports go back to data/result, which is what contrib/formal/uart_formal_props.v binds.
adapter NEW -> recorded 0 d4a7164 (S11 adapter contract) added specs/fpga/adapter.t27, which has 0 errors. The step still failed, because if worse or new: return 1 counted a clean new module as a regression. planted run: 178 = 178, only NEW adapter 0, exit 1.

Red runs on master: a90bdac (177, ternary_isa), 078f8ad (178, uart), then cadd11b (adds NEW adapter).

Fixes

Blast radius of the compiler fix

The Verilog of 10 specs changes; Zig, C and Rust output do not. iverilog error counts for those specs (only ternary_isa is in the ratchet set):

spec before after
compiler/lexer 71 21
tools/gft_generalize_demo 6 2
uuid 2 1
queen task_analysis 5 0
queen views 3 0
fpga/ternary_isa 7 6
prove, ternary_mac_demo_top, gen_kmeans same same
vsa/ops 13 14

vsa/ops is unmasking, not a regression. The old output bound one argument for all three array parameters and computed v+v+v. Now each is passed by value, and the remaining error is on lines that were already there.

Seals. The 15 seals whose Verilog hash moved are resealed with t27c seal --save. tools_GftGeneralizeDemo was resealed with --force: its softmax_picks_the_max_index test already fails with master's t27c (it was recorded blocked). tools/seal_baseline.txt gets a tests-fail row for it. UART_Bridge's seal records the restored uart spec. check_seal_currency.py and check_seal_coverage.py both exit 0.

The rest of fpga-conformance and the other FPGA jobs

On master run 37185428922 every fpga-conformance step after the ratchet was skipped, so none was red on its own. Locally on this branch they all pass:

  • fpga-conformance
    • gate preconditions + self-check
    • vector data + self-check
    • mac 18 cases, spi 3 cases
    • summary 34 CLEAN, schema 34 valid
  • fpga-lint
    • yosys read_verilog -sv -DSIMULATION; hierarchy -top passes for 37/37 generated modules.
    • t27c synth-readiness reports 38/38, READY FOR SYNTHESIS.
  • fpga-synthesis
    • t27c fpga-build --docker false --synth-only completes under yosys 0.67, with and without --minimal. ZeroDSP_UART is synthesised inside ZeroDSP_TopLevel.

The other FPGA jobs (smoke, synthesis, synthesis-arty, formal, bitstream, report) were green on master. No hardware was touched or flashed.

Left open

🤖 Generated with Claude Code

…plained (Closes #5908)

Part of #5906. The FPGA Build / fpga-conformance ratchet printed
178 (baseline 176). iverilog version moved no row: CI installs 12.0
unpinned and master run 35677509145 printed 176 under 12.0.

- ternary_isa 6 -> 7 (901ed4f, #4594): W459 bound an array parameter
  to a test-local `given stages = [...]`, deleting `input [263:0]
  stages;`. Compiler fix: bind only to a module-level const or var.
  Test first: bootstrap/tests/verilog_array_param_test_local.rs.
  FROZEN_HASH updated.
- uart 0 -> 1 (942a001, #4651): the #2364 reproduction patch was
  applied to the spec. The on_comb line is restored.
- adapter NEW 0 (d4a7164): a clean new module failed the step.
  check_elab_ratchet.py reports NEW-clean and exits 0. The self-check
  case NEW0 was written first and shown failing. adapter 0 recorded.

The baseline was re-taken under iverilog 12.0, with the total unchanged
at 176. Fifteen seals were resealed for the new Verilog hashes.
GftGeneralizeDemo was resealed with --force because a test already
fails on master; a tests-fail ledger row records it.

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

The comment above "The gates in this file's table must fail loudly"
said the elaboration ratchet "has failed on every master run". That
stops being true once #5948 lands. It now says what the ratchet checks:
each generated module's iverilog elaboration count is at most its row in
tools/elab_baseline.txt, and a module new to the set passes only at 0.
The a90bdac..#5908 failure is kept as history.

Only comment lines change. The parsed workflow is identical at HEAD and
after the edit (8 jobs, 42 run steps), so the cli-tri census does not
move.

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

github-actions Bot commented Oct 4, 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 Oct 4, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-04 07:55:18 UTC

Summary

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

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

Seal Status

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

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-04 07:57:16 UTC

Summary

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

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

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=aad9a8fd3343 != 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 4, 2026
This was referenced Oct 5, 2026
@gHashTag

gHashTag commented Oct 6, 2026

Copy link
Copy Markdown
Owner Author

PR #6686 takes this PR's t27 and data parts (the uart on_comb line, adapter 0, the iverilog 12.0 header) so master's fpga-conformance can go green, and records ternary_isa 7 as a known gap (#6685). The compiler, ratchet-script and workflow changes here are hand-written Rust/Python/yml and need the owner's owner-approved-foreign label under the only-t27 rule. Once labelled and merged, this PR should bring ternary_isa back to 6 and drop its baseline row to match; it will also need Closes #6685 instead of #5908.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant