Skip to content

searcher: add see pruning - #197

Merged
hansbinderup merged 1 commit into
mainfrom
hans/add-see-pruning
Sep 6, 2025
Merged

searcher: add see pruning#197
hansbinderup merged 1 commit into
mainfrom
hans/add-see-pruning

Conversation

@hansbinderup

Copy link
Copy Markdown
Owner

SEE pruning is an attempt at pruning branches by evaluating the worst/best case scenario in a simplified way.

If the SEE score is significantly low then we can assume that the given branch is not worth searching.

This implementation is very similar to our capture score but here we just compute a balance - and quiet moves are also accepted.

Bench 1209330

Elo   | 7.16 +- 3.40 (95%)
SPRT  | 8.0+0.08s Threads=1 Hash=32MB
LLR   | 2.96 (-2.94, 2.94) [0.00, 2.00]
Games | N: 19080 W: 4874 L: 4481 D: 9725
Penta | [510, 2212, 3803, 2405, 610]
https://openbench.bunny.beer/test/613/

@hansbinderup hansbinderup added this to the release-1.11 milestone Aug 5, 2025
Comment thread src/core/board_defs.h Outdated
Comment thread src/evaluation/see_swap.h
break;
}

if (player == board.player) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there some slicker syntax available here? This is branching with one-liners inside.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optimizer should, hopefully, do this for us :)

Comment thread src/search/searcher.h

if constexpr (!isRoot) {
/* skip this branch if SEE determines the static exchange results in a significant material loss */
const bool moveHasQuietFlag = move.getFlag() == movegen::MoveFlag::Quiet;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we have isQuietMove for this?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isQuietMove is actually a bit misleading - it's just:

    constexpr inline bool isQuietMove() const
    {
        return !isNoisyMove();
    }

@clarashepherd clarashepherd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few nitpicks, otherwise looking great :) Nice to see the SEE swap getting an upgrade!

SEE pruning is an attempt at pruning branches by evaluating the
worst/best case scenario in a simplified way.

If the SEE score is significantly low then we can assume that the given
branch is not worth searching.

This implementation is very similar to our capture score but here we
just compute a balance - and quiet moves are also accepted.

Bench 1209330
@hansbinderup
hansbinderup merged commit b5b3e22 into main Sep 6, 2025
6 checks passed
@hansbinderup
hansbinderup deleted the hans/add-see-pruning branch September 6, 2025 14:52
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.

2 participants