alice-analytics 0.5.0

High-performance telemetry & probabilistic statistical estimation — HyperLogLog++, DDSketch, Count-Min Sketch, local differential privacy, streaming anomaly detection
Documentation
# Determinism gate: the platform `libm` is not bit-exact across OS / CPU /
# compiler, so every float transcendental must go through `alice-det-math`,
# whose kernels are built from IEEE 754 basic operations only. CI runs clippy
# with `--all-targets ... -D warnings`, which turns `disallowed_methods` into a
# red gate for the library, the tests, the examples and the benches alike.
#
# `powi` is listed because it lowers to a multiplication tree whose
# association order is unspecified; use `crate::math::ipow64`, which fixes it.
#
# Deliberately absent: `sqrt` and `mul_add`. IEEE 754 requires both to be
# correctly rounded (`mul_add` is a fused multiply-add with a single rounding,
# and a target without an FMA instruction gets the correctly rounded software
# `fma`), so both are bit-identical on every target.
#
# Pinned by tests/determinism_golden.rs (SHA-256 of bit patterns, run on the
# four-OS CI matrix).
disallowed-methods = [
    { path = "f32::sin", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f32::cos", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f32::tan", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f32::asin", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f32::acos", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f32::atan", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f32::atan2", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f32::sinh", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f32::cosh", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f32::tanh", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f32::asinh", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f32::acosh", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f32::atanh", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f32::exp", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f32::exp2", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f32::exp_m1", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f32::ln", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f32::ln_1p", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f32::log", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f32::log2", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f32::log10", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f32::powf", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f32::cbrt", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f32::hypot", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f32::powi", reason = "lowers to a multiplication tree of unspecified association order; use crate::math::ipow64" },
    { path = "f64::sin", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f64::cos", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f64::tan", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f64::asin", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f64::acos", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f64::atan", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f64::atan2", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f64::sinh", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f64::cosh", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f64::tanh", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f64::asinh", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f64::acosh", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f64::atanh", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f64::exp", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f64::exp2", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f64::exp_m1", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f64::ln", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f64::ln_1p", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f64::log", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f64::log2", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f64::log10", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f64::powf", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f64::cbrt", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f64::hypot", reason = "platform libm is not cross-platform bit-exact; use alice_det_math" },
    { path = "f64::powi", reason = "lowers to a multiplication tree of unspecified association order; use crate::math::ipow64" },
]