feat(tournament): compose+run the real MultiGP multi-main (64-pilot) + fix 4-up FromHeatWinners#324
Merged
Merged
Conversation
…+ 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>
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.
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.tsasserts 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):
FromHeatWinnerscarried 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 properGenerator::advancers()that single_elim overrides to return each heat's real top-N + byes;heat_winnersnow uses it. +2 regression tests.Note:
timed_qualflies 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 cigreen; contract 96 tests; engine 271 + server 369.🤖 Generated with Claude Code