From 72bb4695d1c4b7743f2141fba6b501061d1d1be9 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Tue, 10 May 2016 17:50:51 +0200 Subject: [PATCH] Fix an issue with pawn ordering A subtle one because at leat 3 leading pawns are needed to uncover this bug. Found by stuwph --- src/syzygy/tbprobe.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/syzygy/tbprobe.cpp b/src/syzygy/tbprobe.cpp index 1af3440f..32c605c2 100644 --- a/src/syzygy/tbprobe.cpp +++ b/src/syzygy/tbprobe.cpp @@ -690,7 +690,7 @@ uint64_t probe_table(const Position& pos, Entry* entry, WDLScore wdl = WDLDraw, idx = Pawnidx[leadPawnsCnt - 1][23 - MapToEdges[squares[0]] / 2]; for (int i = 1; i < leadPawnsCnt; ++i) - idx += Binomial[i][MapToEdges[squares[i]]]; + idx += Binomial[i][MapToEdges[squares[leadPawnsCnt- i]]]; next = leadPawnsCnt; goto encode_remaining; // With pawns we have finished special treatments