Skip to content

fix: gpqa grader writes results.json so the harness picks it up#34

Closed
francisco-perez-sorrosal wants to merge 1 commit into
hexo-ai:mainfrom
francisco-perez-sorrosal:fix/gpqa-grader-results-json
Closed

fix: gpqa grader writes results.json so the harness picks it up#34
francisco-perez-sorrosal wants to merge 1 commit into
hexo-ai:mainfrom
francisco-perez-sorrosal:fix/gpqa-grader-results-json

Conversation

@francisco-perez-sorrosal

Copy link
Copy Markdown

Problem

The gpqa task's grader never produces results the harness can read, so gpqa runs are silently scored as a "warning" and the scores never reach the feedback loop.

The orchestrator runs each task's evaluate.py with only --gen-dir and then reads gen-dir/results.json:

  • run_evaluation() invokes [python, evaluate.py, "--gen-dir", gen_directory] (no --output).
  • It then checks os.path.exists(gen-dir/results.json) (Names.RESULTS_JSON).

The gpqa grader, however, defaulted its output to gen-dir/evaluation_results.json. With no --output passed, it wrote the wrong filename, so results.json was never created and run_evaluation() fell through to:

⚠ Evaluation completed but results.json not found

The sibling graders already honor this contract — lawbench writes results.json (its code even comments "required by orchestrator") and longcot-chess defaults to results.json. gpqa was the lone outlier.

Fix

Default the gpqa grader's output filename to results.json (the explicit --output flag still overrides). This is a one-file, three-line change in sia/tasks/gpqa/data/public/evaluate.py, plus a brief comment recording the contract so it does not drift again.

Why it's safe

The submission-discovery path is unaffected. The gpqa reference agent writes its submission into the results/ subdirectory, and find_submission_file() checks results/ before the gen-dir root — so the grader's own results.json at the gen-dir root is never mistaken for a submission. This is exactly how longcot-chess already behaves.

Tests

Added tests/test_gpqa_grader_output.py, which runs the real grader the way the orchestrator does (--gen-dir only) against the private ground truth and a synthetic submission, then asserts results.json (not evaluation_results.json) is written and scored correctly. Verified it fails against the previous grader and passes with this change. The existing eval/task/context/orchestrator suites continue to pass.

The orchestrator runs each task's evaluate.py with only --gen-dir and then
reads gen-dir/results.json (Names.RESULTS_JSON). The gpqa grader, however,
defaulted its output to gen-dir/evaluation_results.json, so under the harness
it produced no results.json: run_evaluation() fell through to the "results.json
not created by evaluate.py" warning and the gpqa scores never reached the
feedback loop. The lawbench and longcot-chess graders already default to
results.json (lawbench even notes it is "required by orchestrator"); gpqa was
the lone outlier.

Default the gpqa grader's output filename to results.json to match that
contract, and add a regression test that runs the real grader the way the
orchestrator does and asserts results.json (not the legacy name) is written.

The submission-discovery path is unaffected: the reference agent writes its
submission into the results/ subdirectory, which find_submission_file() checks
before the gen-dir root, so the grader's own results.json is never mistaken for
a submission.
@yogendrahexo

Copy link
Copy Markdown
Collaborator

Thanks for the PR. This issue is already being addressed in #31, so I'm closing this PR. If PR #31 doesn't end up covering everything, we'd be happy to revisit this.

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.

2 participants