Skip to content

Support generic inline proofs and closed method coverage - #3741

Closed
joshlf wants to merge 1 commit into
Gzdelmzn5y42ab3htat7lqrwovbusi5shfrom
Ggyxdemsrutwypf7tui4otq6shrm2ivah
Closed

joshlf wants to merge 1 commit into
Gzdelmzn5y42ab3htat7lqrwovbusi5shfrom
Ggyxdemsrutwypf7tui4otq6shrm2ivah

Conversation

@joshlf

@joshlf joshlf commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Resolve annotations on parameterized inherent impls and generic methods against Charon's exact Self identity. Optional closed impl scopes reject every unregistered method, including inactive cfg alternatives.

Add bijective named proof slots so support lemmas can sit between registered proofs. Keep generated constants, dependencies, and loop helpers in independently compared scaffolding. Follow helper declarations throughout the proof namespace when checking declared theorem dependencies.

gherrit-pr-id: Ggyxdemsrutwypf7tui4otq6shrm2ivah
Validation: 25 Python tests and 3 Rust annotation-tool tests; full final golden/live replay and dependency failure controls.


Latest Update: v5 — Compare vs v4

📚 Full Patch History

Links show the diff between the row version and the column version.

Version v4 v3 v2 v1 Base
v5 vs v4 vs v3 vs v2 vs v1 vs Base
v4 vs v3 vs v2 vs v1 vs Base
v3 vs v2 vs v1 vs Base
v2 vs v1 vs Base
v1 vs Base
⬇️ Download this PR

Branch

git fetch origin refs/heads/Ggyxdemsrutwypf7tui4otq6shrm2ivah && git checkout -b pr-Ggyxdemsrutwypf7tui4otq6shrm2ivah FETCH_HEAD

Checkout

git fetch origin refs/heads/Ggyxdemsrutwypf7tui4otq6shrm2ivah && git checkout FETCH_HEAD

Cherry Pick

git fetch origin refs/heads/Ggyxdemsrutwypf7tui4otq6shrm2ivah && git cherry-pick FETCH_HEAD

Pull

git pull origin refs/heads/Ggyxdemsrutwypf7tui4otq6shrm2ivah

Stacked PRs enabled by GHerrit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-02T07:38:54.631467Z aa92971 PR opened
🔒 Security Review ✅ Completed 2026-10-02T07:37:38.371561Z aa92971 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codecov-commenter

codecov-commenter commented Oct 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.90%. Comparing base (f7e72dc) to head (b84003e).

Additional details and impacted files
@@                        Coverage Diff                         @@
##           Gzdelmzn5y42ab3htat7lqrwovbusi5sh    #3741   +/-   ##
==================================================================
  Coverage                              91.90%   91.90%           
==================================================================
  Files                                     20       20           
  Lines                                   6177     6177           
==================================================================
  Hits                                    5677     5677           
  Misses                                   500      500           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aa92971bce

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +206 to +208
methods = [function for function in syntax[scope['file']]['functions']
if function['method'] and function['inherent']
and function['impl_type'] == scope['type']]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject macros in closed impl coverage

When a covered impl contains at least one explicit method plus an associated-item macro such as generate_methods!(), the syntax tool reports only the explicit ImplItemFn nodes, so this list can be fully matched while the macro expands to additional unregistered methods. That makes the new “closed” coverage check silently certify incomplete coverage; either expand such macros or fail closed whenever a covered impl contains an uninspectable associated-item macro.

Useful? React with 👍 / 👎.

Comment on lines +461 to +465
display = re.match(r'/-- \[(zerocopy::[^\]\n]+)\]:', match[0])
if not display:
continue
rust = identity(display[1])
if rust not in by_rust:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Skip unknown roots before enforcing inherent identity syntax

When generated Funs.lean contains an unregistered dependency with a braced identity outside this narrow inherent-method grammar—for example a local trait method displayed as {impl Trait for Type}::method—identity() raises here before the subsequent rust not in by_rust branch can preserve it as scaffolding. Consequently --update-goldens fails instead of retaining valid dependency output; unsupported identities should only be rejected when they correspond to an inventoried root.

Useful? React with 👍 / 👎.

Comment on lines +470 to +474
# Loop helpers carry the owner's Rust identity; retain their generated
# definitions independently rather than substituting an inline body.
declaration = next((line for line in lines if line.startswith('def ')), '')
if re.match(rf'def {re.escape(entry["model"])}_loop(?:\.body)?(?=\s|\(|$)', declaration):
continue

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve every numbered loop helper

When an annotated function has multiple loops, Aeneas must disambiguate the later generated loop declarations with a numbered variant of the model’s _loop name while their documentation still carries the owning Rust identity. This regex accepts only the unsuffixed first helper, so a later helper is treated as the registered root and fails the following model-identity check, preventing golden updates for multi-loop functions. Classify loop helpers from their generated attribute/documentation or accept the generator’s numbered loop-name variants.

Useful? React with 👍 / 👎.

Resolve annotations on parameterized inherent impls and generic methods against Charon's exact Self identity. Optional closed impl scopes reject every unregistered method, including inactive cfg alternatives.

Add bijective named proof slots so support lemmas can sit between registered proofs. Keep generated constants, dependencies, and loop helpers in independently compared scaffolding. Follow helper declarations throughout the proof namespace when checking declared theorem dependencies.

gherrit-pr-id: Ggyxdemsrutwypf7tui4otq6shrm2ivah
Validation: 25 Python tests and 3 Rust annotation-tool tests; full final golden/live replay and dependency failure controls.
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.

2 participants