Repository navigation
Conversation
Tiramisu-Cake
pushed a commit
to Tiramisu-Cake/verify-rust-std
that referenced
this pull request
Oct 26, 2026
…peting PRs Audit of competing PR model-checking#701 (head 77d72f7) shows its Freeze-route harnesses (general, network, stable-Freeze) use a fixed 'a < b' comparator, so the panic_on_ord_violation guard in bidirectional_merge is never exercised; non-Copy permutation under a bad comparator (double drop) is unchecked; the non-Freeze comparator never mutates Cells; insertion_sort_shift_left stops at 17 while real callers go to 20; several harnesses exceed the 10-minute cap. Revision 5 defines lead axes O1-O8 (arbitrary-comparator safety on all routes, non-Copy permutation with Drop counting, Cell-mutating comparator, CI budget, branch-complete types and B4 to 20, correctness contracts on helpers, u8 length-32 correctness via order isomorphism, mutation testing) and a work order for server agents: wave 1 K-6+, K-13, K-8, K-9; wave 2 K-14, K-12, K-10, K-11; wave 3 K-16, K-15, measurement reruns. Section 4.1 specifies the panic-path mechanism and a mandatory control against should_panic masking assertion failures. Supersedes sections 2, 3 and 5 of revision 4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KrJdRA8KAKmasW2Tfsa6mp
Tiramisu-Cake
pushed a commit
to Tiramisu-Cake/verify-rust-std
that referenced
this pull request
Oct 26, 2026
All points accepted: - 0: clean-room rule for harness/contract authors (no access to competitor PRs model-checking#576/model-checking#678/model-checking#694/model-checking#701); competitor reading reserved for the plan author. - 1: merge safety contract under proof_for_contract is an untested experiment (job 30/32: instrumentation passed, then CBMC OOM at 13 GiB). - 2: O2 narrowed to a partial answer to model-checking#56 (panic-free paths only); CopyOnDrop unwind restoration stays unverified. - 3: O1 uses should_panic without property asserts and no manual stubs; O2 uses the single manual stub panic_on_ord_violation -> assume(false), now listed in the ledger (R4 section 4 item 6); masking control for both. - 4: probe K-12a (real merge on u8 at lengths 20/24) gates K-12; expected outcome stated as likely no higher than 16-18 on merge routes. - 5: coordinator's assignment accepted; CircleCI credit check before wave 1. Decision table appended to CH8-PLAN-R5-REVIEW-2026-10-26.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KrJdRA8KAKmasW2Tfsa6mp
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds Kani verification coverage for Challenge 8 (
smallsort). The verification targets all seven functions listed by the challenge, with the main focus on the three specializedsmall_sorttrait APIs:StableSmallSortTypeImpl::small_sortUnstableSmallSortTypeImpl::small_sortUnstableSmallSortFreezeTypeImpl::small_sortswap_if_lessinsertion_sort_shift_leftsort4_stablehas_efficient_in_place_swapFor the three
small_sortAPIs, the end-to-end harnesses check:execution of the real implementation without introducing unverified stubs or path pruning,
sortedness under a valid ordering,
preservation of the input multiset,
symbolic slice lengths up to the threshold selected by the corresponding specialization.
Specialization coverage
The harnesses exercise the relevant
smallsortdispatch paths.Stable small sort
The stable implementation covers:
non-
Freezefallback sorting up to length 16,Freezegeneral sorting up to length 32,the
size_of::<T>() <= 16general path using the 8-element presort primitive,the
size_of::<T>() > 16general path using the 4-element presort primitive.The non-
Freezepath is split into separate memory-safety, sortedness, and permutation proofs to keep solver cost manageable.Unstable small sort
The unstable implementations cover:
non-
Freezefallback,Freeze + Copynetwork sorting,Freeze + Copygeneral sorting for both small and larger element sizes,Freeze + Copyoversized fallback,Freeze + !Copygeneral sorting,Freeze + !Copyoversized fallback.Equivalent specialization coverage is included for
UnstableSmallSortFreezeTypeImpldirectly.The general route is instantiated with both element sizes at or below the 16-byte presort cutoff and element sizes above that cutoff, ensuring both general-sort presort strategies are exercised.
Helper functions
swap_if_lessandsort4_stablehave explicit safety contracts and dedicatedproof_for_contractharnesses.insertion_sort_shift_leftis exercised with symbolic length and offset over the range used by the current small-sort implementations.has_efficient_in_place_swapis checked across representative zero-sized, small, large, and interior-mutable element types.Current limitations
Some full-domain proofs still exceed the current 10-minute per-harness verification budget. The length-32 Freeze/general/network paths inline several expensive operations into a single SAT instance, including presorting, insertion extension, and bidirectional merge. An full-domain Stable Freeze experiment required more than 20 minutes locally.
The next step is to investigate modular verification of the expensive internal primitives so the top-level proofs can reuse verified summaries instead of repeatedly expanding the complete implementations.
The sorting properties of the three specialized
small_sortmethods are currently expressed as end-to-end harness assertions rather than reusable Kani function postcondition contracts. Direct contracts on these specialized methods are currently limited by specialization and generic old-state handling in the pinned toolchain.No
assume(false)path pruning or unverified behavioral stubs are used to make the sorting proofs succeed.Resolves #56
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.