Skip to content

Express Alignment::read's pointer guarantees as a tuple - #3878

Open
joshlf wants to merge 1 commit into
Gmunmfwlfxo5nsdg4ic6omp6if4lggr4from
Gebc324cpvia63syt5uspvh2a7nz3uajp
Open

joshlf wants to merge 1 commit into
Gmunmfwlfxo5nsdg4ic6omp6if4lggr4from
Gebc324cpvia63syt5uspvh2a7nz3uajp

Conversation

@joshlf

@joshlf joshlf commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Alignment::read quantifies over an Invariants implementation whose
Alignment is Self. This creates a recursive declaration dependency which
the pinned Aeneas cannot lower when a trait carries a validator signature.

Accept Ptr<_, (A, Self, Safe)> with A: Reference directly. Normalize the
existing caller through unify_invariants, which retains its aliasing,
alignment and validity guarantees. Both read implementations keep their
existing bodies.

Validation: pinned MSRV and stable checks, all 170 nightly library tests,
and nightly workspace Clippy.

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


Latest Update: v9 — Compare vs v8

📚 Full Patch History

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

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

Checkout

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

Cherry Pick

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

Pull

git pull origin refs/heads/Gebc324cpvia63syt5uspvh2a7nz3uajp

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-15T04:57:09.422427Z 467a8e9 PR opened
🔒 Security Review ✅ Completed 2026-10-15T04:56:14.574727Z 467a8e9 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 refactors the Alignment trait's read method signature in zerocopy/src/pointer/invariant.rs to name the aliasing parameter directly as a tuple (A, Self, Safe) instead of quantifying over an Invariants implementation. This change avoids a recursive dependency between the Alignment and Invariants trait declarations during extraction. Corresponding implementations for Unaligned and Aligned are updated, and the call site in zerocopy/src/pointer/ptr.rs is updated to use self.unify_invariants(). There are no review comments, and I have no feedback to provide.

@codecov-commenter

codecov-commenter commented Oct 15, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 55.55556% with 4 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (Gmunmfwlfxo5nsdg4ic6omp6if4lggr4@21013b4). Learn more about missing BASE report.

Files with missing lines Patch % Lines
zerocopy/src/pointer/invariant.rs 50.00% 4 Missing ⚠️
Additional details and impacted files
@@                         Coverage Diff                         @@
##             Gmunmfwlfxo5nsdg4ic6omp6if4lggr4    #3878   +/-   ##
===================================================================
  Coverage                                    ?   59.89%           
===================================================================
  Files                                       ?       23           
  Lines                                       ?     3827           
  Branches                                    ?        0           
===================================================================
  Hits                                        ?     2292           
  Misses                                      ?     1535           
  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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 467a8e9671

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// Name the aliasing parameter directly rather than quantifying over an
// Invariants implementation whose Alignment is Self. Both forms require
// the same pointer guarantees; the tuple avoids a recursive dependency
// between the Alignment and Invariants trait declarations during extraction.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Wrap the comment at the repository limit

This new comment is 81 columns wide, including its prefix, although it can be wrapped without impairing readability. Move during extraction. onto a continuation line to comply with the subtree's 80-column prose convention.

AGENTS.md reference: zerocopy/AGENTS.md:L38-L40

Useful? React with 👍 / 👎.

Alignment::read quantifies over an Invariants implementation whose
Alignment is Self. This creates a recursive declaration dependency which
the pinned Aeneas cannot lower when a trait carries a validator signature.

Accept Ptr<_, (A, Self, Safe)> with A: Reference directly. Normalize the
existing caller through unify_invariants, which retains its aliasing,
alignment and validity guarantees. Both read implementations keep their
existing bodies.

Validation: pinned MSRV and stable checks, all 170 nightly library tests,
and nightly workspace Clippy.

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