Skip to content

Challenge 1 status update - #433

Merged
feliperodri merged 5 commits into
model-checking:mainfrom
AlexLB99:complete-transmute
Sep 9, 2025
Merged

feliperodri merged 5 commits into
model-checking:mainfrom
AlexLB99:complete-transmute

Conversation

@AlexLB99

Copy link
Copy Markdown

Resolves #19

Status of verification of Challenge 1 functions

Function Location Completion
transmute_unchecked core::intrinsics ✔*
transmute core::intrinsics ✔*
MaybeUninit<T>::array_assume_init core::mem X
MaybeUninit<[T; N]>::transpose core::mem ✔
<[MaybeUninit<T>; N]>::transpose core::mem ✔
<[T; N] as IntoIterator>::into_iter core::array::iter ✔
BorrowedBuf::unfilled core::io::borrowed_buf ✔
BorrowedCursor::reborrow core::io::borrowed_buf ✔
str::as_bytes core::str ✔
from_u32_unchecked core::char::convert ✔
char_try_from_u32 core::char::convert ✔
Ipv6Addr::new core::net::ip_addr ✔
Ipv6Addr::segments core::net::ip_addr ✔
align_offset core::ptr ✔
Alignment::new_unchecked core::ptr::alignment ✔
MaybeUninit<T>::copy_from_slice core::mem ✔
str::as_bytes_mut core::str ✔
<Filter<I,P> as Iterator>::next_chunk core::iter::adapters X
<FilterMap<I,F> as Iterator>::next_chunk core::iter::adapters X
try_from_fn core::array X
iter_next_chunk core::array X
from_u32_unchecked core::char ✔
AsciiChar::from_u8_unchecked core::ascii_char ✔
memchr_aligned core::slice::memchr ✔
<[T]>::align_to_mut core::slice ✔
run_utf8_validation core::str::validations ✔
<[T]>::align_to core::slice ✔
is_aligned_to core::const_ptr ✔
is_aligned_to core::mut_ptr ✔
Alignment::new core::ptr::alignment ✔
Layout::from_size_align core::alloc::layout ✔
Layout::from_size_align_unchecked core::alloc::layout ✔
make_ascii_lowercase core::str ✔
make_ascii_uppercase core::str ✔
<char as Step>::forward_checked core::iter::range ✔
<Chars as Iterator>::next core::str::iter ✔
<Chars as DoubleEndedIterator>::next_back core::str::iter ✔
char::encode_utf16_raw core::char N/A **
<char as Step>::backward_unchecked core::iter::range ✔
<char as Step>::forward_unchecked core::iter::range ✔
AsciiChar::from_u8 core::ascii_char ✔
<[T]>::as_simd_mut core::slice ✔
<[T]>::as_simd core::slice ✔
memrchr core::slice::memchr ✔
do_count_chars core::str::count ✔

* Partial contract/harnesses (extent of what is currently expressible by Kani)
** Does not transitively depend on transmute

Some caveats

  1. Not all functions with checkmarks have contracts & harnesses -- for those that were trivially safe, nothing was done (a function is "trivially safe" if there are no SAFETY comments, and upon visual inspection, it is immediately clear that there is no way UB could be triggered, such as for as_bytes).
  2. As shown above, the transmute intrinsics don't have complete contracts -- they've only been verified to what we understand to be the extent of what is currently expressible by Kani (so we don't have a precondition that checks, for instance, that it doesn't transmute an immut ref into a mut ref)
  3. As the challenge stipulates, the above functions were only checked for safety, rather than functional correctness

Question

Given that the completion condition for the challenge is 75% of functions being verified, would it be considered as complete?

Please let us know if we're missing anything, or if any of the caveats would need to be addressed for completion of the challenge.

Thanks!

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

@tautschnig tautschnig left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you please also add a Contributors line to the resolved challenge, cf. challenges 0011 or 0014, among others.

@tautschnig
tautschnig marked this pull request as ready for review September 9, 2025 11:43
@tautschnig
tautschnig requested a review from a team as a code owner September 9, 2025 11:43
@feliperodri
feliperodri added this pull request to the merge queue Sep 9, 2025
Merged via the queue into model-checking:main with commit 047eac5 Sep 9, 2025
26 of 27 checks passed
tautschnig added a commit to tautschnig/verify-rust-std that referenced this pull request Sep 9, 2025
github-merge-queue Bot pushed a commit that referenced this pull request Oct 8, 2025
This is a follow-up to #433 and #482.

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.

Co-authored-by: Felipe R. Monteiro <rms.felipe@gmail.com>
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.

Challenge 1: Verify core transmuting methods

4 participants