Skip to content

Separate cast plans from pointer reconstruction - #3825

Open
joshlf wants to merge 1 commit into
Glzjt2cwoexxyhj2f2lgnba524ajc2cqpfrom
G5bbi6lfcow3sjrplwzweldyeyjggh3at
Open

joshlf wants to merge 1 commit into
Glzjt2cwoexxyhj2f2lgnba524ajc2cqpfrom
G5bbi6lfcow3sjrplwzweldyeyjggh3at

Conversation

@joshlf

@joshlf joshlf commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

The numerical cast decisions are nested inside the generic pointer
projection, which makes them difficult to extract and prove independently.
Move them into a non-generic CastPlan with separate selection and metadata
conversion methods.

Keep CastParams<Src, Dst> as the witness connecting a plan to its
KnownLayout pair. Its associated constant preserves compile-time rejection
of unsupported casts. Pointer projection reads metadata, applies that plan
and reconstructs the destination pointer. Preserve the existing complete
size comparisons and unchecked arithmetic.

Agent-authored-by: AI agent acting on joshlf's behalf


Latest Update: v8 — Compare vs v7

📚 Full Patch History

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

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

Checkout

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

Cherry Pick

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

Pull

git pull origin refs/heads/G5bbi6lfcow3sjrplwzweldyeyjggh3at

Stacked PRs enabled by GHerrit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 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-08T10:22:36.469381Z ce12010 PR opened
🔒 Security Review ✅ Completed 2026-10-08T10:23:30.619702Z ce12010 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 8, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 9.75610% with 74 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.20%. Comparing base (9916d7c) to head (731cde3).

Files with missing lines Patch % Lines
zerocopy/src/layout/cast_from.rs 9.75% 74 Missing ⚠️
Additional details and impacted files
@@                          Coverage Diff                           @@
##           Glzjt2cwoexxyhj2f2lgnba524ajc2cqp    #3825       +/-   ##
======================================================================
- Coverage                              92.94%   61.20%   -31.75%     
======================================================================
  Files                                     17       20        +3     
  Lines                                   2466     3727     +1261     
======================================================================
- Hits                                    2292     2281       -11     
- Misses                                   174     1446     +1272     

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

The numerical cast decisions are nested inside the generic pointer
projection, which makes them difficult to extract and prove independently.
Move them into a non-generic CastPlan with separate selection and metadata
conversion methods.

Keep CastParams<Src, Dst> as the witness connecting a plan to its
KnownLayout pair. Its associated constant preserves compile-time rejection
of unsupported casts. Pointer projection reads metadata, applies that plan
and reconstructs the destination pointer. Preserve the existing complete
size comparisons and unchecked arithmetic.

gherrit-pr-id: G5bbi6lfcow3sjrplwzweldyeyjggh3at
Agent-authored-by: AI agent acting on joshlf's behalf
@joshlf
joshlf force-pushed the Glzjt2cwoexxyhj2f2lgnba524ajc2cqp branch from 79158f4 to 9916d7c Compare October 9, 2026 00:08
@joshlf
joshlf force-pushed the G5bbi6lfcow3sjrplwzweldyeyjggh3at branch from ce12010 to 731cde3 Compare October 9, 2026 00:08
@joshlf
joshlf force-pushed the G5bbi6lfcow3sjrplwzweldyeyjggh3at branch from 731cde3 to 4b7922c Compare October 10, 2026 00:00
@joshlf joshlf changed the title Separate numerical cast planning from typed pointer projection Separate cast plans from pointer reconstruction Oct 10, 2026
@joshlf
joshlf force-pushed the Glzjt2cwoexxyhj2f2lgnba524ajc2cqp branch from 9916d7c to 178670e Compare October 10, 2026 00:00

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