Centralize temperature calculation logic in EffectiveTau function with 1-based move numbering #12
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.
This PR addresses the duplication of temperature calculation logic across search implementations by centralizing it in a new
EffectiveTaufunction, while also updating the move numbering scheme to be more intuitive.Changes Made
New Temperature Module
src/search/common/temperature.{h,cc}with centralizedEffectiveTaufunctionmeson.buildto include the new temperature module in the buildAPI Changes
ply/2to(ply/2)+1for 1-based move numbering(moves+1) >= cutoff_movetomoves >= cutoff_moveto maintain equivalent behaviorSearch Implementation Updates
src/search/classic/search.ccto useEffectiveTauinstead of inline temperature logicsrc/search/dag_classic/search.ccto useEffectiveTauinstead of inline temperature logicBehavior Changes
The move numbering change from 0-based to 1-based affects temperature decay/cutoff timings:
Before: Move numbering started at 0 (ply 0 = move 0, ply 2 = move 1, etc.)
After: Move numbering starts at 1 (ply 0 = move 1, ply 2 = move 2, etc.)
This provides more intuitive move numbering but will cause temperature effects to trigger one move earlier than before. For example, with
cutoff_move=10, the cutoff now happens at the start of move 10 rather than at the start of move 11.Function Signature
Benefits
The centralized function preserves all the original temperature decay and cutoff logic while making the codebase more maintainable and the move numbering more user-friendly.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
wrapdb.mesonbuild.com/usr/bin/python3 /home/REDACTED/.local/bin/meson --internal regenerate /home/REDACTED/work/lc0/lc0 .(dns block)If you need me to access, download, or install something from one of these locations, you can either:
This pull request was created as a result of the following prompt from Copilot chat.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.