Skip to content

fix: standings entries store final match W/D/L for every round#7648

Open
Rathoz wants to merge 1 commit into
standings-tests-aifrom
standings-fix-wdl-snapshot
Open

fix: standings entries store final match W/D/L for every round#7648
Rathoz wants to merge 1 commit into
standings-tests-aifrom
standings-fix-wdl-snapshot

Conversation

@Rathoz

@Rathoz Rathoz commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • carryData.match in StandingsParser.parse was a single shared table that every per-round entry stored by reference (match = carryData.match). This meant (a) every standingsentry row carried the final cumulative W/D/L regardless of roundindex, and (b) since placements are computed after all entries are built, match-based tiebreakers (matchdiff — the default Swiss tiebreaker — matchwins, matchwinrate, Buchholz) computed intermediate-round placements from end-of-tournament records.
  • The fix snapshots the accumulator per round with Table.copy(carryData.match) at the point the entry is constructed. carryData.match itself continues to accumulate as before; only the stored snapshot per entry is now independent.
  • Reviewer note: Final-round entries are unchanged (final cumulative = final cumulative), so definitestatus and final standings are untouched. Intermediate-round stored rows and mid-tournament placements decided by match-based tiebreakers will change on re-render — that is the fix. This PR is based on standings-tests-ai (PR test: add integration tests for standings #7647); the test that asserted the old shared-table behaviour is updated here.

How did you test this change?

  • Ran the full busted test suite (605 successes / 0 failures / 0 errors / 0 pending) against the updated code.
  • Ran luacheck on both changed files with 0 warnings / 0 errors.
  • Updated the test accumulates match scoreboard across rounds in lua/spec/standings_parser_spec.lua: round 1 entry now asserts {w = 1, d = 0, l = 0} (snapshot at end of round 1) and round 2 asserts {w = 1, d = 1, l = 1} (cumulative after round 2); the obsolete comment describing the shared-table behaviour was removed.

🤖 Generated with Claude Code

@Rathoz Rathoz requested review from a team as code owners June 12, 2026 14:05
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Rathoz Rathoz force-pushed the standings-fix-wdl-snapshot branch from 9894aed to 29640fc Compare June 12, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants