Skip to content

fix(scicode): use a pinned scientific grading environment - #4892

Merged
Kipok merged 10 commits into
mainfrom
codex/scicode-legacy-grading-env
Nov 9, 2026
Merged

Kipok merged 10 commits into
mainfrom
codex/scicode-legacy-grading-env

Conversation

@Kipok

@Kipok Kipok commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

SciCode's default grader now executes generated code in a separate Python 3.11 environment with the original scientific APIs, including SciPy 1.10.1 and scipy.integrate.simps. The Gym server no longer needs those scientific packages in its own interpreter. SciCode-Verified's explicit grading_interpreters continue to take precedence. Sandbox mode uses the image's interpreters/data and bypasses local environment setup; this branch includes merged #5474.

Commit the full resolved grading-requirements.lock, generated from the six direct requirements with uv pip compile --python-version 3.11 --universal. Startup applies uv pip sync. A changed lock/Python fingerprint invalidates the marker and recreates the interpreter with uv venv --clear; failed setup never receives a ready marker. Matching prebuilt environments can start offline. Both benchmark and resources-server READMEs describe the execution environment and lock regeneration.

Compatibility: default step_outputs[].environment changes from "current" to "scicode". Scores can move on problems previously failing scientific API imports, including 2 and 28. Creating/updating the default environment requires uv, Python/package download access and a writable grading_venv_path; matching prebuilt environments or explicit interpreters avoid that startup download requirement. The runner uses subprocess.run, not a Ray subprocess.

No separate issue: fixes the reproduced scientific-library incompatibility in the existing benchmark.

Validation:

  • 691 resource/agent/vLLM tests passed on this branch, including changed-version recreation, locked sync, failed-update marker invalidation and offline reuse. The combined reporting/grading branch passed 703 tests.
  • Real Linux x86_64 environment build: Python 3.11.16, scipy.integrate.simps smoke returned 2.6666666666666665; adding requests then invalidating the fingerprint rebuilt the environment and removed requests. A matching subsequent startup reused it.
  • pre-commit run --all-files passed, including guardwords; DCO sign-off included.
  • Earlier saved-generation replay evidence identified the simps failures; no new benchmark inference was launched for these environment-update changes. The universal lock is not a claim of a fresh ARM64 execution smoke. Full CI and reviewer approval remain outstanding.

Latest validation (main 2ac7908c4, head 461a46d3dcee25070b0bbeeb765908f1e5a2035a):

Resolved the main conflict after #5474 merged. Sandbox grading takes precedence and never creates/preflights the local Python environment or reads image-only test data on the host. Added a startup regression covering that interaction; retained the sandbox dependencies while removing the local scientific stack from the server environment. 106 SciCode tests and full pre-commit passed.

@copy-pr-bot

copy-pr-bot Bot commented Oct 21, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@svcnvidia-nemo-ci svcnvidia-nemo-ci added area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers bug Something isn't working labels Oct 21, 2026
@Kipok
Kipok marked this pull request as ready for review October 22, 2026 04:24
@Kipok Kipok added the needs-review PR is ready for code review and waiting on a reviewer label Oct 22, 2026
@Kipok Kipok changed the title fix(scicode): isolate the legacy grading dependencies fix(scicode): use a pinned scientific grading environment Oct 22, 2026

@yaoyu-33 yaoyu-33 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for tracking down the simps import failures. Moving grading into a pinned Python 3.11 env is the right fix, and the replay evidence on problems 2/15/17/28 is convincing.

We traced every grading path (verify → run_substep(..., executable)) and confirmed that the server process no longer imports numpy/scipy/h5py and that SciCode-Verified's explicit grading_interpreters path is unaffected. We also built the env for real with uv on macOS arm64: the simps smoke check passes, the fast path is reused, and a failed install leaves no marker. Inline comments cover two env-update edge cases and a stale README.

A few things are not inline, because resources_servers/scicode/README.md is not part of this diff:

  • resources_servers/scicode/README.md L36-37 still says generated code runs in the server's own venv with scipy<1.14, which is the claim this PR corrects in benchmarks/scicode/README.md. L32 also says "Ray subprocess", but the code uses a plain subprocess.run.
  • Compatibility notes: could the PR body call out three changes? step_outputs[].environment changes from "current" to "scicode" (app.py:202). Scores on problems 2/28 can move because the grader changes. And every server start now needs uv plus download access unless the env is prebuilt.

@yaoyu-33

Copy link
Copy Markdown
Contributor

/ok to test ba6109f

@marcromeyn

Copy link
Copy Markdown
Contributor

/ok to test 91a9513

@Kipok

Kipok commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Merged upstream main 778a37bf3. pre-commit run --all-files and the PR diff whitespace check pass; the merge commit has a DCO sign-off. All 80 SciCode component/setup tests pass, including fingerprint invalidation, locked sync and explicit-interpreter behavior. The earlier reviewer-requested lock/recreation and README/compatibility changes remain intact. No fresh grading-environment build or benchmark inference was run for this main-only update.

@marcromeyn

Copy link
Copy Markdown
Contributor

/ok to test e80b5c3

Copy link
Copy Markdown
Contributor

💬 The author’s resolution preserves sandbox-first execution and the pinned local grader, with a startup regression. My unpublished candidate is no longer needed. Lint and component-lock checks passed on 461a46d3; trusted core/server and end-to-end checks haven’t appeared for that head, and the previous approval was dismissed. I’ll keep watching for CI and review updates.

Copy link
Copy Markdown
Contributor

The model provider is unavailable. Work is paused and automatic retries have stopped. Send a new message or retry when the provider is available to resume.

Copy link
Copy Markdown
Contributor

The label application does not own this session.

Copy link
Copy Markdown
Contributor

I'll watch this ready-to-merge PR and report substantive progress. Running on nim-gpt-6-1-sol.

Keep the pinned grading-environment tests and the stateless regrading tests. Preserve all automatically merged changes.

Signed-off-by: svcnemo-autobot <[email protected]>
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the area:build Packaging, dependencies, containers, and releases label Nov 7, 2026
@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

/ok to test 849b033

@adil-a
adil-a added this pull request to the merge queue Nov 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42461911160

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42462896031

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 8, 2026
@adil-a
adil-a added this pull request to the merge queue Nov 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42537087968

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 9, 2026
@yaoyu-33
yaoyu-33 added this pull request to the merge queue Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42571463276

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 9, 2026
@Kipok
Kipok added this pull request to the merge queue Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42720312812

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42721595664

Merged via the queue into main with commit 73c0dce Nov 9, 2026
98 of 101 checks passed
@Kipok
Kipok deleted the codex/scicode-legacy-grading-env branch November 9, 2026 23:50

This branch was previously deployed

1 inactive deployment
public — 849b033b Deployed Nov 7, 2026 by copy-pr-bot[bot] via release / finalize / notify #10797
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:build Packaging, dependencies, containers, and releases area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers bug Something isn't working ready-to-merge PR is approved, current, and waiting for final CI or merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants