End of story: Problem was in the playMove function playing a castle move with rook staying on the same square. Solved now.
Thanks again.
Andreas
Moderators: hgm, Rebel, chrisw
End of story: Problem was in the playMove function playing a castle move with rook staying on the same square. Solved now.
Hi,RubiChess wrote: ↑Sat Apr 25, 2020 7:40 am Old thread recycled...I'm implementing FRC in RubiChess these days and I'm in trouble with this special perft position. In ply 7 Rubi finds only 6447669103 instead of the correct 6447669114 moves so she misses 11 moves. Up to ply 6 everything is fine. Can anybody imagine which special tricky position can be on the board after 6 plies that has missing moves?Code: Select all
XFEN 04: 4r3/3k4/8/8/8/8/6PP/qR1K1R2 w KQ - 0 1 +-a--b--c--d--e--f--g--h-+ 8 | ::: :::[r]::: :::| 7 |::: :::[k]::: ::: | 6 | ::: ::: ::: :::| 5 |::: ::: ::: ::: | 4 | ::: ::: ::: :::| 3 |::: ::: ::: ::: | 2 | ::: ::: :::<P><P>| 1 |[q]<R>:::<K>:::<R>::: | (w)+-a--*--c--*--e--*--g--h-+ Ply Moves [x] [ep] [+] [++] Prom Cstl Sec 1: 19 1 0 1 0 0 0 0.00 2: 628 20 0 76 0 0 0 0.00 3: 12858 499 0 1090 0 0 163 0.00 4: 405636 15223 0 62483 0 0 0 0.01 5: 8992652 286260 0 857746 0 0 81416 0.15 6: 281330710 11668588 0 48470016 1034 0 0 4.33 7: 6447669114 196804371 0 631079536 0 0 35649155 109.29
Regards, Andreas
Code: Select all
if ( (p.castling & C_wqs)
&& (((BBTools::mask[p.king[Co_White]].between[Sq_c1] | BBSq_c1) & ~BBTools::mask[p.rooksInit[Co_White][CT_OOO]].bbsquare) & occupancy) == empty
&& (((BBTools::mask[p.rooksInit[Co_White][CT_OOO]].between[Sq_d1]| BBSq_d1) & ~BBTools::mask[p.king[Co_White]].bbsquare ) & occupancy) == empty
&& !isAttacked(p,BBTools::mask[p.king[Co_White]].between[Sq_c1] | SquareToBitboard(p.king[Co_White]) | SquareToBitboard(Sq_c1)) )
addMove(from, Sq_c1, T_wqs, moves); // wqs
Ok found it. King and rook can stay in place...xr_a_y wrote: ↑Wed May 06, 2020 9:44 amHi,RubiChess wrote: ↑Sat Apr 25, 2020 7:40 am Old thread recycled...I'm implementing FRC in RubiChess these days and I'm in trouble with this special perft position. In ply 7 Rubi finds only 6447669103 instead of the correct 6447669114 moves so she misses 11 moves. Up to ply 6 everything is fine. Can anybody imagine which special tricky position can be on the board after 6 plies that has missing moves?Code: Select all
XFEN 04: 4r3/3k4/8/8/8/8/6PP/qR1K1R2 w KQ - 0 1 +-a--b--c--d--e--f--g--h-+ 8 | ::: :::[r]::: :::| 7 |::: :::[k]::: ::: | 6 | ::: ::: ::: :::| 5 |::: ::: ::: ::: | 4 | ::: ::: ::: :::| 3 |::: ::: ::: ::: | 2 | ::: ::: :::<P><P>| 1 |[q]<R>:::<K>:::<R>::: | (w)+-a--*--c--*--e--*--g--h-+ Ply Moves [x] [ep] [+] [++] Prom Cstl Sec 1: 19 1 0 1 0 0 0 0.00 2: 628 20 0 76 0 0 0 0.00 3: 12858 499 0 1090 0 0 163 0.00 4: 405636 15223 0 62483 0 0 0 0.01 5: 8992652 286260 0 857746 0 0 81416 0.15 6: 281330710 11668588 0 48470016 1034 0 0 4.33 7: 6447669114 196804371 0 631079536 0 0 35649155 109.29
Regards, Andreas
in this position, I only get 115 castling at depth 3 ...
My generator is validated for standard chess and for FRC I do things like this
so no occupancy except king or rook on rook and king path, and no attack on king path.Code: Select all
if ( (p.castling & C_wqs) && (((BBTools::mask[p.king[Co_White]].between[Sq_c1] | BBSq_c1) & ~BBTools::mask[p.rooksInit[Co_White][CT_OOO]].bbsquare) & occupancy) == empty && (((BBTools::mask[p.rooksInit[Co_White][CT_OOO]].between[Sq_d1]| BBSq_d1) & ~BBTools::mask[p.king[Co_White]].bbsquare ) & occupancy) == empty && !isAttacked(p,BBTools::mask[p.king[Co_White]].between[Sq_c1] | SquareToBitboard(p.king[Co_White]) | SquareToBitboard(Sq_c1)) ) addMove(from, Sq_c1, T_wqs, moves); // wqs
Can you spot my mistake ?