proofs.rs

Report #3 — Parser state transitions and valid scalar construction in the utf8parse 0.2.2 fork

creusot 0.13.0

4 verified claims · 0 findings

Recorded by the author; proofs.rs has not re-run it. How to read a report

nyuichi · 2026-09-25 04:32 UTC

Revision v2 · v1

Overview

For any input byte and a parser state satisfying the reachable-state invariant, Parser::advance in the utf8parse 0.2.2 verification fork updates its state and codepoint accumulator exactly as specified by its transition table, provided receiver callbacks return normally. The invariant is established by new and default, preserved by each completed advance, and retained by clone. Every call to char::from_u32_unchecked receives a value at most U+10FFFF and outside the surrogate range U+D800–U+DFFF.

The parser's own arithmetic, indexing and state updates pass panic-freedom checks. This is conditional on non-panicking receiver callbacks: an arbitrary Receiver implementation is not verified. The result covers the modified fork with default features disabled on macOS aarch64. It does not establish that the table implements the complete UTF-8 specification or that an arbitrary receiver observes the correct sequence of output events.

Findings (0)

No findings reported.

APIs (4)

Associated functions

impl Parser

pub fn new() -> Parser

Methods

impl Parser

pub fn advance<R>(self: &mut Self, receiver: &mut R, byte: u8) where R: Receiver

Trait implementations

impl core::clone::Clone for Parser

pub fn clone(self: &Self) -> Parser

impl core::default::Default for Parser

pub fn default() -> Parser

Evidence

https://github.com/nyuichi/rust-crate-proofs/tree/c8d9dc13e4608bf09b104e6472bd8544353738d3

Reproduce

Toolchain source metadata: not recorded.

Run locally

git clone -- https://github.com/nyuichi/rust-crate-proofs report-3-source-1
git -C report-3-source-1 checkout --detach c8d9dc13e4608bf09b104e6472bd8544353738d3
git -C report-3-source-1 submodule update --init --recursive --checkout
cd report-3-source-1/utf8parse/0.2.2

cargo creusot --no-cache -- --no-default-features

Checks out the recorded source commit from GitHub. Install the report’s tool version before running.

Source on GitHub · SARIF with logs (.json)

Recorded run

Completed · 8 checks passed · 0 failed

2026-09-25T04:28:15.449619+00:00 · 38.6 seconds · Exit code 0

Recorded on the author’s machine.

CheckResultClaim
vc_clone_Parser
utf8parse::<Parser as Clone>::clone
utf8parse/0.2.2/src/lib.rs:52
PassedClaim #1
vc_default_Parser
utf8parse::<Parser as Default>::default
utf8parse/0.2.2/src/lib.rs:63
PassedClaim #2
vc_new
utf8parse::<Parser as Default>::default
utf8parse/0.2.2/src/lib.rs:63
PassedClaim #2
vc_advance
utf8parse::Parser::advance
utf8parse/0.2.2/src/lib.rs:202
PassedClaim #3
vc_advance_R
utf8parse::Parser::advance
utf8parse/0.2.2/src/lib.rs:202
PassedClaim #3
vc_parser_step_preserves
utf8parse::Parser::advance
utf8parse/0.2.2/src/lib.rs:202
PassedClaim #3
vc_perform_action_R
utf8parse::Parser::advance
utf8parse/0.2.2/src/lib.rs:202
PassedClaim #3
vc_new
utf8parse::Parser::new
utf8parse/0.2.2/src/lib.rs:193
PassedClaim #4
Execution details
Started
2026-09-25T04:28:15.449619+00:00
Finished
2026-09-25T04:28:54.094317+00:00
Platform
macos aarch64
Rust compiler
rustc 1.98.0-nightly (91fe22da8 2026-06-21) binary: rustc commit-hash: 91fe22da8084a1c9e993d78d4a56f22ab8396236 commit-date: 2026-06-21 host: aarch64-apple-darwin release: 1.98.0-nightly LLVM version: 22.1.7
Working directory
utf8parse/0.2.2
Environment overrides
None recorded
Git repository
https://github.com/nyuichi/rust-crate-proofs
Git commit
c8d9dc13e4608bf09b104e6472bd8544353738d3
Diagnostics & logs
=== stdout ===
Proved (14 files) ✔

=== stderr ===
   Compiling proc-macro2 v1.0.107
   Compiling quote v1.0.47
   Compiling unicode-ident v1.0.24
   Compiling libc v0.2.189
   Compiling getrandom v0.4.3
   Compiling cfg-if v1.0.5
   Compiling uuid v1.26.1
   Compiling syn v2.0.119
   Compiling pearlite-syn v0.13.0
   Compiling creusot-std-proc v0.13.0
    Checking creusot-std v0.13.0
