Skip to content

Conversation

@kevlu8
Copy link
Owner

@kevlu8 kevlu8 commented Nov 25, 2025

  • This PR implements Lazy SMP as a way to perform multi-threaded search in PZChessBot.

Benchmarks:

  • 1 thread: 2.5Mnps
  • 2 threads: 5.4Mnps
  • 4 threads: 9.6Mnps
  • 8 threads: 17.2Mnps

Current issues:

  • Elo gains are lower than expected
  • Code is very messy

Notes:

  • MultiPV is removed as it was broken in prior commits
  • HCE is removed as it unnecessarily bloats code complexity
  • Some UCI outputs have been removed (e.g. seldepth) but will be added back shortly

TODO:

  • Refactor threading code
  • Allocate memory for new threads as we go instead of initializing a global for MAX_THREADS (slow!)
  • Start search on separate thread to allow for uci stop command

Copilot finished reviewing on behalf of kevlu8 November 26, 2025 04:21

This comment was marked as abuse.

@kevlu8
Copy link
Owner Author

kevlu8 commented Nov 26, 2025

SPRT for always-replace:

Elo   | 13.44 +- 7.44 (95%)
SPRT  | 8.0+0.08s Threads=2 Hash=32MB
LLR   | 3.01 (-2.25, 2.89) [0.00, 5.00]
Games | N: 4732 W: 1786 L: 1603 D: 1343
Penta | [204, 388, 1038, 493, 243]

https://sscg13.pythonanywhere.com/test/1593/

@kevlu8
Copy link
Owner Author

kevlu8 commented Nov 28, 2025

Preliminary test of SMP vs main:

Elo   | -15.44 +- 10.98 (95%)
SPRT  | 8.0+0.08s Threads=1 Hash=32MB
LLR   | -0.98 (-2.20, 2.20) [-10.00, -5.00]
Games | N: 1126 W: 228 L: 278 D: 620
Penta | [12, 146, 293, 104, 8]

https://sscg13.pythonanywhere.com/test/1607/

SMP seems to be clearly weaker. This may be due to several changes that were untested on main, such as:

  • Changing TT scheme to always-replace
  • Copying TT entry at every node

Bench: 10410988
@kevlu8
Copy link
Owner Author

kevlu8 commented Nov 30, 2025

New test:

Elo   | -3.99 +- 2.63 (95%)
SPRT  | 8.0+0.08s Threads=1 Hash=32MB
LLR   | -2.36 (-2.25, 2.89) [-8.00, -2.00]
Games | N: 18970 W: 4258 L: 4476 D: 10236
Penta | [102, 2404, 4679, 2210, 90]

https://sscg13.pythonanywhere.com/test/1613/

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