Repository navigation
fix(terminal-bench): Inkling-Small TB2.1 accuracy gap fixes - #3629
Merged
Merged
Conversation
QEMU grading could fail before running task tests because live Debian package indexes referenced downloads returning HTTP 404. Restore the dated snapshot sources already recorded in the two QEMU images when bootstrapping their verifiers, clear stale indexes, and refresh apt. This deliberately uses historical package versions and disables snapshot metadata expiry checks; repository signature checks and task assertions remain in place. Validation: three resource-server tests; isolated snapshot and no-snapshot shell checks; live reference-solution and unsolved controls for both tasks; all 16 QEMU verifications completed in the full benchmark run. Signed-off-by: Frankie Siino <[email protected]>
The supplied POV-Ray reference solution could not download its source, scene, and documentation archives from the existing mirror. Use dated Internet Archive copies while preserving the existing SHA-256 checks. This changes reference-solution validation only; model attempts receive no additional source files and task assertions remain unchanged. Validation: the reference solution passed all three task tests using the updated code; three resource-server tests passed. Signed-off-by: Frankie Siino <[email protected]>
Signed-off-by: Frankie Siino <[email protected]>
Agent installs with --no-install-recommends can leave curl or libcurl present without a CA bundle. Reinstalling curl in the CompCert and video verifiers does not reliably restore that dependency, so HTTPS bootstrap fails before task tests run. Install ca-certificates explicitly when those verifiers start. Task assertions and agent-time dependencies are unchanged. Validated with exact failing installation commands in two fresh sandboxes, an eight-attempt model smoke with all graders completing, three resource-server unit tests, and scoped pre-commit checks. The smoke does not establish an accuracy improvement. Signed-off-by: Frankie Siino <[email protected]>
Add an opt-in dataset configuration that preserves task instructions and appends guidance on Ctrl+C, shell readiness, and confirming command execution. Signed-off-by: Frankie Siino <[email protected]>
Set DEBIAN_FRONTEND=noninteractive in Terminus task sandboxes so debconf uses defaults instead of waiting for package configuration answers. Signed-off-by: Frankie Siino <[email protected]>
Hide unrelated shared storage from the agent's terminal while keeping task files and their ownership unchanged. Signed-off-by: Frankie Siino <[email protected]>
Keep the model's earlier reasoning available on later turns. Signed-off-by: Frankie Siino <[email protected]>
Skip unnecessary parsing work once the model's full response is available. Signed-off-by: Frankie Siino <[email protected]>
Run the full Inkling benchmark with the same tasks and settings without temporary scripts. Signed-off-by: Frankie Siino <[email protected]>
Keep one preparation path and separate workspace settings from benchmark settings. Signed-off-by: Frankie Siino <[email protected]>
Move the package installation setting into the Inkling recipe without changing behavior. Signed-off-by: Frankie Siino <[email protected]>
Move both reasoning-history settings into the Inkling recipe without changing behavior. Signed-off-by: Frankie Siino <[email protected]>
…nus 2 Flips the agent's interleaved_thinking default to true and removes the redundant recipe overrides. Inkling's resolved config is unchanged, but other Terminus 2 sandboxed runs now retain reasoning too. Signed-off-by: Frankie Siino <[email protected]>
Defaults recover_stalled_interrupts to true and removes the redundant recipe override and the Experimental label. Inkling's resolved config is unchanged, but other Terminus 2 sandboxed runs now drain queued input when the model sends an exact C-c. Signed-off-by: Frankie Siino <[email protected]>
Selects the fast parsers in inkling_small.sh and removes inkling_small_fast_parsers.sh. On any vLLM other than 0.29.0 the plugins now log a warning and use the stock parsers instead of raising. Signed-off-by: Frankie Siino <[email protected]>
… default Moves terminal_hidden_mounts into sandbox_utils.yaml, which the launcher already loads, and removes the separate deployment overlay. Also applies to other launcher-based runs of the TB2.1 Terminus 2 agent. Signed-off-by: Frankie Siino <[email protected]>
Exact-string verifier patches that matched nothing were silently skipped. They now raise, naming the task and pattern. This exposed mcmc-sampling-stan's patch, which targeted solution/solve.sh from the tests/ table and never applied; it moves to the golden-patch table. Adds tests, including a check that every configured patch matches the pinned task scripts. Signed-off-by: Frankie Siino <[email protected]>
…3983 Merges origin/main. Resolves conflicts in the Terminus 2 agent by taking main's terminal session code and re-applying the private mount bootstrap around TerminusTmuxSession.start(). Removes our recover_stalled_interrupts mechanism, its counters and tests, since #3983 now drains queued input before Ctrl-C by default. Updates the mount tests for the new session flow. Signed-off-by: Frankie Siino <[email protected]>
…Bullseye fix main's sandbox setup (#3549) now redirects the Bullseye security source to a signed snapshot. With it alone, the verifier's apt-get update and install succeed on both QEMU task images, so our separate QEMU patch is redundant. Signed-off-by: Frankie Siino <[email protected]>
Removes the generic terminal-use message appended to every task, so the recipe sends the original task instructions unchanged. Upstream #3983 now normalizes standalone control keys in code. Re-pins normalized_rows_sha256 for the unmodified rows. Signed-off-by: Frankie Siino <[email protected]>
Reverts d25578c. On the merged code the guidance is worth about 5 points; restoring it recovers 62.2% vs 56.3% on the same finished attempts. Signed-off-by: Frankie Siino <[email protected]>
scan Signed-off-by: Frankie Siino <[email protected]>
…es nothing Signed-off-by: Frankie Siino <[email protected]>
Inkling recipe Signed-off-by: Frankie Siino <[email protected]>
for tmux Signed-off-by: Frankie Siino <[email protected]>
fsiino-nvidia
marked this pull request as ready for review
October 8, 2026 04:55
Signed-off-by: Frankie Siino <[email protected]>
…cipe Signed-off-by: Frankie Siino <[email protected]>
Signed-off-by: Frankie Siino <[email protected]>
…g fails Signed-off-by: Frankie Siino <[email protected]>
…ccuracy-gap Signed-off-by: Frankie Siino <[email protected]>
Contributor
Author
|
/ok to test a531e7c |
7 tasks done
…ccuracy-gap Signed-off-by: Frankie Siino <[email protected]>
…ccuracy-gap Signed-off-by: Frankie Siino <[email protected]>
Contributor
Author
|
/ok to test 86e9fe0 |
cmunley1
approved these changes
Oct 20, 2026
Contributor
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/39350137659 |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Inkling-Small was reported at 40.17% on Terminal-Bench 2.1 using Gym's Terminus 2 harness, against 64.7% published with a private harness. Most of the gap turned out to come from the surrounding harness and infrastructure (stuck terminals, grading dependencies, dropped reasoning history), not from the model. This PR adds a reproducible Inkling-Small Terminal-Bench 2.1 recipe (listed in the benchmark catalog with its own
manifest.yaml) and the fixes below.173ec922ascored 60.34% (429/711), with one attempt cancelled by the cluster scheduler (see Rerun at the pre-merge commit). The final code (commit48cc31a7f: mergedmain, terminal guidance on) scored 58.37% (415/711) in a full run, with one attempt (task 17, attempt 3) cancelled while still running and no failures. All scores use the automatic benchmark results without manual adjustments, and individual gains come from separate comparisons that cannot be added together.main(NeMo Gym fix(terminal): retain Bullseye security packages during sandbox setup #3549 and fix(agent): recover Terminus controls and exited shells #3983). The branch has mergedmainand removed the PR's own versions of those. Item 2 (terminal guidance) was dropped too, then restored once the merged-code run showed it is worth about 5 points.PR references below were checked on September 24, 2026, apart from NeMo Gym #3549 and #3983, which come from
main's git history on October 7, 2026. They provide related failure reports or implementation history; they do not establish the accuracy gains reported here or imply that this PR's exact changes were accepted upstream. Items without a linked PR rely on the local evidence described here.Changes
QEMU grading dependencies (superseded by upstream)
main's setup alone the verifier'sapt-get updateandapt-get installsucceed. The branch's own QEMU patch was therefore removed when mergingmain._BULLSEYE_SECURITY_SNAPSHOT_SETUPinresources_servers/terminal_bench_2_1/app.py:36.archive.debian.organd removes the old security source; the branch's original patch restored the dated snapshot sources recorded in the images, andmainnow uses its own snapshot redirect. This supports the dependency-failure diagnosis. The PR was open when checked.Terminal guidance
d25578c1d) then scored 54.60%, against 61.16% with it restored (commit4c6c990e6) on otherwise identical code (+6.3 points on the 703 attempts finished in both). That accounts for the whole drop from the pre-merge rerun. The 24-attempt diagnostic was too small to see an effect that is concentrated in a dozen long-running tasks. The cost is that the recipe's task inputs differ from vanilla TB2.1.prepare()inbenchmarks/terminal_bench_2_1/prepare_inkling_small.py, andnormalized_rows_sha256inbenchmarks/terminal_bench_2_1/inkling_small_tasks.json, which pins the rows with the guidance appended.Ctrl+C recovery (superseded by upstream)
main(216e8ba5a). The 60.34% rerun used the branch's implementation, not upstream's.TerminusTmuxSessioninresponses_api_agents/terminus_2_sandboxed_agent/terminal.pyandNeMoGymTerminus2._execute_commands()inresponses_api_agents/terminus_2_sandboxed_agent/app.py.Noninteractive package installation
sandbox_config.env.DEBIAN_FRONTENDinbenchmarks/terminal_bench_2_1/inkling_small.yaml:42.Hide unrelated shared storage
private_terminal_bootstrap()inresponses_api_agents/terminus_2_sandboxed_agent/terminal_mounts.py:57andterminal_hidden_mountsinbenchmarks/terminal_bench_2_1/inkling_small.yaml. Only the Inkling recipe sets it, so other benchmarks and models are unaffected: the agent-level default (terminal_hidden_mounts: []) and the sharedbenchmarks/nemotron_3.5_super/sandbox_utils.yamlare unchanged. It needs Linux root, user/mount namespaces and the tmux binary thatsandbox_utils.yamlconfigures, whichsbatch_external_vllm.shloads automatically; runninggym eval runwithout the launcher requires adding--config benchmarks/nemotron_3.5_super/sandbox_utils.yaml; without it the mount hiding has no tmux binary and every rollout fails withPrivate terminal requires tmux.main: on October 7, 2026, the real agent setup was run with both mounts hidden against a live sandbox. Inside the agent's terminal/mnt/s3-dataand/mnt/.s3-gatewere empty (tmpfs mounted over them), while direct sandbox execution, which is what the grader uses, still saw the S3 data and a file the terminal wrote to/tmp. Only the agent's own tmux session remained afterward.Grader HTTPS certificates
TEST_SH_PATCHESinresources_servers/terminal_bench_2_1/app.py:127._upload_folderin the same file), and a unit test checks that every configured patch matches the pinned task scripts. It warns instead of failing because the default benchmark clones the task repository unpinned, so a stale patch must not zero a task whose upstream script was fixed. This exposed a pre-existingmcmc-sampling-stanpatch that targetedsolution/solve.shfrom thetests/table and had never applied; it now sits in the golden-patch table, so it only affects reference-solution validation.Note: with fixes 1–6 applied, the automatic accuracy was 49.58%. That shows the result with those changes present, not that each change contributed to the gain. Their individual contributions have not been isolated.
Preserve earlier reasoning
interleaved_thinkinginbenchmarks/terminal_bench_2_1/inkling_small.yaml(the shared agent default inresponses_api_agents/terminus_2_sandboxed_agent/configs/terminus_2_sandboxed_agent.yamlstaysfalse) anduses_interleaved_reasoninginresponses_api_models/vllm_model/app.py:170(already the model default).interleaved_thinking, initially set tofalse. That code predates this branch; the Inkling recipe turns it on.Supporting change: POV-Ray reference-solution downloads
is_verifying_golden_patch: false, so this change contributed no accuracy gain to those runs. It is separate from the seven evaluation changes above.GOLDEN_PATCH_SOLVE_SH_PATCHES["terminal-bench/build-pov-ray"]andTerminalBench21ResourcesServer.verify()inresources_servers/terminal_bench_2_1/app.py.Rerun at the pre-merge commit
The rerun used commit
173ec922aon 6 nodes with 4 GPUs each, with a vLLM 0.29.0 image built for other evaluations (see Reproducing the evaluation). 711 of the 712 attempts finished within about 66 minutes. The cluster's scheduler then cancelled the job 77 minutes in, while one attempt (task 42,train-fasttext, attempt 5) was still running. The model servers had been nearly idle for roughly 12 minutes beforehand (about zero requests running), which is consistent with an idle-job policy, but the cause is unconfirmed. The launcher did not write its aggregate metrics file, so the numbers below come from the saved results.Validation
resources_servers/terminal_bench_2_1/tests/), includingmain's tests and a guard that every configured patch matches the pinned task scripts. Removing the unmatched-patch warning, or restoring the misplaced patch, makes tests fail.benchmarks/terminal_bench_2_1/tests/test_inkling_small.py), covering the prepared task inputs and the resolved settings in launcher order. The 84 benchmark-catalog tests (tests/unit_tests/test_benchmarks.py) pass with the newbenchmarks/terminal_bench_2_1/inkling_small/manifest.yaml.gym env test +entrypoint=responses_api_agents/terminus_2_sandboxed_agent), includingmain'stest_terminal.pyand the mount tests updated formain's session code.main): the real agent setup with hidden mounts left both S3 mounts empty inside the agent terminal while the grader's view kept the data, and both QEMU task images updated and installed packages successfully without the branch's QEMU patch.48cc31a7f, a full run on the container in the reproduction command scored 58.37% (415/711, one attempt cancelled while running, no failures). Commit4c6c990e6(the same code before the last cleanups) scored 58.85% (419/712) on that container and 61.16% (433/708) on another vLLM 0.30.0 image. A baseline run oforigin/mainplus only the recipe files scored 45.22% (322/712).Follow-ups
Known gaps that this PR does not address:
regex-chessgrading loophole: some attempts pass by swapping Python's regular-expression implementation instead of satisfying the requested regex-based solution. The grader awards the pass. It needs a grader fix and a trace review of the passes in the reruns.Reproducing the evaluation
The recipe is
benchmarks/terminal_bench_2_1/inkling_small.yaml(catalog entryterminal_bench_2_1/inkling_small, described bybenchmarks/terminal_bench_2_1/inkling_small/manifest.yaml), launched throughbenchmarks/nemotron_3.5_super/sbatch_external_vllm.sh, which loads the config file directly. Requirements: the Gym virtual environment, a valid OpenSandbox key inenv.yaml, a vLLM image that includes Gym built from a recent Gym commit, and sandboxes with Linux root, user/mount namespace support and the tmux binary configured inbenchmarks/nemotron_3.5_super/sandbox_utils.yaml.The launcher mounts the repository checkout as
/opt/Gym, so do not edit it while the job runs. The command below, with the container shown, was used for full runs of the current code:( set -euo pipefail source .venv/bin/activate INKLING_REPO=$(pwd -P) INKLING_RUN_NAME="inkling-small-tb21-$(date -u +%Y%m%dT%H%M%S)-$$" python -m benchmarks.terminal_bench_2_1.prepare_inkling_small mkdir -p "results/$INKLING_RUN_NAME" slurm-logs git rev-parse HEAD > "results/$INKLING_RUN_NAME/gym-commit.txt" unset SBATCH_RESERVATION SBATCH_QOS MODEL_NAME ROLLOUTS_FPATH unset OPENSANDBOX_DOMAIN OPENSANDBOX_API_KEY OPENSANDBOX_PROTOCOL MODEL=/path/to/Inkling-Small-NVFP4 \ VLLM_CONFIG=benchmarks/nemotron_3.5_super/vllm_configs/inkling_small.sh \ EXPERIMENT_NAME="$INKLING_RUN_NAME" \ VLLM_MODE=aggregated \ NUM_NODES=6 \ SEGMENT=6 \ SBATCH_ACCOUNT=<your Slurm account> \ SBATCH_PARTITION=batch_long \ SBATCH_TIMELIMIT=08:00:00 \ SBATCH_GRES=gpu:4 \ CONTAINER=/path/to/evaluation-image.sqsh \ MOUNTS="/lustre:/lustre,$INKLING_REPO:/opt/Gym" \ WANDB_MODE=disabled \ LITELLM_LOCAL_MODEL_COST_MAP=True \ RAY_TMPDIR=/tmp \ bash benchmarks/nemotron_3.5_super/sbatch_external_vllm.sh \ --config benchmarks/terminal_bench_2_1/inkling_small.yaml \ "++model_call_capture_dir=/opt/Gym/results/$INKLING_RUN_NAME/model-calls" \ "++route_failures_to_sidecar=true" )