Skip to content

Add CritPt Benchmark - #1588

Merged
gwarmstrong merged 31 commits into
mainfrom
fsiino/critpt-benchmark-fix-dco
Jun 16, 2026
Merged

gwarmstrong merged 31 commits into
mainfrom
fsiino/critpt-benchmark-fix-dco

Conversation

@fsiino-nvidia

@fsiino-nvidia fsiino-nvidia commented Jun 12, 2026 •

Copy link
Copy Markdown
Contributor

Fixes DCO issue in #1537

--

Migrates the CritPt benchmark from nemo-skills into nemo-gym. This keeps the workflow gym-shaped (per-rollout reward flowing through the standard /verify contract).

How it works in gym:

  • Architecture - Single phase: agent runs per-rollout /run -> /verify.

  • Batching - Resources server buffers concurrent verify() calls until 70 unique problem_ids accumulate, then fires once and resolves all 70 awaiting futures with the same aggregate accuracy

  • num_repeats > 1 - Each repeat of a problem_id opens a new pending batch. N repeats -> N independent AA API calls.

  • Reward - Same as skills in that the aggregate is distributed to all batch members as their reward.

  • Headline metric - pass@k/accuracy via compute_metrics override. Numerically equal to nemo-skills' accuracy at num_repeats=1.

Test results:
With ultra mopd/step36 checkpoint:

Key metrics for critpt_benchmark_agent:
{
    "mean/reward": 0.05714285714285713,
    "mean/accuracy": 0.05714285714285713,
    "mean/timeout_rate": 0.0,
    "mean/input_tokens": 6107.028571428571,
    "mean/output_tokens": 2514.1857142857143,
    "mean/total_tokens": 8621.214285714286
}

wandb: https://wandb.ai/nvidia/fsiino-gym-dev/runs/lle631hq

Signed-off-by: Frankie Siino <[email protected]>
Signed-off-by: Frankie Siino <[email protected]>
…prompt_fpath, fix requirements path, add tests

Signed-off-by: Frankie Siino <[email protected]>
…for pydantic serialization warnings

Signed-off-by: Frankie Siino <[email protected]>
- Log per-verify buffer fill in verify()

- Add /status route for curling

Signed-off-by: Frankie Siino <[email protected]>
Signed-off-by: Frankie Siino <[email protected]>
Signed-off-by: Frankie Siino <[email protected]>
Signed-off-by: Frankie Siino <[email protected]>
This reverts commit 65c860b.

Signed-off-by: Frankie Siino <[email protected]>
Signed-off-by: Frankie Siino <[email protected]>
- Move custom agent + example dataset into resources_server config (matches the convention for custom-agent paired benchmarks)
- Trim benchmarks/critpt/config.yaml; delete unused agent config
- Move example_metrics.json to resources_server data dir; regenerate against the curated example.jsonl
- Simplify benchmarks/critpt/data/.gitignore to *.jsonl

Signed-off-by: Frankie Siino <[email protected]>
- Correct reward in benchmark readme

- Correct log prefix in /status

- Distinguish flat-field vs pre-materialized jsonls

- Fix output_jsonl_fpath collision risk

Signed-off-by: Frankie Siino <[email protected]>
Signed-off-by: Frankie Siino <[email protected]>
@fsiino-nvidia fsiino-nvidia changed the title Fsiino/critpt benchmark fix dco Add CritPt Benchmark Jun 12, 2026
cmunley1
cmunley1 previously approved these changes Jun 12, 2026

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

would be good to reproduce some other models eg kimi, minimax, but lgtm

@cmunley1
cmunley1 requested a review from jiacheng-xu June 12, 2026 21:14

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

small request for additional fields

type: example
jsonl_fpath: resources_servers/critpt/data/example.jsonl
prompt_config: benchmarks/critpt/prompts/turn1.yaml
num_repeats: 1

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.

can you add the license?

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.

also description and value?

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.

Added all 3 in 719cd07 . Thanks!

