TAILLE wrote:I do not see your problem.
Hi Gérard.
The problem is, I must first do some forward move passes with "different logic" before I can switch to doing the "unmove" logic. But, as the example position shows, my "forward move logic" no longer applies.
In my forward move generator, I would "solve" 25-30 as the best move and report the parent position as a win in 21 plies. Then I do a pass over the reflection slice for the other side to move, and it would resolve the loss in 2 plies as being inescapable.
The next pass over, the move generator finds that 18-23 wins in 3 plies, so the position has its win length updated from 21 to 3. The cycle then repeats until no more wins/losses are found, and no more DTW values change.
This is very long for 2 reasons: 1) I have to look at EVERY position on every pass over the database 2) Even when WLD has been completed, sometimes DTW is still being improved.
TAILLE wrote:When generating a new DTW database you have to search first all wins in one ply, then 2 plies etc. and, at each pass, you have to generate all possible moves (catpure if needeed and otherwise promotions and man moves and king moves).
Because DTW has the distance of the subdatabases added to it, this would mean making more passes than in necessary. Right now, except for the 2-piece database, I can always resolve DTW in fewer passes than the longest distance.
Here is some of my data (be warned, this next link could take a long time to load if you have a slow internet connection)
http://www.gothicchess.com/checkers_data.txt
So take this for example:
Code: Select all
***********************************************************************************
* 2-piece database, 1 white king 0 white checkers vs. 1 red king 0 red checkers *
***********************************************************************************
TOTAL POSITIONS: 992
TOTAL BYTES: 992
TOTAL WINS (white to move)........... 230
TOTAL DRAWS (white to move)........... 654
TOTAL LOSSES (white to move)........... 108
Wins resolved as jumps................. 72
Draws resolved as jumps................ 0
Losses resolved as jumps............... 0
Wins resolved from moving.............. 158
Draws resolved from moving............. 0
Losses resolved from moving............ 108
Wins with NO JUMPS for EITHER SIDE..... 140
Draws with NO JUMPS for EITHER SIDE.... 650
Losses with NO JUMPS for EITHER SIDE... 108
Draws resolved from unknowns........... 654
Cumulative win length improvements..... 0
Cumulative loss length changes......... 0
Database resolved after 11 iterations (includes the JUMP pass).
The longest win requires 11 ply to complete.
There are 34 wins of the same length in this database slice.
One of the longest white to move and win positions: (white pieces start at top of board)
***************************************************************************************************************
*----------*----------*----------*----------*----------*----------*----------*----------*----------*----------*
*----------*----------*----------*----------*----------*----------*----------*----------*----------*----------*
*----------*----------*----------*----------*----------*----------*----------*----------*----------*----------*
*----------*----------*----------*----------*----------*----------*----------*----------*----------*----------*
*----------*----------*----------*----------*----------*----------*----------*----------*----------*----------*
***************************************************************************************************************
*----------*##########* *##########* *##########* *##########* *----------*
*----------*##########* *##########* *##########* *##########* *----------*
*----------*### 32 ###* *### 31 ###* *### 30 ###* *### 29 ###* *----------*
*----------*##########* *##########* *##########* *##########* *----------*
*----------*##########* *##########* *##########* *##########* *----------*
***************************************************************************************************************
*----------* *##########* *##########* *##########* *##########*----------*
*----------* *##########* *##########* *##########* *##########*----------*
*----------* *### 28 ###* *### 27 ###* *### 26 ###* *### 25 ###*----------*
*----------* *##########* *##########* *##########* *##########*----------*
*----------* *##########* *##########* *##########* *##########*----------*
***************************************************************************************************************
*----------*##########* *##########* *##########* *##########* *----------*
*----------*##########* *##########* *##########* *##########* *----------*
*----------*### 24 ###* *### 23 ###* *### 22 ###* *### 21 ###* *----------*
*----------*##########* *##########* *##########* *##########* *----------*
*----------*##########* *##########* *##########* *##########* *----------*
***************************************************************************************************************
*----------* *##########* *##########* *##########* *##########*----------*
*----------* *##########* *##########* *##########* *##########*----------*
*----------* *### 20 ###* *### 19 ###* *### 18 ###* *### 17 ###*----------*
*----------* *##########* *##########* *##########* *##########*----------*
*----------* *##########* *##########* *##########* *##########*----------*
***************************************************************************************************************
*----------*##########* *##########* *##########* *##########* -------- *----------*
*----------*##########* *##########* *##########* *##########* |RRRRRR| *----------*
*----------*### 16 ###* *### 15 ###* *### 14 ###* *### 13 ###* -------- *----------*
*----------*##########* *##########* *##########* *##########* |RRRRRR| *----------*
*----------*##########* *##########* *##########* *##########* -------- *----------*
***************************************************************************************************************
*----------* *##########* *##########* *##########* *##########*----------*
*----------* *##########* *##########* *##########* *##########*----------*
*----------* *### 12 ###* *### 11 ###* *### 10 ###* *### 09 ###*----------*
*----------* *##########* *##########* *##########* *##########*----------*
*----------* *##########* *##########* *##########* *##########*----------*
***************************************************************************************************************
*----------*##########* *##########* *##########* *##########* *----------*
*----------*##########* *##########* *##########* *##########* *----------*
*----------*### 08 ###* *### 07 ###* *### 06 ###* *### 05 ###* *----------*
*----------*##########* *##########* *##########* *##########* *----------*
*----------*##########* *##########* *##########* *##########* *----------*
***************************************************************************************************************
*----------* *##########* *##########* *##########* -------- *##########*----------*
*----------* *##########* *##########* *##########* |WWWWWW| *##########*----------*
*----------* *### 04 ###* *### 03 ###* *### 02 ###* -------- *### 01 ###*----------*
*----------* *##########* *##########* *##########* |WWWWWW| *##########*----------*
*----------* *##########* *##########* *##########* -------- *##########*----------*
***************************************************************************************************************
*----------*----------*----------*----------*----------*----------*----------*----------*----------*----------*
*----------*----------*----------*----------*----------*----------*----------*----------*----------*----------*
*----------*----------*----------*----------*----------*----------*----------*----------*----------*----------*
*----------*----------*----------*----------*----------*----------*----------*----------*----------*----------*
*----------*----------*----------*----------*----------*----------*----------*----------*----------*----------*
The 1 King vs. 1 King database takes 11 passes, and the longest win is 11 plies. Easy enough to understand, and it makes sense.
Now let's look at 2 kings vs. 1 king
Code: Select all
***********************************************************************************
* 3-piece database, 2 white kings 0 white checkers vs. 1 red king 0 red checkers *
***********************************************************************************
TOTAL POSITIONS: 14880
TOTAL BYTES: 14880
TOTAL WINS (white to move)........... 14846
TOTAL DRAWS (white to move)........... 34
TOTAL LOSSES (white to move)........... 0
Wins resolved as jumps................. 2016
Draws resolved as jumps................ 0
Losses resolved as jumps............... 0
Wins resolved from moving.............. 12830
Draws resolved from moving............. 26
Losses resolved from moving............ 0
Wins with NO JUMPS for EITHER SIDE..... 12190
Draws with NO JUMPS for EITHER SIDE.... 10
Losses with NO JUMPS for EITHER SIDE... 0
Draws resolved from unknowns........... 8
Cumulative win length improvements..... 454
Cumulative loss length changes......... 0
Database resolved after 21 iterations (includes the JUMP pass).
The longest win requires 33 ply to complete.
There are 220 wins of the same length in this database slice.
One of the longest white to move and win positions: (white pieces start at top of board)
***************************************************************************************************************
*----------*----------*----------*----------*----------*----------*----------*----------*----------*----------*
*----------*----------*----------*----------*----------*----------*----------*----------*----------*----------*
*----------*----------*----------*----------*----------*----------*----------*----------*----------*----------*
*----------*----------*----------*----------*----------*----------*----------*----------*----------*----------*
*----------*----------*----------*----------*----------*----------*----------*----------*----------*----------*
***************************************************************************************************************
*----------*##########* *##########* *##########* *##########* *----------*
*----------*##########* *##########* *##########* *##########* *----------*
*----------*### 32 ###* *### 31 ###* *### 30 ###* *### 29 ###* *----------*
*----------*##########* *##########* *##########* *##########* *----------*
*----------*##########* *##########* *##########* *##########* *----------*
***************************************************************************************************************
*----------* *##########* *##########* *##########* *##########*----------*
*----------* *##########* *##########* *##########* *##########*----------*
*----------* *### 28 ###* *### 27 ###* *### 26 ###* *### 25 ###*----------*
*----------* *##########* *##########* *##########* *##########*----------*
*----------* *##########* *##########* *##########* *##########*----------*
***************************************************************************************************************
*----------*##########* *##########* *##########* *##########* *----------*
*----------*##########* *##########* *##########* *##########* *----------*
*----------*### 24 ###* *### 23 ###* *### 22 ###* *### 21 ###* *----------*
*----------*##########* *##########* *##########* *##########* *----------*
*----------*##########* *##########* *##########* *##########* *----------*
***************************************************************************************************************
*----------* *##########* *##########* *##########* *##########*----------*
*----------* *##########* *##########* *##########* *##########*----------*
*----------* *### 20 ###* *### 19 ###* *### 18 ###* *### 17 ###*----------*
*----------* *##########* *##########* *##########* *##########*----------*
*----------* *##########* *##########* *##########* *##########*----------*
***************************************************************************************************************
*----------*##########* *##########* *##########* -------- *##########* *----------*
*----------*##########* *##########* *##########* |RRRRRR| *##########* *----------*
*----------*### 16 ###* *### 15 ###* *### 14 ###* -------- *### 13 ###* *----------*
*----------*##########* *##########* *##########* |RRRRRR| *##########* *----------*
*----------*##########* *##########* *##########* -------- *##########* *----------*
***************************************************************************************************************
*----------* *##########* *##########* *##########* *##########*----------*
*----------* *##########* *##########* *##########* *##########*----------*
*----------* *### 12 ###* *### 11 ###* *### 10 ###* *### 09 ###*----------*
*----------* *##########* *##########* *##########* *##########*----------*
*----------* *##########* *##########* *##########* *##########*----------*
***************************************************************************************************************
*----------*##########* *##########* *##########* *##########* *----------*
*----------*##########* *##########* *##########* *##########* *----------*
*----------*### 08 ###* *### 07 ###* *### 06 ###* *### 05 ###* *----------*
*----------*##########* *##########* *##########* *##########* *----------*
*----------*##########* *##########* *##########* *##########* *----------*
***************************************************************************************************************
*----------* *##########* *##########* -------- *##########* -------- *##########*----------*
*----------* *##########* *##########* |WWWWWW| *##########* |WWWWWW| *##########*----------*
*----------* *### 04 ###* *### 03 ###* -------- *### 02 ###* -------- *### 01 ###*----------*
*----------* *##########* *##########* |WWWWWW| *##########* |WWWWWW| *##########*----------*
*----------* *##########* *##########* -------- *##########* -------- *##########*----------*
***************************************************************************************************************
*----------*----------*----------*----------*----------*----------*----------*----------*----------*----------*
*----------*----------*----------*----------*----------*----------*----------*----------*----------*----------*
*----------*----------*----------*----------*----------*----------*----------*----------*----------*----------*
*----------*----------*----------*----------*----------*----------*----------*----------*----------*----------*
*----------*----------*----------*----------*----------*----------*----------
The longest win is 33 plies, but only 21 iterations were needed. Why?
The iteration count matches the "longest conversion", and the longest win is the combination of the position that took the longest to convert + landed in the longest subdatabase position as well.
That means iterating and looking for wins in 1 ply, losses in 2 plies, wins in 3 plies, etc. would require more passes than the forward move generator.
This is not correct, I think.
The "unmover" should resolve the databases in fewer passes than the forward mover. The reason is, for each loss, you determine ALL POSSIBLE WINS in "ply + 1" on the same pass. The forward move generator cannot do this.
The problem is, what do you do in the INITIAL forward passes, so that when you switch to the UNMOVING, your DTW will always remain correct?