Skip to content

Add SWE-Atlas-QnA benchmark evaluation - #1978

Closed
wasiahmad wants to merge 9 commits into
mainfrom
wasiahmad/swe-atlas-qna
Closed

wasiahmad wants to merge 9 commits into
mainfrom
wasiahmad/swe-atlas-qna

Conversation

@wasiahmad

Copy link
Copy Markdown
Contributor

No description provided.

…s server

Port the SWE-Atlas Codebase QnA verifier into a NeMo Gym resources server.
verify() grades a candidate codebase answer against per-task expert rubrics
via an LLM judge (one /v1/chat/completions call per rubric, run concurrently),
applies the negative-rubric score flip, and returns the strict "all must-have
rubrics pass" reward plus a soft agg_score and per-rubric breakdown.

- Grader system prompt + user template (identical across all tasks) live
  server-side under prompts/; per-task rubrics + problem_statement flow through
  verifier_metadata.
- Judge endpoint is a configurable OpenAI-compatible model server
  (SWE_ATLAS_QNA_JUDGE_* env vars), paired for now with simple_agent for a
  single-turn smoke test. The mini-swe-agent QnA harness lands separately.
- Data conversion script lives in the SWE-Atlas source repo; only the 5-row
  example.jsonl is committed (the full 124-task set carries canary GUIDs and is
  registry-bound, so it is gitignored).
- Tests mock the judge at the server_client boundary; 40 tests, 98% coverage.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: wasiahmad <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Jul 9, 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.

@wasiahmad
wasiahmad marked this pull request as draft July 9, 2026 21:24
@wasiahmad wasiahmad changed the title feat(swe_atlas_qna): add SWE-Atlas Codebase QnA evaluation Add SWE-Atlas-QnA benchmark evaluation Jul 9, 2026
wasiahmad and others added 8 commits July 9, 2026 14:33
Add benchmarks/swe_atlas_qna, chaining to the swe_atlas_qna rubric-judge
resources server. `gym eval prepare --benchmark swe_atlas_qna` converts the
124-task SWE-Atlas Codebase QnA set into the Gym benchmark JSONL (question at
the top level for prompt_config, rubrics + task identity in verifier_metadata).

- prepare.py resolves the SWE-Atlas source from SWE_ATLAS_DIR / the
  swe_atlas_dir kwarg, falling back to a shallow git clone of the public repo.
  The data is not committed (large + canary GUIDs); only prepare.py + config.
- config.yaml isolates the benchmark's agent wiring via _inherit_from. Paired
  with simple_agent as a placeholder (single-turn, no repo access) so the
  benchmark is preparable and listable now; swaps to the mini-swe-agent QnA
  harness once that lands.
- Verified: gym eval prepare emits 124 rows to the expected jsonl_fpath, and
  gym list benchmarks discovers swe_atlas_qna (domain=knowledge).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: wasiahmad <[email protected]>
…arness

Add responses_api_agents/mini_swe_agent_qna, a mini-swe-agent harness
specialized for SWE-Atlas Codebase QnA (forked from mini_swe_agent_2, minus
SWE-Bench patch/test logic).

- Drives the mini-swe-agent bash loop in a Gym sandbox (Apptainer .sif images
  via the pluggable sandbox provider). The task ends when the agent writes its
  answer to answer_path (/logs/agent/answer.txt, <<FINAL_ANSWER>> tags) and
  submits COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT; the harness reads that file out
  of the sandbox — there is no git patch.
- Reward is delegated to the swe_atlas_qna rubric-judge resources server /verify,
  keeping verification in one tested place; the full trajectory is returned for
  inspection.
- image_template resolves the .sif image from the row's verifier_metadata; a
  QnA-specific mini-swe config template (mswea_qa_config.yaml) drives the loop.
- Self-contained sandbox adapter (copied from mini_swe_agent_2) with its own
  tests. 30 tests, 97% coverage; ruff clean; config validates and the agent is
  discoverable via gym list agents.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: wasiahmad <[email protected]>
Add a verify() test ensuring problem statements or answers containing literal
{ } characters are inserted as values and never re-parsed by the judge prompt
template's str.format(), so brace-heavy code questions don't break grading.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: wasiahmad <[email protected]>
Wire benchmarks/swe_atlas_qna to the mini_swe_agent_qna harness instead of the
single-turn simple_agent placeholder. The benchmark now chains to the harness
config and attaches its benchmark dataset to an inherited copy of that agent,
so a rollout explores the repository in a sandbox before the rubric judge scores
the answer.

_inherit_from moves (not copies) the source instance, so the benchmark inherits
only the harness agent and leaves swe_atlas_qna_resources_server in place (the
inherited agent still references it for reward). Verified: gym env validate
passes, gym eval prepare emits 124 rows, and gym list benchmarks resolves the
benchmark to swe_atlas_qna_benchmark_mini_swe_agent.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: wasiahmad <[email protected]>
… mount

Relocate the agent's final-answer file from /logs/agent/answer.txt to
/sandbox/answer.txt (the sandbox mount point) so it is writable even when the
container image root is read-only — the Apptainer default. Writing to /logs
would otherwise fail silently and every task would score 0.

Updates the default answer_path, the QnA mini-swe template's write instruction,
the agent config, and the docs to the new path.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: wasiahmad <[email protected]>
…ret scan

The policy model is reached through the Gym model server, which ignores the
api_key, so the harness passes a literal "dummy_key". The CI secret scanner
flags any api_key="..." assignment; mark both (runner call + its test) with an
inline `pragma: allowlist secret` to clear the false positive.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: wasiahmad <[email protected]>
@cmunley1 cmunley1 mentioned this pull request Oct 20, 2026
7 tasks done
@svcnvidia-nemo-ci svcnvidia-nemo-ci added area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers feature New capabilities, enhancements, or enablement work labels Oct 20, 2026
@wasiahmad wasiahmad closed this Oct 30, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants