Skip to main content

compute

Function compute 

Source
pub fn compute(
    pairs: &[(&Record, &Record)],
    pricing: &Pricing,
    seed: Option<u64>,
) -> AxisStat
Expand description

Compute the cost axis.

Silent zeros are a footgun: if no pricing table is supplied, or the table has no entries for the traced models, every pair prices at 0.0 and the naive implementation reports delta=0, severity=None — indistinguishable from “both sides are genuinely free.” To prevent that, we track how many pairs had both models present in the pricing table. When that count is zero (or below half of pairs.len()), we attach Flag::NoPricing so downstream renderers and reviewers see a caveat instead of a spurious clean bill of health.