Skip to content

Mark unavailable sandbox scoring incomplete - #469

Closed
abhishekraok wants to merge 2 commits into
mainfrom
codex/lcb-scoring-failures
Closed

abhishekraok wants to merge 2 commits into
mainfrom
codex/lcb-scoring-failures

Conversation

@abhishekraok

@abhishekraok abhishekraok commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Codex · codex://threads/01a1326f-ed81-75e3-80e4-661392dbe4b5

When a LiveCodeBench response loses its sandbox, its samples now count as infrastructure failures and the task is marked incomplete. Missing configuration and an exhausted configured pool retain distinct error types. Pool loss after scoring begins is also classified, so queued outputs cannot escape the infrastructure count. Response-level annotations preserve existing per-output failure counts.

Addresses the silent-zero path in livecodebench-stalled-execution (#457). Command isolation is in isolate-sandbox-commands (#470), followed by recover-quarantined-sandbox (#471).

Validation: an eight-sample runner regression covers missing, exhausted and unavailable task-specific pools even when an unrelated pool is healthy, plus depletion after the first scoring request; HLE failure-count regressions, Ruff/type checks and the unit suite pass. Four unrelated file-size tests require a newer Git than this Mac; Full Python 3.12/3.13 CI passes, including those tests.

@abhishekraok
abhishekraok requested a review from a team as a code owner October 13, 2026 23:03
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 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 🔄 Running since 2026-10-21T22:44:44.178987Z 03b3bb2 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b6eeba483e

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c75589a9b4

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@gregorybchris gregorybchris left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This review was generated by an agent following REVIEW_GUIDE.md. It is not from a human reviewer. Reply in the PR thread and a maintainer will follow up.

Looks good overall! This closes the silent-zero path from #457, and I found nothing blocking. A few non-blocking items and nits follow.

What I checked. The PR fixes the scoring half of #457 (issue suggestion 2). In the reported runs, every executor was quarantined, so ScoringContext.has_execution_env went false. _apply_scorers_async then raised SandboxRequiredError for the whole response. The response-level formatter in results.py never set infrastructure, so each later sample was stored as a plain 0 and the task exited clean. With this PR, that path raises SandboxInfrastructureError, the shared formatter flags it, and compute_task_metrics sets Incomplete: N output score(s) failed due to sandbox infrastructure. The manager change also covers a pool that empties between the gate check and a later lease. Per-output paths were already covered on main: a command timeout returns error="timeout", LiveCodeBench turns the missing verdict into ScoringIncompleteError, and transport exhaustion raises SandboxTransportError.

  • ruff check, ruff format --check, ty check src/ and pytest tests/ --ignore=tests/integration all pass in a local worktree of a62c4f1 (3351 passed, 35 skipped). The only ty warning is an unused ignore in executor.py, which this PR does not touch.
  • I reverted only src/ to the merge base (e169a54f) and reran tests/runners/test_infrastructure_scoring.py. The new parametrized test fails on main with result.error is None. So the regression test catches the bug it targets.
  • The __response__ de-duplication in _record_scoring_failure is correct for HLE. When every sample fails judging, each output already has its own infrastructure error. The response-level error raised after that is no longer counted a second time.

Relation to #470 and #471. These are a stack, not competing fixes. #470's base is this branch, and #471's base is #470's branch. #470 covers issue suggestion 1a: it moves commands out of the SWE-ReX server and kills the whole process group. #471 covers suggestion 1b: it replaces quarantined slots. Neither one edits the lines this PR changes in base.py, results.py or execution.py. #471 edits manager.py near this PR's _execute_with_lease change, but it does not touch the except _NoSandboxAvailableError block, so the two changes stack cleanly. #471 also changes SandboxManager.is_running and has_executor to return true while a slot can still be recovered. That is what lets this PR's is_running gate pass during recovery. So the merge order must be #469, then #470, then #471. If this PR is squash-merged, #470 will need git rebase --onto main codex/lcb-scoring-failures before GitHub can merge it cleanly.

Non-blocking

  1. src/olmo_eval/common/scorers/execution.py:39
    SandboxRequiredError is now always counted as infrastructure. When no sandbox is configured at all, a LiveCodeBench run finishes with Incomplete: 8 output score(s) failed due to sandbox infrastructure; the missing case of the new test asserts exactly that. Marking the task incomplete is right, because a missing sandbox must never become a score. The wording sends a user looking for a broken pool when the real cause is a missing sandboxes entry. The runner already knows which tasks have an ExecutionScorer (runner.py:123) and whether harness_config.sandboxes is set. Could the runner reject that combination before inference starts? If that is out of scope here, please file a follow-up issue named something like "Fail fast when a task with an ExecutionScorer runs without a sandbox".

  2. tests/runners/test_infrastructure_scoring.py:84
    This patches olmo_eval.harness.sandbox.manager._MAX_SANDBOX_RESTARTS with raising=False. That constant is added in #471, so on this branch the patch does nothing. It only creates a new module attribute. After #471 lands, raising=False would also hide a rename of the constant, and the depleted case would quietly start testing recovery behavior instead of depletion. Should this line move to #471 and drop raising=False there?

  3. src/olmo_eval/common/scorers/execution.py:40-45
    Infrastructure classification for SandboxInfrastructureError depends on a guarded import from olmo_eval.harness. If that import ever fails, sandbox failures quietly go back to being ordinary zeros. That is the exact failure this PR fixes. SandboxInfrastructureError has no dependencies, so it could live next to ScoringIncompleteError in common/scorers/execution.py. harness/sandbox/errors.py would re-export it. Then the classification would no longer depend on the guarded import, and common would stop importing from harness at this point. This guarded import existed before this PR in evals/tasks/common/base.py, so the problem is in the existing code. This PR is just a good place to fix it.

Nits

  • Nit: src/olmo_eval/evals/tasks/common/base.py:724: the gate message does not name the capability. Including sorted(sandbox_cap or Capability.DEFAULT) would make a mixed-pool failure easy to trace. That set is what manager.py:631 already prints.
  • Nit: src/olmo_eval/harness/sandbox/manager.py:633: 'recovery unavailable' refers to recovery that does not exist until #471. Something like 'no compatible sandbox was available' reads correctly on this branch alone. It also reads correctly for #471's "manager is stopping" case.
  • Nit: src/olmo_eval/evals/tasks/common/base.py:683: the Raises: section still lists only SandboxRequiredError. The gate now raises SandboxInfrastructureError when a sandbox was configured but none is running.
  • Nit: src/olmo_eval/runners/asynq/results.py:115: the docstring says this runs "before per-output results exist", but the new branch at lines 126-131 deals with outputs that already have results. A one-line comment on why the response-level error is not counted in that case would help the next reader.
  • Nit: src/olmo_eval/evals/tasks/hle.py:115 and src/olmo_eval/evals/tasks/frontierscience.py:92 still import _format_scoring_error from evals.tasks.common.base. That module now only re-exports an alias of the private name. They could import format_scoring_error from common.scorers.execution directly, and it could be added to common/scorers/__init__.py's __all__.

Before merge

Nothing here blocks the merge. Please decide on item 2 before #471 is rebased onto this branch. The author may merge once CI is green, then rebase #470 onto main as described above. If item 1 is deferred, please file and link the follow-up issue.

Mark missing or exhausted sandbox scoring as infrastructure failure at both per-output and response-level catches. Preserve already-recorded verdicts and failure counts, and cover eight-sample LiveCodeBench responses.
@gregorybchris

Copy link
Copy Markdown
Collaborator

Written by Claude Code for @gregorybchris.

#492 (merged as d60f81f) carries this PR's classification and annotation forward, and replaces the zero-tolerance gate with a failure budget. Chris plans to close this PR. Please read the note on the stack below first.

Carried over from this PR

  • SandboxInfrastructureError now lives in common/scorers/execution.py; harness.sandbox.errors re-exports it, and SandboxTransportError subclasses it.
  • format_scoring_error marks ScoringIncompleteError, SandboxRequiredError and SandboxInfrastructureError as "infrastructure": "true".
  • The sandbox gate in _apply_scorers_async tells the two cases apart: no sandbox configured gives SandboxRequiredError. Sandboxes configured but none with the capability running gives SandboxInfrastructureError, naming the capability.
  • A scoring call that finds its pool empty raises SandboxInfrastructureError.
  • Your eight-sample runner regression is ported to tests/runners/test_infrastructure_scoring.py: missing, empty, a healthy pool with another capability, and depletion during scoring.

What's different from this PR

  • A scoring failure no longer marks the task incomplete by itself. The output gets no score, and the instance is left out of the metrics and counts against max_hard_failure_rate, shared with instances that produced no output.
  • The infrastructure flag is diagnostic only.
  • A task with nothing scored fails at any budget, so a run with no sandbox, or one that loses its pool early, still fails.

Conflicts. This branch now conflicts with main in execution.py, base.py, manager.py, results.py and test_infrastructure_scoring.py. All five are files #492 rewrote.

Note on the stack. #470 is based on this PR's branch, codex/lcb-scoring-failures, and #471 is based on #470's. Retarget #470 to main before deleting this branch, or GitHub closes #470.

@abhishekraok

Copy link
Copy Markdown
Collaborator Author

Codex · codex://threads/01a1326f-ed81-75e3-80e4-661392dbe4b5

Closing as superseded by count-scoring-failures (#492). Command isolation now targets main and preserves the merged failure-budget behavior; recovery remains stacked on it.

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.

2 participants