Skip to content

Require realizable source representations for IntoBytes - #3883

Open
joshlf wants to merge 1 commit into
Gcwyaqhevirytq5t6oazk3klcbcycuwnnfrom
Gdtlvwakxpzsmcwa7vhtmv7d5h63sbw3l
Open

joshlf wants to merge 1 commit into
Gcwyaqhevirytq5t6oazk3klcbcycuwnnfrom
Gdtlvwakxpzsmcwa7vhtmv7d5h63sbw3l

Conversation

@joshlf

@joshlf joshlf commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

An initialized physical decoder can reject every byte string. Its
initialization law then holds without supplying any bytes for an admitted
source value, so that law alone cannot justify a conversion out of the
value.

Require each mathematically admitted source value to have a physical
representation. Prove this stronger IntoBytes invariant for the existing
primitive, array, and wrapper implementations. Keep initialization over
the full physical decoding domain, independently of library admission.

The existence requirement permits multiple representations of one value
and remains vacuous for uninhabited sources. Regression examples cover
both cases, empty arrays, and an initialized decoder that cannot represent
one of its admitted values.

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


Latest Update: v6 — Compare vs v5

📚 Full Patch History

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

Version v5 v4 v3 v2 v1 Base
v6 vs v5 vs v4 vs v3 vs v2 vs v1 vs 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/Gdtlvwakxpzsmcwa7vhtmv7d5h63sbw3l && git checkout -b pr-Gdtlvwakxpzsmcwa7vhtmv7d5h63sbw3l FETCH_HEAD

Checkout

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

Cherry Pick

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

Pull

git pull origin refs/heads/Gdtlvwakxpzsmcwa7vhtmv7d5h63sbw3l

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-15T16:28:00.274239Z 633fe56 PR opened
🔒 Security Review ✅ Completed 2026-10-15T16:29:07.907276Z 633fe56 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 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (Gcwyaqhevirytq5t6oazk3klcbcycuwnn@7326327). Learn more about missing BASE report.

Additional details and impacted files
@@                         Coverage Diff                          @@
##             Gcwyaqhevirytq5t6oazk3klcbcycuwnn    #3883   +/-   ##
====================================================================
  Coverage                                     ?   48.80%           
====================================================================
  Files                                        ?       33           
  Lines                                        ?     4725           
  Branches                                     ?        0           
====================================================================
  Hits                                         ?     2306           
  Misses                                       ?     2419           
  Partials                                     ?        0           

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

@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 introduces the concept of "source realizability" to the formal verification of the IntoBytes trait within the Aeneas verification framework. It updates the into_bytes_initialized trait invariant to require that every mathematically admitted raw value has at least one physical byte representation. To support this, new Lean files (RustRealizability.lean, RustRealizabilityModels.lean, and RustRealizabilityTests.lean) are added to provide and test realizability proofs for primitives, arrays, and various wrapper types. Existing proofs and trait declarations are updated accordingly to incorporate these new realizability obligations. There are no review comments to address, and I have no feedback to provide.

An initialized physical decoder can reject every byte string. Its
initialization law then holds without supplying any bytes for an admitted
source value, so that law alone cannot justify a conversion out of the
value.

Require each mathematically admitted source value to have a physical
representation. Prove this stronger IntoBytes invariant for the existing
primitive, array, and wrapper implementations. Keep initialization over
the full physical decoding domain, independently of library admission.

The existence requirement permits multiple representations of one value
and remains vacuous for uninhabited sources. Regression examples cover
both cases, empty arrays, and an initialized decoder that cannot represent
one of its admitted values.

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