esn and lsm do not compile — rand version conflict + drifted API
Discovered while standing up the proof scaffold (#84). cargo check -p esn -p lsm fails:
2 × error[E0277] (trait bounds, rand RNG traits)
7 × error[E0599] (no method `random` / `random_bool`; trait `RngExt` not in scope)
Root cause
Cargo.lock resolves two major versions of rand simultaneously:
rand 0.9.4 (pulled transitively, e.g. via ndarray-rand = "0.16")
rand 0.10.1 (from the direct workspace dep rand = "0.10")
The source in crates/esn and crates/lsm uses an older rand API (e.g. rng.random::<f32>(), random_bool, Normal::new(...).unwrap(), Bernoulli::new(...)) that doesn't line up with the resolved trait set, so RNG method resolution fails. ~9 call-sites across the two crates.
Impact
Fix options (needs a decision)
- Align on one
rand — pin rand, rand_distr, and ndarray-rand to a mutually-compatible set so only one rand major resolves, then update the ~9 call-sites to that version's API. (Preferred.)
- Drop
ndarray-rand and seed ndarray arrays from rand directly, removing the transitive older rand.
Also worth checking
Whether any CI job actually compiles/tests these crates — if not, that gap let this land. (PR #81's checks were governance/scan/lint, no cargo build/test visible.)
esnandlsmdo not compile —randversion conflict + drifted APIDiscovered while standing up the proof scaffold (#84).
cargo check -p esn -p lsmfails:Root cause
Cargo.lockresolves two major versions ofrandsimultaneously:rand 0.9.4(pulled transitively, e.g. viandarray-rand = "0.16")rand 0.10.1(from the direct workspace deprand = "0.10")The source in
crates/esnandcrates/lsmuses an olderrandAPI (e.g.rng.random::<f32>(),random_bool,Normal::new(...).unwrap(),Bernoulli::new(...)) that doesn't line up with the resolved trait set, so RNG method resolution fails. ~9 call-sites across the two crates.Impact
deny(unsafe_code)change (the same E0277/E0599 errors reproduce with that change stashed).Fix options (needs a decision)
rand— pinrand,rand_distr, andndarray-randto a mutually-compatible set so only onerandmajor resolves, then update the ~9 call-sites to that version's API. (Preferred.)ndarray-randand seedndarrayarrays fromranddirectly, removing the transitive olderrand.Also worth checking
Whether any CI job actually compiles/tests these crates — if not, that gap let this land. (PR #81's checks were governance/scan/lint, no
cargo build/testvisible.)