Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assert moveCountPruning properly #5658

Closed
wants to merge 1 commit into from

Conversation

MinetaS
Copy link
Contributor

@MinetaS MinetaS commented Oct 27, 2024

moveCountPruning should not be set to false again once it is set to true, otherwise it will break the internal logics of MovePicker. There have been a few tests which overlooked this.

Examples:
https://tests.stockfishchess.org/tests/view/671e7c0486d5ee47d953d226 https://tests.stockfishchess.org/tests/view/66a1de7b4ff211be9d4eccea

No functional change

moveCountPruning should not be set to false again once it is set to
true, otherwise it will break the internal logics of MovePicker. There
have been a few tests which overlooked this.

Examples:
https://tests.stockfishchess.org/tests/view/671e7c0486d5ee47d953d226
https://tests.stockfishchess.org/tests/view/66a1de7b4ff211be9d4eccea

No functional change
@mstembera
Copy link
Contributor

Would

moveCountPruning = moveCountPruning || moveCount >= futility_move_count(improving, depth);

not do the same thing?

@MinetaS
Copy link
Contributor Author

MinetaS commented Oct 29, 2024

Would

moveCountPruning = moveCountPruning || moveCount >= futility_move_count(improving, depth);

not do the same thing?

That's the "most correct" form that we should have, however this simplification was merged before: #5213

There are two options ...

  1. Introduce a strict assertion as this PR presents, or
  2. Enact a guideline that forbids removing the explicit check to prevent such PRs from being merged.

@Disservin
Copy link
Member

what about "fixing" the movepicker instead ? i.e. add a function skip_quiets(), which sets an internal bool to true and remove the parameter from next_move, would prevent any code assertion and additional maintenance from a pr stand point?

@MinetaS
Copy link
Contributor Author

MinetaS commented Oct 29, 2024

what about "fixing" the movepicker instead ? i.e. add a function skip_quiets(), which sets an internal bool to true and remove the parameter from next_move, would prevent any code assertion and additional maintenance from a pr stand point?

That sounds like a really good idea.

@MinetaS
Copy link
Contributor Author

MinetaS commented Oct 30, 2024

Closing as per the follow-up PR: #5661

@MinetaS MinetaS closed this Oct 30, 2024
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.

3 participants