Skip to content

Prove cast validation and exact-size metadata inference - #3843

Open
joshlf wants to merge 1 commit into
G6adazbpusq7dy2xngdcyapzjy47q6llmfrom
Grerckvocdnwpdtef665ubpieo6wlwfdj
Open

joshlf wants to merge 1 commit into
G6adazbpusq7dy2xngdcyapzjy47q6llmfrom
Grerckvocdnwpdtef665ubpieo6wlwfdj

Conversation

@joshlf

@joshlf joshlf commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Specify metadata_for_exact_size and validate_cast_and_convert_metadata
against independent layout calculations. Prove exact representability,
greatest-fitting metadata, alignment-before-size error priority and the
complete prefix or suffix result.

Add Rust assertion harnesses comparing the full optional metadata and cast
outcomes with remainder-based checked arithmetic. Keep address-addition
bounds and the zero-stride panic exclusion visible in their domains.
Outcome examples cover unattainable sizes and intentional panic separately
from checks of the specification's meaning.

Prove the concrete u32 slice KnownLayout initializer and every checked
size_for_elems result through a Rust assertion harness. Admission traverses
the actual local constant body, rather than assuming its descriptor. An
initializer mutation challenges that connection.

Retain reproducible native capability fixtures for generic KnownLayout,
the production transmute macro, and raw pointers. Unsupported equalities,
recursive declaration dependencies, and incomplete pointer carriers remain
explicit blockers; no bounds or declarations are removed to admit them.

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


Latest Update: v31 — Compare vs v30

📚 Full Patch History

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

Version v30 v29 v28 v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v31 v30 v29 v28 v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v30 v29 v28 v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v29 v28 v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v28 v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v10 v9 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/Grerckvocdnwpdtef665ubpieo6wlwfdj && git checkout -b pr-Grerckvocdnwpdtef665ubpieo6wlwfdj FETCH_HEAD

Checkout

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

Cherry Pick

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

Pull

git pull origin refs/heads/Grerckvocdnwpdtef665ubpieo6wlwfdj

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:26:36.539554Z 9a256bd PR opened
🔒 Security Review ✅ Completed 2026-10-08T10:25:45.509910Z 9a256bd 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 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 107 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (G6adazbpusq7dy2xngdcyapzjy47q6llm@7013978). Learn more about missing BASE report.

Files with missing lines Patch % Lines
zerocopy/src/layout/tail_checks.rs 0.00% 85 Missing ⚠️
zerocopy/src/layout/primitive_checks.rs 0.00% 22 Missing ⚠️
Additional details and impacted files
@@                         Coverage Diff                          @@
##             G6adazbpusq7dy2xngdcyapzjy47q6llm    #3843   +/-   ##
====================================================================
  Coverage                                     ?   50.61%           
====================================================================
  Files                                        ?       32           
  Lines                                        ?     4556           
  Branches                                     ?        0           
====================================================================
  Hits                                         ?     2306           
  Misses                                       ?     2250           
  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 Grerckvocdnwpdtef665ubpieo6wlwfdj branch from 581218a to 57bf5e0 Compare October 14, 2026 21:43
@joshlf
joshlf force-pushed the Grerckvocdnwpdtef665ubpieo6wlwfdj branch from 57bf5e0 to 93270b1 Compare October 15, 2026 00:40
@joshlf
joshlf force-pushed the G6adazbpusq7dy2xngdcyapzjy47q6llm branch from 1577b2a to 1f76cee Compare October 15, 2026 00:40
@joshlf
joshlf force-pushed the G6adazbpusq7dy2xngdcyapzjy47q6llm branch from 1f76cee to d92daa8 Compare October 15, 2026 01:19
@joshlf
joshlf force-pushed the Grerckvocdnwpdtef665ubpieo6wlwfdj branch from 93270b1 to f01acec Compare October 15, 2026 01:19
@joshlf
joshlf force-pushed the G6adazbpusq7dy2xngdcyapzjy47q6llm branch from d92daa8 to 8525c23 Compare October 15, 2026 04:53
@joshlf
joshlf force-pushed the Grerckvocdnwpdtef665ubpieo6wlwfdj branch from f01acec to 6163d88 Compare October 15, 2026 04:53
@joshlf
joshlf force-pushed the G6adazbpusq7dy2xngdcyapzjy47q6llm branch from 8525c23 to ec5b152 Compare October 15, 2026 14:22
@joshlf
joshlf force-pushed the Grerckvocdnwpdtef665ubpieo6wlwfdj branch from 6163d88 to 4d8b758 Compare October 15, 2026 14:22
Specify metadata_for_exact_size and validate_cast_and_convert_metadata
against independent layout calculations. Prove exact representability,
greatest-fitting metadata, alignment-before-size error priority and the
complete prefix or suffix result.

Add Rust assertion harnesses comparing the full optional metadata and cast
outcomes with remainder-based checked arithmetic. Keep address-addition
bounds and the zero-stride panic exclusion visible in their domains.
Outcome examples cover unattainable sizes and intentional panic separately
from checks of the specification's meaning.

Prove the concrete u32 slice KnownLayout initializer and every checked
size_for_elems result through a Rust assertion harness. Admission traverses
the actual local constant body, rather than assuming its descriptor. An
initializer mutation challenges that connection.

Retain reproducible native capability fixtures for generic KnownLayout,
the production transmute macro, and raw pointers. Unsupported equalities,
recursive declaration dependencies, and incomplete pointer carriers remain
explicit blockers; no bounds or declarations are removed to admit them.

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