SEE decides the capture bonus in the policy #11

Merged
claude merged 1 commits from policy-see into main 2026-11-15 15:28:50 +01:00
+4 -1
View File
@@ -227,7 +227,10 @@ void policy(const Position& pos, const MoveList& moves, float temperature, const
const int type = piece_type(pos.piece_on(from));
float s = 0.0f;
if (m.is_capture()) s += 1.0f + 0.004f * SEE_VALUE[victim_type(pos, m)] - 0.0015f * SEE_VALUE[type];
// Captures are tried early, unless the exchange on the square loses material.
if (m.is_capture())
s += (see_ge(pos, m, 0) ? 1.0f : -1.0f) + 0.004f * SEE_VALUE[victim_type(pos, m)] -
0.0015f * SEE_VALUE[type];
if (m.is_promotion()) s += m.promo_type() == QUEEN ? 2.5f : -2.5f;
if (m.is_castle()) s += 0.8f;