Reproduce every claim

Don't take our word
for it. Run it.

Every number on the verification page comes from these exact commands. Clone the repo, run each step in order, and compare your output to what's shown here.

01Clone and build

Requires Rust (stable) and Python 3.9+. No other setup.

git clone https://github.com/codewitharyan29/Port-Mortem.git
cd Port-Mortem
cargo build --release
git clone https://github.com/codewitharyan29/Port-Mortem.git
cd Port-Mortem
cargo build --release
ExpectFinished `release` profile [optimized] target(s) — zero warnings.
02Sanity check the binary

Confirm it's really Rust doing the sorting, not a shim.

"file10`nfile2`nfile1" | .\target\release\natsort_port.exe sort
.\target\release\natsort_port.exe key "a-5.034e2"
printf 'file10\nfile2\nfile1\n' | ./target/release/natsort_port sort
./target/release/natsort_port key "a-5.034e2"
Expectfile1 file2 file10 then T:a- I:5 T:. I:34 T:e I:2
03Native Rust tests

Unit tests, property tests (proptest), and CLI contract tests.

cargo test --release
Expecttest result: ok. 44 passed; 0 failed
04natsort's own tests, unmodified

The headline proof: natsort's original test files, byte-identical to upstream (sha256-verified), run against the Rust binary via a thin adapter.

py -m pip install pytest hypothesis
$env:PYTHONPATH="adapter"
py -m pytest -q
pip install pytest hypothesis
PYTHONPATH=adapter python3 -m pytest -q
Expect33 passed, 30 deselected
Why deselectedEach of the 30 tests genuinely out-of-scope tests (OS locale, PRESORT chaining, Python nan/bytes semantics) is excluded by name with a documented reason in pytest.ini and the root conftest.py — never edited silently. Verify the test files themselves are untouched: sha256sum -c evidence/original_tests.sha256 from inside tests/original/.
05Differential fuzz

Random inputs across the full Unicode character set, compared against the live Python library.

py fuzz\harness.py 3000
python3 fuzz/harness.py 3000
ExpectTOTAL DIVERGENCES: 0 (21,000 comparisons, 7 algorithms)

For the continuous 60-second Fuzz Survivor run (published log at evidence/fuzz_60s_log.txt):

py fuzz\harness_60s.py 60
python3 fuzz/harness_60s.py 60
ExpectRESULT: 60.0s continuous run ... TOTAL DIVERGENCES: 0
06CLI differential + mutation testing

Every CLI invocation compared to Python's CLI; deliberate bugs injected to confirm the test suite actually catches regressions.

py cli_difftest.py 200
py mutation_test.py
python3 cli_difftest.py 200
python3 mutation_test.py
Expect2,800 invocations, 0 divergences and MUTATION SCORE: 5/5
07Lint and coverage

Requires rustup (for clippy) and cargo-llvm-cov.

cargo clippy --release --all-targets -- -D warnings
cargo install cargo-llvm-cov
cargo llvm-cov --release --summary-only
ExpectZero clippy warnings; ~91% region/line coverage on src/lib.rs
08Benchmark

Honest numbers: mean, p50, p95, p99 latency and peak RSS — not just hot-loop throughput.

py bench\run.py 50000 15
python3 bench/run.py 50000 15
Expect~6.8x mean speedup, ~7.3x p99 speedup (exact numbers vary by machine — see evidence/bench_results.txt for the reference run)
09Build and run the live WASM demo

Compiles the same Rust core to WebAssembly so it sorts live in the browser, then serves it over local HTTP.

One-time setup:

rustup target add wasm32-unknown-unknown
cargo install wasm-pack
Windows note./build-wasm.sh invokes bash, which on Windows tries to route through WSL — if no WSL distro is installed you'll see "Windows Subsystem for Linux has no installed distributions." and the build silently won't run. Skip the script and run the underlying command directly instead (works identically on every platform):
wasm-pack build --target web --out-dir web/pkg --out-name natsort_core -- --features wasm
ExpectTakes 1–4 minutes. Ends with: [INFO]: :-) Your wasm pkg is ready to publish at .../web/pkg

Then serve — WASM does not load over a bare file:// URL, it needs an actual HTTP server:

cd web
py -m http.server 8000
cd web
python3 -m http.server 8000
ExpectOpen http://localhost:8000 in a browser (not double-clicking index.html) — the amber "module not found" warning disappears and Sort/Shuffle become live.
If it still shows the warningHard-refresh the page (Ctrl+Shift+R) — browsers sometimes cache the earlier 404 response for pkg/natsort_core.js from before the build finished.
Environment constraints
Rust
Stable toolchain, edition 2021. Tested on 1.75–1.97.
Python
3.9+. Needs pytest and hypothesis (natsort's own conftest imports hypothesis).
Windows
Binary is natsort_port.exe; all Python helpers detect this automatically. Use py, not python3.
Coverage tool
Optional — cargo-llvm-cov needs the llvm-tools-preview rustup component (installed on first run, ~40MB).
WASM demo
Optional — needs wasm-pack + wasm32-unknown-unknown target. See Step 09 above (on Windows, skip build-wasm.sh — it needs WSL; run the wasm-pack build command directly instead).
Network
Only needed once, to fetch crates.io / PyPI packages. All differential tests run fully offline against the vendored natsort source in vendor/.