A Rust reimplementation of Python's natsort library. Not just rewritten — every algorithm is checked against the original until they sort byte-for-byte identically.
Across 21,000 comparisons spanning the full Unicode character set and all seven algorithms, the port and the original library never disagree on order.
Differential testing surfaced a genuine issue in natsort itself. Under ns.REAL, numeric values above the float maximum (~1.8 × 10³⁰⁸) overflow to inf — so two distinct large numbers compare equal and their order is silently lost.
The Rust port reproduces this exactly, so parity holds. Filed upstream: natsort#192 ↗.
Three character classes are handled exactly as natsort does them: decimal digits (fullwidth 0-9, Arabic-Indic ٠-٩, Thai, Devanagari) concatenate into numbers; isolated digits (circled ①, superscript ²) each become a separate single-digit number; numeric non-digits (Roman Ⅷ, fraction ½) are numbers under REAL only.
Input is NFD-normalized and case-insensitive modes use casefolding (ß → ss, fi → fi), so accented and cased text orders identically to Python.
4.7x, not 10x — reported as measured. natsort's Python implementation is already reasonably optimized, which caps the ceiling for an algorithmic port. The clearer win is memory: 4.1x less peak RSS, and no Python runtime is required at all.