Skip to content

Commit

Permalink
Reintroduce depth 2 razoring bench 5765806
Browse files Browse the repository at this point in the history
  • Loading branch information
CounterPly committed May 3, 2018
1 parent fdb6df0 commit 313b074
Showing 1 changed file with 30 additions and 19 deletions.
49 changes: 30 additions & 19 deletions x86/SearchMacros.asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
RazorMargin = 590
RazorMargin1 = 590
RazorMargin2 = 604

macro search RootNode, PvNode
; in:
Expand Down Expand Up @@ -293,30 +294,40 @@ Display 2, "Search(alpha=%i1, beta=%i2, depth=%i8) called%n"
test ecx, ecx
jz .moves_loop


; Step 6. Razoring (skipped when in check)
if PvNode = 0
mov edx, dword[.depth]
mov ecx, dword[.alpha]
cmp edx, 1*ONE_PLY
jg .6skip
lea eax, [ecx - RazorMargin]
mov edx, dword[.depth]
cmp edx, 2*ONE_PLY
jg .6skip
if USE_MATEFINDER = 1
lea eax, [rcx+2*VALUE_KNOWN_WIN-1]
cmp eax, 4*VALUE_KNOWN_WIN-1
jae .6skip
end if
mov ecx, dword[.alpha]
cmp edx, ONE_PLY
jne @1f
lea eax, [ecx - RazorMargin1]
cmp eax, dword[.evalu]
jl .6skip
if USE_MATEFINDER = 1
lea eax, [rcx + 2*VALUE_KNOWN_WIN - 1]
cmp eax, 4*VALUE_KNOWN_WIN - 1
jae .6skip
end if
;mov ecx, dword[.alpha] already here
jl @1f
lea edx, [rcx + 1]
xor r8d, r8d
call QSearch_NonPv_NoCheck
jmp .Return
xor r8d, r8d
call QSearch_NonPv_NoCheck
jmp .Return
@1:
lea eax, [ecx - RazorMargin2]
cmp eax, dword[.evalu]
jl .6skip
xor r8d, r8d
sub ecx, RazorMargin2
lea edx, [rcx+1]
mov esi, ecx
call QSearch_NonPv_NoCheck
cmp eax, esi
jle .Return
.6skip:
end if


; Step 7. Futility pruning: child node (skipped when in check)
if (RootNode = 0 & USE_MATEFINDER = 0) | (PvNode = 0 & USE_MATEFINDER = 1)
mov edx, dword[.depth]
Expand Down

0 comments on commit 313b074

Please sign in to comment.