Skip to content

Commit c109a88

Browse files
anematodevondele
authored andcommitted
fix missing condition
Fixes a bug in #6453 abd835d The modifications to the DirtyThreats bitboards should only happen if PutPiece is true. This somehow didn't affect bench at the default parameters. Reference AVX2: ./stockfish.killdeer-fix.avx2 bench 64 1 23 Nodes searched : 178140156 Nodes/second : 1503152 before patch: ./stockfish.master.avx512icl bench 64 1 23 Nodes searched : 218349728 Nodes/second : 1743450 after patch: ./stockfish.killdeer-fix.avx512icl bench 64 1 23 Nodes searched : 178140156 Nodes/second : 1727520 passed STC: LLR: 2.95 (-2.94,2.94) <-1.75,0.25> Total: 39328 W: 10293 L: 10080 D: 18955 Ptnml(0-2): 113, 4306, 10629, 4487, 129 https://tests.stockfishchess.org/tests/view/692fb2d8b23dfeae38d01c81 closes #6463 Bench: 2912398
1 parent 5297ba0 commit c109a88

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/position.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,8 +1159,11 @@ void Position::update_piece_threats(Piece pc,
11591159
if (!all_attackers)
11601160
return; // Square s is threatened iff there's at least one attacker
11611161

1162-
dts->threatenedSqs |= square_bb(s);
1163-
dts->threateningSqs |= all_attackers;
1162+
if constexpr (PutPiece)
1163+
{
1164+
dts->threatenedSqs |= square_bb(s);
1165+
dts->threateningSqs |= all_attackers;
1166+
}
11641167

11651168
DirtyThreat dt_template{NO_PIECE, pc, Square(0), s, PutPiece};
11661169
write_multiple_dirties<DirtyThreat::PcSqOffset, DirtyThreat::PcOffset>(*this, all_attackers,

0 commit comments

Comments
 (0)