feat(competition): submission preflight go/no-go with per-benchmark gap-to-king - #408
Merged
James-CUDA merged 2 commits intoJul 23, 2026
Merged
Conversation
…nblocks CI) A botched merge left nested git conflict markers in trinity/analysis/__init__.py (union_diagnostics vs oracle_column vs definition_of_done import blocks), so the package is invalid Python and ruff/import fail on every branch. __all__ already lists the symbols of all three modules, so all three import blocks are intended; keep them. Stacked here only to green this PR's CI while the same repair lands via James-CUDA#402/James-CUDA#405 -- it drops out on rebase once main is fixed.
…ap-to-king summarize_competition (James-CUDA#397) tells a miner the composite score-to-beat, but not whether their own run clears it or WHERE it falls short. The competition is composite: pr_eval approves only when the mean of the per-benchmark scores clears the reigning best_composite_score by win_margin. Add trinity.competition_preflight: given the leaderboard + a miner's {benchmark: score}, compute the composite the same way pr_eval does (mean over the declared benchmarks, an unscored board counting as 0.0), decide go/no-go against king + win_margin, and report the per-benchmark delta versus the reigning king plus the weakest board -- so the miner sees which benchmark is dragging the composite down before spending a PR. scripts/preflight_composite.py exits non-zero when the submission would not win. Pure stdlib -- no torch, no network. Offline tests only.
This was referenced Jul 22, 2026
fix(analysis): resolve unresolved merge-conflict markers in __init__ (package failed to import)
#405
Merged
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.
What does this PR do?
summarize_competition(#397) tells a miner the composite score-to-beat, but not whether their own run clears it, nor where it falls short. The competition is composite:pr_evalapproves only when the mean of the per-benchmark scores clears the reigningbest_composite_scorebywin_margin. So a miner needs to turn their own per-benchmark scores into that same composite and compare — before spending a PR.How
Add
trinity.competition_preflight: given the loaded leaderboard + a miner's{benchmark: score}, itpr_evaldoes (mean over the competition's declared benchmarks, an unscored board counting as0.0);king + win_marginand reports the exact gap to close;scripts/preflight_composite.pyrenders it and exits non-zero when the submission would not win:Scope
Pure stdlib — no torch, no network. New module + script + 10 offline tests; the substantive change touches no existing file. Companion to the merged
competition-object toolkit (#384 integrity, #387 standings, #397 score-to-beat).Note on CI / the analysis/init.py change in this diff
maincurrently has unresolved git merge-conflict markers insrc/trinity/analysis/__init__.py(a botched merge → the package is invalid Python, soruff/import fail on every branch). This PR carries the identical repair only to keep its own CI green — it's the same fix as the in-flight #402 / #405 and drops out on rebase once main is green. The preflight feature itself is the real content.Duplication note
Verified against every open PR's file list:
competition_preflight.py+ its CLI/tests are unique to this PR; the only overlap is the sharedanalysis/__init__.pyCI-unblock (transient).