Signed-off-by: Frankie Siino <[email protected]>
@gwarmstrong
gwarmstrong merged commit 74ebce9 into main Jun 16, 2026
16 checks passed
@gwarmstrong
gwarmstrong deleted the fsiino/critpt-benchmark-fix-dco branch June 16, 2026 21:25
linj-glitch added a commit that referenced this pull request Jun 22, 2026
…nt README (#1642)

## Summary

Fixes two CI breakages on `main` introduced by the CritPt benchmark
(#1588). Both fail unit/server CI for any PR once it is merged with
current `main`:

1. **`resources_servers/critpt/configs/critpt.yaml`** referenced
`${artificial_analysis_api_key}` with no definition or default.
`list_benchmarks()` (chained via `benchmarks/critpt/config.yaml`) cannot
resolve it, failing
`tests/unit_tests/test_benchmarks.py::TestListBenchmarks::test_lists_found_benchmarks`
and dropping unit-test coverage below the 96% gate (the errored test
stops covering `benchmarks.py`). Changed to
`${oc.select:artificial_analysis_api_key,null}` so it resolves to `null`
when unset — matching the default-bearing pattern used by sibling
configs (e.g. `labbench2_vlm`'s `${oc.select:judge_api_key,unset}`,
`frontierscience_judge`'s `${oc.env:NVIDIA_API_KEY,null}`). The override
key name is unchanged, so any existing `artificial_analysis_api_key`
config/env override still applies.

2. **`responses_api_agents/critpt_agent`** shipped without a
`README.md`. `ng_test_all` counts it as a candidate module but not a
testable one, failing the total-vs-tested assertion (`Mismatch on the
number of total modules found (120) ... (119)`) on **every**
server-suite shard. Added a `README.md` describing the two-turn agent.

## Testing

- `pytest tests/unit_tests/` → 290 passed; coverage **96.20%** (was
95.87%)
- Module discovery: **120 candidates == 120 testable**
- `critpt` server test is unaffected (it constructs its config directly
with a dummy key and never resolves the YAML interpolation)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Lin Jia <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
ritaneves pushed a commit that referenced this pull request Jun 25, 2026
Fixes DCO issue in #1537

--

Migrates the CritPt benchmark from nemo-skills into nemo-gym. This keeps
the workflow gym-shaped (per-rollout `reward` flowing through the
standard `/verify` contract).

**How it works in gym:**
- Architecture - Single phase: agent runs per-rollout `/run` ->
`/verify`.

- Batching - Resources server buffers concurrent `verify()` calls until
70 unique `problem_id`s accumulate, then fires once and resolves all 70
awaiting futures with the same aggregate accuracy

- `num_repeats > 1` - Each repeat of a `problem_id` opens a new pending
batch. N repeats -> N independent AA API calls.

- Reward - Same as skills in that the aggregate is distributed to all
batch members as their `reward`.

- Headline metric - `pass@k/accuracy` via `compute_metrics` override.
Numerically equal to nemo-skills' `accuracy` at `num_repeats=1`.

**Test results**:
With ultra mopd/step36 checkpoint:
```
Key metrics for critpt_benchmark_agent:
{
    "mean/reward": 0.05714285714285713,
    "mean/accuracy": 0.05714285714285713,
    "mean/timeout_rate": 0.0,
    "mean/input_tokens": 6107.028571428571,
    "mean/output_tokens": 2514.1857142857143,
    "mean/total_tokens": 8621.214285714286
}
```
wandb: https://wandb.ai/nvidia/fsiino-gym-dev/runs/lle631hq

---------

Signed-off-by: Frankie Siino <[email protected]>
Signed-off-by: Rita Fernandes Neves <[email protected]>
ritaneves pushed a commit that referenced this pull request Jun 25, 2026
…nt README (#1642)

## Summary

Fixes two CI breakages on `main` introduced by the CritPt benchmark
(#1588). Both fail unit/server CI for any PR once it is merged with
current `main`:

1. **`resources_servers/critpt/configs/critpt.yaml`** referenced
`${artificial_analysis_api_key}` with no definition or default.
`list_benchmarks()` (chained via `benchmarks/critpt/config.yaml`) cannot
resolve it, failing
`tests/unit_tests/test_benchmarks.py::TestListBenchmarks::test_lists_found_benchmarks`
and dropping unit-test coverage below the 96% gate (the errored test
stops covering `benchmarks.py`). Changed to
`${oc.select:artificial_analysis_api_key,null}` so it resolves to `null`
when unset — matching the default-bearing pattern used by sibling
configs (e.g. `labbench2_vlm`'s `${oc.select:judge_api_key,unset}`,
`frontierscience_judge`'s `${oc.env:NVIDIA_API_KEY,null}`). The override
key name is unchanged, so any existing `artificial_analysis_api_key`
config/env override still applies.

2. **`responses_api_agents/critpt_agent`** shipped without a
`README.md`. `ng_test_all` counts it as a candidate module but not a
testable one, failing the total-vs-tested assertion (`Mismatch on the
number of total modules found (120) ... (119)`) on **every**
server-suite shard. Added a `README.md` describing the two-turn agent.

## Testing

- `pytest tests/unit_tests/` → 290 passed; coverage **96.20%** (was
95.87%)
- Module discovery: **120 candidates == 120 testable**
- `critpt` server test is unaffected (it constructs its config directly
with a dummy key and never resolves the YAML interpolation)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Lin Jia <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: Rita Fernandes Neves <[email protected]>
bxyu-nvidia pushed a commit that referenced this pull request Sep 21, 2026
CritPt currently reports only the formatting turn's token usage,
dropping the solve turn. Sum both turns into the existing response
`usage` so the standard input, output, and total token metrics cover the
complete task. This follows [Artificial Analysis's
methodology](https://artificialanalysis.ai/methodology/intelligence-benchmarking#critpt),
which includes both solving and answer parsing.

The change reuses the shared usage accumulator and adds no metrics or
configuration. If either turn omits usage, report `null` rather than a
partial total. The second-turn output still goes to the same verifier;
prompts and scoring are unchanged. Existing saved rollouts retain their
old counts, so historical second-turn-only token metrics are not
directly comparable.

No separate issue is needed for this focused accounting bug. The
original integration and discussion in #1588 were reviewed. The agent
README documents the corrected usage semantics.

Validation (server-only change):

- `gym env test +entrypoint=responses_api_agents/critpt_agent
+should_validate_data=true` — 27 passed.
- `python -m pytest tests/unit_tests/test_openai_utils.py -o addopts=
-q` — 242 passed.
- `python -m pytest resources_servers/critpt/tests -o addopts= -q` — 57
passed outside the sandbox (the sandboxed TestClient hung).
- `pre-commit run --all-files` and `git diff --check` — passed.
- New regression cases checked against the original agent: six fail on
the original behavior and all pass with the fix. Coverage includes
combined counts, absent usage, optional detail counts, and preservation
of the second-turn answer.
- Live two-turn synthetic physics smoke through the agent, model
adapter, resource verifier, and standard token extraction: output tokens
**64 + 29 = 93**, input tokens **40 + 165 = 205**, total tokens **104 +
194 = 298**. Inspected the formatted answer and verified the returned
output matches turn two. The official AA scoring call was replaced with
a local synthetic-answer stub; no official grading quota or full
benchmark run was used.

Signed-off-by: Igor Gitman <[email protected]>

This branch was previously deployed

1 inactive deployment
public — a4fe4084 Deployed Jun 16, 2026 by copy-pr-bot[bot] via release / finalize / notify #384
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.

3 participants