Hi.gflohr wrote: ↑Fri Jul 23, 2021 10:58 pm Hi!
Trying to understand chess engine programming just for fun ...
... I have used test positions from https://github.com/jdart1/arasan-chess/ ... c/unit.cpp for testing my implementation of a static exchange evaluation function. I have problems understanding this position with white moving Rxc8:
[d]2r5/1P4pk/p2p1b1p/5b1n/BB3p2/2R2p2/P1P2P2/4RK2 w - - 0 1
My implementation returns a bishop's value but the test from Arasan expects a rook's value gain. Unless I terribly missed something here, my explanation is that Arasan "thinks" that re-hitting the rook with Bxc8 is a bad capture, presumably because it would result in a huge material gain for white by re-hitting with the pawn and promoting it to a queen.
My SEE implementation is based on the well-known code from https://www.chessprogramming.org/SEE_-_ ... _Algorithm. Even if I take the material gain by the promotion into account, I still end up with one bishop gain, essentially because the last hit is always the "speculative store" that gets ignored altogether, so that it doesn't matter what else the final pawn hit may win.
So what would be the correct static exchange evaluation for Rxc8 in this position with taking promotions into account?
The sequence is like that, if the white rook move (Rc8) is the move in question: Rc8 (+500) Bc8 (-500) Pc8 (+300 + 900 - 100) = 1100
when the material values are like 900,500,300,300,100 / Q,R,B,N,P
If the squence is within the SEE logic, Rc8 is not the next move but because of lva ordering, the pawn capture would be the first one.
Then the sequence would be like: Pc8 (+500 + 900 - 100) Bc8 ( -900 ) Rc8 (+300) = 700
You should also consider for the general case, that when the promotion is the initial move, a negative SEE value will never be less than -100,
so the SEE score is not the promoted score but the pawn value.