FA-73484 / Rate limiter algorithms / Member archive
Leaky bucket meter: level drains below empty · case 04
A long idle period lets the bucket go negative and admit a burst larger than its capacity.
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 |
|---|---|---|---|
| idle does not bank credit | [["allow", "allow", "allow", "allow"], "-1688/125"] | [["allow", "allow", "deny", "deny"], "437/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 ↗