Skip to content

Support splitting packed DSTs through unaligned element views - #3750

Closed
joshlf wants to merge 12 commits into
Guzdt7nfgmmi7y3e4taezg43ssexn4hrffrom
Gcf7sazu56b7hwm5kb56l7lndntqb7aw2
Closed

joshlf wants to merge 12 commits into
Guzdt7nfgmmi7y3e4taezg43ssexn4hrffrom
Gcf7sazu56b7hwm5kb56l7lndntqb7aw2

Conversation

@joshlf

@joshlf joshlf commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Provide unaligned element views for packed trailing slices and check split
behavior without discarding nested padding. Forward SplitAt through
ManuallyDrop, add via_no_dynamic_padding and retain via_unaligned as a
deprecated forwarding API.

Validation: fresh pinned extraction and complete-model golden comparison;
independent golden/live Lean builds, required-contract checks, and the
transitive axiom audit.

Makes progress on #3617

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


Latest Update: v19 — Compare vs v18

📚 Full Patch History

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

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

Checkout

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

Cherry Pick

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

Pull

git pull origin refs/heads/Gcf7sazu56b7hwm5kb56l7lndntqb7aw2

Stacked PRs enabled by GHerrit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 2, 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-02T15:31:41.730710Z fff8043 PR opened
🔒 Security Review ✅ Completed 2026-10-02T15:35:41.729258Z fff8043 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 2, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 67.24138% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.45%. Comparing base (ef2804b) to head (381343b).

Files with missing lines Patch % Lines
zerocopy/src/split_at.rs 67.24% 19 Missing ⚠️
Additional details and impacted files
@@                          Coverage Diff                          @@
##           Guzdt7nfgmmi7y3e4taezg43ssexn4hrf    #3750      +/-   ##
=====================================================================
- Coverage                              61.11%   60.45%   -0.67%     
=====================================================================
  Files                                     22       22              
  Lines                                   3760     3773      +13     
=====================================================================
- Hits                                    2298     2281      -17     
- Misses                                  1462     1492      +30     

☔ 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 Gcf7sazu56b7hwm5kb56l7lndntqb7aw2 branch from fff8043 to dcb0073 Compare October 2, 2026 15:39
@joshlf
joshlf force-pushed the Guzdt7nfgmmi7y3e4taezg43ssexn4hrf branch 2 times, most recently from ac6e75c to a3fdabf Compare October 2, 2026 19:39
@joshlf
joshlf force-pushed the Gcf7sazu56b7hwm5kb56l7lndntqb7aw2 branch 2 times, most recently from 60bf368 to ec7f378 Compare October 2, 2026 21:06
@joshlf
joshlf force-pushed the Guzdt7nfgmmi7y3e4taezg43ssexn4hrf branch from a3fdabf to d7f9645 Compare October 2, 2026 21:06
@joshlf
joshlf force-pushed the Gcf7sazu56b7hwm5kb56l7lndntqb7aw2 branch from ec7f378 to 73a229c Compare October 3, 2026 16:09
@joshlf
joshlf force-pushed the Guzdt7nfgmmi7y3e4taezg43ssexn4hrf branch from d7f9645 to 3819b9a Compare October 3, 2026 16:09
@joshlf
joshlf force-pushed the Gcf7sazu56b7hwm5kb56l7lndntqb7aw2 branch from 73a229c to 3f2503a Compare October 4, 2026 02:57
@joshlf
joshlf force-pushed the Guzdt7nfgmmi7y3e4taezg43ssexn4hrf branch from 3819b9a to 1908b50 Compare October 4, 2026 02:57
joshlf added 9 commits October 5, 2026 06:18
Keep independent native examples for successful returns, named assumptions and
tuple results. Total contracts reject panic and divergence; partial contracts
admit divergence while rejecting panic and incorrect successful returns.

Validation: fresh pinned extraction and complete-model golden comparison;
independent golden/live Lean builds, required-contract checks, and the
transitive axiom audit.

gherrit-pr-id: Gmasez6fvx2c6chogoybuzpgyoykiaupc
Agent-authored-by: AI agent acting on joshlf's behalf
Prove exact extrema, least padding and the greatest aligned predecessor.
Preserve broad Raw arithmetic results and derive recursive mathematical models
contracts; compose extrema and round-down corollaries. Layout padding is
introduced with its normalized implementation in the later padding proof layer.

Add total Rust assertion harnesses comparing padding and round-down with
independent division/remainder calculations, including usize boundary values.
Keep the comparisons and their power-of-two guard visible in Rust.