[2026-09-25T04:28:30Z WARN  creusot::metadata] could not read metadata for crate `"std"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:30Z WARN  creusot::metadata] could not read metadata for crate `"core"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:30Z WARN  creusot::metadata] could not read metadata for crate `"alloc"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:30Z WARN  creusot::metadata] could not read metadata for crate `"compiler_builtins"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:30Z WARN  creusot::metadata] could not read metadata for crate `"libc"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:30Z WARN  creusot::metadata] could not read metadata for crate `"rustc_std_workspace_core"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:30Z WARN  creusot::metadata] could not read metadata for crate `"unwind"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:30Z WARN  creusot::metadata] could not read metadata for crate `"miniz_oxide"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:30Z WARN  creusot::metadata] could not read metadata for crate `"adler2"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:30Z WARN  creusot::metadata] could not read metadata for crate `"hashbrown"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:30Z WARN  creusot::metadata] could not read metadata for crate `"rustc_std_workspace_alloc"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:30Z WARN  creusot::metadata] could not read metadata for crate `"std_detect"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:30Z WARN  creusot::metadata] could not read metadata for crate `"rustc_demangle"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:30Z WARN  creusot::metadata] could not read metadata for crate `"cfg_if"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:30Z WARN  creusot::metadata] could not read metadata for crate `"addr2line"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:30Z WARN  creusot::metadata] could not read metadata for crate `"gimli"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:30Z WARN  creusot::metadata] could not read metadata for crate `"object"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:30Z WARN  creusot::metadata] could not read metadata for crate `"memchr"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:30Z WARN  creusot::metadata] could not read metadata for crate `"panic_unwind"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:30Z WARN  creusot::metadata] could not read metadata for crate `"creusot_std_proc"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
    Checking utf8parse v0.2.2 (./utf8parse/0.2.2)
[2026-09-25T04:28:35Z WARN  creusot::metadata] could not read metadata for crate `"core"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:35Z WARN  creusot::metadata] could not read metadata for crate `"std"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:35Z WARN  creusot::metadata] could not read metadata for crate `"alloc"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:35Z WARN  creusot::metadata] could not read metadata for crate `"compiler_builtins"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:35Z WARN  creusot::metadata] could not read metadata for crate `"libc"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:35Z WARN  creusot::metadata] could not read metadata for crate `"rustc_std_workspace_core"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:35Z WARN  creusot::metadata] could not read metadata for crate `"unwind"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:35Z WARN  creusot::metadata] could not read metadata for crate `"miniz_oxide"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:35Z WARN  creusot::metadata] could not read metadata for crate `"adler2"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:35Z WARN  creusot::metadata] could not read metadata for crate `"hashbrown"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:35Z WARN  creusot::metadata] could not read metadata for crate `"rustc_std_workspace_alloc"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:35Z WARN  creusot::metadata] could not read metadata for crate `"std_detect"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:35Z WARN  creusot::metadata] could not read metadata for crate `"rustc_demangle"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:35Z WARN  creusot::metadata] could not read metadata for crate `"cfg_if"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:35Z WARN  creusot::metadata] could not read metadata for crate `"addr2line"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:35Z WARN  creusot::metadata] could not read metadata for crate `"gimli"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:35Z WARN  creusot::metadata] could not read metadata for crate `"object"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:35Z WARN  creusot::metadata] could not read metadata for crate `"memchr"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:35Z WARN  creusot::metadata] could not read metadata for crate `"panic_unwind"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:35Z WARN  creusot::metadata] could not read metadata for crate `"creusot_std_proc"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 19.80s
Environment

macOS aarch64; --no-default-features; Rust nightly-2026-06-22 (91fe22da8). Creusot 0.13.0 at upstream commit 318615be3b8bbc60d1f6d52469ba5c0bdebed4f1; creusot-std =0.13.0. Why3 54c92f96bb0711d6e991c18f10bfbc08d90d028b, why3find eab37557d3e24e1913a3c4f44bc5528ef497c6c9, Z3 4.16.0 and CVC5 1.3.1. Source: c8d9dc13e4608bf09b104e6472bd8544353738d3, utf8parse/0.2.2. The attached 2026-09-25 SARIF records cargo creusot --no-cache -- --no-default-features and successful proof sessions. This revision reuses the recorded evidence without rerunning verification.

What is trusted

Receiver::codepoint and Receiver::invalid_sequence are abstract calls; their bodies, side effects and event histories are not proved. Normal return is needed for the stated post-call state, and non-panicking callbacks are needed for panic freedom. Verification-only equality implementations for State and Parser are assumed to agree with their state/accumulator models. The external char::from_u32_unchecked contract is assumed to construct the specified character for a valid scalar; the parser proves that scalar precondition at each call. Creusot's core-operation models remain assumptions.

Technical limitations

The fork changes perform_action to borrow only the accumulator instead of the whole Parser, and replaces derived implementations under cfg(creusot). The source/provenance describes preservation of byte operations and callback order, but the recorded proof does not prove equivalence to the unmodified crates.io release. Receiver effects and full output histories remain unspecified, including behavior after a callback panic. Proving the scalar precondition at one unsafe operation is not a complete Rust undefined-behavior proof. Other feature configurations and targets are outside this recording.

Tool limitations

Verification is relative to the supplied specifications and trusted contracts. Results apply to the compilation target used for verification. The standard-library specifications do not exclude all panics: Vec capacity overflow in operations such as push, insert, and extend is not ruled out, including for vectors of zero-sized types. Out-of-memory failures are also outside the guarantees. The standard vec! macro is unsupported; verified code must use the Creusot replacement where needed. Reference: https://github.com/creusot-rs/creusot/blob/v0.13.0/guide/src/limitations.md

Updated 2026-09-24 05:03 UTC

creusot 0.13.0 — version details

Dependencies (0)

No direct dependencies.

Comments (0)

No comments.

Sign in to comment.