Design, verify, and benchmark an adaptive integer and IEEE (Institute of Electrical and Electronics Engineers, international technical standards organization) 754 floating-point sorting library in safe Rust inspired by structural symmetry, dual-sentinel hash lattices, and cache-resident radix cascades.
The primary evaluation metric is Composite Geometric Mean Latency (geomean_ms) across 9 canonical distributions at
- 100% Exactness: Every output slice must match
std::slice::sort_unstable(orf32::total_cmp/f64::total_cmp) element-for-element across unit tests, property boundary tests, and benchmark suites. - Systems Safety & Style: Zero
unsafeblocks, adherence to the Google Rust Style Guide, and zero warnings undercargo clippy --all-targets -- -D warnings. - Adversarial Resilience: Every candidate optimization must pass the 9-attack Red-Team falsification suite without worst-case degradation.
Supported surface, re-exported from src/lib.rs:
lattice_sort_i32(&mut [i32]),lattice_sort_i64(&mut [i64]): Single-core adaptive sort for 32-bit and 64-bit signed integers.lattice_sort_generic_32<T: LatticeKey32>,lattice_sort_generic_64<T: LatticeKey64>: Same pipelines for caller-defined bijective key types.parallel_lattice_sort,parallel_lattice_sort_32,parallel_lattice_sort_64: Multi-core scoped parallel MSB (Most Significant Byte, highest-order byte of an integer word) + L2 (Level 2 Cache, processor secondary data cache) hybrid radix sort.LatticeSortExt: Extension trait providing.lattice_sort()and.par_lattice_sort()on[i32],[u32],[i64],[u64],[f32], and[f64].SentinelBag: Bounded exact multiset with a self-proving emptiness test.PeriodicRun/PeriodicRunEncoder: Codec for exactly periodic streams.
The internal sorting modules kernel_i32, kernel_i64, and parallel are crate-private; harness stays public under #[doc(hidden)] for standalone benchmarks and may change between minor versions. rust-version is 1.88.
-
src/lib.rs: Crate root, module exports, and public documentation. -
src/kernel_i32.rs: Core 32-bit adaptive pipeline (lattice_sort_i32), including prefix peeling, peak/valley soliton wave merging, 1024-slot dual-sentinel hash aggregation, dense range count sort, fused 4-pass LSD (Least Significant Digit, lowest-order byte pass) radix sort, and 2-level MSB+L2 hybrid cascade. -
src/kernel_i64.rs: 64-bit adaptive 8-pass radix kernel (lattice_sort_i64) with constant-byte pass skipping. -
src/slice_ext.rs: Polymorphic traitLatticeSortExtwith branchless sign-bit and IEEE 754 bijections. -
src/parallel.rs: Multi-core parallel sorting engine (parallel_lattice_sort) built onstd::thread::scope. -
src/harness.rs: Deterministic 9-distribution benchmark evaluator (N = 1,000,000). -
tests/correctness.rs: Automated integration and boundary test suite executed bycargo test. -
benches/:-
benches/latticesort.rs(cargo bench --bench latticesort): Primary 1M-element 9-distribution benchmark. -
benches/adversarial.rs(cargo bench --bench adversarial): Red-Team 9-attack adversarial benchmark at$N = 1,000,000$ . -
benches/bench_10m.rs(cargo bench --bench bench_10m): 10M-element main and adversarial benchmark suite. -
benches/bench_fronts_3_4.rs(cargo bench --bench bench_fronts_3_4): Polymorphic types (u32,i64,u64,f32,f64) and multi-core benchmark. -
benches/bench_literature.rs(cargo bench --bench bench_literature): Head-to-head comparison against 6 sorting algorithms from Computer Science literature. -
benches/bench_1b.rs(cargo bench --bench bench_1b): 1-Billion-element (4.00 GB) single-core and multi-core benchmark.
-
-
results.tsv&RESEARCH_LOG.md: Complete chronological record of experimentsexp00throughexp19.