Validation: fresh pinned extraction and complete-model golden comparison;
independent golden/live Lean builds, required-contract checks, and the
transitive axiom audit.

gherrit-pr-id: Gxi6wprpgshggdrhvt64jphmjwhociog5
Agent-authored-by: AI agent acting on joshlf's behalf
Add mathematical-view composition and an indexed-loop adapter using upstream
specifications. Independent native examples check successful outcomes, overflow
and the loop progress requirements.

Validation: fresh pinned extraction and complete-model golden comparison;
independent golden/live Lean builds, required-contract checks, and the
transitive axiom audit.

gherrit-pr-id: Gjr7bhllf5hkdhoipwvk4k5zbqa5q7qs7
Agent-authored-by: AI agent acting on joshlf's behalf
Develop unbounded size, alignment and capacity formulas and prove their
normalization laws. Keep arithmetic assumptions explicit and independent of
generated function proofs.

Validation: fresh pinned extraction and complete-model golden comparison;
independent golden/live Lean builds, required-contract checks, and the
transitive axiom audit.

gherrit-pr-id: Geshtqcmx24d4schhoccr2bfxlmhdz4yi
Agent-authored-by: AI agent acting on joshlf's behalf
Define recursive record semantics and prove normalization across nested fields
and trailing metadata. Preserve complete inner sizes when composing layouts.

Validation: fresh pinned extraction and complete-model golden comparison;
independent golden/live Lean builds, required-contract checks, and the
transitive axiom audit.

gherrit-pr-id: Gorv7wy3hyn76t7fgbuh776b3o6yz5teg
Agent-authored-by: AI agent acting on joshlf's behalf
Retain the nominal Rust wrapper and define its mathematical model inline.
Decode its already-positive NonZero field into alignment and phase with
power-of-two, phase-bound and representability proofs. Prove the accepted
domain, representation relation and round trips independently of method
proofs. Encoding and decoding specifications use the mathematical pair;
broad Raw lemmas preserve the original representation guarantees.

Construct the rounding model using only its data fields; decoder-scoped
completion proves its unchanged constraints in the construction context.
Independent meaning, admission and round-trip guarantees remain explicit.

Validation: fresh pinned extraction, complete golden comparison, separate
golden/live builds, independent required contracts and axiom audits.

gherrit-pr-id: Gng7s74f35a4f6jjd5xjjmvxbwqqnnx7q
Agent-authored-by: AI agent acting on joshlf's behalf
Represent trailing layouts with their rounding alignment and phase so runtime
normalization preserves complete nested sizes. Keep this implementation change
separate from the later primitive, trailing and padding proof layers. The
packed regression has size 10 where the former calculation produced 8. Preserve
compiler-layout regressions, Kani harnesses and generated expectations with the
runtime change; the next change adds the independent recursive arithmetic
oracle.

Validation: fresh pinned extraction and complete-model golden comparison;
independent golden/live Lean builds, required-contract checks, and the
transitive axiom audit.

Makes progress on #3617

gherrit-pr-id: Gcrebpateb5cosfnz4zvqhnx2xldzt6vv
Agent-authored-by: AI agent acting on joshlf's behalf
Check runtime nested-DST sizes against an independently implemented recursive
Rust oracle, including padding inside packed fields.

Extract and prove the independent checked Rust reference for arbitrary nested
record descriptions and metadata. Use its remainder-based rounding in compiler
regression tests, without sharing the production padding utility.

Validation: fresh pinned extraction and complete-model golden comparison;
independent golden/live Lean builds, required-contract checks, and the
transitive axiom audit.

gherrit-pr-id: Guzdt7nfgmmi7y3e4taezg43ssexn4hrf
Agent-authored-by: AI agent acting on joshlf's behalf
Provide unaligned element views for packed trailing slices and check split
behavior without discarding nested padding. Forward SplitAt through
ManuallyDrop, add via_no_dynamic_padding and retain via_unaligned as a
deprecated forwarding API.

Validation: fresh pinned extraction and complete-model golden comparison;
independent golden/live Lean builds, required-contract checks, and the
transitive axiom audit.

Makes progress on #3617

