fix: honour the canonical-pin grace window in eval.verify (honest training PRs are auto-closed as eval:REJECT) - #232
Merged
ai-hpc merged 1 commit intoJul 25, 2026
Conversation
The pin-grace window from gittensor-model-hub#121 (issue gittensor-model-hub#118) reached only validate_pr_body_canonical_pin and verify_remote_proof_bundle. The third check — check_canonical_dataset_claim inside eval.verify.verify_submission, reached via verify_remote_proof_bundle_scores — still compared the bundle's mix_manifest.sft_sha256 against the single pin at the checked-out tree (live main). An honest training-track PR whose pin advanced mid-training passed stage 1 and was then rejected as eval:REJECT, which training_track.yml auto-closes. Thread the window gate_training_pr already computes down through verify_remote_proof_bundle_scores -> _download_and_verify_bundle -> verify_submission, and give record_merged_ledger_entry the PR's merge_base_ref so the merge-time ledger path computes the same window (otherwise a merged run can be logged eval:REJECT and skip its frontiers.json update). The new parameter defaults to None, so the standalone `python -m eval.verify` validator path keeps requiring the pin at datasets/canonical.json. Closes gittensor-model-hub#231
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.
SparkDistill contribution
Track
Select the one track this PR belongs to.
Summary
Closes #231. Restores the canonical-pin grace window from #121 (issue #118) on the
one code path that still ignored it.
Root cause
#121 added a merge-base→HEAD grace window so a training-track PR is not rejected
when a dataset-track merge advances
datasets/canonical.jsonmid-training. Thewindow reaches two of the three
mix_manifest.sft_sha256checks:validate_pr_body_canonical_pinverify_remote_proof_bundlecheck_canonical_dataset_claiminsideeval.verify.verify_submissiongate_training_prcomputesacceptable_sft_shas, butverify_remote_proof_bundle_scoresnever received it, so
_download_and_verify_bundlecalledverify_submission(bundle_dir, frontier, attestation=attestation)— andverify_submissionhad no such parameter.
check_canonical_dataset_claimthen fell back toallowed = {canonical_sft_sha256()}: the single pin at the checked-out tree, whichtraining_track.ymlchecks out frompull_request.base.ref(livemain).Reproduction with a bundle pinned to the merge-base sha and a window of
{base, head}:The error text reports
allowed 1 pin(s)— proof the grace set never arrived.eval:REJECTis in_AUTO_CLOSE_EVAL_LABELS, andtraining_track.ymlruns the gatewith
--close-on-reject, so the honest PR is closed automatically.Fix approach
Thread the already-computed window down the call chain, nothing more:
gate_training_pr→verify_remote_proof_bundle_scores→_download_and_verify_bundle→
verify_submission→check_canonical_dataset_claim(which already acceptsacceptable_sft_shas).record_merged_ledger_entryshares_download_and_verify_bundle, so it gains amerge_base_refargument and computes the same window via the existing_canonical_sft_sha256s_for_pr_windowhelper;training_track_ledger.ymlpassespull_request.base.sha. Without this, the pin can advance again between the gate joband the ledger job, recording
eval:REJECTfor an already-merged run and skipping itsruns/frontiers.jsonupdate — which would then mis-tier every later submission.Impact
during their train→eval cycle. This is what the PR template already promises:
"any pin from merge-base through HEAD is accepted".
merged/(merged+closed), which gates eligibility at 80% andmultiplies earned score) is no longer damaged by an automated wrong-close.
frontiers.jsonstay correct for runs that were merge-eligibleat gate time.
Risk and tradeoffs
acceptable_sft_shasandmerge_base_refboth default toNone, which preserves today's strict behaviour. The standalonepython -m eval.verifyvalidator path is unchanged and still requires the pin atdatasets/canonical.json.merge-base→HEAD history of
datasets/canonical.json; a miner cannot inject anarbitrary sha, and any pin outside the window is still
canonical_dataset_failed(covered by a test). The gate and the verify stage now agree on one set instead of
silently disagreeing.
Tests
Three regression tests in
tests/test_training_track_pin_grace.py(the file #121 added):verify_submissionaccepts a merge-base pin, still rejects a pin outside the window,and
verify_remote_proof_bundle_scoresno longer tiers a base-pin bundleeval:REJECT.All three fail on
mainand pass with this change.One existing test fake (
fake_verify_submission) gained**kwargsto accept the newkeyword argument.