Skip to content

Prove concrete owned standard transmutation - #3877

Open
joshlf wants to merge 1 commit into
G4s3r4gpuxvvnoxoizjjgoy3b2rwmgi7gfrom
Gwz22aqvb6z6qe2dmsgncsa6phc6jlxbf
Open

joshlf wants to merge 1 commit into
G4s3r4gpuxvvnoxoizjjgoy3b2rwmgi7gfrom
Gwz22aqvb6z6qe2dmsgncsa6phc6jlxbf

Conversation

@joshlf

@joshlf joshlf commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Verify the native standard transmute calls for u32 -> [u8; 4],
[u8; 4] -> u32, and u8 -> bool. Retain the original ordered Rust
endpoint types, require their canonical closed providers, and audit
whole primitive and provider definitions plus every reached call,
including calls inside unannotated helpers.

Scope the numeric interpretation to the original little-endian 64-bit
compiler target. The fixed unsigned scalars and initialized byte arrays
have no padding or pointers. Boolean decoding accepts exactly zero and
one and returns undef before constructing a Boolean for any invalid byte.

Prove the Rust round-trip assertion root and independent arbitrary-outcome
contracts for both integer conversions and the guarded Boolean conversion.
The production transmute macro, pointer semantics, and generic FromBytes
support remain deferred.

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


Latest Update: v11 — Compare vs v10

📚 Full Patch History

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

Version 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/Gwz22aqvb6z6qe2dmsgncsa6phc6jlxbf && git checkout -b pr-Gwz22aqvb6z6qe2dmsgncsa6phc6jlxbf FETCH_HEAD

Checkout

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

Cherry Pick

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

Pull

git pull origin refs/heads/Gwz22aqvb6z6qe2dmsgncsa6phc6jlxbf

Stacked PRs enabled by GHerrit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 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-15T00:43:51.692652Z 67f75a5 PR opened
🔒 Security Review ✅ Completed 2026-10-15T00:44:58.341355Z 67f75a5 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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request integrates support for the standard transmute primitive (core::intrinsics::transmute) into the Aeneas verification pipeline. It introduces a new private Rust module owned_transmute.rs for little-endian targets to perform owned conversions, alongside corresponding Lean specifications, proofs, and audit mechanisms to verify their correctness. Additionally, the compiler admission logic is updated to reject unsupported target overrides. The review feedback suggests a minor optimization in admission.py to avoid redundant evaluations of the variant function within a set comprehension.

Comment on lines 119 to +120
stages = {variant(f['body'])[0] for f in self.functions.values()
if f['body'] != 'Opaque'}
if f['body'] != 'Opaque' and variant(f['body'])[0] != 'Intrinsic'}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The variant(f['body'])[0] expression is evaluated twice for each function in the set comprehension. We can optimize this and improve readability by using a standard loop to build the set.

Suggested change
stages = {variant(f['body'])[0] for f in self.functions.values()
if f['body'] != 'Opaque'}
if f['body'] != 'Opaque' and variant(f['body'])[0] != 'Intrinsic'}
stages = set()
for f in self.functions.values():
if f['body'] != 'Opaque':
stage, _ = variant(f['body'])
if stage != 'Intrinsic':
stages.add(stage)

@codecov-commenter

codecov-commenter commented Oct 15, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.70%. Comparing base (4981be2) to head (24172ac).

Files with missing lines Patch % Lines
zerocopy/src/util/owned_transmute.rs 0.00% 19 Missing ⚠️
Additional details and impacted files
@@                          Coverage Diff                          @@
##           G4s3r4gpuxvvnoxoizjjgoy3b2rwmgi7g    #3877      +/-   ##
=====================================================================
- Coverage                              60.00%   59.70%   -0.30%     
=====================================================================
  Files                                     22       23       +1     
  Lines                                   3808     3827      +19     
=====================================================================
  Hits                                    2285     2285              
- Misses                                  1523     1542      +19     

☔ 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.

Verify the native standard transmute calls for u32 -> [u8; 4],
[u8; 4] -> u32, and u8 -> bool. Retain the original ordered Rust
endpoint types, require their canonical closed providers, and audit
whole primitive and provider definitions plus every reached call,
including calls inside unannotated helpers.

Scope the numeric interpretation to the original little-endian 64-bit
compiler target. The fixed unsigned scalars and initialized byte arrays
have no padding or pointers. Boolean decoding accepts exactly zero and
one and returns undef before constructing a Boolean for any invalid byte.

Prove the Rust round-trip assertion root and independent arbitrary-outcome
contracts for both integer conversions and the guarded Boolean conversion.
The production transmute macro, pointer semantics, and generic FromBytes
support remain deferred.

gherrit-pr-id: Gwz22aqvb6z6qe2dmsgncsa6phc6jlxbf
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