Skip to content

cert: read the type section only through its cut in the acceptance proofs - #1446

Merged
jasisz merged 1 commit into
mainfrom
cert/acceptance-cuts
Sep 26, 2026
Merged

jasisz merged 1 commit into
mainfrom
cert/acceptance-cuts

Conversation

@jasisz

@jasisz jasisz commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

The acceptance proofs a package writes read the type section through its declared cut (types_cut), but two of them unfolded CertDecode.carrierState, TypeTable.carrierConfirmed and WasmSlice.typeSectionMatches with simp. Each of those is a match on the decoded type section, and simp tried to reduce that match before the cut could rewrite the decode, so it evaluated the whole type-section decode in the elaborator.

On btc-listener (commit 5698c8e) compiled after #1444, this made aver-cert check fail: Artifact.lean ran past the 9000-second phase limit, where it took 266 s before #1444. Split into single theorems on the same built package:

theorem before after
roles_ok over 600 s 13 s
plans_ok over 580 s 68 s

The other theorems of Artifact.lean (axes_ok 13 s, envelope_ok under 1 s) were not affected. #1444 added the version and diff structs of every Vector<T>, which is what changed the type section. The fix is the same for both theorems: unfold these definitions by their unconditional equations (eq_def) with matcher reduction off (simp -iota), so the decode is replaced by the cut and read only in the kernel's decide.

This changes only the proof scripts the producer writes into Artifact.lean. The statements, the wall and the checker are unchanged, so the wall id stays the same and nothing moves in the ratchet.

With this change the full aver-cert check of that btc-listener package passes in 1331 s (measured on #1445 merged with main). It failed at the limit without the change.

Tests: the certificate snapshots, cert_certify_spec cert_projects_ and cert_hardening_spec (34).

…oofs

The package's roles_ok and plans_ok unfolded carrierState,
carrierConfirmed and typeSectionMatches with simp. Each is a match on
the decoded type section, and simp reduced that match before the cut
could rewrite the decode, evaluating the whole type-section decode in the
elaborator. After the Vector version structs changed the type section,
btc-listener's Artifact.lean ran past the 9000-second phase limit.

Unfold these definitions by their unconditional equations with matcher
reduction off, so the decode is replaced by the cut and read only in the
kernel: roles_ok 13 s and plans_ok 68 s on that package, where each ran
for over 10 minutes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@jasisz
jasisz force-pushed the cert/acceptance-cuts branch from 81033a0 to 4efea8b Compare September 26, 2026 06:00
@jasisz
jasisz merged commit fc6de67 into main Sep 26, 2026
30 checks passed
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