Local analysis: the bot goes through a game on the phone, in the replay view by michielbaird · Pull Request #18 · michielbaird/hanab-android · GitHub
Skip to content

Local analysis: the bot goes through a game on the phone, in the replay view - #18

Merged
michielbaird merged 2 commits into
mainfrom
feature/local-analysis
Oct 29, 2026
Merged

michielbaird merged 2 commits into
mainfrom
feature/local-analysis

Conversation

@michielbaird

Copy link
Copy Markdown
Owner

What

Analyze now runs the bot on the phone instead of asking a bot by private message.

  • Analysis: the native library (hanab-bot-rs's analyze_comments) goes through a finished game and returns every move the bot would have played differently, with clear mistakes marked. Games of the website are fetched as the site's export (/export/<id>); offline records are converted to the same shape. No bot needs to be online and, for offline games, no connection is needed.
  • Where: an Analyze button at the end of a game, in replays, and next to each game in a profile's history and in the offline stats. You choose the conventions first; it runs for a minute or more.
  • In the replay view: the analysis is a box under the hands with arrows between the comments, a mistakes-only filter, the full list and Close. The arrows move the replay to the position before the move (turn n is stop n - 1); for the leader of a shared replay they use the same call as the playback buttons, so they move everyone's replay. The hands are sized as if the box were not there, as with the clue panel.
  • Kept: each finished analysis is saved per game (it survives restarts); the button then reads Analysis and reopens it at once, and Analyze again runs it with other conventions.
  • Removed: the bot-by-PM analyze dialogs and their state.

Testing

  • Rust host test: analyses a real game of the site (#2046249) and a game played offline; bad input and an unknown convention give errors.
  • Unit tests for reading the result.
  • Not yet run on a device. Open questions: how long it takes on a phone (3 to 4 players can take minutes; it cannot be cancelled mid-run, only ignored), and replays that are not drawn as over.

🤖 Generated with Claude Code

michielbaird and others added 2 commits October 28, 2026 08:48
…ay view

Replaces asking a bot by private message. The native library runs hanab-bot-rs's
analysis and returns every move the bot would have played differently, with clear
mistakes marked. It works for games of the website (the app fetches the site's export)
and for games played offline, with no bot online and, offline, no connection.

- Analyze at the end of a game, in a replay, and next to each game in a profile's
  history and the offline stats. Choose the conventions; it runs for a minute or more.
- In a replay the analysis is a box under the hands with arrows between the comments,
  a mistakes-only filter, the full list and Close. The arrows move the replay to the
  position before the move; for the leader of a shared replay they move everyone's.
- Finished analyses are kept per game (surviving restarts); the button reads Analysis
  and reopens one instantly, and Analyze again runs another convention.
- Offline records are converted to the site's export shape for the bot.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Updates hanab-bot-rs to the commit that analyses each player on its own thread and
reports progress and cancellation (issue 38). The analysis is now a background job
the app starts, polls and cancels: a progress bar of moves examined, and Cancel
stops the bot between moves. A game that took 79 s in the host test takes 23 s.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@michielbaird
michielbaird merged commit 38b660c into main Oct 29, 2026
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