Skip to content

Verify Rust Standard Library - Challenge 11: Safety of Methods for Numeric Primitive Types#985

Draft
dkcumming wants to merge 19 commits intomasterfrom
verify-rust-std/challenge-0011
Draft

Verify Rust Standard Library - Challenge 11: Safety of Methods for Numeric Primitive Types#985
dkcumming wants to merge 19 commits intomasterfrom
verify-rust-std/challenge-0011

Conversation

@dkcumming
Copy link
Collaborator

This PR adds infrastructure for verify-rust-std (docs / github) challenges. challenges and implements Challenge 11: Safety of Methods for Numeric Primitives:

  • Proof harnesses verifying correctness under preconditions (symbolic inputs)
  • Fail harnesses verifying UB detection when preconditions are violated, with expected output
    files
  • All verify-rust-std proofs run with --terminate-on-thunk
  • K simplification lemmas added for shift mask identities

Part 3 (floats) is blocked: KMIR lacks float value support. Harnesses exist in to_int_unchecked-fail.rs and should be moved to to_int_unchecked.rs once passing.

Progress

Part 1 - Unsafe Integer Methods (i8i128, u8u128). Proofs for soundness and proofs catching UB:

  • unchecked_add
  • unchecked_sub
  • unchecked_mul
  • unchecked_shl
  • unchecked_shr
  • unchecked_neg (signed only)

Part 2 - Safe API Verification. Proofs for soundness:

  • wrapping_shl (i8i128, u8u128)
  • wrapping_shr (i8i128, u8u128)
  • widening_mul (u8u64)
  • carrying_mul (u8u64)

Part 3 — Float to Integer Conversion:

  • to_int_unchecked (f16, f32, f64, f128) FIXME: blocked on float support

@dkcumming dkcumming self-assigned this Mar 13, 2026
automergerpr-permission-manager bot pushed a commit that referenced this pull request Mar 14, 2026
Collapse `prove-rs` into `prove`:
- ProveRSOpts merged into ProveOpts
- `kmir prove` is the primary command (`prove-rs` kept as alias for
backwards compatibility)
- adds `parsed_smir` option for programmatic use (useful for tests with
many start symbols like #985)
@dkcumming dkcumming force-pushed the verify-rust-std/challenge-0011 branch from caf61b6 to f54ce95 Compare March 15, 2026 10:58
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.

1 participant