COOLJAPAN
← All posts

SplitRS 0.3.2 Released — SMT-Verified Refactoring That Proves It Didn't Change Your Code

SplitRS 0.3.2 adds an SMT-verified extraction pass: it factors pure integer sub-blocks out of over-budget functions and commits the rewrite only when OxiZ proves the result is equivalent for all inputs. Plus array-splitting, a test-module splitter, shipped editor plugins, and 450 passing tests.

release splitrs rust refactoring smt formal-verification oxiz developer-tools

Most refactoring tools ask you to trust them. SplitRS 0.3.2 hands you a proof — or a counterexample.

Today we released SplitRS 0.3.2 — a patch that makes SplitRS the first member of its class to prove certain refactorings preserve semantics before applying them, using OxiZ, the pure-Rust SMT solver, as the verification backend.

SplitRS is the AST-based Rust refactoring tool that splits oversized source files into clean, compilable modules: it parses with syn, clusters methods, infers visibility, and writes the imports and mod.rs for you. Up to now its safety story was the honest, conventional one — whole-item module moves are byte-identical relocations, and the Rust compiler verifies name resolution with cargo check. 0.3.2 adds something stronger for the cases where SplitRS actually rewrites code rather than just moving it.

No C, no external solver process, no SMT-LIB shell-out. The verification fragment runs in-process against OxiZ — pure Rust — and the whole tool still compiles to a single static binary. SMT support is feature-gated and off by default, so it costs you nothing unless you ask for it.

Why 0.3.2 is a meaningful step

Splitting a file is mostly relocation, and relocation is safe by construction. But the moment a tool extracts a helper function — rewriting the body — “trust me” stops being good enough. 0.3.2 closes that gap with a verified extraction pass:

There is also a standalone oracle: splitrs smt-verify-equiv --left calc.rs::a --right calc.rs::b proves whether two pure integer functions are equivalent for all inputs, or hands you the input where they diverge.

Technical Deep Dive: the verified extraction pipeline

The new machinery lives behind the smt feature in two modules — src/extraction/ and src/smt/ — and threads a proof obligation through the normal split flow:

  1. Live-variable dataflow (dataflow.rs + detector::find_candidate). A live-variable analysis finds a contiguous, pure-integer sub-block whose live outputs are well-defined — the candidate for extraction.
  2. Helper synthesis (rewriter::rewrite). SplitRS factors the sub-block into a helper function with the correct signature and substitutes a call at the original site.
  3. The gate (gate::verify_and_decide). This is where OxiZ runs. EquivBuilder encodes both the original body and the rewritten body in QF_BV and asks: are they equal for all inputs? It uses whole-function inline-back with a componentwise fallback. The outcome is one of three honest verdicts — Committed, SkippedRefuted (counterexample found — the rewrite is rejected), or SkippedUnsupported (outside the fragment).
  4. Back into the normal pipeline. A committed helper is just an ordinary function, so it flows through the usual split/write path with everything else.

The soundness boundary is stated plainly: the proven fragment is pure, fixed-width integers only — + - * & | ^ << >>, comparisons, if/else, let, and integer casts. Everything else is Unsupported and never committed. Purity is probed first by non-mutating checks (is_pure_supported_expr / is_pure_supported_block) so non-candidates incur zero SMT overhead.

Getting Started

Install the latest SplitRS:

cargo install splitrs

The everyday splitter works exactly as before — no flags, no solver:

splitrs --input src/large_file.rs --output src/large_file/ --split-impl-blocks --max-impl-lines 200

For verified extraction, build with the smt feature and ask for a report:

cargo install splitrs --features smt
splitrs --features smt -i big.rs -o out/ --extract-pure --smt-verify

Or prove two functions equivalent directly:

splitrs --features smt smt-verify-equiv --left calc.rs::a --right calc.rs::b

What’s New in 0.3.2

Tips

This is the foundation

SplitRS sits inside a pure-Rust ecosystem and now depends on a piece of it: OxiZ, the COOLJAPAN SMT solver, is the engine behind verified extraction — one Rust tool proving another Rust tool’s rewrites correct, with no C solver in sight. It remains the development workhorse that keeps the whole codebase under the under-2,000-lines-per-file policy, and 0.3.2 is where its safety story graduates from “trust the compiler” to “here is the proof.”

Repository: https://github.com/cool-japan/splitrs

Star the repo if a refactoring tool that proves it didn’t break your code is the kind of thing you want in your toolbox. Pure Rust refactoring is here — fast, safe, and now verifiable.

KitaSan at COOLJAPAN OÜ June 9, 2026

↑ Back to all posts