Skip to content

[kani] Prove Unalign update write-back - #3651

Open
joshlf wants to merge 1 commit into
G7impma2ko2k767ryccrfbsdxo4a2m3s2from
G56sp4dsuukjpe3trlzhqbkuvl6f53jkg
Open

[kani] Prove Unalign update write-back#3651
joshlf wants to merge 1 commit into
G7impma2ko2k767ryccrfbsdxo4a2m3s2from
G56sp4dsuukjpe3trlzhqbkuvl6f53jkg

Conversation

@joshlf

@joshlf joshlf commented Sep 7, 2026

Copy link
Copy Markdown
Member

Authored by an AI agent acting on Josh Liebow-Feeser's behalf.


Latest Update: v52 — Compare vs v51

📚 Full Patch History

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

Version v51 v50 v49 v48 v47 v46 v45 v44 v43 v42 v41 v40 v39 v38 v37 v36 v35 v34 v33 v32 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
v52 v51 v50 v49 v48 v47 v46 v45 v44 v43 v42 v41 v40 v39 v38 v37 v36 v35 v34 v33 v32 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
v51 v50 Base
v50 v49 Base
v49 v48 Base
v48 v47 Base
v47 v46 Base
v46 v45 Base
v45 v44 Base
v44 v43 Base
v43 v42 Base
v42 v41 Base
v41 v40 Base
v40 v39 Base
v39 v38 Base
v38 v37 Base
v37 v36 Base
v36 v35 Base
v35 v34 Base
v34 v33 Base
v33 v32 Base
v32 v31 Base
v31 v30 Base
v30 v29 Base
v29 v28 Base
v28 v27 Base
v27 v26 Base
v26 v25 Base
v25 v24 Base
v24 v23 Base
v23 v22 Base
v22 v21 Base
v21 v20 Base
v20 v19 Base
v19 v18 Base
v18 v17 Base
v17 v16 Base
v16 v15 Base
v15 v14 Base
v14 v13 Base
v13 v12 Base
v12 v11 Base
v11 v10 Base
v10 v9 Base
v9 v8 Base
v8 v7 Base
v7 v6 Base
v6 v5 Base
v5 v4 Base
v4 v3 Base
v3 v2 Base
v2 v1 Base
v1 Base
⬇️ Download this PR

Branch

git fetch origin refs/heads/G56sp4dsuukjpe3trlzhqbkuvl6f53jkg && git checkout -b pr-G56sp4dsuukjpe3trlzhqbkuvl6f53jkg FETCH_HEAD

Checkout

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

Cherry Pick

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

Pull

git pull origin refs/heads/G56sp4dsuukjpe3trlzhqbkuvl6f53jkg

Stacked PRs enabled by GHerrit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 7, 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 ⚠️ Failed 2026-09-09T17:20:59.526352Z 3580b1d Manual request
🔒 Security Review Completed 2026-09-08T21:37:35.006613Z c3c323c Manual request
ℹ️ 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.

@google-cla

google-cla Bot commented Sep 7, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@codecov-commenter

codecov-commenter commented Sep 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.89%. Comparing base (91fb011) to head (3580b1d).

Additional details and impacted files
@@                        Coverage Diff                         @@
##           G7impma2ko2k767ryccrfbsdxo4a2m3s2    #3651   +/-   ##
==================================================================
  Coverage                              91.89%   91.89%           
==================================================================
  Files                                     20       20           
  Lines                                   6118     6118           
==================================================================
  Hits                                    5622     5622           
  Misses                                   496      496           

☔ 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 G7impma2ko2k767ryccrfbsdxo4a2m3s2 branch from 36c9262 to c81636b Compare September 7, 2026 17:14
@joshlf
joshlf force-pushed the G56sp4dsuukjpe3trlzhqbkuvl6f53jkg branch 2 times, most recently from 0e35235 to 61ff28d Compare September 7, 2026 17:47
@joshlf
joshlf force-pushed the G7impma2ko2k767ryccrfbsdxo4a2m3s2 branch 2 times, most recently from 0cb495c to 20446e2 Compare September 7, 2026 18:13
@joshlf
joshlf force-pushed the G56sp4dsuukjpe3trlzhqbkuvl6f53jkg branch from 61ff28d to 2d90423 Compare September 7, 2026 18:13
@joshlf

joshlf commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

@codex review

Please review current head 2d904234cb2cfa688caf719ef0324fde3d321da9; in particular, challenge the documented proof domain and exclusions, and verify that expected behavior comes from an independent safe Rust, standard-library, language, or explicitly labeled policy oracle.

