Skip to content

Check Rust specs against golden and live Aeneas models - #3826

Open
joshlf wants to merge 1 commit into
G5bbi6lfcow3sjrplwzweldyeyjggh3atfrom
G5ql2xwdsnzdupc5d4auj6l5vgi5okgrc
Open

joshlf wants to merge 1 commit into
G5bbi6lfcow3sjrplwzweldyeyjggh3atfrom
G5ql2xwdsnzdupc5d4auj6l5vgi5okgrc

Conversation

@joshlf

@joshlf joshlf commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Make a specification beside a Rust item a mandatory CI claim about that
item's extracted implementation. Parse doc fences with their syntax owners,
audit every reserved fence independently, and bind each specification to
the inspected function signature and original arguments. Keep proofs in
ordinary Lean theorems outside Rust.

Recursively decode extracted values into mathematical carriers. Inline type
models may refine decoded fields; ordinary clauses use those values and
raw clauses retain the representations. Retain generic modeling providers
explicitly and require every successful result to decode before checking
its postconditions. A shared composition helper carries execution through
the retained mathematical decoder, preserving failures and divergence;
its total and partial contract rules match the separate decoding checks.
Preserve nominal tuple structs through the checked-in patch exposing
Aeneas's existing setting.

Use Anneal's pinned toolchain to extract the four initial arithmetic
helpers. Compare complete generated modules with checked-in goldens, then
build and audit proofs independently against golden and live definitions.
Check contract adequacy against separately written expectations for
arbitrary execution outcomes, so a weaker but provable spec cannot satisfy
an existing expectation unnoticed.

Check in the assembled model shapes, decoders and specifications as
review snapshots. CI regenerates and compares them exactly, while
compiling proofs from fresh Rust-derived annotation sources.

Add a stable native Lean editing project, source maps and guarded copy-back
to the owning Rust comments. Preserve unchanged generated timestamps and
use native incremental module checks for provisional editing feedback.
Keep the final command separate: it rebuilds every mutable source against
both models and runs all binding, proof-dependency and axiom checks.

Run rejection controls in bounded, isolated families. Freeze independently
verified baselines, reuse them for metadata-only mutations, and rebuild
semantic mutations from current sources. Retain exact statuses, logs and
timings, including interrupted work. Optionally share pinned toolchain
installations using complete input identities and validated payloads;
publish each cache entry atomically without replacing an existing entry.

Document the interpretation, trust boundary and deferred design work.
These checks establish conditional functional claims rather than
whole-crate unsafe soundness.

Authored by an AI agent acting on joshlf's behalf.


Latest Update: v31 — Compare vs v30

📚 Full Patch History

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

Version v30 v29 v28 v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v31 v30 v29 v28 v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v30 v29 v28 v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v29 v28 v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v28 v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v8 v7 v6 v5 v4 v3 v2 v1 Base
v7 v6 v5 v4 v3 v2 v1 Base
v6 v5 v4 v3 v2 v1 Base
v5 v4 v3 v2 v1 Base
v4 v3 v2 v1 Base
v3 v2 v1 Base
v2 v1 Base
v1 Base
⬇️ Download this PR

Branch

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

Checkout

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

Cherry Pick

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

Pull

git pull origin refs/heads/G5ql2xwdsnzdupc5d4auj6l5vgi5okgrc

Stacked PRs enabled by GHerrit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 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-08T10:27:04.809896Z be63c2e PR opened
🔒 Security Review ✅ Completed 2026-10-08T10:23:52.004844Z be63c2e 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.

This was referenced Oct 8, 2026

@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: be63c2ec2e

ℹ️ 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 thread zerocopy/src/util/mod.rs
///
/// ```aeneas
/// spec padding_lt_alignment
/// ensures p => (p : Nat) < (align : Nat)

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 Require padding to produce an aligned offset

The new contract only bounds p; it never relates the result to len. For example, with len = 1 and align = 8, an implementation returning 0 satisfies this specification even though len + p is not aligned and the function's documentation and Kani contract require padding to the next multiple. Add the power-of-two premise and the corresponding congruence postcondition so the Aeneas proof checks the function's intended behavior.

AGENTS.md reference: zerocopy/AGENTS.md:L58-L59

Useful? React with 👍 / 👎.

Comment thread zerocopy/src/util/mod.rs
/// ```aeneas
/// spec round_down_spec
/// requires h : (align : Nat).isPowerOfTwo
/// ensures m => (m : Nat) ≤ (n : Nat) ∧ (m : Nat) % (align : Nat) = 0

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 Require the greatest aligned predecessor

