Simplify DirtyPiece

Simplifies the DirtyPiece struct.

passed STC: https://tests.stockfishchess.org/tests/view/68054c9798cd372e3aea05d7
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 36608 W: 9641 L: 9437 D: 17530
Ptnml(0-2): 89, 3630, 10668, 3822, 95

passed LTC: https://tests.stockfishchess.org/tests/view/6805514598cd372e3aea0783
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 127620 W: 31993 L: 31894 D: 63733
Ptnml(0-2): 42, 10983, 41665, 11074, 46

closes https://github.com/official-stockfish/Stockfish/pull/6016

No functional change
This commit is contained in:
Carlos Esparza
2025-05-13 20:30:22 +02:00
committed by Disservin
parent ed6b8d179a
commit 63c6f22627
4 changed files with 44 additions and 48 deletions
+6 -6
View File
@@ -152,16 +152,16 @@ void AccumulatorStack::forward_update_incremental(
{
if (next + 1 < size)
{
auto& dp1 = accumulators[next].dirtyPiece;
auto& dp2 = accumulators[next + 1].dirtyPiece;
DirtyPiece& dp1 = accumulators[next].dirtyPiece;
DirtyPiece& dp2 = accumulators[next + 1].dirtyPiece;
if (dp2.dirty_num >= 2 && dp1.piece[0] == dp2.piece[1] && dp1.to[0] == dp2.from[1])
if (dp1.to != SQ_NONE && dp1.to == dp2.remove_sq)
{
const Square captureSq = dp1.to[0];
dp1.to[0] = dp2.from[1] = SQ_NONE;
const Square captureSq = dp1.to;
dp1.to = dp2.remove_sq = SQ_NONE;
double_inc_update<Perspective>(featureTransformer, ksq, accumulators[next],
accumulators[next + 1], accumulators[next - 1]);
dp1.to[0] = dp2.from[1] = captureSq;
dp1.to = dp2.remove_sq = captureSq;
next++;
continue;