Skip to content

feat(tournament): compose+run the real MultiGP multi-main (64-pilot) + fix 4-up FromHeatWinners#324

Merged
ryan-johnson2 merged 1 commit into
develfrom
real-multi-main-compose
Jun 30, 2026
Merged

feat(tournament): compose+run the real MultiGP multi-main (64-pilot) + fix 4-up FromHeatWinners#324
ryan-johnson2 merged 1 commit into
develfrom
real-multi-main-compose

Conversation

@ryan-johnson2

Copy link
Copy Markdown
Contributor

Proves the real bracketed multi-main composes end-to-end from atomic rounds (D17) via the new range/combine seeding: 64-pilot qualifier → 3 mains bottom-up, each a single_elim bracket of 4-pilot heats, C/B single-race finals (top 2 bump up), A-main Chase-the-Ace final → champion. New multi-main-real.contract.ts asserts every heat is size 4, the bumps land in the next main, and a champion is crowned.

Root-cause bug fixed (found by 4-up composition): FromHeatWinners carried the wrong advancers for 4-up levels (a head-to-head-only "losers tie at one position" filter kept 6 instead of 4, breaking bracket finals). Fixed via a proper Generator::advancers() that single_elim overrides to return each heat's real top-N + byes; heat_winners now uses it. +2 regression tests.

Note: timed_qual flies the whole field in one heat (ignores heat_size) — test uses round_robin for the 16-heat qualifier; that's a separate gap, flagged.

cargo xtask ci green; contract 96 tests; engine 271 + server 369.

🤖 Generated with Claude Code

…+ fix 4-up FromHeatWinners

Proves the real bracketed multi-main composes end-to-end from atomic rounds (D17) using the new
range/combine seeding: a 64-pilot qualifier → 3 mains run bottom-up, each a single_elim bracket of
4-pilot heats, with C/B single-race finals (top 2 bump up) and an A-main Chase-the-Ace final →
champion. New contract test frontend/contract/multi-main-real.contract.ts drives it against the real
Director (deterministic mock sim) and asserts: every heat is exactly 4 pilots, each lower final's
top-2 bump into the next main's level-1 field, and a champion is crowned.

Root-cause bug found by the 4-up composition (head-to-head-only code path):
- SeedingRule::FromHeatWinners carried the WRONG advancers for 4-up levels. heat_winners used a
  "position < worst band" filter that assumes all losers tie at one position (true only for
  head-to-head); a 4-up level advancing 2 ranks its losers at distinct positions, so the filter kept
  6 pilots instead of 4 — breaking every bracket final's seeding.
- Fix at the root: new Generator::advancers(completed) (default = prior ranking heuristic, so other
  formats are unchanged); single_elim overrides it to return each heat's real top-`advance` (in heat
  order) + byes. heat_winners now calls advancers. +2 single_elim regression tests.

Note: timed_qual flies the whole field in one heat (ignores heat_size), so the test uses round_robin
(1 round, heat_size 4) for the 16-heat 64-pilot qualifier. (timed_qual large-field chunking is a
separate gap, flagged.)

cargo xtask ci green; contract suite 96 tests; engine 271 + server 369.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ryan-johnson2 ryan-johnson2 merged commit 350c517 into devel Jun 30, 2026
3 checks passed
@ryan-johnson2 ryan-johnson2 deleted the real-multi-main-compose branch June 30, 2026 00:40
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.

1 participant