FA-73575 / Rate limiter algorithms / Member archive
AIMD adaptive concurrency limit: losses during cooldown do not count it down · case 05
A sustained burst of losses keeps the limiter in cooldown and prevents any further decrease.
Case contract
Input {initial, min, max, cooldown, events}. The limit is kept in fixed-point thousandths (integer). "ok" adds floor(10^6 / limit_thousandths), i.e. 1/limit, capped at max, and counts down an active cooldown. "drop" or "timeout" halves the limit (floor), floored at min, and starts a cooldown of the given number of events when no cooldown is active; during a cooldown a loss only counts it down. After each event report floor(limit). Return [reported whole limits, final limit in thousandths].
Why this case matters
Adaptive concurrency limiters (AIMD, as in TCP congestion control) protect overloaded backends; step sizes, bounds and cooldowns decide whether the limit converges or oscillates.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| cooldown counts losses | [[8, 8, 8, 8, 8, 8, 8, 8, 8, 8], 8605] | [[8, 8, 8, 4, 4, 4, 4, 4, 4, 5], 5122] | 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 ↗