Skip to content

Reduce Kani verification cost without changing runtime algorithms - #3797

Open
joshlf wants to merge 1 commit into
Gvlifygrl474ib42743gciqjrsgpm27ixfrom
Gum62fph6nc5t4h6fpqbuck4qgm2jz2ht
Open

joshlf wants to merge 1 commit into
Gvlifygrl474ib42743gciqjrsgpm27ixfrom
Gum62fph6nc5t4h6fpqbuck4qgm2jz2ht

Conversation

@joshlf

@joshlf joshlf commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Reduce Kani verification cost with independent specifications and checked
acyclic contract dependencies. Preserve every upstream production algorithm,
including element sizing and rounding-word decoding. Normalize padding and
metadata specifications while keeping independent capacity and selected-size
evidence. Partition endian proofs and specialize sized proof generation.

Upstream's new Ref codegen benchmarks exposed regressions in the earlier
byte-size helper. Remove that helper and restore the original sizing body
and comments. Retain the added runtime-layout benchmark with a baseline
measured against upstream's unchanged implementation. No pre-existing upstream
assembly or LLVM-MCA snapshot is changed.

Rebased on upstream main (dcb8149). The parent removes the entire
kani_slow mechanism and keeps only the two metadata ignores justified by
local results. Preserve upstream's independent duplicate-proof removal and
strengthened unrestricted byte-count bound proof, which passes in 6.8 seconds.
The final compiled graph checks 30 providers and selects 80 enabled harnesses
with exactly two skips. No duplicate CI/Python machinery or disabled safety
checks are added. Ignored contracts remain unverified; enabled-suite CI is
pending.

Validation: all 107 assembly/LLVM-MCA benchmarks and 155 MSRV library tests
pass, along with repository pre-push checks. The runtime benchmark matches
the unchanged upstream implementation. The restored original sizing proof timed out at the 300-second local
limit. It remains enabled, and callers must verify its provider; no successful
contract or complete-suite verification is claimed. CI verification is pending.

Makes progress on #3792.

Authored by an AI agent acting on Josh Liebow-Feeser'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/Gum62fph6nc5t4h6fpqbuck4qgm2jz2ht && git checkout -b pr-Gum62fph6nc5t4h6fpqbuck4qgm2jz2ht FETCH_HEAD

Checkout

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

Cherry Pick

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

Pull

git pull origin refs/heads/Gum62fph6nc5t4h6fpqbuck4qgm2jz2ht

Stacked PRs enabled by GHerrit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 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 ✅ Completed 2026-10-07T04:22:48.513547Z 85cd793 PR opened
🔒 Security Review ✅ Completed 2026-10-07T04:26:24.664555Z 85cd793 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 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.94%. Comparing base (c5aa42d) to head (ff91257).

Additional details and impacted files
@@                        Coverage Diff                         @@
##           Gvlifygrl474ib42743gciqjrsgpm27ix    #3797   +/-   ##
==================================================================
  Coverage                              92.94%   92.94%           
==================================================================
  Files                                     16       16           
  Lines                                   2466     2466           
==================================================================
  Hits                                    2292     2292           
  Misses                                   174      174           

