Skip to content

feat(gdpval): run Pi in place of Stirrup - #4589

Merged
athitten merged 2 commits into
mainfrom
athitten/gdpval-pi-4178
Oct 23, 2026
Merged

athitten merged 2 commits into
mainfrom
athitten/gdpval-pi-4178

Conversation

@athitten

@athitten athitten commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds benchmarks/gdpval/pi.yaml, which runs GDPVal with Pi in place of Stirrup, using the same resources server, judges and multi-stage driver:

export PERSIST_DELIVERABLES_DIR=$PWD/output/gdpval_pi/deliverables
gym eval prepare --benchmark gdpval/pi
gym eval run --model-type vllm_model --benchmark gdpval/pi --split benchmark --output results/gdpval_pi.jsonl \
    --model-url <vllm_base_url> --model-api-key <vllm_api_key> --model <served_model_name> \
    ++policy_model.responses_api_models.vllm_model.propagate_context_overflow_errors=true \
    '++policy_model.responses_api_models.vllm_model.sampling_overrides={temperature: 1.0, top_p: 0.95}'
  • Pi runs in the task sandbox the resources server lends it, with /root as its working directory.
  • It reaches finish, abandon_task_finish, web_search and fetch_web_page over MCP: expose_tools_over_mcp: true on the resources server and resources_tool_transports: [mcp] on the environment server.
  • finish_tool_names: [finish, abandon_task_finish]: a turn whose tool calls are all successful finish calls ends Pi's run.
  • pi.yaml includes config.yaml, removes the Stirrup agent with gdpval_stirrup_agent: null and points gdpval_environment_server at Pi. (_delete_key would leave an empty gdpval_stirrup_agent: {}, which gym env start and gym env prefetch fail on.)
  • Pi settings:
    • concurrency: 32 matches Stirrup's and the environment server's max_concurrent_episodes;
    • timeout: 10800 fits inside the environment server's 18,000 s episode timeout;
    • max_output_tokens: 32768 per model call.
  • The two overrides in the command depend on the model type, so they go on the command line rather than in pi.yaml:
    • context-length errors reach Pi, which then compacts its context. By default vllm_model returns an empty completion instead, and the episode ends without a submission;
    • sampling is pinned to the Stirrup agent's temperature 1.0 and top_p 0.95, because Pi sends neither.

Also:

  • prepare_harness_neutral.py writes the same rows as prepare.py without the responses_create_params.tools list, because Pi, Codex and Hermes sessions reject a request tool list. The rows use fix: decouple GDPVal and Stirrup #4178's prompts/harness-neutral.yaml. Both scripts call prepare.py's row writer, now write_benchmark(output_fpath, *, tools); prepare.py's output is unchanged.
  • test_harness_configs.py checks the harness configs, listed by name (here pi.yaml), so other configs in benchmarks/gdpval/, such as nooa.yaml from feat(nooa): add a canonical GDPval recipe #4821, are left out. For each one it checks:
    • the dataset;
    • that it changes only the agent, the allowed agent and the MCP transport, so the judges, scoring, sandbox and multi-stage driver are the ones Stirrup runs with;
    • that no Stirrup agent and no empty top-level entry is left, and that the harness's timeout is shorter than the episode timeout;
    • that each key in the agent's entry is a setting of the agent's config class. The agent ignores unknown keys, so a misspelled setting would be dropped silently.
  • The benchmark README gets a "Run another harness" section: the command, the two model server settings and their openai_model equivalents, and the gym eval run flags Pi rejects (--temperature, --top-p, --max-output-tokens). It also asks for a separate PERSIST_DELIVERABLES_DIR per run: deliverables are stored by task and repeat only, so a run into another run's directory replaces its files. And it notes that a Pi run that times out before finish is judged as an empty submission and not retried (see Compatibility).

#4591 (Codex in place of Stirrup) is stacked on this PR and #4590.

