<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>proofs.rs blog</title>
    <link>https://proofs.rs/blog/</link>
    <description>proofs.rs blog</description>
    <language>en</language>
    <atom:link href="https://proofs.rs/blog/rss.xml" rel="self" type="application/rss+xml"/>
    <item>
      <title>How Google&#39;s Anneal Uses lean-miri to Validate Its Rust Semantics</title>
      <link>https://proofs.rs/blog/how-google-s-zerocopy-project-uses-lean-miri-to-verify-unsafe-rust/</link>
      <guid isPermaLink="false">https://proofs-rs.hashnode.dev/how-google-s-zerocopy-project-uses-lean-miri-to-verify-unsafe-rust</guid>
      <dc:creator>Yuichi Nishiwaki</dc:creator>
      <pubDate>Sun, 29 Nov 2026 00:00:00 &#43;0900</pubDate>
      <content:encoded>&lt;p&gt;&lt;a href=&#34;https://proofs-rs.github.io/lean-miri/&#34;&gt;lean-miri&lt;/a&gt; was recently adopted by &lt;a href=&#34;https://crates.io/crates/cargo-anneal&#34;&gt;Anneal&lt;/a&gt;, a Rust verification tool developed as part of Google&#39;s &lt;a href=&#34;https://github.com/google/zerocopy&#34;&gt;zerocopy&lt;/a&gt; project. Following this adoption, &lt;a href=&#34;https://github.com/proofs-rs/lean-miri/pull/91&#34;&gt;a pull request&lt;/a&gt; from Anneal’s creator, &lt;a href=&#34;https://github.com/joshlf&#34;&gt;Josh Liebow-Feeser&lt;/a&gt;, has already been merged into lean-miri. What makes this especially remarkable is that lean-miri was developed almost entirely by AI and found real-world adoption less than three weeks after its public announcement.&lt;/p&gt;
