Skip to content

Add an independent Rust reference for nested DST sizes - #3834

Open
joshlf wants to merge 1 commit into
Grj7aviyzvieawpdu72r5yprrid63scszfrom
Gdb6nhuavogydrpjnu6lnfrefglg42v4c
Open

joshlf wants to merge 1 commit into
Grj7aviyzvieawpdu72r5yprrid63scszfrom
Gdb6nhuavogydrpjnu6lnfrefglg42v4c

Conversation

@joshlf

@joshlf joshlf commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

The nested-layout regression reference used the production padding helper,
so an error shared by both calculations could evade comparison. Replace
that rounding with independent remainder-based checked arithmetic.

Add a recursive Rust reference over record-layer descriptors and prove its
complete optional result against the unbounded semantics for arbitrary
depth and metadata. Preserve inner field padding under packing and cover
invalid descriptors, overflow and zero-sized elements. Arithmetic
descriptors need not correspond to realizable Rust types.

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

Checkout

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

Cherry Pick

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

Pull

git pull origin refs/heads/Gdb6nhuavogydrpjnu6lnfrefglg42v4c

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:18.686207Z 96c6b27 PR opened
🔒 Security Review ✅ Completed 2026-10-08T10:24:35.670650Z 96c6b27 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 8, 2026

@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: 96c6b273a5

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

/// NestedReference.checkedSize leading.val elem_size.val leaf_align.val elems.val
/// ```
#[allow(clippy::arithmetic_side_effects, clippy::indexing_slicing)]
pub(super) fn size_for_metadata(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Route comparisons through the verified recursive oracle

The native comparison never calls this newly verified function: both test_model_via_dst_layout* tests still obtain their expected values from size_for_metadata_model, which shares only the two round_up calls, and a repo-wide Rust search finds nested_reference::size_for_metadata only at this definition. Consequently, a defect or later drift in recursive layer traversal or composition can pass every DstLayout comparison while the Lean proof covers a different, dead implementation; construct expected values with this function or directly compare the two oracles.

AGENTS.md reference: zerocopy/AGENTS.md:L58-L59

Useful? React with 👍 / 👎.

@joshlf
joshlf force-pushed the Grj7aviyzvieawpdu72r5yprrid63scsz branch from 1cdbb70 to d910834 Compare October 14, 2026 21:43
@joshlf
joshlf force-pushed the Grj7aviyzvieawpdu72r5yprrid63scsz branch from d910834 to b11ccc9 Compare October 15, 2026 00:40
@joshlf
joshlf force-pushed the Gdb6nhuavogydrpjnu6lnfrefglg42v4c branch from f2c6958 to b1c2827 Compare October 15, 2026 00:40
@joshlf
joshlf force-pushed the Gdb6nhuavogydrpjnu6lnfrefglg42v4c branch from b1c2827 to b47286f Compare October 15, 2026 01:19
@joshlf
joshlf force-pushed the Grj7aviyzvieawpdu72r5yprrid63scsz branch from 309858b to ef35d41 Compare October 15, 2026 04:53
@joshlf
joshlf force-pushed the Gdb6nhuavogydrpjnu6lnfrefglg42v4c branch from b47286f to 83e8f48 Compare October 15, 2026 04:53
@joshlf
joshlf force-pushed the Gdb6nhuavogydrpjnu6lnfrefglg42v4c branch from 83e8f48 to b8e50bf Compare October 15, 2026 14:22
@joshlf
joshlf force-pushed the Grj7aviyzvieawpdu72r5yprrid63scsz branch from ef35d41 to 57244d4 Compare October 15, 2026 14:22
The nested-layout regression reference used the production padding helper,
so an error shared by both calculations could evade comparison. Replace
that rounding with independent remainder-based checked arithmetic.

Add a recursive Rust reference over record-layer descriptors and prove its
complete optional result against the unbounded semantics for arbitrary
depth and metadata. Preserve inner field padding under packing and cover
invalid descriptors, overflow and zero-sized elements. Arithmetic
descriptors need not correspond to realizable Rust types.

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