Skip to content

[kani] Strengthen SplitByteSlice proofs - #3649

Open
joshlf wants to merge 1 commit into
G4pavaeiw7kliymw4ujvmg43vcwah5v5pfrom
G3hsfirdl7ux7wqc5tmzkwycqmjxflxa2
Open

[kani] Strengthen SplitByteSlice proofs#3649
joshlf wants to merge 1 commit into
G4pavaeiw7kliymw4ujvmg43vcwah5v5pfrom
G3hsfirdl7ux7wqc5tmzkwycqmjxflxa2

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

Checkout

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

Cherry Pick

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

Pull

git pull origin refs/heads/G3hsfirdl7ux7wqc5tmzkwycqmjxflxa2

Stacked PRs enabled by GHerrit.

@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.

@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:56.276649Z 225b02c Manual request
🔒 Security Review Completed 2026-09-08T21:37:54.967653Z 4517a85 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.

@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 (867d9c2) to head (225b02c).

Additional details and impacted files
@@                        Coverage Diff                         @@
##           G4pavaeiw7kliymw4ujvmg43vcwah5v5p    #3649   +/-   ##
==================================================================
  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.

@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: 3b10359346

ℹ️ 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/byte_slice.rs Outdated
Comment on lines +474 to +475
// SAFETY: The assertion above establishes the method's sole caller
// precondition using the address-stable dereference observed above.

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 Cite the contract supporting the unchecked split

The new safety comment only refers to the local assertion and dereference stability, but the repository's mandatory unsafe-code review requires every unsafe block's justification to quote and cite a versioned Rust Reference or standard-library guarantee. Expand this comment with the required authoritative citation and quoted guarantees so the block can pass the project's safety audit.

AGENTS.md reference: zerocopy/AGENTS.md:L19-L23

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 unchecked helper now cites and quotes the Rust 1.93.0 slice::split_at_unchecked bound, and the proof establishes that bound from a length-stable safe dereference immediately before the call. Expected partitions and mutations come from safe slice operations.

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

@joshlf
joshlf force-pushed the G4pavaeiw7kliymw4ujvmg43vcwah5v5p branch from f22e083 to 503d7a8 Compare September 7, 2026 17:14
@joshlf
joshlf force-pushed the G3hsfirdl7ux7wqc5tmzkwycqmjxflxa2 branch 2 times, most recently from 316d409 to 5e971ad Compare September 7, 2026 17:47
@joshlf
joshlf force-pushed the G4pavaeiw7kliymw4ujvmg43vcwah5v5p branch 2 times, most recently from 9719a71 to e6b583c Compare September 7, 2026 18:13
@joshlf
joshlf force-pushed the G3hsfirdl7ux7wqc5tmzkwycqmjxflxa2 branch from 5e971ad to ae91fc4 Compare September 7, 2026 18:13
@joshlf

joshlf commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

@codex review

Please review current head ae91fc4d1a0db417421177993e282f85d3d1f782; 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

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

Reviewed commit: ae91fc4d1a

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 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: ae91fc4d1a

ℹ️ 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/byte_slice.rs Outdated
let bytes = kani::any::<[u8; BUFFER_LEN]>();
let original = bytes;
let len = any_len();
let _ = check_split_at(&bytes[..len], kani::any(), &original[..len]);

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 Vary the subslice start in the proof harnesses

When the input is an interior view such as &bytes[1..3], none of these proofs exercises it: every slice harness uses &bytes[..len], and the Ref/RefMut harnesses likewise map only [..len]. Consequently, the documented domain does not cover every subslice view, and the mutable frame checks never test bytes preceding the view, so an implementation that miscomputes addresses or writes before a non-prefix view could still pass. Make both the view start and end symbolic and derive the independent oracle from the corresponding range of original.

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. A shared View { start, end } generator now covers every contiguous view of the four-byte backing array, including every empty prefix/interior/suffix view. All slice, Ref, and RefMut harnesses use it, and mutable expected results plus the whole-buffer frame come from safe slice operations.

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

