Skip to content

Spinlock instead of Mutex#224

Merged
QueensGambit merged 4 commits into
masterfrom
spinlock
Nov 21, 2025
Merged

Spinlock instead of Mutex#224
QueensGambit merged 4 commits into
masterfrom
spinlock

Conversation

@QueensGambit

Copy link
Copy Markdown
Owner

This PR integrates a spinlock as a replacement of mutex for Node.h
The memory consumption is almost identical.
Leads to 17.73 +/- 17.05 Elo improvement in chess.

Also adds if (numPhases > 1) { check in searchthread.cpp

File: /data/SL/spinlock_optimized_v3.pgn

Name                        :  Games                 Elo    Pts   Pts%   Win  Loss  Draw  Tf  Sc
ClassicAra_master           :   1000   -17.73 +/-  17.05  474.5   47.5   288   339   373   0   0
ClassicAra_spinlock         :   1000    17.73 +/-  17.05  525.5   52.5   339   288   373   0   0

Name                        :  W_win  B_win   Draw
ClassicAra_master           :    126    162    373
ClassicAra_spinlock         :    153    186    373


Name                        :   Wapc     Sd
ClassicAra_master           :     94     35
ClassicAra_spinlock         :     99     40

Finished games   : 1000
White wins       : 279 (27.9%)
Black wins       : 348 (34.8%)
Draws            : 746 (74.6%)
Unfinished games : 0 (0.0%)

Tf = time forfeit
Sc = stalled connection
Wapc = win average ply count, lower is better
Sd = standard deviation

@QueensGambit
QueensGambit merged commit 173ba98 into master Nov 21, 2025
0 of 3 checks passed
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.

1 participant