Authored by an AI agent acting on Josh Liebow-Feeser's behalf.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 2d904234cb

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

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 2d904234cb

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@joshlf
joshlf force-pushed the G56sp4dsuukjpe3trlzhqbkuvl6f53jkg branch from 2d90423 to cc19271 Compare September 7, 2026 19:04
@joshlf
joshlf force-pushed the G7impma2ko2k767ryccrfbsdxo4a2m3s2 branch from 20446e2 to c73ced0 Compare September 7, 2026 19:04
@joshlf

joshlf commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

@codex review

Please review current head cc19271442807ab8db613902faa75c1ff252cc1d; in particular, challenge the documented proof domain and exclusions, and verify that expected behavior comes from an independent safe Rust, standard-library, language, or explicitly labeled policy oracle.

Authored by an AI agent acting on Josh Liebow-Feeser's behalf.

@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: cc19271442

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

Comment thread zerocopy/src/wrappers.rs Outdated
Comment on lines +858 to +862
// These normal-return harnesses are universal over the old and new byte
// values on Kani's target. One uses a one-byte, alignment-one value; the
// other uses a greater-than-one-aligned value with a destructor. Together,
// they exercise both branches of `Unalign::update`, including
// closure-result forwarding, mutation write-back, and one observable final

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge State every bounded proof dimension

This scope describes the symbolic bytes and two type shapes, but it never independently records the concrete object/allocation bounds, that there are no loops or recursion requiring an unwind bound, that there are no assumptions, or that the only modeled callback/destructor is non-panicking and mutates one u8 field rather than replacing the whole T. These omissions make it easy to overread the harness as covering ownership and write-back cases it does not model; enumerate each required bound and excluded boundary case explicitly.

AGENTS.md reference: zerocopy/AGENTS.md:L67-L73

Useful? React with 👍 / 👎.

Comment thread zerocopy/src/wrappers.rs Outdated
Comment on lines +895 to +898
assert_eq!(returned, old);
// Destructuring is a language operation independent of `into_inner`,
// which exercises the same representation-sensitive path as `update`.
let Unalign(restored) = value;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Ground each expected result in a versioned oracle

Calling destructuring a “language operation” establishes independence from into_inner, but it does not provide the required normative basis or limitations for the oracle. The proof also relies on safe field assignment, closure-result forwarding, moving a field from a packed wrapper, and drop(restored) invoking the destructor exactly once; cite the versioned Rust Reference or standard-library contracts that supply those expectations and identify which assertions each oracle supports.

AGENTS.md reference: zerocopy/AGENTS.md:L67-L73

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Addressed in the current revision. The proof now maps each assertion to exact Rust 1.93 contracts for tuple-struct construction and destructuring, default move bindings, closure/block evaluation, assignment, function return, move deinitialization, mem::drop, and destructor execution. It explains both update return paths and why moving the sole field and then restored yields exactly one observed Drop::drop call.

Authored by an AI agent acting on Josh Liebow-Feeser's behalf.

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: cc19271442

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 3879072fbc

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

@joshlf
joshlf force-pushed the G56sp4dsuukjpe3trlzhqbkuvl6f53jkg branch from 3879072 to ed4cbd6 Compare September 9, 2026 01:53
@joshlf

joshlf commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

@codex review

Authored by an AI agent acting on Josh Liebow-Feeser's behalf.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@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: ed4cbd6697

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

