Skip to content

Bound pointer projections even for empty referents - #3891

Open
joshlf wants to merge 1 commit into
Gsrhkadysza6axfyzqxp4iamxj6iko5exfrom
Gsul3w4vydc4wowguwwscielqttbpeytg
Open

joshlf wants to merge 1 commit into
Gsrhkadysza6axfyzqxp4iamxj6iko5exfrom
Gsul3w4vydc4wowguwwscielqttbpeytg

Conversation

@joshlf

@joshlf joshlf commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Byte-set inclusion puts no bound on an empty destination's address. State
Project's postcondition with a nonnegative bounded offset, carry that
contract through HasField, and use it in the NonNull and transitive
projection safety arguments.

Add shared mathematical Projection, Cast, and CastExact laws for explicit
extents and opaque provenance. Prove composition, empty and one-past bounds,
non-null propagation, slice splitting, and no-wrap consequences under
explicit word bounds. Keep native pointer carriers rejected: the unchanged
Aeneas pin does not retain their geometry. Exercise that boundary with
well-formed native pointer shapes.

Audit every imported shared Rust module and test root, including referent
laws, so adding a library module cannot silently omit its assumptions.

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


⬇️ Download this PR

Branch

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

Checkout

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

Cherry Pick

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

Pull

git pull origin refs/heads/Gsul3w4vydc4wowguwwscielqttbpeytg

Stacked PRs enabled by GHerrit.

Byte-set inclusion puts no bound on an empty destination's address. State
Project's postcondition with a nonnegative bounded offset, carry that
contract through HasField, and use it in the NonNull and transitive
projection safety arguments.

Add shared mathematical Projection, Cast, and CastExact laws for explicit
extents and opaque provenance. Prove composition, empty and one-past bounds,
non-null propagation, slice splitting, and no-wrap consequences under
explicit word bounds. Keep native pointer carriers rejected: the unchanged
Aeneas pin does not retain their geometry. Exercise that boundary with
well-formed native pointer shapes.

Audit every imported shared Rust module and test root, including referent
laws, so adding a library module cannot silently omit its assumptions.

gherrit-pr-id: Gsul3w4vydc4wowguwwscielqttbpeytg
Agent-authored-by: AI agent acting on joshlf's behalf
@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-15T22:23:54.069946Z 6afb011 PR opened
🔒 Security Review ✅ Completed 2026-10-15T22:25:18.534537Z 6afb011 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 15, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.67%. Comparing base (5d3a57a) to head (6afb011).

Additional details and impacted files
@@                        Coverage Diff                         @@
##           Gsrhkadysza6axfyzqxp4iamxj6iko5ex    #3891   +/-   ##
==================================================================
  Coverage                              48.67%   48.67%           
==================================================================
  Files                                     35       35           
  Lines                                   4754     4754           
==================================================================
  Hits                                    2314     2314           
  Misses                                  2440     2440           

☔ 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 Rust.Pointer.Geometry module in Lean, which defines and proves numerical byte-range relations (such as Projection, Cast, and CastExact) between raw pointer values, including handling of empty referents and address bounds. It also updates the Lean test auditing mechanism to dynamically select submodules, documents the extraction boundaries in LOWERING_AUDIT.md, expands Python admission tests for raw pointer carriers, and refines safety documentation/comments in the zerocopy Rust crate to align with these geometric definitions. I have no feedback to provide as there are no review comments.

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