Repository navigation
fix(opencode_search,browsecomp_advanced_harness): parse markdown-emphasized judge verdicts - #6263
qiaochuz-nv wants to merge 1 commit into
Conversation
…asized judge verdicts
Both servers grade with the same judge prompt (browsecomp_advanced_harness
judge_prompt.py) and parse the reply with their own copy of
`re.finditer(r"correct:\s*(yes|no)\b", ..., re.IGNORECASE)`, last match wins.
A hosted judge (azure/anthropic/claude-sonnet-4-5) sometimes wraps the label
and/or value in markdown emphasis, as it did for tavily_search in the
2026-11-13 QA regression:
**extracted_final_answer:** China
**correct:** yes
The scan does not match `**correct:** yes`, `**correct**: yes`,
`correct: **yes**` or `*correct:* yes`. On such a reply both servers burn
every judge attempt (browsecomp 15 calls at temperature 1.0, opencode 4 calls
with a 30 s delay) and then score the row 0.0, so a correct answer counts as
wrong. When a reasoning judge also echoes a plain `correct: yes` inside its
think block, the last plain match is the echo, so a bold `**correct:** no`
verdict is overridden and a wrong answer scores 1.0.
Changes:
- Move the verdict and answer-line patterns next to the prompt they parse, as
JUDGE_VERDICT_RE and JUDGE_EXTRACTED_ANSWER_RE in
browsecomp_advanced_harness/judge_prompt.py (opencode_search already imports
its template from there), and use them in `_parse_judge` and
`parse_judge_verdict`.
- JUDGE_VERDICT_RE is the tavily_search pattern from #6260: emphasis is
allowed around the label and value, `\b` keeps the label the `correct`
field (not `incorrect`), and the value is exactly yes/no.
- The answer line accepts the same emphasis and leaves it out of the capture,
so `extracted_final_answer` reads `China`, not `** China`, and the
template-echo check still catches a bold echo.
Unchanged: last-match rule, case-insensitivity, retries, and each server's
handling of a reply with no verdict (scored 0.0 after the retries).
Tests: parametrized bold/italic variants and the plain form, near-misses that
must stay unparsed (`**extracted_final_answer:** yes`, `incorrect: yes`,
`[correct_answer]: yes`, `**correct:** maybe`, `correct: **yesterday**`),
a plain think echo before a bold `no` verdict, a bold template echo, and one
end-to-end grade per server (verify() / _judge_answer()) asserting reward 1.0
on the first judge call.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: qiaochuz <[email protected]>
|
/ok to test 53566c3 |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP WITH CARE
RISK: Add the required representative rollout and reward-comparison evidence
Both changed parsers determine fixed BrowseComp benchmark rewards through BrowseComp grading and OpenCode grading. The supplied validation includes stubbed grader replays and agreement on 48 live judge replies, but no representative model rollout or paired benchmark reward profile. The probe supports plain-reply compatibility; it does not show the reward distribution on representative benchmark outputs. The pinned rubric requires that comparison, and repository guidance requires representative real smoke rollouts for behavior-changing environment work. This is a validation gap, not a demonstrated scoring defect.
Could you add representative real smoke evidence for the affected pairings and inspect the final answers and verifier results? Compare base/head grading on the same saved benchmark answers and judge replies, reporting sample count, aggregate reward, unparsed counts, and the cause of each changed grade. Keeping the replies fixed isolates the parser change without requiring two full agent evaluations.
Acceptance should show unchanged grades for ordinary replies and explain changes caused by emphasized verdicts or rejected incorrect labels. Keep the existing first-call bold-yes assertions in the BrowseComp test and OpenCode test, including reward 1.0, answer China, and one judge call. Also retain the echoed-yes followed by bold-no result of reward 0.0.
I inspected all five changed files and traced both grading paths. I did not execute tests or rollouts; the checks requested above are proposed acceptance checks.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
| # yes/no. The answer line accepts the same emphasis and leaves it out of the captured answer, so | ||
| # the field reads `China`, not `** China`, and the template-echo check still sees a bold echo. | ||
| JUDGE_VERDICT_RE = re.compile(r"\**\bcorrect\**\s*:\s*\**\s*(yes|no)\b", re.IGNORECASE) | ||
| JUDGE_EXTRACTED_ANSWER_RE = re.compile(r"extracted_final_answer\**\s*:\s*\**\s*(.+?)[ \t]*\**[ \t]*(?:\n|$)") |
There was a problem hiding this comment.
RISK: Preserve literal asterisks in extracted answers
With extracted_final_answer: A*\ncorrect: yes, this pattern captures A; a plain *NSYNC similarly becomes NSYNC. The base parser kept those characters. These are unpaired literal asterisks, not emphasis, and the prompt requests the exact answer. Both BrowseComp and OpenCode now return the altered extracted_final_answer. Rewards still follow the verdict, so the defect affects the recorded answer rather than the score.
Could you separate label-closing markers from value formatting and unwrap value emphasis only when its outer markers are paired? The invariant is that accepting markdown must not remove unmatched characters from an otherwise plain answer. I cannot give a reliable one-line replacement because stars after the colon can close label emphasis or open value emphasis; blanket trimming would repeat this defect.
Proposed checks for both parsers: the inputs above must return (True, "A*", True) and (True, "*NSYNC", True). Also preserve A* with the label **extracted_final_answer:**. Retain the existing cases where **extracted_final_answer:** Paris, extracted_final_answer: **Paris**, and italic labels extract Paris. Keep bold template echoes unparsed and the plain think-block yes followed by a bold no verdict returning (False, "Lyon", True). These expectations are based on source inspection, not executed tests.
What changed and why
opencode_search and browsecomp_advanced_harness grade with the same judge prompt (
browsecomp_advanced_harness/judge_prompt.py). Each server parses the reply with its own copy ofre.finditer(r"correct:\s*(yes|no)\b", ..., re.IGNORECASE), and the last match wins. A hosted judge (azure/anthropic/claude-sonnet-4-5) sometimes wraps the label and/or value in markdown emphasis. It did this for tavily_search in the 2026-11-13 QA regression (fixed there by #6260):The scan does not match
**correct:** yes,**correct**: yes,correct: **yes**or*correct:* yes. On main this causes two wrong outcomes:correct: yes, and then gives a bold**correct:** noverdict. The last-match rule exists for this case, but the bold verdict does not match, so the last plain match is the echo and the row gets reward 1.0.This PR:
JUDGE_VERDICT_REandJUDGE_EXTRACTED_ANSWER_REinbrowsecomp_advanced_harness/judge_prompt.py, which opencode_search already imports its template from._parse_judgeandparse_judge_verdictuse them, so the two parsers cannot drift apart;JUDGE_VERDICT_RE. It allows emphasis around the label and the value.\bkeeps the label to thecorrectfield, so it cannot match insideincorrect, and the value must be exactlyyesorno;extracted_final_answerthen readsChina, not** China, and the template-echo guard still catches a bold echo.Unchanged: the last-match rule, case-insensitivity, the retry loops, and how each server handles a reply with no verdict at all (the row scores 0.0 after the retries).
User-facing / benchmark impact:
incorrect: yesis no longer read as ayesverdict. On main it was, because the old pattern had no word boundary beforecorrect.Issue
No issue: a follow-up to #6260. The 2026-11-13 full Gym QA regression found the gap in tavily_search, and its triage found the same parser copied into these two servers.
Validation
pytest resources_servers/opencode_search/tests resources_servers/browsecomp_advanced_harness/tests: 491 passed.app.pyandjudge_prompt.pywith this branch's tests): 20 failed. On this branch they all pass. The new tests cover:**extracted_final_answer:** yes,incorrect: yes,**incorrect:** yes,[correct_answer]: yes,**correct:** maybe,correct: **yesterday**;noverdict, which must stayno;verify()and opencode_judge_answer()return reward 1.0 on the first judge call.pre-commit run --files <changed files>: passed.Rollout evidence
Replay through each server's own grading path. The judge reply is the only stubbed part (Mac, Gym main
d04b6bb294vs this branch):correct: yesChinaChina(unchanged)**correct:** yes(regression shape)verify()''China**correct:** yes(regression shape)_judge_answer()judge_parsed: false, 4 attemptsjudge_parsed: true, 1 attempt,Chinacorrect: yes, then**correct:** noverify()** LyonLyoncorrect: yes, then**correct:** no_judge_answer()** LyonLyonLive judge probe (h100-207, azure/anthropic/claude-sonnet-4-5, temperature 1.0). I sent 6 question/answer pairs × 4 samples with this servers' prompt, and the same with tavily_search's prompt as a control, then parsed every reply with main's patterns and this branch's.
The judge used emphasis in none of the 48 live replies. The one bold reply on record is from the 2026-11-13 regression (1 of 5 tasks). So the live probe shows that plain replies are not affected; it does not exercise the bold path. The replay and the unit tests above cover the bold path.
No full rollout. browsecomp_advanced_harness needs a Tavily or Exa key plus a sandbox, and opencode_search needs a sandbox plus Exa. The change touches only the reply parser, and the replay runs it through each server's own grading function. Since the live judge did not use emphasis in 48 calls, a rollout would most likely not reach the changed path either.
Replay log, before and after