☔ 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 changed the title Make Kani layout proofs compositional and simplify sizing Make Kani proofs fail closed and reduce verification cost Oct 7, 2026
@joshlf
joshlf changed the base branch from Gkmakpbkvu43eijrgrxe4l6n6h4abipko to main October 7, 2026 06:49
@joshlf
joshlf force-pushed the Gum62fph6nc5t4h6fpqbuck4qgm2jz2ht branch 2 times, most recently from ed3e62f to 87a1133 Compare October 7, 2026 08:29
@joshlf
joshlf changed the base branch from main to Gvlifygrl474ib42743gciqjrsgpm27ix October 7, 2026 08:29
@joshlf
joshlf force-pushed the Gvlifygrl474ib42743gciqjrsgpm27ix branch from 78eade4 to e2adb94 Compare October 7, 2026 08:43
@joshlf
joshlf force-pushed the Gum62fph6nc5t4h6fpqbuck4qgm2jz2ht branch from 87a1133 to c3c1df7 Compare October 7, 2026 08:43
@joshlf
joshlf force-pushed the Gvlifygrl474ib42743gciqjrsgpm27ix branch from e2adb94 to 40e1852 Compare October 7, 2026 09:10
@joshlf
joshlf force-pushed the Gum62fph6nc5t4h6fpqbuck4qgm2jz2ht branch from c3c1df7 to ae3bad7 Compare October 7, 2026 09:10
@joshlf
joshlf force-pushed the Gvlifygrl474ib42743gciqjrsgpm27ix branch from 40e1852 to 6f0386d Compare October 7, 2026 09:13
@joshlf
joshlf force-pushed the Gum62fph6nc5t4h6fpqbuck4qgm2jz2ht branch 2 times, most recently from dd6c51b to bb739ca Compare October 7, 2026 09:39
@joshlf joshlf changed the title Make Kani proofs fail closed and reduce verification cost Reduce Kani verification cost with focused sizing and proof changes Oct 7, 2026
@joshlf
joshlf force-pushed the Gvlifygrl474ib42743gciqjrsgpm27ix branch 2 times, most recently from 0825ffb to d93a15f Compare October 7, 2026 10:08
@joshlf
joshlf force-pushed the Gum62fph6nc5t4h6fpqbuck4qgm2jz2ht branch 3 times, most recently from ae95724 to 527a5db Compare October 7, 2026 11:33
@joshlf joshlf changed the title Reduce Kani verification cost with focused sizing and proof changes Reduce Kani verification cost without changing codegen snapshots Oct 7, 2026
@joshlf
joshlf force-pushed the Gvlifygrl474ib42743gciqjrsgpm27ix branch from d93a15f to 361f486 Compare October 7, 2026 18:10
@joshlf
joshlf force-pushed the Gum62fph6nc5t4h6fpqbuck4qgm2jz2ht branch 2 times, most recently from 19884d0 to f4cb3b5 Compare October 7, 2026 20:06
@joshlf
joshlf force-pushed the Gvlifygrl474ib42743gciqjrsgpm27ix branch from 361f486 to da49a8a Compare October 7, 2026 20:06
@joshlf
joshlf force-pushed the Gum62fph6nc5t4h6fpqbuck4qgm2jz2ht branch 2 times, most recently from c127687 to 1f47790 Compare October 7, 2026 22:09
@joshlf
joshlf force-pushed the Gvlifygrl474ib42743gciqjrsgpm27ix branch from da49a8a to d43cf40 Compare October 8, 2026 09:20
@joshlf
joshlf force-pushed the Gum62fph6nc5t4h6fpqbuck4qgm2jz2ht branch from 1f47790 to d385738 Compare October 8, 2026 09:20
Keep every production implementation, including element sizing and rounding
word decoding, identical to upstream main. The new upstream Ref benchmarks
expose regressions in the earlier checked-add byte helper, so remove that
helper and restore the original element-sizing body and its comments. Retain
the new runtime-layout benchmark, measured against the unchanged upstream
implementation; no pre-existing upstream snapshot is changed.

Normalize sizing specifications with independent widened arithmetic and
prove equivalence with checked arithmetic. Use equivalent modular and
quotient/remainder specifications for padding and metadata. Preserve the
independent capacity and selected-size evidence. Partition endian proofs
and generate only the requested sized branch in layout proofs.

Use the macro's checked acyclic contract dependencies for rounding decoders,
capacity, padding and element sizing. All substituted providers must pass
unrestricted implementation proofs in the same configuration. Preserve
upstream's broadened byte-count bound proof and duplicate-proof removal.
Remove the duplicate handwritten padding harness, retaining the unrestricted
generated contract. Replace the misleading expected-panic Kani harness with
an ordinary regression using the existing pre-1.57 gate.

This PR adds no duplicate CI/Python machinery. The parent removes every
kani_slow gate, explicitly ignores only the two resource-limited metadata
contracts, and rejects enabled proofs that substitute ignored providers.
The final compiled graph selects 80 enabled harnesses, inspects two ignored
proofs and validates 30 generated providers. Failed or timed-out proofs
establish nothing; no verification safety or contract checks are disabled.

Validation: all 107 codegen benchmarks and 155 MSRV library tests pass.
The restored original sizing proof times out at the 300-second local limit.
It remains enabled; no successful contract or full-suite result is claimed.

Makes progress on #3792

Agent-authored-by: AI agent acting on Josh Liebow-Feeser's behalf
gherrit-pr-id: Gum62fph6nc5t4h6fpqbuck4qgm2jz2ht
@joshlf
joshlf force-pushed the Gum62fph6nc5t4h6fpqbuck4qgm2jz2ht branch from d385738 to ff91257 Compare October 8, 2026 10:02
@joshlf joshlf changed the title Reduce Kani verification cost without changing codegen snapshots Reduce Kani verification cost without changing runtime algorithms Oct 8, 2026
@joshlf
joshlf force-pushed the Gvlifygrl474ib42743gciqjrsgpm27ix branch from d43cf40 to c5aa42d Compare October 8, 2026 10:02

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Would prefer to remove this benchmark. We basically don't ever work over runtime layouts, and so benchmarks involving them are highly misleading.

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.

3 participants