FA-73499 / Rate limiter algorithms / Member archive
Leaky bucket meter: admission ignores the request cost · case 04
A large request is admitted into an almost full bucket and overflows it.
Case contract
Input {capacity, leak_per_s, requests [[t_ms, cost]]} with nondecreasing t. The water level drains continuously at leak_per_s units per second (exact rationals) but never below zero; the drain clock advances at every request. A request is admitted iff level + cost <= capacity, raising the level by cost; a denied request leaves the level unchanged. Return [decisions, final level as a fraction string].
Why this case matters
Leaky-bucket meters police sustained rates for network and API traffic; drain and admission rules decide how much burst is tolerated after idleness.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fill and drain | [["allow", "allow", "allow", "deny", "allow"], "624/125"] | [["allow", "allow", "deny", "allow", "allow"], "499/125"] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