Skip to content

test(aeneas): coverage guard — real relay primitive (CRC32) - #20

Merged
avrabe merged 3 commits into
mainfrom
experiment/aeneas-relay-coverage
Jul 22, 2026
Merged

test(aeneas): coverage guard — real relay primitive (CRC32)#20
avrabe merged 3 commits into
mainfrom
experiment/aeneas-relay-coverage

Conversation

@avrabe

@avrabe avrabe commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Discovery experiment, now a confirmed regression guard: translates relay's real crates/relay-primitives/plain/src/crc32.rs (IEEE CRC32) through the Aeneas pipeline.

Finding

  • Charon (Rust → LLBC): fully handles relay's code — const arrays, &[u8] slices, indexing, casts, bit ops.
  • Aeneas (build-2026.04.22, LLBC → Lean): hits [Error] Internal error, please file an issue specifically on a const-eval'd global array initializer (src/lib.rs:10-28, the CRC32_TABLE const) — a version-specific Aeneas bug, not a fundamental Rust-feature gap. Functions translate fine.
  • Workaround (this PR): compute the table via a runtime fn instead of const. Confirmed green on CI: aeneas translated relay CRC32 -> ... (3666 bytes), Build completed successfully.

Verdict for relay

Relay's verification-oriented plain code is Aeneas-translatable with one known idiom to avoid (const-eval'd global arrays) until upstream fixes the internal error. Worth filing with AeneasVerif.

What this adds

A permanent CI job (relay-coverage) translating real, external Rust — a stronger regression guard than the synthetic hello example, and documentation of the const-array limitation + workaround for anyone adapting more relay code.

🤖 Generated with Claude Code

avrabe and others added 3 commits July 1, 2026 07:14
Translates relay's crates/relay-primitives/plain/src/crc32.rs verbatim through
the pipeline to discover Aeneas coverage on relay's verification-oriented code.
Exercises features beyond the trivial example: a const-eval array, &[u8] slices,
indexing,  casts, , bit ops, while loops. Translate-only (light) + prints
the generated Lean. Adds a relay-coverage CI job.

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

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Aeneas (build-2026.04.22) hits an internal error translating a const-eval'd
global array initializer (src/lib.rs:10-28, the CRC32_TABLE const). Charon
handles it fine; the functions translate fine. Workaround: compute the table
via a runtime fn instead of const. This is the confirmed mitigation for
relay's crc32.rs pattern pending an upstream Aeneas fix.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@avrabe
avrabe marked this pull request as ready for review July 22, 2026 05:28
@avrabe avrabe changed the title [experiment] Aeneas coverage on real relay Rust (CRC32) test(aeneas): coverage guard — real relay primitive (CRC32) Jul 22, 2026
@avrabe
avrabe merged commit 37293a6 into main Jul 22, 2026
11 checks passed
@avrabe
avrabe deleted the experiment/aeneas-relay-coverage branch July 22, 2026 05:28
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