Skip to content

Show bot search progress and let the player cut a search short - #4

Merged
BAKocska merged 4 commits into
mainfrom
feat/search-progress
Sep 28, 2026
Merged

BAKocska merged 4 commits into
mainfrom
feat/search-progress

Conversation

@BAKocska

@BAKocska BAKocska commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

Delivers RM-04 on top of v0.7.0.

  • internal/bot: a Move search publishes an immutable SearchProgress snapshot when it starts, after every completed deepening iteration and when it returns. bot.ProgressOf reads the latest one without a lock and without starting work. Hint and analysis searches leave it untouched.
  • The thinking line shows elapsed time and the deepest completed iteration with its node count, only for the search behind the coming move. Each request reads its engine generation under the serialiser before Move and captures the final snapshot right after it, so a search left over from a finished game can never lend its figures to the rematch.
  • esc while the bot searches plays now: the search is cancelled without invalidating its move, and the tier's ordinary choice from the completed work (or its ordering pick before any iteration) is played exactly once. esc keeps its link-mode and confirm meanings.
  • i shows the finished search's figures (completed depth, nodes and time in all, stop reason), shortened by whole items to fit the width.
  • Fix: a finished bot game's leftover search could have its move applied to the rematch; the rematch inherits the move generation and a move arriving while no search is pending is dropped.

Scope

No search-strength change, no principal variation, no disk or wire change. The Windows input-dependency pin is unchanged.

Verification

  • Local: gofmt, vet (also GOOS=windows), full suite with zero e2e skips, -race on internal/app and on the progress tests. The progress tests now run under the race detector in CI by name.
  • Compiled e2e TestPlayNowCutsAMaxSearchShort drives a real max search on 24×24, presses escape and checks one legal stored reply and the i figures; it accepts both the completed-depth and the before-any-iteration wording so slow runners stay valid. It is required on native Windows.
  • Two independent review rounds resolved. On the final code, eleven finite mutations were killed by named tests (generation reuse, missing publication, running flag, locked progress read, foreign generation, play-now invalidating its move, rematch generation reset, rematch accepting an unrequested move, esc in link mode, depth-0 claim, final totals on the live line); one defensive final-snapshot generation check is equivalent for the real engine, which always publishes before a successful move.
  • Actual binary smoke in tmux: depth 5 done · 119426 nodes while thinking, escape played early from depth 5, i reported the figures.

A Move search publishes a snapshot when it starts, after each completed iteration and when it returns. ProgressOf reads the latest without taking any lock or starting work; hint and analysis searches do not touch it. The progress tests run under the race detector by name.
The thinking line shows elapsed time and the deepest completed iteration of the search behind the coming move, bound to that request under the serialiser. esc while the bot searches plays its last completed choice, or its legal ordering pick, exactly once; i shows the finished search's figures. A search left running by a finished game can no longer have its move played in the rematch.
i now chooses the widest whole-item form of the finished search's figures that fits, so the move and completed depth survive the narrowest status line and nodes and time survive from forty columns. The manual and changelog describe play now as the tier's ordinary choice from the completed work: the beginner tier still picks among its near-best candidates.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-28T13:34:05.357024Z 098dcf2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@BAKocska
BAKocska merged commit 91fa38a into main Sep 28, 2026
16 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