Repository navigation
test(batch): bound two-worker compute by observed lease grants, print counts - #22920
Merged
Merged
Conversation
… 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]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
batch-two-workersin 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 at3508c7ca, and that diff can't reach batch compute. The check compared compute evidence with the job'sattemptfield. 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):
testing/sync_cloud_tasks_stack/batch_worker.pywrapsScheduler.pullandScheduler.deferin the stack worker. They emitlease_grantedandlease_refundedevidence with the segment id, attempt and worker name. No production code changes.batch.pycheckscomputes <= grantsandresults <= grantsfor each segment.attemptandgrants - refundsprints and is counted asattempt_driftinbatch_two_workers_verified.Why this doesn't hide a paid-twice bug
transcribe_batchcalls, which run on our own GPUs in prod. Paid STT is quarantine recovery only, andpaid_calls == 1is still asserted.attempt.pullis the only lease grant.deferis the only call that lowersattempt, and in this lane it runs only before compute. TheHeldWorkpath is fenced off because_BATCH_LANE_READY = False. TheFatalGpuErrorpath is CUDA-only.owns_leasepluscompute_admission_token.attempt.Investigation notes:
data/run-2026-10-13-two-lane-nemotron/gauntlet-double-compute-2026-10-20.mdin the omi-workspace repo.Test plan
backend/testing/sync_cloud_tasks_stack/run.sh --only batchpassed locally (attempt_drift=0,paid_calls=1, 5 segments, 2 replicas).🤖 Generated with Claude Code