This postcondition permits any aligned value below n, not the largest one promised by the function documentation and the adjacent Kani contract. With n = 9 and align = 8, returning 0 satisfies the Aeneas contract even though the required result is 8; include the maximality condition, such as requiring the next aligned value to exceed n when it is representable.

AGENTS.md reference: zerocopy/AGENTS.md:L58-L59

Useful? React with 👍 / 👎.

Comment on lines +110 to +113
"runtime_binary_sha256": {name: digest(tools / name) for name in
["charon", "charon-driver", "rust/bin/rustc",
"rust/bin/cargo", "lean/bin/lean", "lean/bin/lake"]},
"libraries": {p.name: digest(p) for p in sorted((tools / "libs").glob("*.dylib"))}}

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 Include proof backends and runtime libraries in provenance

When setup.sh reuses an existing toolchain, validate compares this record, but the record hashes only selected executables and tools/libs/*.dylib; it omits the Lean backend consumed by prepare.share_manifest and the shared libraries under lean/lib and rust/lib. Consequently, changing a cached backend definition or Linux runtime library leaves provenance unchanged and the installation is reported as validated even though subsequent extraction or proof checking uses altered code. Include these directories in the recorded content identity, or revalidate the archive that supplied them.

Useful? React with 👍 / 👎.

@joshlf
joshlf force-pushed the G5bbi6lfcow3sjrplwzweldyeyjggh3at branch from 2b81695 to 92559e5 Compare October 14, 2026 18:32
@joshlf
joshlf force-pushed the G5ql2xwdsnzdupc5d4auj6l5vgi5okgrc branch from f9211b5 to 9f142e4 Compare October 14, 2026 18:32
@joshlf
joshlf force-pushed the G5ql2xwdsnzdupc5d4auj6l5vgi5okgrc branch from 9f142e4 to b03b22f Compare October 14, 2026 21:43
@joshlf
joshlf force-pushed the G5bbi6lfcow3sjrplwzweldyeyjggh3at branch from 92559e5 to 3924d25 Compare October 14, 2026 21:43
@joshlf
joshlf force-pushed the G5ql2xwdsnzdupc5d4auj6l5vgi5okgrc branch from b03b22f to f561c6e Compare October 15, 2026 00:40
@joshlf
joshlf force-pushed the G5bbi6lfcow3sjrplwzweldyeyjggh3at branch from 3924d25 to ce0aad4 Compare October 15, 2026 00:40
Make a specification beside a Rust item a mandatory CI claim about that
item's extracted implementation. Parse doc fences with their syntax owners,
audit every reserved fence independently, and bind each specification to
the inspected function signature and original arguments. Keep proofs in
ordinary Lean theorems outside Rust.

Recursively decode extracted values into mathematical carriers. Inline type
models may refine decoded fields; ordinary clauses use those values and
raw clauses retain the representations. Retain generic modeling providers
explicitly and require every successful result to decode before checking
its postconditions. A shared composition helper carries execution through
the retained mathematical decoder, preserving failures and divergence;
its total and partial contract rules match the separate decoding checks.
Preserve nominal tuple structs through the checked-in patch exposing
Aeneas's existing setting.

Use Anneal's pinned toolchain to extract the four initial arithmetic
helpers. Compare complete generated modules with checked-in goldens, then
build and audit proofs independently against golden and live definitions.
Check contract adequacy against separately written expectations for
arbitrary execution outcomes, so a weaker but provable spec cannot satisfy
an existing expectation unnoticed.

Check in the assembled model shapes, decoders and specifications as
review snapshots. CI regenerates and compares them exactly, while
compiling proofs from fresh Rust-derived annotation sources.

Add a stable native Lean editing project, source maps and guarded copy-back
to the owning Rust comments. Preserve unchanged generated timestamps and
use native incremental module checks for provisional editing feedback.
Keep the final command separate: it rebuilds every mutable source against
both models and runs all binding, proof-dependency and axiom checks.

Run rejection controls in bounded, isolated families. Freeze independently
verified baselines, reuse them for metadata-only mutations, and rebuild
semantic mutations from current sources. Retain exact statuses, logs and
timings, including interrupted work. Optionally share pinned toolchain
installations using complete input identities and validated payloads;
publish each cache entry atomically without replacing an existing entry.

Document the interpretation, trust boundary and deferred design work.
These checks establish conditional functional claims rather than
whole-crate unsafe soundness.

gherrit-pr-id: G5ql2xwdsnzdupc5d4auj6l5vgi5okgrc
Agent-authored-by: AI agent acting on joshlf's behalf

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

Development

Successfully merging this pull request may close these issues.

2 participants