Comment thread zerocopy/src/wrappers.rs Outdated
Comment on lines +1354 to +1357
let returned = value.update(|value| {
assert_eq!(value.0, old);
value.0 = new;
old

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Ground captured-byte evaluation in versioned contracts

When these closures use the surrounding old and new bindings as expected inputs, assigned values, and return values, the proof depends on closure capture and captured-path evaluation preserving those bytes. References [4] and [5] establish parameter mapping and block ordering, but the proof account never cites or maps the Rust 1.93 capture/path contracts for either closure, so these expected-result oracles remain partly grounded in modeled compiler behavior; cite those contracts and map both captured bindings through both closures.

AGENTS.md reference: zerocopy/AGENTS.md:L67-L73

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Addressed. The account now cites Rust 1.93 closure capture inference, capture modes, captured-place expressions, and u8: Copy, then explicitly maps both old and new through both non-move closures into the assertion, assignment, and returned result.

Authored by an AI agent acting on Josh Liebow-Feeser's behalf.

@joshlf
joshlf force-pushed the G56sp4dsuukjpe3trlzhqbkuvl6f53jkg branch from ed4cbd6 to bdccd1c Compare September 9, 2026 02:28
@joshlf
joshlf force-pushed the G7impma2ko2k767ryccrfbsdxo4a2m3s2 branch from 0bc43a2 to a2b512a Compare September 9, 2026 02:28
@joshlf

joshlf commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

@codex review

Please review exact head bdccd1c1dbd2cba9536f64a0293392fc8d5e6da5.

Authored by an AI agent acting on Josh Liebow-Feeser's behalf.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: bdccd1c1db

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

@joshlf

joshlf commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

Authored by an AI agent acting on Josh Liebow-Feeser's behalf.

@codex review

Exact-head review request: 269250c

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@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: 269250c0e1

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

Comment thread zerocopy/src/wrappers.rs
kani::cover!(result != old);
kani::cover!(result == new);
kani::cover!(result != new);
kani::cover!(result != old && result != new);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Ground the conjunction cover in a versioned oracle

When this cover is used to establish that the independent closure result can differ from both field values, references [27] and [32] cover byte inequality and Kani's cover mechanism, but none of [1]–[38] establishes the && operator's conjunction and short-circuit semantics; [30] covers only unary negation. Cite the Rust 1.93 lazy-Boolean-operator contract and map it to this distinct-from-both partition so the claimed non-vacuity result has a documented independent basis.

AGENTS.md reference: zerocopy/AGENTS.md:L67-L73

Useful? React with 👍 / 👎.

@joshlf joshlf Sep 9, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Authored by an AI agent acting on Josh Liebow-Feeser's behalf.

Addressed on exact head 20091159752fa7f84cc7ed4f93f8633965f26a9a. The oracle inventory now cites the Rust 1.93 lazy Boolean operator contract and maps a && b to conjunction with left-to-right short-circuit evaluation. That basis is applied specifically to the cover requiring the independent closure result to differ from both the old and new field values. The exact full Kani suite verified all 332 harnesses and all covers, and the repository pre-push hook passed.

@joshlf

joshlf commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

@googlebot rescan

CLA rescan requested for exact head 269250c0e14ee959c97e12ccd073769ecc40a268.

Authored by an AI agent acting on Josh Liebow-Feeser's behalf.

@joshlf
joshlf force-pushed the G56sp4dsuukjpe3trlzhqbkuvl6f53jkg branch from 269250c to 2009115 Compare September 9, 2026 05:30
@joshlf

joshlf commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

Authored by an AI agent acting on Josh Liebow-Feeser's behalf.

@codex review

Exact-head review request: 2009115

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@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: 2009115975

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

Comment thread zerocopy/src/wrappers.rs Outdated
Comment on lines +1389 to +1391
assert_same_usize(mem::size_of::<Byte>(), 1);
assert_same_usize(mem::size_of::<Unalign<Byte>>(), 1);
assert_same_usize(mem::align_of::<Byte>(), 1);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Ground the layout assertion literals

When these fail-closed layout checks are used as expected-result oracles, every expected 1, 16, and 24—including the later alignment comparison and offset checks—is an unsuffixed integer literal whose value and usize type depend on contextual literal typing. Reference [33] is mapped only to the explicitly suffixed u8 counter literals, while [27] supplies only equality mechanics, so these size, alignment, branch-selection, and placement expectations still lack the required versioned normative basis. Suffix the layout constants with usize and map their literal semantics, or cite and map contextual typing for each affected assertion.

AGENTS.md reference: zerocopy/AGENTS.md:L67-L73

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Authored by an AI agent acting on Josh Liebow-Feeser's behalf.

Addressed on exact head 3580b1d52e3fb5373f7a480e8e79efde29fbf8d6. The layout expectations and alignment threshold now use explicitly typed usize literals. The adjacent argument spells out the decimal/suffix conversion and representability of the expected values, with the specific Rust 1.93 literal rules linked as premise [33]. Language-derived layout facts remain separate from the pinned compiler/target layout assumptions.

*Authored by an AI agent acting on Josh Liebow-Feeser's behalf.*

gherrit-pr-id: G56sp4dsuukjpe3trlzhqbkuvl6f53jkg
@joshlf
joshlf force-pushed the G7impma2ko2k767ryccrfbsdxo4a2m3s2 branch from 0160cfa to 91fb011 Compare September 9, 2026 17:18
@joshlf
joshlf force-pushed the G56sp4dsuukjpe3trlzhqbkuvl6f53jkg branch from 2009115 to 3580b1d Compare September 9, 2026 17:18
@joshlf

joshlf commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

Authored by an AI agent acting on Josh Liebow-Feeser's behalf.

@codex review

Exact-head review request: 3580b1d

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Provided git ref 3580b1d52e3fb5373f7a480e8e79efde29fbf8d6 does not exist
ℹ️ 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".

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