cert: certify a match on a List - #1445
Merged
Merged
Conversation
The plan grammar gains the two List patterns, `[]` and `[head, ..tail]`, and the two-arm List match the emitter lowers: both arms in either order, or either one first and `_` second. The wall ports `emit_mir_list_match` (stash the subject, `ref.is_null`, the `[]` arm in `then`, the head and tail read from the cons struct into the arm's binders in `else`) and proves the case in `agreement_step`, so a function that matches on a List, recursive ones included, is certified for the bytes already emitted. No helper, no new runtime contract, no schema change; the wall id rotates. The producer prints the patterns and carries the Rust twins of the arm pick, the typing and the lowering. Four hardening tests: the clean List certificate checks, and exchanged arm results, exchanged cons structs and exchanged head and tail slots decline. The ratchet records 54 gains and no loss; btc-listener goes from 632 to 765 certified exports. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A type table long enough to be written in pieces (`types_records_0`, `types_records_1`, ...) left those pieces folded in the `simp` that proves a bridge's arguments well typed, so the step stopped on an unreduced record lookup and the bridge fell to `sorry`. btc-listener's records crossed that length once List matches were certified: 65 of its 494 bridges and one bridged law lost their credit. The typing step now unfolds every piece of the table but the string segments, which typing never reads, and btc-listener is back at 494 of 494 bridges and 16 of 17 bridged laws with 765 certified exports. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
jasisz
marked this pull request as ready for review
September 25, 2026 22:26
# Conflicts: # docs/certification.md
This was referenced Sep 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First container for the certificate: a
matchon a List.What changes
Grammar,GrammarLower,GrammarSound): the patterns[](emptyList) and[head, ..tail](cons head tail), and the two-arm List match the emitter lowers: both arms in either order, or either one first with_second (listPick, the pick ofemit_mir_list_match). The lowering stashes the subject, tests it withref.is_null, runs the[]arm inthen, and inelsereads the head (field 0) and tail (field 1) of the cons struct into the arm's binders before the cons arm. The soundness case is inagreement_step; the root theorems keep the axiomspropext, Classical.choice, Quot.sound. No helper, no runtime contract, no schema change. The wall id rotates.plan_check.rscarries the Rust twins of the pick, the typing and the lowering.cert_hardening_spec: the clean List certificate checks, and a plan with the arm results exchanged, the List cons structs declared for each other's instantiation, and a cons pattern with head and tail slots exchanged each decline. Goal matrix, fibonacci blocker pins, json/payment_ops counts moved deliberately.--allow-dropnot used).types_records_0, …) left those pieces folded in a bridge's typingsimp. btc-listener's records crossed that length with the new exports, and 65 bridges plus one bridged law fell tosorryuntil the typing step unfolded the pieces.certification.md, CHANGELOG.Measurements
aver-cert checkof btc-listener (commit 5698c8e), main vs this branch:Other programs (producer admission):
A List argument has no source-bridge decoder yet, so the new exports carry no bridge; bridges and laws on bytes do not move until that decoder lands.
Strict
aver-cert verifyof a three-export List probe: CERTIFIED.Not in this PR
Non-empty List literals, the List helpers (
len,reverse,concat,take,drop,contains), the List bridge decoder, and Vector/Map (a store model and proved helper templates; #1444 is on main and declines every Vector-typed plan until then).Merged with main
main gained #1444 (wasm-gc Vector versions). The one conflict was the plan-grammar paragraph of
docs/certification.md: it keeps this branch's List match and #1444's sentence that a function touching a Vector is declined, and drops the fusedVector.getread from the admitted list. The wall id, the snapshots and the ratchet baseline merged without conflict: #1444 does not touch the wall, the snapshots are unchanged, andtools/cert_ratchet.pypasses on the merged baseline as it is (thecellAtdrop came with #1444). Re-run after the merge:cargo test -p aver-cert --all-features,cert_hardening_spec(38),cert_certify_spec cert_projects_, the snapshot tests, thecert_verify_spectripwires (43) andcert_one_build_spec, all passing.