Skip to content

Prove selected cast plans preserve size without metadata overflow - #3845

Open
joshlf wants to merge 1 commit into
Gtab63hdyxorrg5am3uaygvri4dbs3cs5from
Ghrpggbfqci57rogpnzh6zckn5odscj6u
Open

joshlf wants to merge 1 commit into
Gtab63hdyxorrg5am3uaygvri4dbs3cs5from
Ghrpggbfqci57rogpnzh6zckn5odscj6u

Conversation

@joshlf

@joshlf joshlf commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Compose plan selection with the actual unchecked metadata conversion.
Prove that an accepted plan and a complete source size fitting usize imply
that the entire metadata calculation fits and that the destination has the
same size. This includes Rust's stronger isize-bounded object-size domain.

Add a total Rust assertion harness comparing checked metadata and complete
source and destination sizes with the independent remainder-based
reference. Metadata overflow after acceptance is an assertion failure,
rather than an excluded input. Cover sized-to-sized, sized-to-DST and affine
DST-to-DST plans, keeping witness guards explicit.

Use that result to shorten the pointer adapter's numerical safety argument.
KnownLayout correspondence, reference validity and provenance remain
separate obligations.

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

Checkout

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

Cherry Pick

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

Pull

git pull origin refs/heads/Ghrpggbfqci57rogpnzh6zckn5odscj6u

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:25:36.600771Z 27bc9ef PR opened
🔒 Security Review ✅ Completed 2026-10-08T10:26:13.257270Z 27bc9ef 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 0% with 58 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (Gtab63hdyxorrg5am3uaygvri4dbs3cs5@c01180d). Learn more about missing BASE report.

Files with missing lines Patch % Lines
zerocopy/src/layout/cast_from.rs 0.00% 53 Missing ⚠️
zerocopy/src/layout/tail_transform_checks.rs 0.00% 5 Missing ⚠️
Additional details and impacted files
@@                         Coverage Diff                          @@
##             Gtab63hdyxorrg5am3uaygvri4dbs3cs5    #3845   +/-   ##
====================================================================
  Coverage                                     ?   51.06%           
====================================================================
  Files                                        ?       28           
  Lines                                        ?     4475           
  Branches                                     ?        0           
====================================================================
  Hits                                         ?     2285           
  Misses                                       ?     2190           
  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.

@joshlf
joshlf force-pushed the Gtab63hdyxorrg5am3uaygvri4dbs3cs5 branch from 5dec377 to c01180d Compare October 9, 2026 00:08
@joshlf
joshlf force-pushed the Ghrpggbfqci57rogpnzh6zckn5odscj6u branch from 4c7bdd5 to 984c90f Compare October 9, 2026 00:08
Compose plan selection with the actual unchecked metadata conversion.
Prove that an accepted plan and a complete source size fitting usize imply
that the entire metadata calculation fits and that the destination has the
same size. This includes Rust's stronger isize-bounded object-size domain.

Add a total Rust assertion harness comparing checked metadata and complete
source and destination sizes with the independent remainder-based
reference. Metadata overflow after acceptance is an assertion failure,
rather than an excluded input. Cover sized-to-sized, sized-to-DST and affine
DST-to-DST plans, keeping witness guards explicit.

Use that result to shorten the pointer adapter's numerical safety argument.
KnownLayout correspondence, reference validity and provenance remain
separate obligations.

gherrit-pr-id: Ghrpggbfqci57rogpnzh6zckn5odscj6u
Agent-authored-by: AI agent acting on joshlf's behalf
@joshlf
joshlf force-pushed the Ghrpggbfqci57rogpnzh6zckn5odscj6u branch from 984c90f to f89ac0d Compare October 9, 2026 02:21
@joshlf
joshlf force-pushed the Gtab63hdyxorrg5am3uaygvri4dbs3cs5 branch from c01180d to 5a0b5d8 Compare October 9, 2026 02:21
@joshlf
joshlf force-pushed the Gtab63hdyxorrg5am3uaygvri4dbs3cs5 branch from 5a0b5d8 to f27f214 Compare October 10, 2026 00:00
@joshlf
joshlf force-pushed the Ghrpggbfqci57rogpnzh6zckn5odscj6u branch from f89ac0d to f5906fb Compare October 10, 2026 00:00
@joshlf joshlf changed the title Prove cast metadata composition against reference sizes Prove selected cast plans preserve size without metadata overflow Oct 10, 2026

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