Merge pull request 'SEE penalty for quiet moves that hang the piece' (#12) from policy-quiet-see into main

SPRT https://bench.rektdie.com/test/5293/
Elo   | 247.64 +- 50.37 (95%)
SPRT  | 8.0+0.08s Threads=1 Hash=64MB
LLR   | 3.96 (-2.94, 2.94) [0.00, 10.00]
Games | N: 258 W: 190 L: 32 D: 36
Penta | [1, 4, 30, 24, 70]

Bench: 549158
This commit was merged in pull request #12.
This commit is contained in:
claude committed 2026-11-15 15:34:36 +01:00
commit 2ac8d64ca9
1 file changed
+4 -1
+4 -1
View File
@@ -237,9 +237,12 @@ void policy(const Position& pos, const MoveList& moves, float temperature, const
s += 0.01f * float(mg_pst[type][relative_square(us, to)] - mg_pst[type][relative_square(us, from)]); s += 0.01f * float(mg_pst[type][relative_square(us, to)] - mg_pst[type][relative_square(us, from)]);
if (type != PAWN && type != KING) { if (type != PAWN && type != KING) {
if (pawn_threats & bb(to)) s -= 0.004f * SEE_VALUE[type]; if (m.is_capture() && (pawn_threats & bb(to))) s -= 0.004f * SEE_VALUE[type];
if (pawn_threats & bb(from)) s += 0.003f * SEE_VALUE[type]; if (pawn_threats & bb(from)) s += 0.003f * SEE_VALUE[type];
} }
// A quiet move that puts the piece where the exchange loses it (to a
// pawn, or to any attacker it is not defended well enough against).
if (!m.is_capture() && !m.is_promotion() && !see_ge(pos, m, 0)) s -= 0.004f * SEE_VALUE[type];
if (check_squares[m.is_promotion() ? m.promo_type() : type] & bb(to)) s += 0.5f; if (check_squares[m.is_promotion() ? m.promo_type() : type] & bb(to)) s += 0.5f;
if (bias) s += bias[i]; if (bias) s += bias[i];