Repository navigation
fix(pinchbench): retry sandbox and harness failures - #4850
AdamRajfer wants to merge 2 commits into
Conversation
A sandbox that failed to start, an Apptainer exec that failed or wrote no result archive, and a host-side `FileNotFoundError` were classified `legitimate` and made final. In evaluation they are `provider_unavailable`, retried. The host side of a run reads only harness files; the task's grader runs inside the sandbox, so a deliverable the model did not write is graded there and never surfaces as these errors. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
|
/ok to test 18c5f11 |
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
HOLD — one RISK: managed Apptainer execution failures still bypass the new evaluation retry classification.
The direct-exec changes preserve RuntimeError compatibility and existing signal/timeout handling. However, the shipped managed-sandbox configuration retains a path that makes provider failures final rather than retryable.
Reviewed all three changed files and traced sandbox producers, response routing, and collector retry decisions. Validation was static only; unit tests and model smoke rollouts were not executed.
Note: formal approval is not available for this request, so this review is posted as a comment only.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
| if isinstance(exc, TimeoutError): | ||
| return "timeout_exceeded" | ||
| if is_eval_mode() and isinstance( | ||
| exc, (SandboxCreateError, SandboxNoOutputError, SandboxExecError, FileNotFoundError) |
There was a problem hiding this comment.
RISK — the managed Apptainer path still makes infrastructure exec failures final.
Failure: With evaluation enabled and the shipped managed configuration, an instance disappearing after readiness makes ApptainerProvider.exec return SandboxExecResult(return_code=125, error_type="sandbox", ...). But _run_in_sandbox converts that into a plain RuntimeError, which misses this new tuple and remains legitimate. The resulting row is terminal to the collector, so affected evaluations permanently count a provider failure as zero instead of retrying it. The direct-exec path is fixed, but the default managed path is not.
Correction: In _run_in_sandbox, replace the non-timeout exec_result.error_type branch's raise at line 312 with:
raise SandboxExecError(
f"PinchBench sandbox execution failed ({exec_result.error_type}): {detail}"
)This restores the invariant that an explicitly reported sandbox-runtime exec failure reaches the evaluation-only provider retry route. The existing timeout branch must remain first; ordinary nonzero process exits with error_type=None must still download and grade their archive. This suggested change is source-traced, not executed; verify it before adoption.
Preservation and acceptance — proposed checks, not run:
- Extend test_managed_sandbox_exec_errors_skip_download so its
error_type="sandbox"case requiresSandboxExecError, still skips download, and calls stop. Run that fake sandbox throughagent.run: evaluation must return_ng_failure_class="provider_unavailable"withis_terminal_failure(row) == False; training must retainlegitimateand a terminal row. - Keep its
error_type="timeout"case raisingTimeoutError;runmust retaintimeout_exceededand the terminal marker in both modes. Keep generic taskRuntimeErrorclassifiedlegitimate. - For
return_code=1, error_type=None, supply a downloadable archive containing a valid task result with mean0.0: retainstatus="success", reward0.0, and no failure-routing key. A legitimate failed task must not gain a retry. - Retain direct-exec no-archive classification and the existing signal cases
-15,137, and143asSandboxKilledError/kill_shaped; the proposed producer-only change leaves those branches untouched.
There was a problem hiding this comment.
Fixed in f9c40a7: the managed path now raises SandboxExecError for a sandbox-level exec error, as the direct path does, so evaluation routes it to provider_unavailable and retries it; training keeps legitimate. test_managed_sandbox_exec_errors_skip_download[sandbox] now expects SandboxExecError and fails on the previous code.
…th too The managed sandbox path turned an exec that the provider reports as a sandbox failure (an error_type other than timeout) into a plain RuntimeError, which is classified legitimate and final. The direct apptainer path already raises SandboxExecError for the same event, so evaluation routes it to provider_unavailable and retries it. Both paths now agree; training still keeps legitimate. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
Part 8 of 9, merge in order. Stacked on #4849; the diff shows only this part's changes.
What and why. A sandbox that failed to start, an Apptainer exec that failed or wrote no result archive, and a host-side
FileNotFoundErrorwere classifiedlegitimateand made final. In evaluation they areprovider_unavailable, retried. So is a sandbox-level exec error on the managed sandbox path, which now raisesSandboxExecErroras the direct Apptainer path does. The host side of a run reads only harness files; the task's grader runs inside the sandbox, so a deliverable the model did not write is graded there and never surfaces as these errors.Methodology. An infrastructure failure is retried, not scored.
Eval scores. PinchBench runs with sandbox failures move up once retries succeed.
Training and RL: no change. The classification is behind
is_eval_mode(); outside it these staylegitimate.SandboxNoOutputErrorandSandboxExecErrorareRuntimeErrorsubclasses with the same messages. Checked bytest_classify_task_failurein both modes.Unit tests.
responses_api_agents/pinchbench/tests/test_app.py.🤖 Generated with Claude Code