Skip to content

Optimize: ask the server about a session and report a step's outcome from three minutes of play - #2480

Merged
utkarshdalal merged 2 commits into
masterfrom
optimize-verdict-frame-budget
Nov 20, 2026
Merged

utkarshdalal merged 2 commits into
masterfrom
optimize-verdict-frame-budget

Conversation

@utkarshdalal

@utkarshdalal utkarshdalal commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Description

The app only asked the server about a session, and only reported a step's outcome, once the session had run for several minutes, so a short session never reached the server at all.

This moves that point to three minutes after the session's first frame (OptimizeServer.ASK_PLAY_SEC; ASK_GAMEPLAY_SEC is the same point in the session's gameplay_s, which counts from SessionVerdict.WARMUP_SEC after the first frame). From there:

  • the exit dry-run for an unsure or unlisted local verdict is sent (OptimizeServer.asksAtExit), with the session's per-second samples as before;
  • a session in which the device throttled asks at exit (OptimizeServer.throttledSession);
  • a step's session is reported as an outcome instead of being held back as short, and can serve as a baseline (OptimizeJudge.COMPARABLE_GAMEPLAY_SEC, used by the judge, OptimizeLadders.accepted and the baseline lookup).

The server's answer decides the card and the judgement, as it already does when it answers. SessionVerdict and its tests are untouched: the app's own verdict is unchanged and still only used when there is no answer. No new user-visible strings.

With an older server the app asks earlier and gets that server's answer for a short session (no card), and a step's session from three minutes on is judged by the app's own judge, with the server's answer recorded beside it.

Recording

None: no visible UI change.

Type of Change

  • Bug fix
  • Performance / stability improvement
  • Compatibility improvements
  • Other (requires prior approval)

Checklist

  • If I have access to #code-changes, I have discussed this change there and it has been green-lighted. If I do not have access, I have still provided clear context in this PR. If I skip both, I accept that this change may face delays in review, may not be reviewed at all, or may be closed.
  • This change aligns with the current project scope (core functionality, stability, or performance). If not, it has been explicitly approved beforehand.
  • I have attached a recording of the change.
  • I have read and agree to the contribution guidelines in CONTRIBUTING.md.

Testing

  • OptimizeServerTest, OptimizeJudgeTest, OptimizeCrashRevertTest and OptimizeOfferTest cover the new ask point (one second before it does not ask or judge, at it does).
  • Not built locally; CI compiles and runs the tests.
  • Not run on a device yet. Before merge a device run must cover, on one game: a session of three to five minutes that ends with the exit dry-run sent (unsure verdict) and the card shown or not as the server says; accepting the card; the next session of three to five minutes producing an outcome report and the server's judgement applied; and a throttled session of that length asking at exit.

@coderabbitai

coderabbitai Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@utkarshdalal
utkarshdalal force-pushed the optimize-verdict-frame-budget branch from 1713a5d to 73dedda Compare November 20, 2026 10:10
@utkarshdalal utkarshdalal changed the title Optimize: a verdict after about three minutes; a thread that keeps missing the frame deadline counts as the limit Optimize: ask the server about a session and report a step's outcome from three minutes of play Nov 20, 2026
…from three minutes of play

The exit dry-run for an unsure or unlisted verdict, the throttled-session ask, a step's outcome
report and the baseline a step is judged against now start three minutes after the session's
first frame (ASK_PLAY_SEC; ASK_GAMEPLAY_SEC in gameplay_s), so the server sees short sessions
and decides on them. The app's own verdict is unchanged.
@utkarshdalal
utkarshdalal force-pushed the optimize-verdict-frame-budget branch from 73dedda to 54e4ee1 Compare November 20, 2026 10:15
@utkarshdalal
utkarshdalal marked this pull request as ready for review November 20, 2026 15:54
@utkarshdalal
utkarshdalal merged commit 47c5a40 into master Nov 20, 2026
4 of 5 checks passed
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