gherrit-pr-id: Gcf7sazu56b7hwm5kb56l7lndntqb7aw2
Agent-authored-by: AI agent acting on joshlf's behalf
@joshlf
joshlf force-pushed the Guzdt7nfgmmi7y3e4taezg43ssexn4hrf branch from ad40668 to e52a4f6 Compare October 5, 2026 10:33
@joshlf
joshlf force-pushed the Gcf7sazu56b7hwm5kb56l7lndntqb7aw2 branch 2 times, most recently from 8376447 to e3838aa Compare October 5, 2026 11:34
@joshlf
joshlf force-pushed the Guzdt7nfgmmi7y3e4taezg43ssexn4hrf branch from e52a4f6 to d0c0fc3 Compare October 5, 2026 11:34
@joshlf
joshlf force-pushed the Gcf7sazu56b7hwm5kb56l7lndntqb7aw2 branch from e3838aa to f7a4aa6 Compare October 5, 2026 12:18
@joshlf
joshlf force-pushed the Guzdt7nfgmmi7y3e4taezg43ssexn4hrf branch from d0c0fc3 to 8addb73 Compare October 5, 2026 12:18
@joshlf
joshlf force-pushed the Gcf7sazu56b7hwm5kb56l7lndntqb7aw2 branch from f7a4aa6 to e2c12ae Compare October 5, 2026 12:26
@joshlf
joshlf force-pushed the Guzdt7nfgmmi7y3e4taezg43ssexn4hrf branch 2 times, most recently from 2b181a0 to d7235f7 Compare October 5, 2026 13:03
@joshlf
joshlf force-pushed the Gcf7sazu56b7hwm5kb56l7lndntqb7aw2 branch from e2c12ae to 9234d89 Compare October 5, 2026 13:03
joshlf added 3 commits October 5, 2026 11:02
Move the inline cast_from module to layout/cast_from.rs without changing its
implementation. Use layout/mod.rs as the root of the resulting multi-file
module, and update existing source-path references.

Agent-authored-by: AI agent acting on joshlf's behalf
gherrit-pr-id: Gvvdmej5q7tk5o76yu4c26esuzqpvpdca
Hoist the numerical CastPlan out of the generic pointer method. Keep
CastParams<Src, Dst> as the private connection to the selected KnownLayout
pair, and select its plan through an associated constant instead of the
local Params trait. Project then reads metadata, applies the selected plan,
and reconstructs the destination pointer.

Preserve the existing offset/stride selection and unchecked arithmetic.
The nested-padding correction and Aeneas proofs remain later changes.

Agent-authored-by: AI agent acting on joshlf's behalf
gherrit-pr-id: Gysrrwrr4oyfrqso6dw7gdmpjocmskwtx
Associate spec-only Rust doc fences with their syntax owners and derive
original binders from verified signatures. Recursively decode fields into
nominal mathematical carriers; inline type models may refine those fields
with a fallible decoder. Plain clauses and dependent ghosts use decoded
values, while explicit raw clauses retain extracted representations.
Freeze native providers and thread every original type parameter's
dictionary explicitly. Successful execution must produce a decodable
result shared by all postconditions.

Check ordinary canonical proofs and independent expectations against both
complete models. The initial scope covers four arithmetic helpers; broad
Raw lemmas retain their representation domains. Preserve nominal tuple
structs using a reproducible patch exposing the existing upstream option.
Audit source snapshots, exact annotation ownership and axioms; retain source maps and a stable Lean development project.

Define generic shapes solely over mathematical carrier types. Generate
structural decoder decomposition with retained child witnesses. Complete
only omitted proposition proofs at decoder construction sites, bounded
by the caller heartbeat budget, and preserve native module exports.
Protect edited Lean projections and inspect compiled effective specs.

Add native Lean edit regions and guarded copy-back into owned Rust doc
fences. Preserve unrelated edits and bytes, reject stale source or generated
scaffolding changes, and recover interrupted source/baseline replacements.
Validate native editor/copy/regeneration round trips at the first and final
stack stages and preserve byte-identical CI assembly throughout the stack.

Compare every inline contract with its independent expectation for arbitrary
execution outcomes, then specialize to the canonical implementation proof.
Record the complete design and deferred decisions in DESIGN.md.

Derive fixed registration names from their owner and share nominal case
assembly. Normalize source ownership once, retain generated lines with their
locations, and reuse checked editing regions. Share file rosters while keeping
independent source ownership and contract adequacy checks separate. Explain
the pipeline and the purpose of its guards for readers new to the integration.

Derive extraction roots solely from present annotations. Every discovered
specification is mandatory in both builds; removing a specification and its
proof deliberately removes that claim. No method roster or root marker is
required. Preserve Unit decoding through reduction so total assertion
harnesses use the same contract path as ordinary value-returning functions.

Validation: fresh pinned extraction, complete golden comparison, separate
golden/live builds, independent required contracts and axiom audits.

gherrit-pr-id: Gf75ukj4vvtufg6dwjpfa3bx5a457sw74
Agent-authored-by: AI agent acting on joshlf's behalf
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