Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
e4327ff
Add Kani harnesses for flt2dec digits_to_dec_str and digits_to_exp_str
gui-wf May 19, 2026
730e7e1
Add Nix flake and complete Kani verification for flt2dec helpers
gui-wf May 19, 2026
ab18b62
Document flake decision and update status to 2 of 12 verified
gui-wf May 19, 2026
aba6498
Verify the four public flt2dec wrappers, monomorphised to f32
gui-wf May 19, 2026
45df47f
Add memory cap and document grisu/dragon contract-decomposition path
gui-wf May 19, 2026
538b39b
Stub-based safety harnesses for grisu and dragon strategies
gui-wf May 20, 2026
946a554
Verify grisu strategy safety with deterministic mul + hoisted round_a…
gui-wf May 20, 2026
b7f5695
Dragon stubs: compile and run, but stub-correlation issue remains
gui-wf May 20, 2026
e44afa5
Status: 8 of 12 Challenge 28 functions verified
gui-wf May 20, 2026
d13fca6
Verify grisu wrapper safety; total 10 of 12
gui-wf May 20, 2026
39e702a
Dragon size-based cmp stub + status update to 10/12
gui-wf May 20, 2026
813821e
Verify dragon strategies; Challenge 28 at 12 of 12
gui-wf May 22, 2026
6a2fc9c
Reference kani#4591 in flt2dec safety-contract doc blocks
gui-wf May 22, 2026
eb25f27
Fix CI failures on PR #596: cfg(kani)-gate dragon debug_asserts; rustfmt
gui-wf May 24, 2026
2679276
Consolidate dragon digit extraction; fix remaining rustfmt diffs
gui-wf May 26, 2026
da939ac
Remove fork-internal tooling and notes from PR
gui-wf May 26, 2026
5698c1e
Address Copilot review on PR #596: f64 coverage, scope docs, contract…
gui-wf May 27, 2026
0e522ad
Merge branch 'main' into challenge-28-flt2dec-helpers
gui-wf May 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions library/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
//! which do not trigger a panic can be assured that this function is never
//! called. The `lang` attribute is called `eh_personality`.
#![cfg_attr(kani, recursion_limit = "256")]
#![stable(feature = "core", since = "1.6.0")]
#![doc(
html_playground_url = "https://play.rust-lang.org/",
Expand Down
27 changes: 27 additions & 0 deletions library/core/src/num/bignum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,33 @@ macro_rules! define_bignum {
}
(self, borrow)
}

/// Havoc the bignum to a nondeterministic value whose bit length is
/// bounded by `max_bits`. Used exclusively by Kani verification
/// stubs to avoid tracing through the full multi-limb arithmetic.
#[cfg(kani)]
#[doc(hidden)]
pub fn kani_size(&self) -> usize {
self.size
}

#[cfg(kani)]
#[doc(hidden)]
pub fn kani_havoc(&mut self, max_bits: usize) {
let digitbits = <$ty>::BITS as usize;
let cap_bits = $n * digitbits;
let bound = if max_bits > cap_bits { cap_bits } else { max_bits };
let sz: usize = crate::kani::any();
let max_sz = (bound + digitbits - 1) / digitbits;
crate::kani::assume(sz <= max_sz);
// Whole-array nondet; CBMC models this as a symbolic array
// without per-element loop unwinding. Skip the canonical-
// size mask and non-zero-top-limb constraints: dragon's
// safety stubs only depend on `size`, and adding those
// constraints would re-introduce per-limb reasoning.
self.size = sz;
self.base = crate::kani::any();
}
}

impl crate::cmp::PartialEq for $name {
Expand Down
Loading
Loading