Skip to content

feat(competition): king-progression timeline from competition.history - #403

Merged
James-CUDA merged 2 commits into
James-CUDA:mainfrom
galuis116:feat/competition-timeline
Jul 23, 2026
Merged

feat(competition): king-progression timeline from competition.history#403
James-CUDA merged 2 commits into
James-CUDA:mainfrom
galuis116:feat/competition-timeline

Conversation

@galuis116

Copy link
Copy Markdown
Contributor

What does this PR do?

summarize_competition (#397) reports the current composite king + score-to-beat, and standings (#387) ranks miners — but nothing tells the story of the competition: who has held the composite crown, in what order, at what score, and how much each new king had to gain to take it. competition.history records exactly that — pr_eval._update_leaderboard appends one entry per crowning, in order.

How

Add trinity.competition_timeline: build_timeline reads competition.history and reports the reign-by-reign progression —

  • each king's composite score, per-benchmark breakdown, and gain over the previous king (the delta that had to clear win_margin; the first crown is measured against the 0.0 seed floor);
  • the total gain from the first crown to now, and the single biggest leap.

It's read-only and tolerant: a non-dict competition, non-list history, non-dict entry, or an entry missing miner/score are skipped without crashing. scripts/competition_timeline_report.py renders it (text or --json):

| # | king | composite | gain over prev | pr | when |
| 1 | alice (gen 2) | 0.6000 | +0.6000 | #10 | 2026-07-05T00:00:00Z |
| 2 | bob (gen 4)   | 0.8500 | +0.2500 | #20 | 2026-07-06T00:00:00Z |

- current king: bob (0.8500) after 2 crowning(s)
- total gain (first crown → now): +0.2500

Scope

Pure stdlib — no torch, no network. New module + script + tests; touches no existing file. The committed seed leaderboard.json renders "no one has been crowned yet." 10 offline tests cover the gain-over-previous-king math, the biggest leap, the per-benchmark breakdown, the empty/no-competition cases, skipped malformed entries, and load-from-file.

  • ruff + mypy clean; pytest tests/test_competition_timeline.py green (10).

Duplication note

New self-contained module; verified no open PRs exist at push time, and it's distinct from standings (current ranking) and summarize_competition (current king) — this is the historical progression. Fourth piece of the competition-object toolkit (after merged #384/#387/#397).

summarize_competition reports the CURRENT composite king + score-to-beat and
standings ranks miners, but nothing tells the story of the competition -- who has
held the composite crown, in what order, at what score, and how much each new king
had to gain to take it. competition.history records exactly that (pr_eval appends
one entry per crowning, in order).

Add trinity.competition_timeline: build_timeline reads competition.history and
reports the reign-by-reign progression -- each king's composite, per-benchmark
breakdown, and gain over the previous king (the delta that had to clear win_margin;
the first crown is measured against the 0.0 seed) -- plus the total gain from first
crown to now and the single biggest leap. Read-only, tolerates a non-dict
competition / non-list history / non-dict entry / missing miner-or-score without
crashing. Empty (no crownings) on the seed leaderboard. Pure stdlib -- no torch, no
network. Adds scripts/competition_timeline_report.py and offline tests.
…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.
@galuis116

Copy link
Copy Markdown
Contributor Author

CI was red because main has unresolved git merge-conflict markers in src/trinity/analysis/__init__.py (a botched merge → the package is invalid Python, so ruff/import fail on every branch). That's unrelated to this PR's files. I've stacked the identical repair here purely to unblock CI — it's the same fix as the in-flight #402/#405 and drops out on rebase once main is green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants