Module stats

Module stats 

Source
Expand description

2026-09-26: Shared measurement helpers: accept length, prompt synthesis, percentiles, median and formatting.

Owner: bench. Invariants:

  • percentile uses the nearest-rank rule of pct in bench/bench_concurrency.py, over the finite values only.
  • make_prompt with an empty tag uses that script’s word list and word count. Checked 2026-09-26 by running both: the texts are equal up to an ISL of 1104; above it the script emits fewer words than it asks for.

Structs§

Percentiles
2026-09-26: p50 / p90 / p99, each from percentile.

Enums§

PromptMode
2026-09-26: Should the prompt push the model to fill the output budget?

Functions§

accept_len
2026-09-26: Emitted tokens per decode step, completion / (completion - accepted): 1.0 when no draft token was accepted. decode_floor and concurrency both read this one rule.
fmt_ms
2026-09-26: Format an optional millisecond value for a table cell: seconds from 10 s up, and — for none, negative or non-finite.
make_prompt
2026-09-26: Build a prompt of roughly isl_tokens tokens. A non-empty prefix_tag opens the prompt as [tag] : a unique tag gives a prompt no earlier request shares, and a constant tag gives the same prompt every time.
median
2026-09-26: True median of the finite values: the middle element for odd n, the mean of the two middle elements for even n. Not percentile(values, 50), whose index for n=3 is 2, the maximum.
pct_delta
2026-09-26: Relative change new vs base, in percent. None when either is non-finite, base is not positive, or the result is not finite.
percentile
2026-09-26: p-th percentile (0–100) of values, nearest rank: idx = min(int(n*p/100 + 0.5), n-1) over the sorted finite values.