&lt;p&gt;lean-miri is a port of Rust’s Miri interpreter to the Lean proof assistant, providing an executable formalization of Rust’s MIR semantics. It is designed to enable formal proofs that Rust programs, including those containing unsafe code, are free of undefined behavior. Rather than running lean-miri directly as an end-to-end verifier, Anneal uses its MIR execution model as a reference semantics. Proofs in Anneal show that individual operations in Anneal’s own model correspond to the matching operations in lean-miri.&lt;/p&gt;
&lt;p&gt;Anneal lets users state and prove specifications about Rust programs by extracting MIR directly from the Rust compiler. Its verification machinery is proven sound relative to its model of MIR semantics, making the semantic model itself one of the few components that must be trusted. Gaining confidence in the accuracy of this model is therefore central to Anneal&#39;s approach.&lt;/p&gt;
&lt;p&gt;lean-miri provides an independently developed, executable formalization of MIR semantics against which Anneal can check its own model.&lt;/p&gt;
&lt;p&gt;Integrating an executable interpreter into real proofs exposed a clear gap: running an operation is different from proving properties about it (&lt;a href=&#34;https://github.com/google/zerocopy/issues/4009&#34;&gt;zerocopy issue #4009&lt;/a&gt;). Anneal needed specification and frame lemmas for memory operations—such as how written bytes change and that untouched ranges stay intact—without repeatedly unfolding the interpreter’s internal representation. Josh contributed those lemmas upstream in &lt;a href=&#34;https://github.com/proofs-rs/lean-miri/pull/91&#34;&gt;lean-miri PR #91&lt;/a&gt;, and driving improvements through real downstream use cases like this is a great way for the project to evolve.&lt;/p&gt;
&lt;p&gt;I originally developed lean-miri as a standalone verification tool for Rust programs. Seeing it serve as a reference semantics for another verification tool was an unexpected and welcome development. I hope lean-miri will continue to be useful not only as a verifier in its own right, but also as a shared semantic foundation for other Rust verification tools.&lt;/p&gt;
&lt;p&gt;What makes this particularly exciting to me is that Anneal started using lean-miri less than three weeks after its public announcement. lean-miri was developed almost entirely by AI, with its implementation validated through differential testing against Miri.&lt;/p&gt;
&lt;p&gt;AI-generated software is often associated with slop, and for good reason. But when AI-driven development is backed by a rigorous validation harness, it can produce software that is not only technically credible but also genuinely useful to others. I see Anneal&#39;s adoption of lean-miri as a concrete example of this: software developed almost entirely by AI, independently recognized as valuable and put to use by another project within a matter of weeks.&lt;/p&gt;
&lt;p&gt;If you are building verification tooling for Rust and need a formal baseline, try out lean-miri and let us know what is missing. Thanks to Josh for the contribution.&lt;/p&gt;
</content:encoded>
    </item>
    <item>
      <title>lean-miri: Formally Proving Rust Programs Free of Undefined Behavior with Lean</title>
      <link>https://proofs.rs/blog/lean-miri-formally-proving-rust-programs-free-of-undefined-behavior-with-lean/</link>
      <guid isPermaLink="false">https://proofs-rs.hashnode.dev/lean-miri-formally-proving-rust-programs-free-of-undefined-behavior-with-lean</guid>
      <dc:creator>Yuichi Nishiwaki</dc:creator>
      <pubDate>Tue, 03 Nov 2026 14:24:37 &#43;0000</pubDate>
      <content:encoded>&lt;p&gt;Miri is an interpreter for Rust’s Mid-level Intermediate Representation (MIR) that detects undefined behavior (UB). It supports a wide range of Rust language features, including advanced traits and raw pointer operations, and implements state-of-the-art memory models. This broad coverage makes Miri a practical and widely used tool for detecting UB in real-world Rust code.&lt;/p&gt;
&lt;p&gt;While dynamic execution tools like Miri are invaluable for catching bugs during testing, proving that a program is free of Undefined Behavior (UB-freedom) across all valid inputs or thread schedules generally requires formal verification. Tools like Aeneas and Creusot provide such great verification pipelines for Rust, but fully formalizing low-level execution semantics still remains a big challenge.&lt;/p&gt;
&lt;p&gt;To explore whether we can leverage Miri&#39;s existing, highly comprehensive execution model for mathematical proofs, we built &lt;a href=&#34;https://github.com/proofs-rs/lean-miri&#34;&gt;lean-miri&lt;/a&gt;, an experimental port of the Miri interpreter into the Lean 4 theorem prover.&lt;/p&gt;
&lt;p&gt;By running Miri’s exact operational semantics inside Lean 4, we can write and check formal proofs of UB-freedom for Rust programs directly against Miri’s unsafe semantics.&lt;/p&gt;
&lt;h2 id=&#34;why-port-miri-to-lean&#34;&gt;Why Port Miri to Lean?&lt;/h2&gt;
&lt;p&gt;Building a standalone formal semantics, as done in many existing verification tools, often involves trading off language coverage, making it difficult to handle complex traits or advanced language constructs.&lt;/p&gt;
&lt;p&gt;Miri already provides the most complete operational model of Rust in practice. By porting Miri to Lean 4 instead of defining another semantics from scratch, we get a verifier based directly on Rust’s reference execution model.&lt;/p&gt;
&lt;p&gt;The core objective is straightforward: given a Rust program &lt;span class=&#34;katex&#34;&gt;&lt;math xmlns=&#34;http://www.w3.org/1998/Math/MathML&#34;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;P&lt;/mi&gt;&lt;/mrow&gt;&lt;annotation encoding=&#34;application/x-tex&#34;&gt;P&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt; and the interpreted Miri state &lt;span class=&#34;katex&#34;&gt;&lt;math xmlns=&#34;http://www.w3.org/1998/Math/MathML&#34;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi mathvariant=&#34;script&#34;&gt;M&lt;/mi&gt;&lt;/mrow&gt;&lt;annotation encoding=&#34;application/x-tex&#34;&gt;\mathcal{M}&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt; in Lean 4, prove the following property as a theorem:&lt;/p&gt;
&lt;span class=&#34;katex&#34;&gt;&lt;math xmlns=&#34;http://www.w3.org/1998/Math/MathML&#34; display=&#34;block&#34;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi mathvariant=&#34;normal&#34;&gt;∀&lt;/mi&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo&gt;:&lt;/mo&gt;&lt;mtext&gt;input&lt;/mtext&gt;&lt;mo separator=&#34;true&#34;&gt;,&lt;/mo&gt;&lt;mspace width=&#34;1em&#34;/&gt;&lt;mtext&gt;valid&lt;/mtext&gt;&lt;mo stretchy=&#34;false&#34;&gt;(&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&#34;false&#34;&gt;)&lt;/mo&gt;&lt;mtext&gt;  &lt;/mtext&gt;&lt;mo&gt;⟹&lt;/mo&gt;&lt;mtext&gt;  &lt;/mtext&gt;&lt;mi mathvariant=&#34;script&#34;&gt;M&lt;/mi&gt;&lt;mo stretchy=&#34;false&#34;&gt;(&lt;/mo&gt;&lt;mi&gt;P&lt;/mi&gt;&lt;mo separator=&#34;true&#34;&gt;,&lt;/mo&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;mo stretchy=&#34;false&#34;&gt;)&lt;/mo&gt;&lt;mo mathvariant=&#34;normal&#34;&gt;≠&lt;/mo&gt;&lt;mtext&gt;UB&lt;/mtext&gt;&lt;/mrow&gt;&lt;annotation encoding=&#34;application/x-tex&#34;&gt;\forall i : \text{input}, \quad \text{valid}(i) \implies \mathcal{M}(P, i) \neq \text{UB}&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;h2 id=&#34;proving-undefined-behavior-freedom&#34;&gt;Proving Undefined Behavior-Freedom&lt;/h2&gt;
&lt;p&gt;So far, we have been working on proving UB-freedom for some concrete programs:&lt;/p&gt;
&lt;h3 id=&#34;1-a-trivial-safe-function&#34;&gt;1. A trivial safe function&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-rust&#34; data-lang=&#34;rust&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;fn&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;empty_function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{}&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Even for an empty function, verifying state transitions through the full Miri evaluation loop is non-trivial and served as an essential baseline for the core architecture.&lt;/p&gt;
&lt;h3 id=&#34;2-a-realistic-function-with-unsafe-duplicate_prefix&#34;&gt;2. A realistic function with &lt;code&gt;unsafe&lt;/code&gt; (&lt;code&gt;duplicate_prefix&lt;/code&gt;)&lt;/h3&gt;
&lt;p&gt;A function that duplicates the first &lt;span class=&#34;katex&#34;&gt;&lt;math xmlns=&#34;http://www.w3.org/1998/Math/MathML&#34;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;/mrow&gt;&lt;annotation encoding=&#34;application/x-tex&#34;&gt;n&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt; bytes of a buffer into the following &lt;span class=&#34;katex&#34;&gt;&lt;math xmlns=&#34;http://www.w3.org/1998/Math/MathML&#34;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;/mrow&gt;&lt;annotation encoding=&#34;application/x-tex&#34;&gt;n&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt; bytes:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-rust&#34; data-lang=&#34;rust&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;sd&#34;&gt;/// Duplicate the first `n` bytes into the following `n` bytes.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;sd&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;pub&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;fn&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;duplicate_prefix&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;buf&lt;/span&gt;: &lt;span class=&#34;kp&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;mut&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;u8&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;n&lt;/span&gt;: &lt;span class=&#34;kt&#34;&gt;usize&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;-&amp;gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;==&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;        &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;return&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;buf&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;len&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;        &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;return&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;let&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;buf&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;as_mut_ptr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;unsafe&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;        &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;std&lt;/span&gt;::&lt;span class=&#34;n&#34;&gt;ptr&lt;/span&gt;::&lt;span class=&#34;n&#34;&gt;copy_nonoverlapping&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This serves as a practical test case involving pointer arithmetic, bounds checking, and an &lt;code&gt;unsafe&lt;/code&gt; block. References in the target program are treated under the Tree Borrows semantics.&lt;/p&gt;
&lt;p&gt;For both programs, we have formally proven in Lean the safety under Miri&#39;s operational semantics (with Tree Borrows).&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lean&#34; data-lang=&#34;lean&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;-- The empty function does not have undefined behavior.&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;kn&#34;&gt;theorem&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;noUB&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Static&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;metadata&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Metadata&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;profile&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Profile&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Packet&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;runtime&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;RuntimeProfile&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;input&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;InputDraft&lt;/span&gt;&lt;span class=&#34;bp&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;CurrentInputDraft&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;CallLevelNoUB&lt;/span&gt;&lt;span class=&#34;bp&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;NoUB&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;a-bug-in-miri&#34;&gt;A bug in Miri&lt;/h2&gt;
&lt;p&gt;While verifying state transitions related to Tree Borrows in Lean 4, we encountered a subtle edge case that resulted in an internal assertion failure in Miri. We reported this finding to the developers as &lt;a href=&#34;https://github.com/rust-lang/miri/issues/5543&#34;&gt;&lt;strong&gt;Issue #5543&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;challenges--current-limitations&#34;&gt;Challenges &amp;amp; Current Limitations&lt;/h2&gt;
&lt;p&gt;While our porting already covers most of the original interpreter, the current codebase and experiments face several challenges:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The Lean implementation of the interpreter is currently unoptimized. Workloads that run quickly in native Miri take significantly longer inside Lean, which directly impacts proof elaboration and build times. For the second example above, it takes over 2 hours to check the validity of the proof.&lt;/li&gt;
&lt;li&gt;To evaluate MIR accurately, the exported data includes &lt;code&gt;rustc&lt;/code&gt; layout and sizing metadata for all relevant standard library types. This inflates exported program payloads to ~500MiB, adding overhead to the evaluation process.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;lean-miri&lt;/code&gt; currently operates as a forward-execution step interpreter. Without a dedicated program logic (such as a weakest precondition calculus), verification requires manually inferring and structuring intermediate lemmas, which scales proof complexity.&lt;/li&gt;
&lt;li&gt;To keep initial verification tractable, features like garbage collection and data race detection within the interpreter were disabled during current experimental runs. Enabling full data race checking to verify liveness across arbitrary thread schedules remains work in progress.&lt;/li&gt;
&lt;li&gt;We lack a large, well-designed theorem library for proving various properties of the interpreter and its execution traces. To make verification of larger programs practical, we need to avoid repeatedly proving basic results and instead reuse established lemmas from the framework. The proof of the second example, for instance, currently consists of over 700,000 lines of Lean code and is essentially an unmaintainable mess. It will need substantial refactoring around a well-designed program logic and a reusable library of lemmas.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;whats-next&#34;&gt;What’s Next?&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;lean-miri&lt;/code&gt; is still an early-stage experiment, not a push-button verifier for arbitrary Rust code. We have a lot of refactoring and optimization work ahead. In particular, designing a nice program logic and building a useful library of lemmas should be a very interesting challenge.&lt;/p&gt;
&lt;p&gt;If you are interested in our development, check out the repository! Feedback, contributions, and discussions are all very welcome.&lt;/p&gt;
&lt;p&gt;GitHub: &lt;a href=&#34;https://github.com/proofs-rs/lean-miri&#34;&gt;https://github.com/proofs-rs/lean-miri&lt;/a&gt;&lt;/p&gt;
</content:encoded>
    </item>
    <item>
      <title>Announcing Proofs.rs: A Public Registry for Rust Formal Verification Results</title>
      <link>https://proofs.rs/blog/announcing-proofs-rs-a-public-registry-for-rust-formal-verification-results/</link>
      <guid isPermaLink="false">https://proofs-rs.hashnode.dev/announcing-proofs-rs-a-public-registry-for-rust-formal-verification-results</guid>
      <dc:creator>Yuichi Nishiwaki</dc:creator>
      <pubDate>Sat, 10 Oct 2026 22:23:16 &#43;0000</pubDate>
      <content:encoded>&lt;p&gt;Hi, folks!&lt;/p&gt;
&lt;p&gt;We’re very happy to introduce &lt;a href=&#34;https://proofs.rs&#34;&gt;proofs.rs&lt;/a&gt;, a place to publish and explore formal verification results for Rust crates.&lt;/p&gt;
&lt;h2 id=&#34;why&#34;&gt;Why?&lt;/h2&gt;
&lt;p&gt;There are some great tools for formally verifying Rust code, such as Kani, Verus, and Creusot, but their verification results often stay buried in individual repositories, making them hard to discover when we’re trying to decide whether to trust a library.&lt;/p&gt;
&lt;p&gt;We wanted to make those results easier to find, examine, and reuse as building blocks for establishing the correctness of larger systems.&lt;/p&gt;
&lt;h2 id=&#34;what-does-it-do&#34;&gt;What does it do?&lt;/h2&gt;
&lt;p&gt;On proofs.rs, you can browse verification reports by crate and API, see what properties have been verified, and follow links to the GitHub repositories containing the verification code and supporting evidence.&lt;/p&gt;
&lt;p&gt;Each report also has a comment section for questions and discussion. Why? Because, importantly, proofs.rs doesn’t (or rather, cannot) certify that a crate is safe. Formal verification results come with assumptions, limitations, and sometimes subtle details that matter. Understanding what a result actually guarantees requires careful review. That’s why proofs.rs is designed around sharing evidence and enabling discussion, rather than issuing certifications.&lt;/p&gt;
&lt;h2 id=&#34;how-to-use-it&#34;&gt;How to use it?&lt;/h2&gt;
&lt;p&gt;Publishing a report is pretty straightforward:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Fork a Rust crate on GitHub.&lt;/li&gt;
&lt;li&gt;Add verification annotations to your fork.&lt;/li&gt;
&lt;li&gt;Run cargo-proofs to submit your report.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;That’s it!&lt;/p&gt;
&lt;p&gt;Partial proofs are very welcome. You don’t need to verify every API or every property. Even a small, well-scoped result can be useful to someone, and perhaps one day, someone will build on your work to verify the entire crate.&lt;/p&gt;
&lt;p&gt;As an example, we’ve verified &lt;a href=&#34;https://crates.io/crates/itoa/1.0.18&#34;&gt;the itoa crate&lt;/a&gt; and published &lt;a href=&#34;https://proofs.rs/report/4&#34;&gt;the results&lt;/a&gt; on proofs.rs. Feel free to take a look!&lt;/p&gt;
&lt;h2 id=&#34;whats-next&#34;&gt;What’s next?&lt;/h2&gt;
&lt;p&gt;We’d love to see formal verification become one more piece of information people can use when choosing software dependencies. Over time, we hope these results can also be composed and reused to establish stronger guarantees for larger systems built from verified components.&lt;/p&gt;
&lt;p&gt;proofs.rs is still in a very early beta stage, so there may be bugs and rough edges in the user experience. Feedback, suggestions, and contributions are always appreciated.&lt;/p&gt;
&lt;p&gt;Right now, cargo-proofs supports Kani and Creusot. If you’re using or developing another verification tool, we’d be happy to hear about it. Requests for additional tool support are very welcome!&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://proofs.rs&#34;&gt;https://proofs.rs&lt;/a&gt;&lt;/p&gt;
</content:encoded>
    </item>
  </channel>
</rss>
