Skip to content

test(batch): bound two-worker compute by observed lease grants, print counts - #22920

Merged
Git-on-my-level merged 3 commits into
mainfrom
lane/gauntlet-dc
Oct 20, 2026
Merged

Git-on-my-level merged 3 commits into
mainfrom
lane/gauntlet-dc

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Summary

batch-two-workers in the Sync Cloud Tasks Stack Gauntlet still fails now and then with "a segment was computed more often than it was leased across replicas", even after #22866. PR #22902 hit it twice at 3508c7ca, and that diff can't reach batch compute. The check compared compute evidence with the job's attempt field. That field is a retry budget, not a count of lease grants: a refund before compute lowers it. The check also printed no counts, so the CI failures couldn't be diagnosed.

Changes (test harness only):

  • Lease evidence. testing/sync_cloud_tasks_stack/batch_worker.py wraps Scheduler.pull and Scheduler.defer in the stack worker. They emit lease_granted and lease_refunded evidence with the segment id, attempt and worker name. No production code changes.
  • New bound. batch.py checks computes <= grants and results <= grants for each segment.
  • Counts on failure. The failure message now includes grants, refunds, attempt, computes, results, state and failure.
  • Drift is visible, not fatal. A mismatch between attempt and grants - refunds prints and is counted as attempt_drift in batch_two_workers_verified.
  • Unchanged assertions. These still apply: one paid recovery call, one committed result log entry per segment, an intact predecessor chain, and capture order.

Why this doesn't hide a paid-twice bug

  • The counter isn't paid STT. It counts Parakeet transcribe_batch calls, which run on our own GPUs in prod. Paid STT is quarantine recovery only, and paid_calls == 1 is still asserted.
  • Only one path lowers attempt. pull is the only lease grant. defer is the only call that lowers attempt, and in this lane it runs only before compute. The HeldWork path is fenced off because _BATCH_LANE_READY = False. The FatalGpuError path is CUDA-only.
  • Publication stays fenced. It is checked by owns_lease plus compute_admission_token.
  • Local stress agrees. About 25 local two-worker runs, including some with a 3s/1s lease/heartbeat, never had computes exceed attempt.

Investigation notes: data/run-2026-10-13-two-lane-nemotron/gauntlet-double-compute-2026-10-20.md in the omi-workspace repo.

Test plan

  • backend/testing/sync_cloud_tasks_stack/run.sh --only batch passed locally (attempt_drift=0, paid_calls=1, 5 segments, 2 replicas).
  • CI: Sync Cloud Tasks Stack Gauntlet.

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

… counts

batch-two-workers still failed occasionally ("a segment was computed more
often than it was leased") after #22866, e.g. PR #22902 at 3508c7c, whose
diff cannot reach batch compute. The check compared compute evidence with
the job's attempt field, which is a retry budget (a pre-compute refund
lowers it) rather than a grant count, and printed no counts, so CI failures
were undiagnosable.

The stack worker now records lease_granted / lease_refunded evidence by
wrapping Scheduler.pull/defer (test harness only). The scenario asserts
computes <= grants and results <= grants per segment, includes grants,
refunds, attempt, computes, results, state and failure in the failure
message, and reports attempt drift (attempt != grants - refunds) as a
visible, non-fatal attempt_drift count. The paid-once and committed-once
assertions are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T20:02:04.250795Z cd10a8d New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Git-on-my-level and others added 2 commits October 21, 2026 02:49
test_all_three_cohorts_share_batch_bucket_and_summary_survives_admission_rollback
is its file's first test (module import amortized into the call) and sweeps
4000 cohort decisions; it measured 1.03-1.06s CPU on CI shard 2 in three runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Git-on-my-level
Git-on-my-level merged commit f4c39a3 into main Oct 20, 2026
56 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/gauntlet-dc branch October 20, 2026 20:55
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