Skip to content

chore: staged movegen with a fix in qs#273

Merged
ptsouchlos merged 11 commits intomainfrom
fix/qsearch-manual-move-filter
Mar 20, 2026
Merged

chore: staged movegen with a fix in qs#273
ptsouchlos merged 11 commits intomainfrom
fix/qsearch-manual-move-filter

Conversation

@ptsouchlos
Copy link
Owner

@ptsouchlos ptsouchlos commented Mar 19, 2026

Refactor move_generation, legal_move_generation and submodules for staged legal movegen. This is a stepping stone for implementing a move picker (#41).

This also properly uses staged movegen in qsearch so that we don't have to manually filter them depending on if we're in check or not.

bench: 728983

Add a promotion filter for what promotions to consider when enumerating
moves.

bench: 729284
This will replace the function that returns a massive tuple of data for
legal move gen.

bench: 729284
Integrate submodule and updated enumerate moves function into main
movegen and legal movegen.

bench: 729284
The new approach had significantly worse performance (~13% worse) in
search bench. This simplifies our approach to just provide a move type
(all, capture, quiet) when generating moves and then the mobility
bitboards are just &'d with a mask. This makes the new move gen only ~3%
worse on average compared to main.

bench: 773383
We changed the function signature so we have to update all the call
sites.
bench: 773383
bench: 773383
bench: 773383
Used staged movegen instead.

bench: 728983
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 96.06987% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.57%. Comparing base (8084ecd) to head (95a50af).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
chess/src/legal_move_generation.rs 95.29% 4 Missing ⚠️
chess/src/move_generation/metadata.rs 95.55% 4 Missing ⚠️
engine/src/search.rs 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #273      +/-   ##
==========================================
- Coverage   94.63%   94.57%   -0.06%     
==========================================
  Files          45       46       +1     
  Lines        7896     7923      +27     
==========================================
+ Hits         7472     7493      +21     
- Misses        424      430       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptsouchlos
Copy link
Owner Author

STC regression

Elo   | 19.47 +- 9.91 (95%)
SPRT  | 8.0+0.08s Threads=1 Hash=16MB
LLR   | 2.96 (-2.94, 2.94) [-5.00, 0.00]
Games | N: 2394 W: 810 L: 676 D: 908
Penta | [62, 251, 478, 303, 103]
https://openbench.nocturn9x.space/test/6193/

Possibly a gainer?

@ptsouchlos ptsouchlos changed the title chore: staged movegen + fix in qs chore: staged movegen with a fix in qs Mar 20, 2026
@ptsouchlos ptsouchlos merged commit fd928c1 into main Mar 20, 2026
17 checks passed
@ptsouchlos ptsouchlos deleted the fix/qsearch-manual-move-filter branch March 20, 2026 02:39
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