Challenge 10: Kani contracts for String memory safety - #645
Open
sankalpsthakur wants to merge 1 commit into
Open
Challenge 10: Kani contracts for String memory safety#645sankalpsthakur wants to merge 1 commit into
sankalpsthakur wants to merge 1 commit into
Conversation
Author
|
both ubuntu jobs die with a runner shutdown signal shortly after string::verify::check_from_utf16le_lossy starts, while the 3-thread macos jobs finish that same harness in 238s, so it was peaking the 16 gb runner's memory rather than failing a check. switched it to kissat, the same remedy core::ptr uses for check_align_offset_5; state space and check count are unchanged. |
sankalpsthakur
force-pushed
the
challenge/10-string
branch
from
August 23, 2026 08:38
7f81109 to
1d9ad25
Compare
Add safety contracts and proof harnesses covering String allocation and mutation. Runtime stdlib logic is unchanged: everything added here is either a contract attribute or lives behind cfg(kani). check_from_utf16le_lossy passes the whole 2-byte buffer instead of a symbolic sub-slice. On a little-endian target it is the only one of the four UTF-16 harnesses that keeps the align_to::<u16> arms of from_utf16le_lossy live, and any_slice_of_array picks a symbolic start as well as a symbolic end, which left the slice's base pointer alignment symbolic on top of that. Both bytes are still symbolic; only the slice bounds are now fixed. This also drops the earlier solver(kissat) selection. kissat did not stop the ubuntu runner being reclaimed mid-solve, and it made the harness slower on macOS, where it then ran past the 10m autoharness timeout. Fixes rust-lang#61
sankalpsthakur
force-pushed
the
challenge/10-string
branch
from
August 23, 2026 15:22
1d9ad25 to
1ce502d
Compare
Author
|
dropped solver(kissat); ubuntu was still getting reclaimed with it in place, and it pushed the macos autoharness run past the 10m cap. check_from_utf16le_lossy now takes the whole 2-byte buffer rather than a symbolic sub-slice, so the bytes stay symbolic but the base pointer alignment feeding align_to:: doesn't. |
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
Kani safety contracts and proof harnesses for this challenge. Runtime stdlib logic is unchanged; annotations are cfg(kani) / contract attributes.
String allocation/mutation safety contracts.
Validation
challenge/10-stringscripts/run-kani.sh)Fixes #61
AI/LLM disclosure