FA-73783 / Rate limiter algorithms / Member archive
EWMA arrival-rate throttle: late arrival rewinds the clock · case 03
After a late arrival the next interval is measured from the past and appears artificially long or short.
Case contract
Input {tau_ms, limit_rps, requests [t_ms]}. The rate estimate r starts at 0. For each arrival strictly after the latest seen time, dt = t - last, a = exp(-dt/tau) and r = a*r + (1-a)*(1000/dt) requests per second. Simultaneous or late arrivals leave r unchanged and never move the clock backwards. Every arrival reports deny if r > limit else allow, with r rounded to 3 decimals.
Why this case matters
Irregular-interval EWMA estimators throttle clients by smoothed request rate; time-unit and duplicate-timestamp handling decide whether bursts are detected.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| late arrival ignored for clock | [["allow", 0.0], ["allow", 0.787], ["allow", 0.787], ["allow", 1.354], ["allow", 2.015]] | [["allow", 0.0], ["allow", 0.787], ["allow", 0.787], ["allow", 1.551], ["allow", 2.176]] | 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 ↗