Skip to content

Simplify is_legal#812

Open
protonspring wants to merge 2 commits intocodedeliveryservice:mainfrom
protonspring:ps_islegal121
Open

Simplify is_legal#812
protonspring wants to merge 2 commits intocodedeliveryservice:mainfrom
protonspring:ps_islegal121

Conversation

@protonspring
Copy link
Contributor

Mostly non-functional.

We only set the tt_move when it is NOT Null, so checking it again here is not necessary. Also, consolidate some conditions.

bench 3554133

STC
Elo | 1.87 +- 2.18 (95%)
SPRT | 8.0+0.08s Threads=1 Hash=16MB
LLR | 2.98 (-2.25, 2.89) [-2.75, 0.25]
Games | N: 23748 W: 5955 L: 5827 D: 11966
Penta | [49, 2615, 6434, 2711, 65]
https://recklesschess.space/test/12620/

bench 3554133
bench 3554133

if !mv.is_en_passant() && !(self.checkers() | between(king, self.checkers().lsb())).contains(to) {
if self.checkers().is_multiple()
|| !(mv.is_en_passant() || (self.checkers() | between(king, self.checkers().lsb())).contains(to))
Copy link
Contributor

@87flowers 87flowers Mar 25, 2026

Choose a reason for hiding this comment

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

I don't enjoy this specific change as this makes it harder to read.

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