feat: SEE decides the capture bonus in the policy
The +262 Elo of butterfly history showed that the hand-written policy is the main weakness. One clear flaw: every capture got a +1 logit bonus, including ones that just lose the piece (a knight taking a defended pawn, a bishop sacrifice on f7). Now a capture whose static exchange on the square loses material (SEE < 0) gets -1 instead of +1; the victim and attacker terms are unchanged. Example priors (startpos-like middlegame, white to move): Nxe5 with the pawn defended 0.3%, Bxf7+ 1.4%, while winning captures stay on top (Nxe5 against an undefended pawn 10.8%). Bench is deterministic. Bench: 552832 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f61564c58e
commit
1460f5e81e
1 file changed
+4
-1
+4
-1
@@ -227,7 +227,10 @@ void policy(const Position& pos, const MoveList& moves, float temperature, const
|
|||||||
const int type = piece_type(pos.piece_on(from));
|
const int type = piece_type(pos.piece_on(from));
|
||||||
float s = 0.0f;
|
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_promotion()) s += m.promo_type() == QUEEN ? 2.5f : -2.5f;
|
||||||
if (m.is_castle()) s += 0.8f;
|
if (m.is_castle()) s += 0.8f;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user