FA-73372 / Rate limiter algorithms / Member archive
Generic cell rate algorithm limiter: idle time banks unlimited credit · case 02
After a quiet period the limiter admits an unbounded burst because TAT lags far behind now.
Case contract
Input {period_ms T, burst B, requests [[t, quantity]]}. State TAT starts at 0. A quantity above B is ["never", 0, 0]. Otherwise tat = max(TAT, t) and new_tat = tat + q*T; the request is allowed iff new_tat - t <= B*T, in which case TAT = new_tat and remaining = floor((B*T - (TAT - t))/T). A denied request leaves TAT unchanged and reports retry_after = new_tat - B*T - t and remaining floor((B*T - (tat - t))/T). Return [[decision, retry_after, remaining]].
Why this case matters
GCRA limiters store a single theoretical-arrival timestamp per key; every decision and header value is derived from it, so small formula errors leak bursts or starve clients.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| idle credit bounded | [["allow", 0, 2], ["allow", 0, 201], ["allow", 0, 200], ["allow", 0, 199], ["allow", 0, 198], ["allow", 0, 197]] | [["allow", 0, 2], ["allow", 0, 2], ["allow", 0, 1], ["allow", 0, 0], ["deny", 50, 0], ["deny", 30, 0]] | 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 ↗