Skip to content

Add the game_end when the game clock reaches the time limit - #140

Merged
adri0 merged 2 commits into
mainfrom
time-limit-game-end
Oct 22, 2026
Merged

adri0 merged 2 commits into
mainfrom
time-limit-game-end

Conversation

@adri0

@adri0 adri0 commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Follow-up to #138. A game stopped by Season 4's two-hour limit (Adef vs Vswed, video 100) needed its game_end added by hand. Now extraction adds it.

What changes

  • extract._detect_time_limit: finds the first sample where the game clock reads 2:00:00 or more (_TIME_LIMIT_S). The clock has to tick up to it: if the previous reading is more than _CLOCK_STEP_TOLERANCE_S below, it's a misread and doesn't count.
  • extract._game_events: the per-game event steps (start, claims, winner, end), moved out of extract_video so they can be tested without a video. When the limit is reached:
    • Only claims seen by then count, plus _MARK_DEBOUNCE_SAMPLES, so a square already showing at the limit is still confirmed. The overlay freezes the clock, but a square handed in late can still turn on the board (Season 4 match 107).
    • If no line or unbeatable majority settled the game first, a game_end is added as the last event. determine_winner(..., time_up=True) then decides on the count: majority for the leader, a tie when level.
  • The limit applies to every season. On scadustats-site, no game's clock goes past 2:00:01, and only Adef vs Vswed reaches it. The next longest game ends at 1:58:52.
  • Docs: EventType docstring and CLAUDE.md.

Testing

  • 6 new tests in tests/pipeline/test_extract.py: a win on the count, a tie, a claim after the limit dropped, a claim showing at the limit counted, a misread jump to two hours ignored, and a game settled before the limit keeping its own game_end.
  • Full suite passes (533), Ruff clean.
  • Not run against a real VOD: video 100's VOD was deleted.

Known limits

  • An unmark under way at the limit (it needs 4 samples to confirm) is lost.
  • Two misread samples in a row at two hours or more would still stop the game.

🤖 Generated with Claude Code

adri0 and others added 2 commits October 19, 2026 23:12
A game stopped by Season 4's two-hour limit needed its game_end added by
hand (#138). Extraction now finds the first sample where the clock has
ticked up to 2:00:00 (a jump there from far below is a misread and doesn't
count), keeps only the claims seen by then, plus the mark debounce, and,
when no line or unbeatable majority settled the game first, adds a
game_end at that point so the square count decides it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main moved scoring to _settle_game, which runs once the match's season is
known. The time limit now fits that: _game_events returns the game's events
and the sample where the clock reached two hours, and _settle_game adds the
GAME_END there and calls the count, as it does for a points game that ran
out of time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adri0
adri0 merged commit f3237c0 into main Oct 22, 2026
1 check passed
@adri0
adri0 deleted the time-limit-game-end branch October 24, 2026 21:17
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