micro-Max STM32 follow-up: the PST sign fix paid off - first win against Stockfish 15.1 (skill 4), and a mate in 1 delivered by the engine itself
Intro
This is a follow-up to our earlier posts on the STM32 port of micro-Max
(umax4_8.c): the FEN castling scheme via the "moved" flag and the PST bug
report (inverted sign in the move delta + a rook mirror error). After
applying the fixes we played a new series against Stockfish 15.1
(python-chess, ENGINE_DEPTH=10, skill 4; our engine always plays black),
with two additional tuning changes on top of the bug fixes. This post
summarizes what changed in the engine's behavior - the diagnostics turned
out to be more interesting than the game results, and one of the games was
a first win.
What we changed since the bug-fix post
- Differentiated shield penalty. In the original, the pawn
penalty for moving in front of an unmoved king is a flat -20:
Code: Select all
v -= 20 * ((x-2&M||b[x-2]-u) + (x+2&M||b[x+2]-u) - 1
+ (b[x^16]==k+36));
We split the king term: -10 for a single step or capture (displacement
+-8, +-7/+-9), -20 for the double push (displacement +-16):
Code: Select all
v -= 20 * ((x-2&M||b[x-2]-u) + (x+2&M||b[x+2]-u) - 1);
if(b[x^16]==k+36) v -= 10 + 10*!((y-x)&15);
The intent: e7-e6 (which frees the f8 bishop and enables O-O) should be
cheap, e7-e5 in front of an unmoved king should stay expensive.
- Halved the top pawn PST row (60/62/64/68 -> 30/31/32/34, both
colors). We should note honestly: this row is only reachable in the
promotion delta (a pawn can never stand on the last rank), so it
cannot influence opening pawn pushes at all - the original "suicidal pawn"
regulator hypothesis was wrong. We kept the change as a promotion-behavior
tuning, nothing more.
The sign fix in action
The difference is immediately visible in the move lists. Before the fix,
the engine was
paid for retreating (Ng8, Qc8 each scored up to +15)
and black pawns almost never played double pushes. After the fix:
- no rewarded retreats anywhere in the series;
- 7 out of 8 black pawns moved in one of the games (d5, c5, c4, f5, g5,
b5, a6, h6 - including double pushes);
- the famous "magnetic king" works as designed: in the winning game the
king marched Kf8-e7-e6-f5 into the attack in the middlegame, exactly
what the PST endgame pull is supposed to encourage once material thins
out.
[pgn][Event "Computer Schach Partie"]
[Site "PC"]
[Date "????.??.??"]
[Round "?"]
[White "stockfish 15.1"]
[Black "stm32"]
[Result "0-1"]
[Termination "normal"]
1.e4
{0.2s}
1...c5
{book, bal=+0, diff=+0, 7.5s}
2.d4
{0.1s}
2...cxd4
{book, bal=+0, diff=+0, 7.0s}
3.Nf3
{0.1s}
3...e5
{book, bal=+0, diff=+0, 6.9s}
4.c3
{0.1s}
4...Nc6
{book, bal=+0, diff=+0, 6.3s}
5.Bc4
{0.2s}
5...Nf6
{book, bal=+0, diff=+0, 6.2s}
6.cxd4
{0.1s}
6...Nxe4
{book, bal=+0, diff=+0, 6.0s}
7.O-O
{0.1s}
7...d5
{d=4 uz=78718 oc=137, tt=1, bal=+1, diff=+38, 17.9s}
8.Re1
{0.1s}
8...Bb4
{d=4 uz=81743 oc=217, tt=1, bal=+1, diff=+118, 18.8s}
9.Nbd2
{0.2s}
9...Nxd2
{d=4 uz=111843 oc=252, tt=15, bal=+1, diff=+153, 22.8s}
10.Bxd2
{0.1s}
10...Bxd2
{d=5 uz=455939 oc=284, tt=15, bal=+1, diff=+185, 68.3s}
11.Nxd2
{0.1s}
11...dxc4
{d=5 uz=259638 oc=295, tt=21, bal=+1, diff=+196, 40.4s}
12.Nxc4
{0.1s}
12...Nxd4
{d=5 uz=389095 oc=324, tt=73, bal=+3, diff=+27, 51.2s}
13.Rxe5+
{0.2s}
13...Be6
{d=5 uz=388453 oc=317, tt=103, bal=+3, diff=+20, 52.5s}
14.Re4
{0.1s}
14...Nf5
{d=5 uz=363249 oc=271, tt=90, bal=+3, diff=-26, 45.9s}
15.Qa4+
{0.1s}
15...Kf8
{d=5 uz=177769 oc=280, tt=71, bal=+3, diff=-17, 27.7s}
16.Rae1
{0.1s}
16...h5
{d=5 uz=810469 oc=314, tt=304, bal=+3, diff=+17, 100.3s}
17.Qb5
{0.1s}
17...Qd5
{d=5 uz=620245 oc=309, tt=195, bal=+3, diff=+12, 79.7s}
18.Qxd5
{0.1s}
18...Bxd5
{d=5 uz=78371 oc=308, tt=27, bal=-6, diff=+902, 14.2s}
19.R4e2
{0.2s}
19...Bxc4
{d=6 uz=524717 oc=601, tt=213, bal=+3, diff=+304, 58.3s}
20.Rc2
{0.4s}
20...Bxa2
{d=5 uz=68266 oc=700, tt=12, bal=+6, diff=+106, 13.6s}
21.Rcc1
{0.3s}
21...Rh7
{d=5 uz=108441 oc=727, tt=51, bal=+7, diff=+34, 18.2s}
22.Rc7
{0.3s}
22...Nd6
{d=5 uz=121640 oc=702, tt=20, bal=+7, diff=+9, 18.8s}
23.h3
{0.4s}
23...Be6
{d=5 uz=134225 oc=735, tt=33, bal=+7, diff=+42, 19.8s}
24.Re5
{0.3s}
24...Rc8
{d=5 uz=370175 oc=715, tt=207, bal=+7, diff=+22, 41.4s}
25.Rc3
{0.2s}
25...Nc4
{d=5 uz=244621 oc=726, tt=111, bal=+7, diff=+33, 31.3s}
26.Rb5
{0.2s}
26...Rc7
{d=5 uz=273638 oc=723, tt=378, bal=+7, diff=+30, 33.9s}
27.b3
{0.4s}
27...Nd6
{d=5 uz=184225 oc=663, tt=3, bal=+7, diff=-30, 23.8s}
28.Rxc7
{0.1s}
28...Nxb5
{d=6 uz=267834 oc=601, tt=13, bal=+2, diff=+403, 28.4s}
29.Rc5
{0.2s}
29...Nd4
{d=5 uz=60711 oc=725, tt=0, bal=+7, diff=+32, 10.9s}
30.Rc7
{0.2s}
30...Bd5
{d=5 uz=59919 oc=710, tt=0, bal=+7, diff=+17, 12.0s}
31.h4
{0.2s}
31...Nxb3
{d=5 uz=64973 oc=794, tt=0, bal=+7, diff=+101, 12.6s}
32.Rd7
{0.1s}
32...Be4
{d=6 uz=308326 oc=804, tt=26, bal=+8, diff=+12, 31.8s}
33.Kh2
{0.1s}
33...Nc5
{d=5 uz=90536 oc=814, tt=3, bal=+8, diff=+22, 14.7s}
34.Rd8+
{0.1s}
34...Ke7
{d=6 uz=119091 oc=779, tt=74, bal=+8, diff=-13, 16.7s}
35.Rd1
{0.1s}
35...Ke6
{d=5 uz=89296 oc=802, tt=3, bal=+8, diff=+10, 14.7s}
36.Re1
{0.2s}
36...Kf5
{d=5 uz=70268 oc=800, tt=2, bal=+8, diff=+8, 13.4s}
37.f3
{0.2s}
37...Bd5
{d=6 uz=443640 oc=783, tt=57, bal=+8, diff=-9, 43.8s}
38.Kh3
{0.2s}
38...Be6
{d=5 uz=63718 oc=801, tt=7, bal=+8, diff=+9, 11.7s}
39.Rb1
{0.2s}
39...Kf4+
{d=6 uz=326508 oc=800, tt=25, bal=+8, diff=+8, 35.5s}
40.Kh2
{0.0s}
40...Nb3
{d=5 uz=101717 oc=799, tt=0, bal=+8, diff=+7, 15.2s}
41.Rf1
{0.1s}
41...g5
{d=5 uz=108077 oc=813, tt=0, bal=+8, diff=+21, 16.0s}
42.g3+
{0.1s}
42...Kf5
{d=6 uz=171357 oc=803, tt=4, bal=+8, diff=+11, 20.3s}
43.Rd1
{0.2s}
43...Rg7
{d=5 uz=81849 oc=814, tt=3, bal=+8, diff=+22, 13.5s}
44.Kh3
{0.1s}
44...Ke5+
{d=5 uz=104899 oc=821, tt=8, bal=+8, diff=+29, 16.1s}
45.Kh2
{0.1s}
45...Nd4
{d=5 uz=90609 oc=823, tt=2, bal=+8, diff=+31, 14.5s}
46.f4+
{0.1s}
46...gxf4
{d=6 uz=456272 oc=905, tt=31, bal=+8, diff=+113, 47.6s}
47.gxf4+
{0.1s}
47...Ke4
{d=6 uz=436412 oc=795, tt=0, bal=+8, diff=+3, 45.6s}
48.f5
{0.0s}
48...Nxf5
{d=6 uz=494534 oc=904, tt=25, bal=+8, diff=+112, 47.4s}
49.Ra1
{0.1s}
49...b5
{d=5 uz=94046 oc=907, tt=32, bal=+9, diff=+16, 14.2s}
50.Kh1
{0.1s}
50...Nxh4
{d=5 uz=77069 oc=920, tt=2, bal=+9, diff=+29, 12.9s}
51.Rd1
{0.1s}
51...Nf3
{d=5 uz=66296 oc=1046, tt=3, bal=+10, diff=+56, 11.9s}
52.Rb1
{0.0s}
52...f5
{d=5 uz=89779 oc=1034, tt=2, bal=+10, diff=+44, 14.5s}
53.Rc1
{0.0s}
53...f4
{d=5 uz=67995 oc=1044, tt=2, bal=+10, diff=+54, 12.5s}
54.Ra1
{0.0s}
54...Bh3
{d=5 uz=91827 oc=1038, tt=2, bal=+10, diff=+48, 14.3s}
55.Ra4+
{0.0s}
55...Kd5
{d=6 uz=490489 oc=1548, tt=9, bal=+10, diff=+558, 47.7s}
56.Ra3
{0.0s}
56...Bg2#
{d=98 uz=171 oc=7999, tt=0, bal=+10, diff=+7009, 5.8s}
0-1
[/pgn]
The first win - and what made it possible
Second game of the series, black (micro-Max) wins:
Code: Select all
33. g1h2 {0.1s} b3c5 {oc=+814, diff=+22}
...
55. a1a4 {0.0s} e4d5 {oc=+1548, diff=+558} <-- engine sees +5.5 pawns
56. a4a3 {0.0s} h3g2 {d=98 uz=171, 5.8s} <-- mate in 1, 171 nodes
0-1
Two details worth noting. First, the +1548 assessment at move 55 was not
false optimism of the kind we saw before the sign fix: a mating net was
genuinely materializing, and even Stockfish skill 4 did not see it in time.
Second, the mate in 1 was found
by the engine itself: d=98, 171
nodes, 5.8 s. The mate-distance scoring (score = -(8000 - plies)) works
exactly as in the original.
Calibration: a 40-move endgame with oc ~= -200, bal = -2
[pgn][Event "Computer Schach Partie"]
[Site "PC"]
[Date "????.??.??"]
[Round "?"]
[White "stockfish 15.1"]
[Black "stm32"]
[Result "*"]
[Termination "normal"]
1.Nf3
{0.2s}
1...d5
{d=5 uz=65402 oc=25, tt=0, bal=+0, diff=+25, 20.6s}
2.e3
{0.1s}
2...c5
{d=5 uz=143027 oc=20, tt=0, bal=+0, diff=+20, 32.6s}
3.h3
{0.1s}
3...Be6
{d=5 uz=227927 oc=8, tt=2, bal=+0, diff=+8, 39.5s}
4.b3
{0.2s}
4...f5
{d=5 uz=226147 oc=8, tt=8, bal=+0, diff=+8, 41.0s}
5.d4
{0.2s}
5...Nc6
{d=5 uz=255953 oc=13, tt=24, bal=+0, diff=+13, 43.0s}
6.Ba3
{0.2s}
6...c4
{d=5 uz=320611 oc=-16, tt=63, bal=+0, diff=-16, 49.7s}
7.bxc4
{0.1s}
7...dxc4
{d=5 uz=130209 oc=-17, tt=17, bal=-1, diff=+82, 23.7s}
8.c3
{0.2s}
8...Nf6
{d=5 uz=343354 oc=-5, tt=65, bal=+0, diff=-5, 52.6s}
9.Nfd2
{0.1s}
9...b5
{d=5 uz=389992 oc=-31, tt=25, bal=+0, diff=-31, 59.3s}
10.Be2
{0.1s}
10...g5
{d=5 uz=464881 oc=-18, tt=48, bal=+0, diff=-18, 68.9s}
11.Nf3
{0.1s}
11...Bh6
{d=5 uz=395898 oc=-15, tt=21, bal=+0, diff=-15, 60.4s}
12.Bc5
{0.2s}
12...Ne4
{d=4 uz=73635 oc=3, tt=1, bal=+0, diff=+3, 16.5s}
13.Nfd2
{0.1s}
13...Nxc5
{d=4 uz=65358 oc=-10, tt=4, bal=+0, diff=-10, 15.5s}
14.dxc5
{0.1s}
14...O-O
{d=5 uz=361377 oc=-14, tt=49, bal=+0, diff=-14, 51.9s}
15.O-O
{0.2s}
15...Qd5
{d=5 uz=277304 oc=99, tt=47, bal=+0, diff=+99, 41.4s}
16.a4
{0.1s}
16...a6
{d=5 uz=332401 oc=75, tt=133, bal=+0, diff=+75, 47.8s}
17.Nf3
{0.1s}
17...Qxc5
{d=5 uz=380571 oc=95, tt=383, bal=+0, diff=+95, 55.3s}
18.Nd4
{0.1s}
18...Bd5
{d=5 uz=584270 oc=98, tt=581, bal=+1, diff=-1, 83.3s}
19.axb5
{0.1s}
19...Nxd4
{d=5 uz=566839 oc=84, tt=514, bal=+0, diff=+84, 74.8s}
20.exd4
{0.1s}
20...Qxb5
{d=5 uz=178597 oc=104, tt=87, bal=+0, diff=+104, 27.3s}
21.Bf3
{0.1s}
21...Rf7
{d=5 uz=278274 oc=117, tt=255, bal=+1, diff=+18, 40.6s}
22.Nd2
{0.1s}
22...Bxf3
{d=5 uz=1107346 oc=98, tt=1446, bal=+1, diff=-1, 134.4s}
23.Nxf3
{0.2s}
23...Ra7
{d=5 uz=143476 oc=121, tt=44, bal=+1, diff=+22, 23.1s}
24.Qe2
{0.1s}
24...Rc7
{d=5 uz=224831 oc=101, tt=163, bal=+1, diff=+2, 32.6s}
25.Rfb1
{0.1s}
25...Qc6
{d=5 uz=200789 oc=101, tt=14, bal=+1, diff=+2, 29.1s}
26.Rb8+
{0.1s}
26...Rf8
{d=5 uz=378655 oc=1, tt=321, bal=+1, diff=-98, 48.4s}
27.Rxf8+
{0.1s}
27...Bxf8
{d=5 uz=121969 oc=16, tt=22, bal=-4, diff=+412, 19.2s}
28.Rb1
{0.1s}
28...Qf6
{d=5 uz=183996 oc=101, tt=48, bal=+1, diff=+2, 26.2s}
29.Nxg5
{0.1s}
29...Qxg5
{d=5 uz=111288 oc=196, tt=15, bal=+0, diff=+196, 17.8s}
30.Qe6+
{0.1s}
30...Kg7
{d=6 uz=224786 oc=-218, tt=26, bal=+3, diff=-515, 28.0s}
31.Qe5+
{0.1s}
31...Qf6
{d=6 uz=259560 oc=-221, tt=18, bal=+3, diff=-518, 29.6s}
32.Qg3+
{0.1s}
32...Kf7
{d=6 uz=309510 oc=-221, tt=38, bal=+3, diff=-518, 33.7s}
33.Qxc7
{0.1s}
33...Qe6
{d=5 uz=90087 oc=-202, tt=7, bal=-2, diff=-4, 14.9s}
34.Qf4
{0.1s}
34...Bg7
{d=5 uz=116460 oc=-197, tt=8, bal=-2, diff=+1, 17.4s}
35.Qg5
{0.1s}
35...Bh6
{d=5 uz=165176 oc=-223, tt=14, bal=-2, diff=-25, 20.7s}
36.Qh4
{0.1s}
36...Qg6
{d=5 uz=173452 oc=-203, tt=7, bal=-2, diff=-5, 22.0s}
37.f4
{0.1s}
37...Bg7
{d=5 uz=163873 oc=-202, tt=4, bal=-2, diff=-4, 20.7s}
38.Qf2
{0.1s}
38...Qc6
{d=5 uz=163395 oc=-207, tt=7, bal=-2, diff=-9, 21.6s}
39.Qe2
{0.1s}
39...Bh6
{d=5 uz=152672 oc=-218, tt=47, bal=-2, diff=-20, 22.8s}
40.Re1
{0.1s}
40...Bxf4
{d=5 uz=135328 oc=-208, tt=15, bal=-2, diff=-10, 19.6s}
41.Qxe7+
{0.1s}
41...Kg8
{d=5 uz=94867 oc=-252, tt=11, bal=-2, diff=-54, 14.5s}
42.Kh1
{0.1s}
42...Qc8
{d=5 uz=315780 oc=-211, tt=82, bal=-2, diff=-13, 32.5s}
43.Qe8+
{0.1s}
43...Qxe8
{d=6 uz=144189 oc=-320, tt=341, bal=-2, diff=-122, 16.3s}
44.Rxe8+
{0.1s}
44...Kf7
{d=7 uz=247960 oc=-302, tt=251, bal=-2, diff=-104, 22.8s}
45.Rc8
{0.1s}
45...Ke6
{d=6 uz=201444 oc=-340, tt=68, bal=-2, diff=-142, 22.0s}
46.Rc6+
{0.1s}
46...Kd5
{d=6 uz=70027 oc=-319, tt=8, bal=-2, diff=-121, 11.0s}
47.Rc5+
{0.0s}
47...Ke4
{d=6 uz=67424 oc=-337, tt=2, bal=-2, diff=-139, 10.8s}
48.Rxc4
{0.1s}
48...Kd3
{d=6 uz=216463 oc=-343, tt=11, bal=-3, diff=-46, 22.6s}
49.Rc6
{0.1s}
49...Bd2
{d=6 uz=155046 oc=-311, tt=13, bal=-3, diff=-14, 17.1s}
50.Rxa6
{0.1s}
50...Bxc3
{d=6 uz=135419 oc=-307, tt=60, bal=-4, diff=+89, 15.6s}
51.Ra7
{0.1s}
51...Bxd4
{d=6 uz=101411 oc=-292, tt=32, bal=-3, diff=+5, 13.1s}
52.Rc7
{0.1s}
52...h6
{d=6 uz=148010 oc=-219, tt=4, bal=-2, diff=-21, 17.5s}
53.Rh7
{0.1s}
53...Be3
{d=6 uz=104887 oc=-203, tt=6, bal=-2, diff=-5, 13.1s}
54.Kh2
{0.1s}
54...Bf4+
{d=6 uz=91367 oc=-196, tt=12, bal=-2, diff=+2, 12.1s}
55.g3
{0.1s}
55...Bg5
{d=6 uz=98523 oc=-202, tt=9, bal=-2, diff=-4, 13.2s}
56.h4
{0.1s}
56...Be3
{d=6 uz=112006 oc=-199, tt=5, bal=-2, diff=-1, 13.3s}
57.Kg2
{0.0s}
57...Ke4
{d=6 uz=157406 oc=-203, tt=10, bal=-2, diff=-5, 16.3s}
58.Re7+
{0.0s}
58...Kd4
{d=6 uz=131280 oc=-216, tt=9, bal=-2, diff=-18, 14.3s}
59.Rc7
{0.1s}
59...Ke4
{d=6 uz=130250 oc=-205, tt=4, bal=-2, diff=-7, 15.0s}
60.Re7+
{0.1s}
60...Kd4
{d=6 uz=131662 oc=-216, tt=9, bal=-2, diff=-18, 14.8s}
61.Rf7
{0.1s}
61...Ke4
{d=6 uz=129813 oc=-205, tt=3, bal=-2, diff=-7, 13.7s}
62.Rc7
{0.1s}
62...Bd4
{d=6 uz=174048 oc=-201, tt=8, bal=-2, diff=-3, 18.4s}
63.Re7+
{0.0s}
63...Kd5
{d=6 uz=151826 oc=-225, tt=10, bal=-2, diff=-27, 16.4s}
64.Kf3
{0.1s}
64...Bc5
{d=6 uz=314045 oc=-295, tt=11, bal=-2, diff=-97, 27.2s}
65.Re8
{0.0s}
65...Ba3
{d=6 uz=239973 oc=-229, tt=224, bal=-2, diff=-31, 22.8s}
66.Ra8
{0.1s}
66...Bc1
{d=6 uz=241979 oc=-209, tt=232, bal=-2, diff=-11, 22.8s}
67.Ra4
{0.1s}
67...Bd2
{d=6 uz=184530 oc=-208, tt=103, bal=-2, diff=-10, 18.2s}
68.Ra2
{0.1s}
68...Bb4
{d=6 uz=216204 oc=-212, tt=206, bal=-2, diff=-14, 20.4s}
69.Ra1
{0.0s}
69...Be7
{d=6 uz=273641 oc=-209, tt=132, bal=-2, diff=-11, 25.6s}
70.Ra6
{0.1s}
70...Bd6
{d=6 uz=146878 oc=-213, tt=91, bal=-2, diff=-15, 15.5s}
71.Ra8
{0.0s}
71...Be5
{d=6 uz=184571 oc=-218, tt=237, bal=-2, diff=-20, 18.0s}
72.Ra6
{0.0s}
72...Bd6
{d=6 uz=162613 oc=-225, tt=138, bal=-2, diff=-27, 16.8s}
73.g4
{0.0s}
73...fxg4+
{d=6 uz=222209 oc=-233, tt=125, bal=-2, diff=-35, 21.3s}
74.Kxg4
{0.1s}
74...Ke5
{d=6 uz=128505 oc=-240, tt=110, bal=-2, diff=-42, 14.4s}
75.Ra4
{0.1s}
75...Bf8
{d=6 uz=218588 oc=-238, tt=123, bal=-2, diff=-40, 20.0s}
76.h5
{0.0s}
76...Bc5
{d=6 uz=89437 oc=-204, tt=21, bal=-2, diff=-6, 12.3s}
77.Ra5
{0.1s}
77...Kd5
{d=6 uz=76000 oc=-225, tt=45, bal=-2, diff=-27, 10.8s}
78.Kf3
{0.1s}
78...Kc6
{d=6 uz=81329 oc=-223, tt=102, bal=-2, diff=-25, 11.3s}
79.Ra6+
{0.1s}
79...Bb6
{d=7 uz=318807 oc=-215, tt=662, bal=-2, diff=-17, 25.7s}
80.Ra8
{0.1s}
80...Bd4
{d=6 uz=171812 oc=-290, tt=331, bal=-2, diff=-92, 17.8s}
81.Rg8
{0.1s}
81...Kd6
{d=6 uz=162845 oc=-317, tt=105, bal=-2, diff=-119, 16.7s}
82.Rg6+
{0.0s}
82...Kd5
{d=6 uz=66819 oc=-321, tt=5, bal=-2, diff=-123, 10.1s}
83.Rxh6
{0.0s}
83...Ke5
{d=6 uz=74022 oc=-329, tt=2, bal=-3, diff=-32, 10.5s}
84.Rg6
{0.1s}
84...Kd5
{d=6 uz=99723 oc=-324, tt=10, bal=-3, diff=-27, 12.0s}
85.h6
{0.1s}
85...Bh8
{d=6 uz=384617 oc=-489, tt=114, bal=-3, diff=-192, 32.1s}
86.Kf4
{0.1s}
86...Be5+
{d=6 uz=139963 oc=-302, tt=15, bal=-3, diff=-5, 15.0s}
87.Kg4
{0.1s}
87...Ke4
{d=6 uz=406269 oc=-489, tt=104, bal=-3, diff=-192, 33.0s}
88.Re6
{0.1s}
88...Kd5
{d=7 uz=184707 oc=-876, tt=18, bal=-3, diff=-579, 20.7s}
89.Rxe5+
{0.1s}
89...Kxe5
{d=8 uz=264737 oc=-893, tt=63, bal=-6, diff=-299, 22.8s}
90.Kg5
{0.0s}
90...Ke4
{d=8 uz=323316 oc=-894, tt=177, bal=-1, diff=-795, 28.3s}
91.h7
{0.0s}
91...Ke5
{d=7 uz=111852 oc=-901, tt=60, bal=-1, diff=-802, 13.7s}
92.Kh5
{0.1s}
92...Kf5
{d=7 uz=85453 oc=-901, tt=85, bal=-1, diff=-802, 11.8s}
93.Kh6
{0.1s}
93...Ke5
{d=7 uz=74582 oc=-902, tt=77, bal=-1, diff=-803, 11.1s}
94.Kh5
{0.0s}
94...Kf5
{d=7 uz=85466 oc=-901, tt=85, bal=-1, diff=-802, 11.7s}
95.Kh6
{0.0s}
95...Ke5
{d=7 uz=74584 oc=-902, tt=77, bal=-1, diff=-803, 11.1s}
96.Kg5
{0.1s}
96...Kd5
{d=7 uz=137757 oc=-902, tt=31, bal=-1, diff=-803, 15.4s}
97.Kf4
{0.0s}
97...Kd4
{d=7 uz=182111 oc=-901, tt=9, bal=-1, diff=-802, 18.7s}
98.Kf3
{0.0s}
98...Ke5
{d=7 uz=147162 oc=-902, tt=19, bal=-1, diff=-803, 16.2s}
99.Ke3
{0.0s}
99...Ke6
{d=7 uz=131772 oc=-902, tt=70, bal=-1, diff=-803, 14.6s}
100.Ke4
{0.0s}
100...Kf6
{d=7 uz=140379 oc=-902, tt=72, bal=-1, diff=-803, 15.9s}
101.h8=Q+
{0.1s}
101...Kf7
{d=6 uz=99626 oc=-943, tt=33, bal=-9, diff=-52, 13.8s}
102.Kf5
{0.0s}
102...Ke7
{d=7 uz=246399 oc=-943, tt=35, bal=-9, diff=-52, 22.7s}
103.Qd4
{0.1s}
103...Kf7
{d=98 uz=328355 oc=-7997, tt=60, bal=-9, diff=-7106, 29.1s}
104.Kg5
{0.0s}
104...Ke6
{d=7 uz=270778 oc=-930, tt=27, bal=-9, diff=-39, 23.9s}
105.Kf4
{0.0s}
*
[/pgn]
The most valuable diagnostic of the whole series is the
lost game.
From move 43 to move 104 the engine's own score stayed within -196..-343
while the material balance was -2, and diff stayed in the +-30 band for
[font=courier]forty consecutive moves[/font]. Engine self-assessment and
the independent material count agreed to within a third of a pawn across
an entire endgame. This is the direct payoff of the sign fix and the
capture correction (adding PST[victim] to the material bonus on
captures): no drift in either direction.
The loss itself was a depth problem, not an evaluation problem - the
engine never claimed it was better when it was worse. Two decisive
moments, both beyond the search horizon:
- move 26-27: a rook trade offered at d=5 with oc=+1 while the
truth was -98 (diff=-98): micro-Max gave up the exchange because the
recapture line was one ply beyond its horizon;
- move 29: Stockfish sacrificed a knight (oc=+196, diff=+196 - the
engine happily took the bait); one move later the follow-up showed -515.
Against skill 4 at depth 5-6, that is expected. The evaluator did its job:
it reported the truth once it became visible, and never invented a fantasy
plus.
The remaining bottleneck: the isolated pawn penalty
One observation from the games disagrees with first impressions, so here
are the numbers. Pawn activity is fine everywhere
except one square:
in the lost game, e7 never moved. The arithmetic explains why - after d7
and f7 leave early, e7 is isolated, and a step e7-e6 costs:
Code: Select all
PST: e6(14) - e7(8) = +6
isolation penalty: -20 <-- dominant term
new shield penalty (single step): -10
total: -24
Our shield change returned only 10 of ~24 points; the isolation coefficient
dominates. The engine still found a workaround (g7-g5, Bf8-h6, then O-O -
the shield does not apply to g7, since x^16 of g7 is g8, not the king).
Next experiment, single coefficient: the pawn-structure term
Code: Select all
v -= 20 * ((x-2&M||b[x-2]-u) + (x+2&M||b[x+2]-u) - 1);
goes to
- back toward the original spirit (the constant was 9 before we raised
it). This makes e7-e6 cost -14 instead of -24. The known trade-off: the
phalanx
bonus also halves (+20 -> +10), so paired pawn jumps become
slightly less attractive - but with 7 of 8 pawns moving, there is clearly
spare drive.
Summary so far
- PST sign fix: confirmed working - no rewarded retreats, active
pawn play, honest endgame calibration over 40 moves.
- Capture correction: confirmed - diff on capture moves now reflects
genuine tactics, not bookkeeping residue.
- First win against Stockfish 15.1 skill 4, including a mate in 1 found
by the engine itself (171 nodes).
- Remaining depth limitation documented: sacrifices with a 2-ply
follow-up are invisible at d=5-6; the evaluator is not at fault.