Repository navigation
v1.2.2
structguru v1.2.2
A dependency release. The native sampling filter now draws its per-record random number from fastrand instead of rand, which removes seven transitive crates from the wheel build — among them the yanked chacha20 release that blocked the first 1.2.1 publish. Sampling behavior, the public API, and the wheel matrix are unchanged. No breaking changes; upgrade in place from any v1.x.
Dependencies
-
The sampling filter uses
fastrandinstead ofrand. The filter needs one uniformf64in[0, 1)per record, drawn on the calling thread. It got that fromrand::random, which routes through rand's ChaCha-based thread RNG — a cryptographically secure generator, withchacha20,rand_core,getrandom,cpufeatures,cfg-if, andr-efibehind it, for a sampling decision that never needed unpredictability.fastrand::f64()gives the same half-open draw from a per-thread WyRand generator seeded from the clock and thread id, and the crate has no dependencies on any wheel target.# before: rand 0.10 (+ rand_core, chacha20, getrandom, cpufeatures, cfg-if, r-efi) # after: fastrand 2.5
Cargo.lockshrinks from 44 packages to 38, and the release audit no longer depends on the RustSec status of a cryptographic crate the filter never used. The sampling tests — rate zero drops everything, rate one keeps everything, rate one half stays within its statistical bound — pass unchanged against the new generator.sample_ratesemantics, the drop counters, and thesample_max_levelgate are untouched.
Context
- Why a point release for a dependency swap. The first 1.2.1 tag failed the release audit because
chacha20 0.10.1had been yanked after the lockfile was generated; the tag was moved to a commit with the updated lock before anything reached PyPI. Removing the crate entirely, rather than tracking its releases, closes that class of interruption for the sampling path. fastrand is maintained under the smol-rs organization, forbids unsafe code, is dual-licensed MIT/Apache-2.0, and is the generatortempfileitself relies on.