Skip to content

Aeneas Level 2: compile + verify translated Rust (advances #1)#12

Merged
avrabe merged 8 commits into
mainfrom
feat/aeneas-verified-library
Jun 6, 2026
Merged

Aeneas Level 2: compile + verify translated Rust (advances #1)#12
avrabe merged 8 commits into
mainfrom
feat/aeneas-verified-library

Conversation

@avrabe

@avrabe avrabe commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Completes the Rust verification pipeline, modelled on rules_rocq_rust/examples/rust_to_rocq. All CI green, including the heavy Aeneas Lean lib build job which now runs the full chain.

The full chain — now CI-proven

Rust → Charon (LLBC) → Aeneas (Lean) → compile → PROVE

  • charon_llbc (Rust→LLBC) and aeneas_translate (LLBC→Lean, now a discrete .lean module).
  • hello_compiled: lean_library compiling the translated model against @aeneas_lean_lib.
  • hello_verified: lean_proof_test kernel-checking properties of the translated functions (zero sorry/axiom):
    • add.spec — no-overflow add returns the exact sum;
    • identity.spec — identity returns its input.

Fixes this surfaced (each only exposable by an actual compile/proof)

  • _required_lean_from_rev stripped -rcN, falsely flagging RC Lean (4.28.0-rc1) vs RC Mathlib skew.
  • aeneas_translate now emits a discrete .lean (removes the TreeArtifact blocker).
  • aeneas olean consolidation: prefer .lake/build/lib/lean (flat layout) and copy Mathlib from mathlib4_src (the aeneas_lean_lib has the same unpinned full-clone / silent-HEAD bug fixed for mathlib in #6 #7 local-path redirect moved it out of .lake/packages).
  • aeneas binary is at the tarball root, not bin/.
  • CI Linux jobs migrated to the org self-hosted runner pool (light/rust-cpu); GitHub-hosted ubuntu-latest no longer allocated.

Shared infra

lean/private/mathlib_fetch.bzl — the #7 shallow-fetch helper used by both mathlib_repo and aeneas_lean_lib.

Advances #1 (FEAT-006). Dev-mode pin (no sha256 yet) — pin hashes follow-up. The aeneas_verified_library convenience macro (translate+compile+prove in one) is a remaining nicety; the example demonstrates the full pipeline.

🤖 Generated with Claude Code

avrabe and others added 8 commits June 6, 2026 06:28
…neas output)

Models rules_rocq_rust's rust_to_rocq: translate -> compile -> (proof next).

- aeneas_translate now emits a discrete <name>.lean (copies the single module
  out of aeneas's -dest dir; fails loudly on multi-file/-split output). This
  removes the TreeArtifact blocker so a lean_library can consume it directly.
- tests/charon_llbc: wire the lean toolchain (4.28.0-rc1, dev-mode — must match
  @aeneas_lean_lib's oleans) and add `hello_compiled` = lean_library over the
  translated Lean, deps @aeneas_lean_lib//:Aeneas. Kernel-checks that the Rust
  model elaborates.
- ci.yml: build-aeneas-lean-lib also builds //:hello_compiled.

Next: a hand-written proof + lean_proof_test (the verify step), once the
compile bridge is CI-green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
CI caught it via the aeneas Level-2 compile: Lean 4.28.0-rc1 (what Aeneas pins)
pairs with Mathlib v4.28.0-rc1, but _required_lean_from_rev did
base.split('-')[0] -> '4.28.0', falsely flagging skew against the '4.28.0-rc1'
toolchain. Mathlib tags track the Lean version exactly including pre-release
suffixes, so strip only the leading 'v'. Stable-version tests didn't exercise
this; the RC path did.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Level-2 compile exposed it: `import Aeneas` couldn't find Aeneas.olean. Lake v4
nests oleans under .lake/build/lib/lean/, and the consolidation copied the outer
.../lib/. — landing them at lib/lean/Aeneas.olean instead of lib/Aeneas.olean,
which the path_marker dir (lib/) can't resolve. Mirror the mathlib consolidation:
prefer the .../lib/lean level and break on first match, so modules land flat in
lib/. Latent bug — nothing compiled against @aeneas_lean_lib until now.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ath)

Level-2 compile got past 'import Aeneas' to 'unknown module prefix Mathlib'.
The #7 shallow-fetch made aeneas's mathlib a LOCAL-PATH dep, so its oleans live
under mathlib4_src/.lake/build, not .lake/packages — the consolidation missed
them, so Aeneas's transitive Mathlib imports couldn't resolve. Copy from
mathlib4_src too, mirroring @mathlib's own consolidation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…test

The verification payoff. HelloProofs.lean states + kernel-checks properties of
the Aeneas-translated functions (zero sorry/axiom), using Aeneas's ⦃ ⦄
progress-spec DSL:
  - add.spec: no-overflow add returns the exact sum.
  - identity.spec: identity returns its input.

Wires a lean_proof_test over :hello_compiled + @aeneas_lean_lib and runs it in
CI. Completes the Rust -> LLBC -> Lean -> compile -> PROVE chain (closes #1's
Level-2 gap), modelled on rules_rocq_rust's point_proofs.v.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
CI: add.spec checked green; identity.spec hit 'No goals to be solved' at step,
since  already discharges ok x ⦃ y => y = x ⦄ (x = x). Remove
the trailing step.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@avrabe avrabe marked this pull request as ready for review June 6, 2026 07:06
@avrabe avrabe changed the title [WIP] Aeneas Level 2: compile + verify translated Rust (closes #1) Aeneas Level 2: compile + verify translated Rust (advances #1) Jun 6, 2026
@avrabe avrabe merged commit 8e3e33f into main Jun 6, 2026
10 checks passed
@avrabe avrabe deleted the feat/aeneas-verified-library branch June 6, 2026 08:11
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