fix(validator): skip synchronous eval for submissions with no artifact (#143)#175
Open
joaovictor91123 wants to merge 1 commit into
Conversation
mini-router#143) Infra/bugfix PRs that ship no submissions/final_model/best_theta.npy were being evaluated, failing with `missing_checkpoint`, and marked `failed` -- the state that closes them before a maintainer can merge (mini-router#143). The async paths already skip such submissions: the pipeline enqueue in /submit and queue.py both gate on `submission_artifact_id is not None`. The synchronous branch (`if settings.sync_eval_on_submit and not settings.uses_train_pipeline`) did not, so evaluate_submission ran on a checkpoint-less submission. Extract _should_sync_eval(settings, submission) and add the same artifact clause so the sync path matches the async ones. eval_runner's missing_checkpoint failure is left intact -- it is the correct behaviour when an artifact row exists but its checkpoint file is genuinely missing. Tested offline via the pure _should_sync_eval helper (no Postgres required): no-artifact -> skip, artifact present -> eval, sync disabled / train pipeline -> defer to async.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #143
Summary
Infra/bugfix PRs that ship no
submissions/final_model/best_theta.npywere being evaluated, failing withmissing_checkpoint, and markedfailed— the state that closes them before a maintainer can merge (#143). My own #117 was auto-closed exactly this way.The async paths already enforce "don't evaluate a submission with no artifact": the pipeline enqueue in
/submitandqueue.pyboth gate onsubmission.submission_artifact_id is not None.But the synchronous branch right below it was missed:
evaluate_submissionthen hits eval_runner.py"submission … does not have a checkpoint to evaluate"→missing_checkpoint→ submissionfailed.What Changed
validator/src/eval_backend/api/routes.py: extracted_should_sync_eval(settings, submission)and added the samesubmission_artifact_id is not Noneclause, so the synchronous path matches the two async paths. The decision still readssettings(as the async enqueue gate does); only the artifact guard is added.validator/tests/test_submit_sync_eval_gate.py(new, offline — no Postgres/GPU): the pure_should_sync_evaldecision is unit-tested — no-artifact → skip, artifact present → eval, sync disabled → skip, train pipeline → defer to async.docs/JOURNAL.md: replication-log entry per repository protocol (AGENTS.md §6).What This Deliberately Does NOT Change
eval_runner'smissing_checkpointfailure is left intact. That path is the correct behaviour when a submission genuinely has an uploaded artifact row whose checkpoint file is missing/corrupt. The fix is narrowly about not starting an eval for a submission that has no artifact at all — mirroring the existing async gate, not weakening the safety net.Why the artifact_id gate is the right signal (matching #143's proposal)
An infra/bugfix PR never uploads a bundle, so its submission's
submission_artifact_idstaysNone. #143 proposes exactly this: "only queue eval whensubmission_artifact_idis set." This applies that rule to the one code path that violated it.Notes
test_no_artifact_is_never_sync_evaluatedfails on pre-fixmain(the sync branch returnsTruefor a checkpoint-less submission) and passes after; the other three pass both ways. The test needs no database, so it runs in CI regardless of Postgres availability (the DB-backed validator tests skip without it).