No issue: this follows #4178. It builds on #4587, now on main, which lets Pi sandbox sessions use MCP tool grants and finish tools; this diff has only the GDPVal side. It also relies on #3902, also on main, which keeps the task's HOME, so files saved under ~ survive until /verify. Related: #4549 tracks harness validation across benchmarks, GDPVal included; #4546 (draft) adds GDPVal configs for Pi and other sandbox harnesses on the layout before #4178.

Port of athitten#2 (Pi × GDPval on the yaoyu-33#8 prototype) to #4178's design. Most of that PR's fixes are not needed here:

Its configurable LibreOffice command is ported in #4586.

Validation

At f0c065e, on main 4c66403, which includes #4178 and #4587. The PR has two commits: 9eeb8a0, and f0c065e, which adds only the README's timeout note. 9eeb8a0 changes only test_harness_configs.py from fc87770, where the checks below that run Pi or Gym were done. It merges cleanly with main 9240708, which includes #4787 (it made PERSIST_DELIVERABLES_DIR required); on that merge, the GDPVal tests give 863 passed, 1 skipped.

  • pytest resources_servers/gdpval/tests: 853 passed, 2 of them new; 1 skipped (it needs Stirrup installed). Locked packages match uv.lock.
  • The new tests fail when the code they guard is broken (checked by mutation): a tool list in the harness-neutral rows; an empty Stirrup entry; the direct_http transport; expose_tools_over_mcp: false; the Stirrup prompt; and a harness config that changes the reward mode, the judge panel, the judge config or the episode timeout, or sets a timeout past the episode timeout, or misspells a Pi setting.
  • pytest tests/unit_tests/test_benchmarks.py tests/unit_tests/test_discovery.py tests/unit_tests/test_registry.py tests/unit_tests/test_cli.py: 285 passed.
  • gym env resolve with the README's overrides, and gym list benchmarks: gdpval/pi resolves to gdpval_pi_agent with the harness-neutral rows and prompt, 8 servers, no Stirrup agent and the two vllm_model settings, and is listed with its description. gym env prefetch --benchmark gdpval/pi --model-type vllm_model: completed without errors.
  • With real Pi 0.80.2 on Node 24 and 22.19.0 (the host's Node and Pi in place of the in-sandbox install), pi.yaml's Pi settings, main's GDPVal resources server over MCP, Gym's local sandbox provider in a scratch directory in place of OpenSandbox, and a scripted model: the model saw the four tools as gdpval_resources_server_<tool>; finish and abandon_task_finish each ended the run, and /verify saved the files; a turn that mixed finish with another tool did not end it.
  • The README command, through gym eval run's argument handling, gives vllm_model the model URL, key and name from the flags, and both settings. With real Pi 0.80.2, the real vllm_model server and a scripted engine, every request carried temperature 1.0 and top_p 0.95, and a context-length error made Pi compact and finish. Without the two overrides, the run stopped with no submission.
  • pre-commit run --all-files: passed, with no changes.
  • Independent review: three rounds before the rebase onto main with feat(pi): use MCP tool grants in sandbox sessions #4587 (runtime wiring, tests and CI, docs and compatibility, and Pi integration and scale; then the fixes, a fresh full pass and PDF reading in the judges; then the fixes again and a maintainer pass), a pass after that rebase, whose fixes are included, a pass of fc87770, a pass of the test change, whose two suggestions are included, and a pass of the README's timeout note, whose wording fix is included.
  • End to end on a GPU cluster: see Rollouts.

Rollouts

Smoke of fc87770 on main 4c66403, on a GPU cluster with the same model as the runs below. It ran from #4591's head ff00cd9, which adds #4590 and the Codex config; neither changes the Pi path. It used the README's gym eval prepare and gym eval run commands with the placeholders filled in, --limit 3, and its own output, log and deliverables paths. The cluster has no OpenSandbox, LibreOffice or Tavily key, so a local env.yaml ran the task sandboxes under Apptainer with the GDPVal image and turned judging off, and TAVILY_API_KEY was a placeholder (no run called web_search).

  • No failure rows; all 32 model calls returned HTTP 200.
  • 2 runs ended on finish, and /verify saved the files and finish_params.json under task_<id>/repeat_0/. In one of them, Pi's argument check rejected the first finish call (result in place of reason), and the model called it again correctly. No model call followed a successful finish.
  • 1 run ended on a model call that hit the 32,768-token limit while still reasoning (its 6th call), so it submitted nothing, as 16 of the 220 runs below did.

The earlier smoke and the 220-task run below used #4178 before it merged, when the Tavily key defaulted to a placeholder (dummy). So every web_search call failed with a 401: 140 calls in 54 of the 220 tasks, none in the earlier smoke. main now refuses to start without TAVILY_API_KEY.

Smoke on #4178 at bf9f8db, merged with main, #4587, #4588 and #4586, 3 tasks with the same model, sandbox and overrides as the full run below:

  • All 3 runs ended on finish, and /verify saved the files, finish_params.json and the reference files under task_<id>/repeat_0/, the folder fix: decouple GDPVal and Stirrup #4178 now takes from the rollout id.
  • No model call followed a successful finish. In 1 run, Pi's argument check rejected the first finish call (no reason), and the model called it again correctly.
  • 119 model calls, all HTTP 200; no failure rows.

220 GDPVal tasks with Pi 0.80.2, from #4178 at fd1cb9e merged with main plus #4587 (an earlier revision, without its later refusal of a finish call from a reply cut off at the output limit; none of the run's 208 finish calls came from such a reply), the HOME change from #3902, and #4586:

  • Model: an internal checkpoint served with vLLM, 262,144-token context, 32,768 output tokens per call. It was reached through openai_model with propagate_upstream_http_status_codes: [400], so context-length errors reached Pi, and with temperature 1.0 and top_p 0.95 in its extra_body.
  • Pi: 16 tasks at a time and a 3,600 s timeout, as in the earlier Pi run. This config's defaults are 32 and 10,800 s.
  • Sandbox: Apptainer with the GDPVal image and a private /tmp per sandbox (--containall). The OpenSandbox path the README describes has not been run with Pi.
  • Judging: generation with judge_deliverables: false, then the GPT-5.5 / Gemini 3.1 Pro / Opus 4.8 panel, with:
    • multistage ELO with 18 references, stages 45 → 220 × 4;
    • a rubric re-judge with gym eval reverify.

Scores, compared with the earlier Pi run (athitten#2) counted the same way:

This PR athitten#2
ELO (comparison/eval_elo) 1182.8 1150.6
Rubric over the same 217 tasks, no submission = 0 78.4 79.3
Same 217 tasks, without the runs that ended on a capped call 84.7 over 201 83.2 over 206
  • ELO final stage:
    • 218 of 220 tasks judged against the same 4 references as before.
    • Accepted at 99.1% coverage, not degraded, no imputed losses.
    • Left out: 2 tasks whose files are too large for every judge; the earlier run also left out both.
    • Runs that did not submit were judged as empty submissions and count as losses, so this number already charges them.
  • Rubric:
    • Left out: 2 tasks over a judge's input limit (the same 2 as before) and 1 task that GPT-5.5 rejected three times (the same as for Codex).
    • Over all 220 tasks, with unjudged tasks as 0: 77.4 against 78.6.
  • Generation:
    • 204 runs called finish. In 4, Pi's argument check rejected the first call and the model called it again.
    • 16 never did: each ended on a model call that hit the 32,768-token limit while still reasoning, mostly within its first few calls. The earlier run had 11 such runs.
    • Pi does not recover from a capped call, and under fix: decouple GDPVal and Stirrup #4178 a run that never calls finish submits nothing. That is why the rubric is lower even though the other tasks score higher.
    • 6,449 model calls, with 4 context-length errors; Pi compacted and finished all 4.
    • Two vLLM stalls on one node failed 58 attempts across 46 tasks; all 46 were rerun from the start on another node and completed.
    • Median 17 model calls and 6 minutes per task (earlier: 19 and 9.5).
  • No web_search call worked (placeholder key, see above). fetch_web_page worked.

The setup is not identical to the earlier run: harness-neutral prompt, finish over MCP, a page-fetch tool. So the differences are not from code alone.

Compatibility and benchmark impact

  • None for the Stirrup benchmark (gdpval): config.yaml, the prepare.py output and the Stirrup prompt are unchanged.
  • Pi scores use the harness-neutral prompt, so they are not AA v2 scores.
  • A Pi run that reaches its timeout before a successful finish is judged with no submission and is not retried. Stirrup reports the same event with stop_reason: wall_time, which GDPVal masks as agent_timeout, and --resume reruns it. Pi does not set it yet; a follow-up PR on the Pi agent will. The README says so in "Run another harness". None of the runs above timed out.
  • Until fix(pi): record the context-overflow outcome in JSON mode #4588 merges, with the README's setting that sends context-length errors to Pi, a run whose context still overflows after one compaction fails instead of being judged as no submission, so it is left out of the score and --resume reruns it. None of the runs above hit this: all 4 context-length errors recovered after one compaction.

Checklist

  • I have read the contributing guidelines.
  • The change is focused; unrelated "drive-by" edits are tracked as separate issues/PRs.
  • Tests added or updated and pass locally, or N/A for docs-only / non-code changes (so CI unit/server checks pass when applicable).
  • Documentation added or updated, or N/A with justification.
  • Pre-commit checks pass locally (pre-commit run --all-files) (so CI lint/format checks pass).
  • New source files include the required Apache-2.0 SPDX header.
  • All commits have DCO sign-off (git commit -s) (so the DCO check passes).

@athitten athitten added feature New capabilities, enhancements, or enablement work area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers labels Oct 14, 2026
@copy-pr-bot

copy-pr-bot Bot commented Oct 14, 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.

@athitten

Copy link
Copy Markdown
Contributor Author

/ok to test c40a782

@athitten
athitten marked this pull request as ready for review October 21, 2026 08:24
@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team October 21, 2026 08:24
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the needs-review PR is ready for code review and waiting on a reviewer label Oct 21, 2026
@athitten
athitten requested a review from yaoyu-33 October 21, 2026 08:29

@svcnvidia-nemo-ci svcnvidia-nemo-ci 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.

SHIP — LGTM — no reliability concerns.

Reviewed all six changed files and traced the Pi preset through dataset preparation, prompt materialization, sandbox/MCP execution, verification, and multi-stage deliverable reuse. No actionable findings. The shared writer preserves Stirrup’s row output while omitting request tools for Pi.

Validation was source-only; tests and rollouts were not executed in this read-only review.

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.

@athitten
athitten force-pushed the athitten/gdpval-pi-4178 branch from c40a782 to fc87770 Compare October 21, 2026 14:09
@athitten

Copy link
Copy Markdown
Contributor Author

/ok to test fc87770

@athitten

Copy link
Copy Markdown
Contributor Author

/review reset=true

@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team October 21, 2026 14:10
@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team October 21, 2026 14:10
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

@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 the Pi preset and the harness-neutral rows. Reviewed at 9eeb8a0.

  • pi.yaml resolves cleanly (gym env resolve with the README's vllm_model overrides): Stirrup is removed, the environment server points at gdpval_pi_agent over MCP, and every Pi key is a PiAgentConfig field on main.
  • prepare.py writes byte-identical output after the write_benchmark refactor, and the harness-neutral rows equal those rows without the tool list.
  • The judges, references and /verify path are the same as Stirrup's, so score differences come from the harness settings. The two inline comments are about where those differ.

Comment thread benchmarks/gdpval/pi.yaml
# Per model call.
max_output_tokens: 32768
# The Pi process, inside the environment server's default_episode_timeout_seconds.
timeout: 10800

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.

benchmarks/gdpval/pi.yaml:36

When Pi reaches this timeout before calling finish, its response is incomplete without stop_reason: wall_time. GDPVal's verify masks and retries a run only on that stop reason (resources_servers/gdpval/app.py:972), so a Pi timeout is judged as an empty submission, while a Stirrup timeout is retried. That lowers Pi's score relative to Stirrup's. The PR body mentions it, but the README does not. Could you add a line to the "Run another harness" section? The lasting fix is for Pi to set stop_reason: wall_time on a confirmed timeout, maybe as a follow-up. Masking on the agent-timeout key would not work, because Pi's metadata always carries that budget.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in benchmarks/gdpval/README.md:448-450: "Run another harness" now says that a Pi run that times out before a successful finish is judged as an empty submission and not retried, while a Stirrup timeout is masked and rerun on --resume. Having Pi set stop_reason: wall_time on a confirmed timeout will come in a follow-up PR on the Pi agent.

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.

Verified at f0c065e; the README note matches the code. Thanks.

- Deliverables are stored by task and repeat only, so give each run its own `PERSIST_DELIVERABLES_DIR`, for example
by changing `gdpval_pi` in the export above. A run into another run's directory replaces that run's files, and
re-judging the earlier run then judges the later one's.
- The prompt and the harness differ from the certified Stirrup setup, so these are not AA v2 scores.

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.

benchmarks/gdpval/README.md:448

Could you share a reference point for these settings? The 220-task numbers in the PR body come from a different setup than this preset: openai_model, concurrency 16, a 3,600 s timeout, an earlier #4587 revision, and a placeholder Tavily key (web_search returned 401 on 140 calls across 54 tasks). The only comparison is with an earlier Pi run. One Stirrup run on the same checkpoint, judge panel and references (ELO and rubric over the same tasks) would show whether Pi is a fair stand-in. A Pi rerun of this pi.yaml with a real Tavily key would also help.

@athitten

Copy link
Copy Markdown
Contributor Author

/ok to test f0c065e

@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.

Re-reviewed at f0c065e. The new README note on timeouts is accurate: Pi still sets no stop_reason, and GDPVal masks only wall_time. Thanks.

The baseline question in the README thread is still open: one Stirrup run on the same checkpoint, judge panel and references, or a note that none exists, would settle it.

OUTPUT_FPATH = DATA_DIR / "gdpval_benchmark_harness_neutral.jsonl"


def prepare() -> Path:

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.

benchmarks/gdpval/prepare_harness_neutral.py:20

Non-blocking: this script is fine, but a reader who finds two GDPVal prepare scripts has to work out why. Could you say so where people look first?

  • In the README's "Run another harness" section and in prepare.py's docstring: gdpval/pi (and later gdpval/codex) use prepare_harness_neutral.py, which writes the same rows without the tool list. Stirrup takes its tools from the request, while Pi and Codex get them over the MCP grant and reject a tool list in the request.
  • Why it is a separate script: gym eval prepare calls the benchmark's prepare_script with no arguments (prepare_script_args can only be set on the command line), and the output path must match jsonl_fpath. One sentence is enough.

As a follow-up, not for this PR: if a benchmark YAML could set prepare_script_args per dataset, GDPVal could keep a single prepare.py with a tools flag.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks @yaoyu-33 will add in the follow-up PR. I have a list of follow-up items for GDPVal, Pi and Codex, added this to that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Also the Stirrup and pi runs are still queued, will share the numbers once available

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed in #5076: README.md:435-440 and prepare.py:22-26. One correction to the reason: a benchmark YAML can set prepare_script_args (birdbench does), but gym eval prepare gives that same mapping to every dataset, so a dataset cannot pass its own arguments.

@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.

Approving at f0c065e. The Pi preset resolves and validates, prepare.py's output is unchanged, and the README now says how Pi timeouts are scored. The baseline question and the prepare-script note are non-blocking follow-ups.

@yaoyu-33 yaoyu-33 added ready-to-merge PR is approved, current, and waiting for final CI or merge and removed needs-review PR is ready for code review and waiting on a reviewer labels Oct 22, 2026
@athitten
athitten added this pull request to the merge queue Oct 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 23, 2026
@athitten
athitten added this pull request to the merge queue Oct 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

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

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 23, 2026
@athitten
athitten added this pull request to the merge queue Oct 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

Merged via the queue into main with commit 97ed636 Oct 23, 2026
52 of 58 checks passed
@athitten
athitten deleted the athitten/gdpval-pi-4178 branch October 23, 2026 12:18

This branch was previously deployed

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

Labels

area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers feature New capabilities, enhancements, or enablement work 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.

3 participants