Skip to content

[kani] Prove representative derived validators - #3655

Open
joshlf wants to merge 1 commit into
Gti2px6v6qyolz34c5rkfkgsrcirhtxpefrom
Gsgjodecq7t42k3eelvsqemhatlt2or2u
Open

[kani] Prove representative derived validators#3655
joshlf wants to merge 1 commit into
Gti2px6v6qyolz34c5rkfkgsrcirhtxpefrom
Gsgjodecq7t42k3eelvsqemhatlt2or2u

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

Checkout

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

Cherry Pick

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

Pull

git pull origin refs/heads/Gsgjodecq7t42k3eelvsqemhatlt2or2u

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:21:04.301002Z df12de6 Manual request
🔒 Security Review Completed 2026-09-08T21:37:14.546637Z b179b09 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 (d906ebb) to head (df12de6).

Additional details and impacted files
@@                        Coverage Diff                         @@
##           Gti2px6v6qyolz34c5rkfkgsrcirhtxpe    #3655   +/-   ##
==================================================================
  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 Gsgjodecq7t42k3eelvsqemhatlt2or2u branch 2 times, most recently from 7dd9138 to 89a8bf3 Compare September 7, 2026 17:21
@joshlf
joshlf force-pushed the Gti2px6v6qyolz34c5rkfkgsrcirhtxpe branch from 17ccb01 to e985ff7 Compare September 7, 2026 17:47
@joshlf
joshlf force-pushed the Gsgjodecq7t42k3eelvsqemhatlt2or2u branch 2 times, most recently from dda6a78 to edac273 Compare September 7, 2026 18:13
@joshlf
joshlf force-pushed the Gti2px6v6qyolz34c5rkfkgsrcirhtxpe branch from e985ff7 to 5a84428 Compare September 7, 2026 18:13
@joshlf

joshlf commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

@codex review

Please review current head edac273aeeae39fddecb4c1f1072ac1e085d0528; 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. Breezy!

Reviewed commit: edac273aee

ℹ️ 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: edac273aee

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 Gsgjodecq7t42k3eelvsqemhatlt2or2u branch from edac273 to 94bc86b Compare September 7, 2026 19:04
@joshlf
joshlf force-pushed the Gti2px6v6qyolz34c5rkfkgsrcirhtxpe branch from 5a84428 to 658451e Compare September 7, 2026 19:04
@joshlf

joshlf commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

@codex review

Please review current head 94bc86bb9551066568afe678c7b73b7e6c3b5fba; 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: 94bc86bb95

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 Gsgjodecq7t42k3eelvsqemhatlt2or2u branch from 94bc86b to c7ae9cf Compare September 7, 2026 19:18

@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: 94bc86bb95

ℹ️ 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/proofs.rs Outdated
Comment on lines +23 to +28
//! the candidate representation is valid. Each theorem covers one fixed,
//! sized derive input and every byte pattern for that input on Kani's target.
//! This is not a generator theorem: it does not cover other derive inputs,
//! configurations, targets, or properties absent from Kani's memory model. The
//! sized inputs also deliberately avoid the nested-DST layout issue tracked in
//! #3630.

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 Document every proof-domain bound and exclusion

The family scope does not state the concrete byte sizes, that there are no assumptions or dynamic allocations, whether loops/unwind bounds are absent or applicable, or the specific Kani blind spots around aliasing, provenance, invalid values, and uninitialized memory. Saying only “fixed, sized” and “properties absent from Kani's memory model” leaves several required scope dimensions implicit, so readers cannot audit what “every byte pattern” establishes; add an explicit scope ledger covering those dimensions and the public invalid-input-path exclusion.

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

Useful? React with 👍 / 👎.

Comment thread zerocopy/src/proofs.rs Outdated
Comment on lines +37 to +39
fn char_from_bytes(bytes: &[u8], offset: usize) -> Option<char> {
let representation: [u8; 4] = bytes[offset..offset + 4].try_into().unwrap();
char::from_u32(u32::from_ne_bytes(representation))

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 Ground the byte-to-char mapping in a language oracle

Both struct proofs treat four candidate bytes as the native-endian object representation of char, but char::from_u32 only supplies checked scalar construction; it does not by itself establish that u32::from_ne_bytes(representation) describes the candidate char bytes. The existing primitive proof cites the versioned Reference guarantee that char is represented as a 32-bit unsigned word, but this new oracle neither cites nor unambiguously refers to that premise. Add the same versioned representation basis and explain the native-endian mapping so the expected result is independent of the validator under proof.

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

Useful? React with 👍 / 👎.

Comment on lines +71 to +77
// Domain: all initialized representations of this fixed `repr(C)` type.
// Establishes: the generated validator accepts exactly when both fields
// do. On those independently valid inputs, the public value-reading API
// succeeds and returns the oracle's field values.
// Oracle: actual field offsets plus safe checked `char` construction and the
// shared `bool` language-validity oracle. This is not a derive-generator or
// generic struct-layout theorem.

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 Justify arbitrary struct padding in the validity oracle

For BoolAndChar, the symbolic representation includes arbitrary padding between the one-byte bool and four-byte char, while the safely constructed witness can contain different padding. Field offsets and safe field constructors therefore do not alone establish validity of the exact candidate bytes, despite the shared macro explicitly requiring each caller to explain that step. Cite the independent aggregate-validity/padding rule and state that padding bytes impose no additional validity condition before using expected.is_some() as the exact acceptance oracle.

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 aggregate oracle now cites Rust 1.93’s field-validity rule and MaybeUninit padding contract, and explains that initialized padding bytes impose no additional validity condition. Compiler offset_of! values select the exact field bytes, so safely constructed matching fields witness validity even when their padding differs from the candidate.

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

@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: 686a73b8dc

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

@codex review

Please review current head 9ae835d5d35e4e2a7e932ac97cf9926ca29a13eb; 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. More of your lovely PRs please.

Reviewed commit: 9ae835d5d3

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

@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. Keep it up!

Reviewed commit: 8cb0ea167a

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

@codex review

Please review exact head fb3a28ad40f14d6351fb8d0e1da363dbbbbfd780.

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. More of your lovely PRs please.

Reviewed commit: fb3a28ad40

ℹ️ 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: 4121014

@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: 41210145a3

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

@googlebot rescan

CLA rescan requested for exact head 41210145a34e21d09104f34276e75b4ff1e6df22.

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

@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: 52f55b3

@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. Chef's kiss.

Reviewed commit: 52f55b36fe

ℹ️ 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: c292d92

@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. More of your lovely PRs please.

Reviewed commit: c292d92297

ℹ️ 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: Gsgjodecq7t42k3eelvsqemhatlt2or2u
@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: df12de6

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