Skip to content

feat(colab_fleet): persistent VM session reuse, polite spawn pacing & exponential 503 backoff - #38

Merged
saariuslystoned merged 1 commit into
mainfrom
feat/colab-fleet-vm-reuse-and-pacing
Nov 27, 2026
Merged

saariuslystoned merged 1 commit into
mainfrom
feat/colab-fleet-vm-reuse-and-pacing

Conversation

@saariuslystoned

Copy link
Copy Markdown
Collaborator

Summary

Follow-up hardening for tools/colab_fleet.py based on live multi-wave Colab fleet runs:

  1. Persistent VM Session Reuse (--reuse-sessions, default ON; --max-jobs-per-session 16):
    • Parks healthy sessions after rc=0 when compatible pending jobs remain and reuses them directly (session_reused), cutting VM spawns ~10× and eliminating cold starts.
    • Immediately drains & stops any idle session once no compatible pending jobs remain, guaranteeing zero_fleet_leaked=true.
    • Live proof on 4× 100K CPU shards (euw4b0): sessions_created=1, sessions_reused=3, 4.48s–7.14s/shard, 0 leaked sessions.
  2. Polite Spawn Pacing & Exponential 503/429 Backoff:
    • Enforces --spawn-spacing-s 18.0 between distinct colab new calls to avoid Colab rapid-spawn burst throttles.
    • Exponential backoff with ±15% jitter (30s -> 60s -> 120s -> 240s -> cap 300s) via compute_backoff_s() plus optional --wait-on-cooldown.
  3. R2 Endpoint Subdomain Redaction:
    • Masks https://<hex>.r2.cloudflarestorage.com in S3CompatibleSyncBackend.describe() so account IDs are never written to STATE.md/PROOF.md.

Verification

  • python3 tools/colab_fleet.py --self-test — PASS
  • python3 tools/test_colab_fleet.py -v — 9/9 PASS (including persistent VM reuse, spawn spacing, exponential backoff + jitter, and R2 endpoint masking)
  • Live Colab verification: 4× 100K shards completed on 1 reused CPU_HM session (sessions_created=1, sessions_reused=3, zero_fleet_leaked=true).

… exp backoff

Reuses live compatible sessions across sequential jobs/shards (--reuse-sessions, default on, --max-jobs-per-session 16) to cut VM creations ~10x and eliminate cold-start overhead, while immediately draining idle sessions with no compatible pending work.

Adds polite spawn pacing (--spawn-spacing-s 18) between distinct VM creations, per-SKU exponential backoff with jitter (30s -> 60s -> 120s -> cap 300s) on 503/429/ReadTimeout plus optional --wait-on-cooldown, and redacts R2 account subdomains in S3 backend describe().

Signed-off-by: Bobby Bones <saariuscrypto@gmail.com>
@saariuslystoned
saariuslystoned merged commit 1048b5d into main Nov 27, 2026
2 checks passed
@saariuslystoned
saariuslystoned deleted the feat/colab-fleet-vm-reuse-and-pacing branch November 27, 2026 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant