ReNunney/docs/TRACK2_RUST.md

73 lines
2.0 KiB
Markdown

# Track 2 Rust Plan
Updated: 2026-04-11
## Purpose
This note defines the initial Rust entry point for Track 2 in `renunney`.
Track 2 is not a line-by-line translation of Nunney's published threshold
heuristic. It is the modern path: explicit threshold definitions, clearer
simulation contracts, and a performant kernel.
## Why Rust
Rust is the preferred Track 2 kernel language because it directly addresses the
main engineering problems revealed by Track 1:
- heavy repeated stochastic simulation,
- threshold sweeps over many independent jobs,
- need for clear data structures and reproducible binaries,
- and a likely future need for Python bindings or service backends.
## Initial Scope
The first Rust step is intentionally narrow:
- create a Rust workspace,
- define a Track 2 core crate,
- and encode threshold-centered abstractions rather than immediately porting
the entire biological simulator.
This is the correct order because Track 2 should start from a clean statement
of what is being estimated.
## Current Crate
The initial crate is:
- `rust/track2-core`
Current contents:
- `ExtinctionCount`
- `ThresholdPoint`
- `ThresholdBracket`
- `ThresholdEstimate`
- `bracket_threshold(...)`
- `midpoint_threshold(...)`
These are placeholders for a modern threshold-estimation path where:
- extinction probability is explicit,
- bracketing is explicit,
- and the estimator is separate from the simulation kernel.
## Next Rust Steps
1. Add a simulation-state model for Track 2.
2. Add a trait or function contract for producing extinction probabilities from
repeated stochastic runs.
3. Add a threshold search strategy that consumes those estimates.
4. Add serialization-friendly input/output structs for orchestration.
5. Only then start porting heavy simulation loops from Python.
## Operational Targets
The repo Makefile should treat Rust as a first-class build/test surface:
- `make rust-test`
- `make rust-check`
That keeps Track 2 visible in daily workflow from the start.