Early-exit validation: stop once enough valid proxies found

- validate_proxies: target= param — once N valid found, remaining
  tasks skip the HTTP call and drain immediately (no wasted time)
- _build_pool: target = max(min_pool_size, chain_length * 3)
- Settings: min_pool_size (default 20), max_candidates default 400->200
- UI: Stop after N valid / Max candidates fields in Settings tab
- README: updated settings table
- 1 new test for early-exit with unreachable target

Made-with: Cursor
This commit is contained in:
Dr Jones
2026-04-16 02:31:40 -07:00
parent 8ffde94d48
commit 9439037cac
6 changed files with 66 additions and 9 deletions

View File

@@ -126,7 +126,8 @@ class Settings:
# ── validation ────────────────────────────────────────────────────────
validation_concurrency: int = 64
max_candidates: int = 400
max_candidates: int = 200 # cap before validation (shuffled, so random sample)
min_pool_size: int = 20 # stop validating once this many good proxies found
validation_timeout_seconds: float = 12.0
prefer_elite: bool = False
@@ -204,7 +205,21 @@ def sanitize_settings(s: Settings) -> tuple[Settings, bool]:
s.max_candidates = 10
changed = True
except (TypeError, ValueError):
s.max_candidates = 400
s.max_candidates = 200
changed = True
try:
mps = int(s.min_pool_size)
if mps < 3:
s.min_pool_size = 3
changed = True
elif mps > 500:
s.min_pool_size = 500
changed = True
except (TypeError, ValueError):
s.min_pool_size = 20
changed = True
if not hasattr(s, "min_pool_size"):
s.min_pool_size = 20
changed = True
try:
vt = float(s.validation_timeout_seconds)