Repository navigation
feat(scicode): run scientific grading in OpenSandbox - #5474
Conversation
Signed-off-by: Igor Gitman <[email protected]>
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP WITH CARE
I found two cancellation-related reliability risks, detailed inline, plus the validation gap and documentation suggestion below. I inspected all eight changed files and their directly affected scoring, provider, and consumer contracts. This was a static review; I didn't execute tests or contact OpenSandbox.
RISK — Validate the submitted adaptation on the real remote path
The PR description explicitly distinguishes its successful development-lineage evaluations from the submitted adaptation to current runtime APIs and interpreter behavior. Those runs are useful evidence, but they don't validate the integration exposed by the new overlay. The pinned rubric requires representative real-model rollouts for behavior-changing environment work and before/after reward evidence for fixed-benchmark verifier changes. This is a validation gap, not a demonstrated scoring defect.
Could you run a representative real-model smoke using this adaptation and provide local-versus-remote regrading of fixed saved programs? Record the reviewed commit, image digest, architecture, completed/scored counts, whole-problem reward and subtask accuracy before/after, explained discrepancies, and sandbox cleanup outcome. Preserve the local default, two-interpreter OR rule, pinned HDF5 checksum, and prefilled/sentinel accounting; this doesn't require changing verified: false or completing the separate full-baselining checklist. Acceptance is recorded evidence that representative grading completes through the submitted provider/image path, produces the expected scoring/accounting, and reclaims every sandbox created by the smoke.
NOTE — Suggestion: expose the workflow in the user docs
The benchmark instructions explain the feature, but the user-facing OpenSandbox guide has no SciCode entry point. The rubric places notable user-feature documentation in Fern. Could you add a short section or pointer with the benchmark selector, required credentials/image contract, concurrency controls, and infrastructure-failure semantics? Keep the detailed image recipe in its existing location and make clear that local grading remains the default. Static acceptance: the Fern section links to the overlay and image instructions, and its configuration agrees with the two interpreter paths and corrected HDF5 path.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
…etes Signed-off-by: Igor Gitman <[email protected]>
Signed-off-by: Igor Gitman <[email protected]>
Signed-off-by: Igor Gitman <[email protected]>
|
Merged upstream main 89 SciCode component tests pass, including local sibling permit retention and teardown through repeated cancellation. Both inline cancellation findings are already fixed and remain covered. The provider/image parity and real-model smoke evidence is recorded in the PR description.
|
|
/ok to test c8d4f84 |
|
/review |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
No remaining eligible findings in this follow-up.
- The local cancellation guard fixes the reported sibling-failure case: local executor-backed siblings keep their permits until execution finishes, while remote siblings are still canceled and awaited.
- The shielded teardown fixes the repeated-cancellation finding. The new regressions cover local retries and remote deletion, including verification with a semaphore-waiting sibling.
- The Fern section resolves the documentation suggestion and agrees with the overlay and image contract.
- The supplied validation record addresses the earlier evidence gap: six saved substeps matched all 12 local environment verdicts, before/after accuracy and rewards were unchanged, a fresh model-generated substep passed both interpreters, and all 14 smoke sandboxes were reported deleted. This is selected smoke/parity evidence, not full-benchmark equivalence or throughput validation at 64 attempts.
I compared the fixes and subsequent configuration/import changes with the previous-review tree and traced their directly affected tests, callers, and provider contracts. I found no unresolved prior findings or introduced regressions above the historical moderate-impact threshold. This was a static follow-up review; I didn't execute tests or contact OpenSandbox, and the live results remain author-reported.
Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.
yaoyu-33
left a comment
There was a problem hiding this comment.
Thanks. Moving SciCode's scientific subprocesses off the serving host fixes the OOMs, and the sandbox handling follows the repo's rules: files go through SandboxSpec.files, every attempt stops in finally (shielded through repeated cancellation), ttl_s is set, and both error_type and return_code are checked. By default, grading still runs locally and is unchanged.
Approving. I left one non-blocking suggestion inline about SIGKILL.
- Merge order with #4892: both PRs rewrite
model_post_init,_resolve_grading_interpretersandrequirements.txt. Whichever lands second, keep the sandbox branch ahead of #4892'sensure_grading_envdefault, so sandbox mode never builds a local 3.11 environment it won't use. - CI: the red Core tests (shard 3) come from
test_orchestration_otel.py, which can't resolvedriver.gym_install.ref 'main'from GitHub. That failure is unrelated to this PR.
| result = json.loads(execution.stdout or "") | ||
| if not isinstance(result, dict) or not isinstance(result.get("passed"), bool) or "error" not in result: | ||
| raise RuntimeError("SciCode sandbox returned an invalid grading result") | ||
| if result.get("returncode") == -9: |
There was a problem hiding this comment.
Non-blocking: the local runner scores a killed process as a fail (passed = proc.returncode == 0 in runner.run_substep), but here SIGKILL raises. Suppose a candidate always needs more than memory_mib. Graded locally, the answer scores 0. Graded here, /verify fails on every resume and the row never gets a score.
If the goal is to keep sandbox-limit kills apart from model answers, retry once on a fresh sandbox and then record a fail, or an explicit unscored outcome. Either way, such rows stop blocking the run. Fine as a follow-up.
|
I'll watch this ready-to-merge PR and report substantive progress. Running on |
|
🤖 On it — handling this as babysit-ready-to-merge. |
1 similar comment
|
🤖 On it — handling this as babysit-ready-to-merge. |
|
💬 CI diagnosis is blocked: the GitHub read and its bounded retry both failed because the native Git authority returned HTTP 503. I haven’t read the failing job logs, so I can’t classify the failure or safely request a CI retry. Platform access needs to recover before diagnosis can continue; the PR watch remains armed. |
|
Checked the current-head CI log: core shard 3 failed because git ls-remote for driver.gym_install.ref main timed out, outside this diff (job 126185368131). The non-blocking KiloCode model_error failure is shared across unrelated PRs. Keeping the approved scoring behavior in this PR; the SIGKILL suggestion remains an explicit follow-up because terminal unscored outcomes versus candidate failures changes the evaluation contract. Also noted the merge-order requirement with #4892: sandbox mode must bypass the local grading-env build. |
Signed-off-by: Igor Gitman <[email protected]>
|
Merged current main |
|
/ok to test 35412b2 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42088901105 |
|
💬 GitHub access has recovered. The run named in the alert passed; the current red checks come from KiloCode’s non-blocking conformance probe, where a controlled HTTP 400 becomes an agent RuntimeError. Current-main CI didn’t execute that probe, so I haven’t established whether main shares the failure. Merge-queue validation is already in progress; I won’t request a speculative retry. |
|
The PR is no longer an open ready-to-merge PR targeting main. |
SciCode's scientific subprocesses can exhaust the model-serving host's memory at normal grading concurrency. Add optional OpenSandbox execution so each scientific grading attempt runs remotely while retaining the existing subprocess grader, generated test programs, and two-environment OR grading contract. Local grading remains the default. No separate issue is needed for this focused memory-isolation change.
The existing semaphore covers sandbox creation through deletion. Each attempt validates the interpreter and test-data checksum, uploads the existing grader and program, and cleans up in
finally, with a finite TTL as a backstop. Infrastructure errors and SIGKILL propagate instead of being scored as incorrect model answers; sibling attempts are canceled and awaited on failure. An opt-in SciCode-Verified overlay and image-build recipe document the required interpreters, data, image digest, credentials and concurrency controls.Validation:
pre-commit run --all-filespassed; commit includes DCO sign-off.Representative rollout evidence: the development implementation completed a 512-row saved-program replay and a fresh 512-row model evaluation with 20 concurrent grading attempts and unlimited model admission, without host OOM or infrastructure failures. Replay matched all compared verdicts for 510/512 rows; the differences were traced to unseeded randomness and ARM/x86 floating-point rounding. All 4,582 replay sandboxes were deleted. The fresh evaluation resumed two remaining rows after an allocation timeout; the 510 preserved rows were verified unchanged.
Those live evaluations exercised the development lineage before this patch was adapted to current main's
server_runtimeAPIs and local interpreter behavior. The unit tests above cover this submitted adaptation; the live results do not establish statistical equivalence or replace reference-solution validation. Keep the verifier image digest and architecture fixed when comparing benchmark results.Review follow-up at
f6ce911f5ec5407d20095de79224c1bb2aa9c39c:Live validation of the submitted adaptation (after the fixes):
sha256:15f95ba70bc8a8239b1d2b6bc5a72323ce74229e0260c23e91b9844efa862633, Linux amd64, corrected HDF5 MD52b41a7df40ddc23ce651ec05b8ecb6f8, both 2024/2025 interpreters.[0, 0, 0]before and after. No discrepancies. This is a selected parity smoke, not a full benchmark score.The OpenSandbox overlay now defaults to 64 concurrent grading attempts; local grading remains at 20. The completed live evaluations above used 20. The higher default reduces the concurrency cap on remote execution without changing per-sandbox resources, timeouts or scoring rules; no throughput result at 64 is claimed.