feat: default two structured re-asks and sharper AIMD cut

Round 5 left three residual failure classes; ladder exhaustion (3.2%
of structured calls with a single re-ask) and 429 leakage (5.8%, AIMD
oscillating above the sustainable point) are addressable: re-ask
default goes 1 to 2 (conservative vs instructor's 3) and the AIMD cut
factor drops to 0.5.
This commit is contained in:
2026-07-21 12:52:32 -04:00
parent dcd386d4aa
commit 6b98a89bb3
7 changed files with 18 additions and 6 deletions
+2 -2
View File
@@ -482,8 +482,8 @@ class TestAdaptivePacing:
pacer=pacer,
)
await mw(_REQ)
# 429 削减一次(8→5.6),随后成功加性增长(5.6 + 1/5.6)
assert pacer.limit("a") == pytest.approx(8.0 * 0.7 + 1.0 / (8.0 * 0.7))
# 429 削减一次(8→4),随后成功加性增长(4 + 1/4)
assert pacer.limit("a") == pytest.approx(8.0 * 0.5 + 1.0 / (8.0 * 0.5))
async def test_inflight_returns_to_zero_after_call(self):
from polygateway.sources import AdaptivePacer