Improve strength limiting with logistic noise and root depth caps - #7036
Open
yashahuja31 wants to merge 1 commit into
Open
Improve strength limiting with logistic noise and root depth caps#7036yashahuja31 wants to merge 1 commit into
yashahuja31 wants to merge 1 commit into
Conversation
This refactors the strength limited search implementation to address issue official-stockfish#3635. Instead of selecting moves randomly at the root from multiPV scores: - Evaluation noise (sampled from standard logistic distribution quantiles) is added to leaf evaluations, scaled by level and non-pawn material phase. - Evaluation perturbation is deterministic per position key and game seed (drawn once per game on ucinewgame in ThreadPool::clear). - A level-dependent depth limit is enforced to prevent deep tactical lines while maintaining human-like mistakes at lower skill levels. - Added tests/skill_unit_test.py automated unit test suite for skill options, depth limits, and game re-seeding. Bench: 2829394 closes official-stockfish#3635 No functional change
|
clang-format 20 needs to be run on this PR. (execution 31201262293 / attempt 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR refactors the
Skillimplementation for strength-limited play, addressing issues discussed in #3635.Instead of selecting moves semi-randomly at the root from
MultiPVscores (which can cause blunder-like single-move drops despite deep search), strength is limited in two complementary ways:depth_limit() = 1 + level) prevents the search from finding deep tactical lines and forced mates at lower skill levels.NoiseQuantile) is added to leaf evaluations duringevaluate(), scaled by skill level and game phase (non-pawn material). This simulates human-like misjudgments of positions rather than sudden gross blunders.Key Details & Stability
ThreadPool::clear(), called onucinewgame), ensuring consistent evaluations within a game while varying engine play across different games.std::clamp(v, VALUE_TB_LOSS_IN_MAX_PLY + 1, VALUE_TB_WIN_IN_MAX_PLY - 1)).Skill Level 20),skill.enabled()isfalse, maintaining exact master behavior and benchmark signature.Testing & Verification
2829394(Unchanged, signature OK).tests/skill_unit_test.pycovering UCI options (Skill Level,UCI_LimitStrength,UCI_Elo), depth limits, search execution, and seed re-randomization across games.Closes #3635
No functional change