@joshlf
joshlf force-pushed the G3hsfirdl7ux7wqc5tmzkwycqmjxflxa2 branch from ae91fc4 to aba94a1 Compare September 7, 2026 19:04
@joshlf
joshlf force-pushed the G4pavaeiw7kliymw4ujvmg43vcwah5v5p branch from e6b583c to 60f0d48 Compare September 7, 2026 19:04
@joshlf

joshlf commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

@codex review

Please review current head aba94a1f588645460d21c6fa929a5652157ed1a7; 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: aba94a1f58

ℹ️ 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/byte_slice.rs Outdated
Comment on lines +386 to +388
// Oracle: Safe `slice::split_at_checked` supplies result classification
// and expected partitions; safe `slice::split_at_mut` supplies expected
// mutations.

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 Cite every operation used as a proof oracle

The oracle inventory omits operations that supply expected behavior: check_split_at_unchecked derives pointer shape with slice::split_at, assert_split derives expected contents with another split_at, and the mutation checks depend on get_mut. The repository's proof protocol requires every oracle to state its versioned normative basis, independence from the target, and limitations, so add those operations and citations rather than documenting only split_at_checked and split_at_mut.

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

Useful? React with 👍 / 👎.

Comment thread zerocopy/src/byte_slice.rs Outdated
Comment on lines +374 to +377
// Domain: Every `[u8; 4]`, every contiguous view (including empty prefix,
// interior, and suffix views), and every `usize` midpoint for the safe
// operation or every valid midpoint for the unchecked operation, for
// `&[u8]`, `&mut [u8]`, `Ref<[u8]>`, and `RefMut<[u8]>`.

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 State the concrete unwind and allocation bounds

The documented domain identifies the four-byte input but never records that each harness uses one fixed stack-backed allocation, has no explicit proof loops, and applies #[kani::unwind(5)]. These are independent proof-scope dimensions required by the repository's validation protocol; without them, readers cannot tell whether the bound is a deliberate part of the assurance or an incidental verifier setting. Add those concrete bounds to this domain statement.

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

Useful? React with 👍 / 👎.

@joshlf
joshlf force-pushed the G3hsfirdl7ux7wqc5tmzkwycqmjxflxa2 branch from 171b12a to eae4632 Compare September 9, 2026 01:35
@joshlf
joshlf force-pushed the G4pavaeiw7kliymw4ujvmg43vcwah5v5p branch from 274a10a to 6037ae9 Compare September 9, 2026 01:35
@joshlf

joshlf commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

@codex review

Please review current head eae4632ec94ba7b9fa814b7a1edfab32ed6d4f85; 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

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. Nice work!

Reviewed commit: eae4632ec9

ℹ️ 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 G3hsfirdl7ux7wqc5tmzkwycqmjxflxa2 branch from eae4632 to b2efd47 Compare September 9, 2026 01:53
@joshlf
joshlf force-pushed the G4pavaeiw7kliymw4ujvmg43vcwah5v5p branch from 6037ae9 to 2f73227 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

Copy link
Copy Markdown

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

Reviewed commit: b2efd47d6e

ℹ️ 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 G4pavaeiw7kliymw4ujvmg43vcwah5v5p branch from 2f73227 to 9aebc12 Compare September 9, 2026 02:28
@joshlf
joshlf force-pushed the G3hsfirdl7ux7wqc5tmzkwycqmjxflxa2 branch from b2efd47 to 25a6c2f Compare September 9, 2026 02:28
@joshlf

joshlf commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

@codex review

Please review exact head 25a6c2f82efdff9ce7925a5891a7d9052359187e.

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. 🎉

Reviewed commit: 25a6c2f82e

ℹ️ 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: 2d20df4

@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: 2d20df4e76

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

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

gherrit-pr-id: G3hsfirdl7ux7wqc5tmzkwycqmjxflxa2
@joshlf
joshlf force-pushed the G4pavaeiw7kliymw4ujvmg43vcwah5v5p branch from 6350696 to 867d9c2 Compare September 9, 2026 17:18
@joshlf
joshlf force-pushed the G3hsfirdl7ux7wqc5tmzkwycqmjxflxa2 branch from 2d20df4 to 225b02c 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: 225b02c

@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 225b02cb4611a4802e2d05916ca4488b84be9126 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