Repository navigation
fix(tier3): honor --n-concurrent with --stop-on-pass - #275
Conversation
With --stop-on-pass (or harbor.stop_on_pass: true), the runner never passed n_concurrent to the stop-on-pass path, which then looped over every case and attempt one at a time. --n-concurrent, documented as concurrent eval cases per agent and shown in the run plan, silently had no effect, so large evaluations took several times longer than the configured concurrency allowed. Run up to n_concurrent cases at once per arm on a bounded worker pool. Each case still launches one single-trial Harbor job per attempt, and its next attempt starts only after the previous one scored, stopping at the first pass. The with-skill and without-skill arms still run one after the other, each with the full per-agent budget. Attempt jobs and errors are collected in dataset order, so the merged arm job stays deterministic. An unexpected exception in one case stops later launches and propagates without merging a partial aggregate, as the serial loop did. Document the stop-on-pass concurrency semantics in the Tier 3 guide. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
rng1995
left a comment
There was a problem hiding this comment.
Reviewed the diff in full context. No findings. Attempts of a case stay sequential, the pool is bounded by min(n_concurrent, cases), merged attempt jobs keep dataset order, an unexpected error stops queued launches like the old serial loop, and the per-case error filtering for recovered timeouts is equivalent. The new concurrency tests (rendezvous barrier, ordering, error propagation) pass locally along with tests/test_tier3_public_runtime.py; ruff clean. Docs and CHANGELOG match the behavior.
Reviewed with Claude Code.
40cdd5d to
7cc741b
Compare
chrisknvidia
left a comment
There was a problem hiding this comment.
I read _run_stop_on_pass_variant and _run_agent_pair end to end and found nothing blocking. The pool is capped at min(n_concurrent, cases), each case's attempts stay sequential, and the stop flag is set before the exception propagates, so queued cases never launch (the n_concurrent=1 error test is deterministic for that reason). Concurrent _run_harbor calls are safe because each one copies run_env and gets its own working directory, and the per-case timeout-recovery filter is equivalent since a recovery only matches an earlier attempt of the same task. The docs example matches the default max_agents.
Resolve the CHANGELOG.md conflict: keep main's new Unreleased entry and put this PR's entry after it. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Resolve runner.py conflicts with the Ctrl+C cancellation from #291: keep both the PR's n_concurrent keyword and main's cancellation keyword on _run_stop_on_pass_variant and on its call in _run_agent_pair. The PR's per-case workers already pass cancellation to _run_harbor, so concurrent stop-on-pass cases stop on Ctrl+C like the sequential path did. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Resolve the CHANGELOG.md conflict: keep main's install-retry entry (#277) and add this PR's stop-on-pass entry after it. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
--stop-on-pass(orharbor.stop_on_pass: true) now runs up ton_concurrenteval cases at once per agent, instead of running every case and attempt one at a time.harbor run(n_attempts=1,n_concurrent=1,--include-task-name <case>).n_concurrentbudget, so per-agent concurrency matches the non-stop-on-pass path, which splits the same budget across the two arms running in parallel.<skill>-<agent>-<arm>job and the error list stay deterministic.docs/tier3-live-evaluation.mdxexplains how--n-concurrentapplies with--stop-on-pass, with a worked example. CHANGELOG entry under Unreleased / Fixed.Why
_run_agent_pairdid not passn_concurrentto the stop-on-pass path. That path looped over cases and attempts one at a time, so--n-concurrent(default 4) had no effect once--stop-on-passwas set. The CLI reference and the Tier 3 guide both describe--n-concurrentas "concurrent eval cases per agent", and the run plan shows the configured concurrency, so nothing told users their run was serialized. A dataset of N cases with up to K attempts could take up to N x K sequential trials per arm, rather than finishing in roughly N / n_concurrent rounds.No public issue tracks this.
Kept from public
_run_harborcontract is unchanged. Concurrent calls were already safe because each launch gets a private working directory. They now also happen within one arm._job_passed, which uses the collector's pass semantics, and_merge_attempt_jobs, with its hardened Harbor 0.24 merge and symlink and reparse checks.harbor_timeout_job_recoveredonly matches an earlier attempt of the same task (same task id and checksum).n_concurrentvalidation still rejects values below 1 before execution.case_concurrencysetting that admits C cases across all agents and arms). It is a larger feature: new CLI and config surface, collector and progress changes, and its own documentation of peak trial counts. It is better proposed on its own, if wanted._run_stop_on_pass_variantas open PR feat(plugin): Add Plugin evaluation support across all tiers #28, so whichever merges second will need a small rebase. The per-attempt loop body is unchanged apart from moving into a per-case helper.Tests
tests/test_harbor_stop_on_pass_concurrency.py:test_stop_on_pass_runs_cases_concurrently_with_serial_attempts[1|2|4]runs the real_run_agent_pair->_run_stop_on_pass_variant->_merge_attempt_jobspath with a filesystem-backed_run_harbordouble that writes Harbor 0.24JobResultandTrialResultfiles. A barrier proves thatn_concurrentcases overlap, and peak concurrency equalsn_concurrent. Attempts of one case never overlap, and attempt counts follow early stopping (a=1, b=2, c=1, d=3). All with-skill launches come before the baseline arm. Each merged arm result has all 7 trials in dataset order, even though later cases finish first. It fails on current main: the barrier times out because cases run serially.test_stop_on_pass_failed_attempts_retry_only_their_case_in_dataset_order: a failed launch retries only its own case, and errors come back in dataset order.test_stop_on_pass_unexpected_case_error_stops_queued_cases: an unexpected exception propagates, no later case launches, and no partial aggregate is merged.tests/test_tier3_public_runtime.py::test_native_harbor_metadata_entry_id_seam_across_runner_collector_and_dataset_snapshotruns with the defaultn_concurrent=4. The test now checks launches per arm as a multiset, because the order of cases within an arm is no longer fixed. The arm ordering and attempt counts it checks are unchanged.test_harbor_timeout_recovery.pyandtest_harbor_timeout_recovery_docker.py(which call_run_stop_on_pass_variantdirectly),test_tier3_public_runtimeandtest_harbor_collector_runtime_failuresall pass: 491 passed.test_harbor_runner_status,test_harbor_runtime_preflight,test_harbor_runner_environment,test_harbor_runner_artifacts,test_harbor_local_mode,test_harbor_local_upload,test_harbor_runtime_skill_isolation,test_tier3_progress,test_tier3_case_summary,test_tier3_compare,test_tier3_config_key_parity,test_harbor_task_toml_retry_env,test_judge_lift_integrity,test_commands,tests/golden,tests/evaluation/test_tier3_benchmark_contract.py,tests/tier3/test_workflow.py,tests/tier3/test_judge_failure_artifacts.py,tests/tier3/test_judge_result_semantics.pyandtests/reporting/test_tier3_scoped_reports.py, plus the docs, CI and CHANGELOG tests. All 14 failures also fail on an unmodified copy of main on this machine:test_judge_failure_artifacts.py(test_generated_custom_only_script_*) run the generated grader with the hostpython3, which is 3.9 here, and that grader usesint | float.test_bounded_harbor_process_timeout_preserves_redacted_diagnostic_tailgives the child process 0.1 s to write to stderr, which is too short on a loaded machine.test_harbor_runtime_preflight,test_harbor_local_modeandtest_harbor_runner_statusfailed while other test runs loaded the machine. All 22 pass when rerun serially.ruff check,ruff format --checkonrunner.pyand the changed test files, andscripts/check_oss_boundary.pyall pass.🤖 Generated with Claude Code