Skip to content

Line Fill Rate (βline)

ServiceLevelType::LineFillRate is a real metric distinct from unit fill rate (β): βline counts a shorted order LINE as a missed line regardless of how many of its units were served. "Fill as many order lines as possible" instead of "serve as many units as possible".

Why the Order Grain Is Required

The line structure ("number of hits") exists only in master.demand_orders (Layer 0). A weekly aggregate or forecast path carries no line information — this is the reason the demand layering exists.

Formula

MEIO_v3/src/distributions.rs::line_fill_rate_for_rop — V1 compound-Poisson line semantics on real hit statistics:

  • The buffer is judged in line-equivalents: x = (buffer + eoq_min)/μ against the Poisson CDF of the expected LINES over lead time (Λ = λ·lt_weeks), averaged over the same EOQ-step cycle positions as every other rop→fill-rate formula.
  • β (unit) and α (stockout) are byte-identical — their formulas, dispatch and search are untouched.

Hit Statistics

meio_runner._attach_line_hit_stats — per (item, site) from closed history (date < planning_monday AND NOT is_open):

  • line_hit_rate λ = order lines per week (span = first..last line date)
  • avg_units_per_line μ = average units per line

Attached ONLY when at least one scenario in the run selects line_fill_rate (β/α wire payloads stay byte-identical).

Search Granularity

The Poisson line-count CDF is FLAT between line boundaries — sub-line buffer steps yield zero marginal value and would kill the greedy below target. Under βline + hit stats, the candidate step jumps to the next line boundary (next multiple of μ above rop, rounded up to a lot multiple).

Worked example (Rust + Python e2e): λ = 2 lines/wk, μ = 5 units/line, LT = 1 wk, target 0.90 → rop = 20 (P(Poisson(2) ≤ 4) = 0.947). The test compares it with unit β on the same SKU, which sizes to 10 — but only because the test SKU has zero demand variability (a deterministic 10 units a week, so the buffer needed is just the mean). That 20-vs-10 gap is a test of the metric dispatch, not a typical ratio. With variable (Poisson) demand the gap is smaller: 5 units a week arriving as 2 lines of 2.5 units, 95% target → βline needs a reorder point of 13, β needs 9 — see the five-order example.

λ-Weighted Group Fill Rate

Under βline, the group fill-rate metric weights every counted SKU by its order-line rate λ (forecast / μ), not the unit demand rate — the group's achieved fill rate is the λ-weighted average of member line fill rates = the expected fraction of order lines filled. Unit weighting would chase high-unit-volume SKUs regardless of how few lines they represent. A counted SKU with λ=0 (WH/no-history node) contributes zero line weight and routes its unit rate into the WH-only-group indirect proxy bucket. β/α scenarios keep the flag off ⇒ byte-identical legacy weighting.

Degradation (WH / indirect-only nodes)

Warehouse nodes and new items have no order history — no line concept. They stay at λ=0 and are sized on unit β by the Rust degenerate guard. The degradation is loud (one WARNING per run with the SKU count) and per-SKU provenance lands in PIPE_meio_results.demand_signal (sizing_metric: 'line_fill_rate' with λ/μ, or 'unit_fill_rate' + reason: 'no_order_lines'), surfaced as an amber "β" badge in the results grid and the CSV "Basis / Metric" column.

Guards

  • Stale-extension guards: meio_optimizer_v3.line_fill_supported() AND line_fill_weight_supported() must exist before any βline batch dispatches — a stale .pyd would treat βline as β via serde defaults; the runner aborts with the rebuild hint instead.
  • βline requires the V3 optimizer (V1/V2 never had the formula).
  • βline × forecast basis is unrepresentable — see Forecast Demand Basis; forecast basis wins on load-time normalization.

Golden-Fixture Impact

β/α scenarios keep byte-identical wire payloads (hit stats never attached) and identical formulas — existing tenants' MEIO outputs are unchanged; only scenarios that explicitly select line_fill_rate size differently (strictly larger buffers on lumpy line sizes, by design).