Closed lantonov closed 6 years ago
Score of asmFishW_1663723_bmi2 vs stockfish-0a74c16: 192 - 192 - 616 [0.500] 1000 depth 14 Elo difference: 0.00 +/- 13.33 0/500 different results.txt
For the next patch Always do MaxCardinality checks in ThreadPool.asm:219
; Skip TB probing when no TB found
cmp dword[options.multiPV], 1
jne .check_tb_ret
mov dl, byte[options.syzygy50MoveRule]
mov byte[Tablebase_RootInTB], 0
mov byte[Tablebase_UseRule50], dl
mov eax, dword[options.syzygyProbeLimit]
mov ecx, dword[options.syzygyProbeDepth]
xor edx, edx
cmp eax, dword[Tablebase_MaxCardinality]
cmovg eax, dword[Tablebase_MaxCardinality]
cmovg ecx, edx
mov dword[Tablebase_Cardinality], eax
mov dword[Tablebase_ProbeDepth], ecx
to
; Skip TB probing when no TB found
mov dl, byte[options.syzygy50MoveRule]
mov byte[Tablebase_RootInTB], 0
mov byte[Tablebase_UseRule50], dl
mov eax, dword[options.syzygyProbeLimit]
mov ecx, dword[options.syzygyProbeDepth]
xor edx, edx
cmp eax, dword[Tablebase_MaxCardinality]
cmovg eax, dword[Tablebase_MaxCardinality]
cmovg ecx, edx
mov dword[Tablebase_Cardinality], eax
mov dword[Tablebase_ProbeDepth], ecx
cmp dword[options.multiPV], 1
jne .check_tb_ret
Bench is the same 5015773
Score of asmFishW_525856e_bmi2 vs stockfish-8cfcca1: 203 - 203 - 594 [0.500] 1000 depth 14 Elo difference: 0.00 +/- 13.71 0/500 different results.txt
Capture Stat Simplification in C++
{
if (!pos.capture_or_promotion(ttMove))
update_stats(pos, ss, ttMove, nullptr, 0, stat_bonus(depth));
- else
- update_capture_stats(pos, ttMove, nullptr, 0, stat_bonus(depth));
// Extra penalty for a quiet TT move in previous ply when it gets refuted
if ((ss-1)->moveCount == 1 && !pos.captured_piece())
Relevant code at SearchMacros.asm:1377
movzx eax, byte[rbp+Pos.board+rax]
or al, byte[_CaptureOrPromotion_or+rdx]
test al, byte[_CaptureOrPromotion_and+rdx]
jnz .20Quiet_UpdateCaptureStats
UpdateStats r12d, .quietsSearched, dword[.quietCount], r11d, r10d, r15
jmp .20Quiet_UpdateStatsDone
.20Quiet_UpdateCaptureStats:
UpdateCaptureStats r12d, .capturesSearched, dword[.captureCount], r11d, r10d
.20Quiet_UpdateStatsDone:
lea r10d, [r10+2*(r13+1)+1]
I was not able to make bench 5363761 so far
Code by @jdehorty at SearchMacros.asm:1513
lea r15d, [rax+rcx]
; r15d = offset of [piece_on(prevSq),prevSq]
test dl, dl
- jnz .ReturnTTValue_UpdateCaptureStats
UpdateStats r12d, 0, 0, r11d, r10d, r15
- jmp .ReturnTTValue_UpdateStatsDone
-.ReturnTTValue_UpdateCaptureStats:
- UpdateCaptureStats r12d, 0, 0, r11d, r10d
+ jmp .ReturnTTValue_UpdateStatsDone
.ReturnTTValue_UpdateStatsDone:
mov eax, edi
lea r10d, [r10+2*(r13+1)+1]
In this part for arm
sub w0, w0, w26
bmi .8skip
The sub
does not set the flags. You can use subs
to set the flags.
Patch in Stockfish
The relevant asmFish code is at SearchMacros.asm:341
My attempt
Bench is 5015773, the same as in the Stockfish patch Unfortunately, in armFish the same changes give bench 6845061