Repository navigation
fix(eval): bind every judge failure that ordinary recovery selects - #6373
AdamRajfer merged 3 commits into
Conversation
bind_judge_failures compared _ng_failure_class to judge_failed in two places, while ordinary recovery selects a judge failure through _is_judge_failure, which also accepts the retained classification (_ng_failure_legacy_class) and leaves out omitted rollouts. A record classified judge_unparseable that keeps judge_failed as its retained classification was therefore selected by ordinary recovery and left out of the automatic re-verification binding, so the re-verification found nothing to settle and the run stayed incomplete. Both checks now use _is_judge_failure, so the failure cap and the binding cover the same records the ordinary selection does. Signed-off-by: Adam Rajfer <[email protected]>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP WITH CARE
One RISK: the binding now includes retained judge-failure classifications, but settlement still rejects them after the judge call.
I inspected both changed files and traced the affected selection, admission, settlement, and reload paths. I did not execute tests in this read-only review.
Inline comments (escaped v1):
-
nemo_gym/rollouts/rollout_records.pyline 515: RISK: Allow newly bound judge failures through settlement validationThe newly bound
judge_unparseablerows still cannot settle. Using the new fixture, let/verifyreturn the same savedresponsewithreward=1.0. The binding now sends that row to the judge, butis_rejudgment_ofrequires the predecessor's canonical class to bejudge_failedorNone. is_rejudgment_failure_of likewise requires canonicaljudge_failed.Consequently, check_rejudgment raises
ConfigErrorsaying the result does not settle the saved judge failure. Cleanup withdraws the admission, and the original failure stays due. A mixed batch cannot save its other grades either because settlement validates every row before writing. These restrictions predate this PR, but widening the binding makes them reachable through automatic recovery, which now calls the judge and then fails.Could you align both predecessor checks with the binding's retained-class contract?
matches_failure_classis already imported in this module. The focused replacement is:@@ is_rejudgment_of - failure.get("_ng_failure_class") in ("judge_failed", None) + (failure.get("_ng_failure_class") is None or matches_failure_class(failure, {"judge_failed"})) @@ is_rejudgment_failure_of - failure.get("_ng_failure_class") == "judge_failed" + failure.get("_ng_failure_class") is not None + and matches_failure_class(failure, {"judge_failed"})
Keep the remaining answer, identity, and grade guards unchanged. Saved results with no failure class must still support successful regrading without becoming eligible predecessors for saved failed rejudgments.
Proposed acceptance checks, not executed:
- Parameterize the real reverify-path test over canonical
judge_failedand the new retained classification. Both should make one/verifycall, settle reward1.0with the original answer/run/attempt, survive a freshRolloutStore.read, clear pending admissions and due work, and make no call on a second pass. - For the retained predecessor, return another canonical
judge_failedoutcome with a distinct failure ID and the same answer. It should persist as the selected failure, consume one additional failure attempt, and reload without conflict. - Retain the saved-result regrading assertions: one verify call, the same answer and attempt, and no remaining due work. Verify that a classless saved result still cannot satisfy
is_rejudgment_failure_of. - Keep spent failures excluded with
skip_spent=True, omitted/non-judge rows unbound, and changed-answer or foreign-identity results rejected.
- Parameterize the real reverify-path test over canonical
Review generated by codex. This was a full review. Request a full review with /review reset=true.
giuliolovisotto
left a comment
There was a problem hiding this comment.
I reproduced the settlement failure at 35d28c37 with two rollouts in the same automatic recovery pass. One had _ng_failure_class=judge_failed. The other had _ng_failure_class=judge_unparseable and _ng_failure_legacy_class=judge_failed. Both reached the mock verifier, which graded the original saved answers with reward=1.0. Settlement raised ConfigError on the second rollout and withdrew both admissions. After reopening the source store, neither grade was saved and both rollouts were due again.
Please update the predecessor checks in is_rejudgment_of and is_rejudgment_failure_of to recognize the retained judge-failure class the binding now accepts. Keep the existing distinction for classless saved results, which can be regraded successfully. The answer and attempt identity checks should still apply.
Please add a regression test that runs the mixed batch through automatic recovery, reopens the source store, and checks that both grades persisted and that a second pass makes no verifier calls. The two new binding tests and the existing canonical recovery test all passed in my run.
…ned class The settlement predicates still required the canonical judge_failed class, so a failure classified judge_unparseable that keeps judge_failed as its retained class was selected and bound, then refused at settlement, which withdrew every admission of the pass. Both predicates now match the retained class too, and a saved result with no class still settles as before. Signed-off-by: Adam Rajfer <[email protected]>
|
🤖 Adam’s AI assistant Thanks, reproduced. Two new tests. |
|
@AdamRajfer, thanks. I verified your fix at I found one remaining issue when the verifier returns another judge failure. Here's how I reproduced it using the same test helpers:
I saw one verifier call on each pass. After the first retry, the source still held the original failure ID, the failure count was 1, and the rollout was still due. I expected the new failure ID to persist, the count to reach 2, and the next pass to make zero calls. The withdrawal check in settle_rejudgments checks only the canonical class, so it withdraws this result before the updated repeat-failure predicate sees it. Could you make that check recognize the retained judge-failure class too, keep the existing withdrawal behavior for saved results, and cover the two-attempt case through recovery and reload? |
… when settling a re-judgment The withdrawal check in settle_rejudgments compared only the canonical failure class with judge_failed, so a repeat judge failure whose canonical class is judge_unparseable was withdrawn before the repeat-failure predicate saw it. It now recognizes the retained judge_failed classification too, and a test covers the two-attempt case through recovery and reload. Signed-off-by: Adam Rajfer <[email protected]>
|
@giuliolovisotto thanks for verifying the first fix and for the exact repro. The withdrawal check in |
giuliolovisotto
left a comment
There was a problem hiding this comment.
Verified both fixes at c34f3b8. The mixed batch keeps both grades after reload. With a two-attempt cap, a repeat judge_unparseable failure now persists under its new failure ID, the count reaches two, and the next recovery pass makes zero verifier calls. All 76 tests in the two focused recovery test files passed.
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/45236161198 |
Recovery selects records with
_is_judge_failure, but the automatic re-verification binding checked only the canonical class. Ajudge_unparseablerecord that keepsjudge_failedas its retained class was selected, then dropped, so re-verification printed "Nothing to be re-verified" and the run stayed incomplete.bind_judge_failuresinnemo_gym/eval/rollout_reverification.py: both checks use_is_judge_failure.is_rejudgment_ofandis_rejudgment_failure_ofinnemo_gym/rollouts/rollout_records.py, andsettle_rejudgments, also match the retained class.Tested: new unit tests in
tests/unit_tests/eval/test_rejudge_saved_judge_failures.py, including a batch through the real re-verification path.