Tuning #8
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe change activates evaluation tuning registrations, adds a Threads option, updates search heuristics and timing state, changes search to return node counts, and introduces a fixed-position ChangesSearch engine updates
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Sequence Diagram(s)sequenceDiagram
participant UCI
participant execCmd
participant search
participant Position
UCI->>execCmd: bench
execCmd->>Position: load benchmark FEN
execCmd->>search: search(position, depth=10)
search-->>execCmd: session.nodes
execCmd-->>UCI: nodes and nps
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 06a2a9ead6
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -25,7 +25,7 @@ struct LimitsType { | |||
| bool use_time_management() const { return time[chess::WHITE] || time[chess::BLACK]; } | |||
There was a problem hiding this comment.
Check the moving side's clock before time-managing
When only the opponent's clock is provided/nonzero, e.g. go btime 30000 while White is to move, this now enables time management even though limits.time[us] is zero. TimeManagement::init() then computes scales from a zero clock (log10(time / 1000.0)), which can produce non-finite or effectively immediate/huge time limits; the previous side-specific guard avoided that path. Base the predicate on the side to move's clock instead of either clock.
Useful? React with 👍 / 👎.
| score = -score; | ||
| std::cout << score << std::endl; | ||
| break; | ||
| } else if (token == "bench") { |
There was a problem hiding this comment.
Stop any active search before benching
If bench is entered while a previous go search is still running, this branch starts repeated synchronous search::search() calls without first joining searchThread. Since search::search() resets the shared stop flag and uses the global transposition table, the benchmark and background search can run concurrently and interleave/corrupt engine state and output; other search-affecting commands call stop() before proceeding.
Useful? React with 👍 / 👎.
| auto start = std::chrono::high_resolution_clock::now(); | ||
| for (auto &fen : Defaults) { | ||
| std::cerr << fen << '\n'; | ||
| chess::Position pos(fen); |
There was a problem hiding this comment.
Parse bench move suffixes before searching
Several benchmark entries above include a UCI-style moves ... suffix, but constructing chess::Position directly from the whole string does not replay those moves, so those cases are searched from the base FEN instead of the intended post-move position (or may be rejected by strict FEN parsing). Reuse the same FEN-plus-moves parsing logic as handlePosition() for each bench entry.
Useful? React with 👍 / 👎.
No description provided.