A modular, no_std-first Rust foundation for low-latency financial systems
across centralized and decentralized markets, with first-class replay, verification, and performance tooling.
┌─────────────────────────────┐
│ Application │
└──────────┬──────────────────┘
│
┌────────────────────┼────────────────────┐
│ │ │
┌────────▼───────┐ ┌────────▼────────┐ ┌────────▼────────┐
│ mantis-queue │ │ (future crates) │ │ mantis-layout │
│ SPSC ring buf │ │ order book, AMM │ │ struct layout │
│ lock-free I/O │ │ event model ... │ │ cache inspector │
└───────┬─────────┘ └────────┬────────┘ └─────────────────┘
│ │
┌───────▼─────────────────────▼────────┐
│ mantis-core │
│ IndexStrategy · PushPolicy │
│ Instrumentation · CountingInstr │
└───────────────┬──────────────────────┘
│
┌───────▼─────────┐
│ mantis-types │
│ SeqNum · Slot │
│ PushError etc │
└─────────────────┘
── Tooling (std-only, not depended on by core crates) ──
┌─────────────────┐ ┌─────────────────┐
│ mantis-bench │ │ mantis-verify │
│ criterion + │ │ kani proofs │
│ cycle counters │ │ bolero props │
│ JSON reports │ │ diff testing │
└─────────────────┘ └─────────────────┘
| Crate | Purpose | no_std |
|---|---|---|
mantis-core |
Strategy traits (IndexStrategy, PushPolicy, Instrumentation) |
yes |
mantis-types |
Newtypes and error types (SeqNum, PushError, QueueError) |
yes |
mantis-queue |
Lock-free SPSC ring buffer with modular strategies | yes |
mantis-platform |
Platform abstractions: CT types, cycle counters, ISA primitives | yes |
mantis-bench |
Criterion benchmarks + platform cycle counters + JSON reports | no |
mantis-layout |
Struct layout and cache-line inspector | no |
mantis-verify |
Kani proofs, Bolero property tests, differential testing | no |
cargo build --all-features
cargo test --all-features
cargo clippy --all-targets --all-features -- -D warnings
cargo bench
cargo run -p mantis-layoutRun the full suite including external contenders:
cargo bench --features bench-contendersReports are written to target/bench-report-mantis.json and target/bench-report-contenders.json.
| Workload | Mantis | rtrb | crossbeam |
|---|---|---|---|
| single push+pop (u64) | 2.14 ns | 2.48 ns | 3.93 ns |
| burst 100 (u64) | 422 ns | 332 ns | 546 ns |
- Correctness — Kani proofs, Miri, differential tests
- Safety — all unsafe isolated in
rawmodules with// SAFETY:comments - Performance — benchmarked, layout-inspected, ASM-verified
no_stdfirst — no heap in hot paths,allocoptional
See CLAUDE.md for the full development guide and docs/PROGRESS.md for current status.
Apache-2.0
