verifying my understanding of see

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

flok

verifying my understanding of see

Post by flok »

Given:

[D]K7/8/k3r3/3q1b2/4r3/5P2/4R3/8 w - - 0 0

(please ignore the fact that kings are check etc)

and:
pawn 100
knight 325
bishop 325
rook 500
queen 975

Am I right that the see for capturing the rook at e4 gives an see of:

500 (rook, the piece captured) + 100 (pawn, first attacker) - 325 (bishop, first protector) + 500 (rook) - 500 (rook) (ends here because no more attackers) and thus 275?
User avatar
hgm
Posts: 27790
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: verifying my understanding of see

Post by hgm »

Not always.

The SEE for capturing Re4 with the Pawn is +400, because you won't be so dumb as to sac your Rook for a Bishop. Only the SEE of Rxe4 has a SEE of 275, because you will continue with PxB after the recapture.

Btw, usually SEE is done with piece values 1,3,3,5,9 (or 10), rather than the more precise values used in eval.
flok

Re: verifying my understanding of see

Post by flok »

hgm wrote:Not always.

The SEE for capturing Re4 with the Pawn is +400, because you won't be so dumb as to sac your Rook for a Bishop.
I don't understand this. We start with a rook which gets captured by that pawn. This gives +400. 400 > bishop, so why won't the bishop capture that pawn?
Btw, usually SEE is done with piece values 1,3,3,5,9 (or 10), rather than the more precise values used in eval.
Why is that?


regards!
abulmo2
Posts: 433
Joined: Fri Dec 16, 2016 11:04 am
Location: France
Full name: Richard Delorme

Re: verifying my understanding of see

Post by abulmo2 »

flok wrote:
hgm wrote:Not always.
The SEE for capturing Re4 with the Pawn is +400, because you won't be so dumb as to sac your Rook for a Bishop.
I don't understand this. We start with a rook which gets captured by that pawn. This gives +400. 400 > bishop, so why won't the bishop capture that pawn?!
The value is 400 after the bishop capture the pawn. The white rook will not capture the bishop, because it will be recaptured again.
Richard Delorme
User avatar
hgm
Posts: 27790
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: verifying my understanding of see

Post by hgm »

It is not smart to capture a protected Bishop with a Rook, and SEE knows that. So it stands pat at that point.

See is really not different from QS, except that (next to stand pat) it only considers a single move: recapture to the same square with the least valuable piece.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: verifying my understanding of see

Post by Evert »

flok wrote:
Btw, usually SEE is done with piece values 1,3,3,5,9 (or 10), rather than the more precise values used in eval.
Why is that?
It doesn't matter either way, as long as the outcome (in particular the sign) is useful.
You might as well use the eval values to keep things simple. Three caveats though:
1. SEE can the return values that have an absolute value below 1 pawn. What do you do with those? SEE doesn't consider positional elements, as a predictor for the change in score it's certainly no more accurate than a pawn value.
2. What eval values do you use? Opening or middle-game? You certainly don't want to interpolate (too slow), and for the purpose of SEE it shouldn't actually matter, but see 1.
3. What about king-captures? You can deal with those by giving the king a sufficiently high value that trying to capture a defended piece with the king becomes a no-go. If you get this wrong, the program will occasionally exchange kings, with hilarious results (SEE will be spectacularly wrong).
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: verifying my understanding of see

Post by Ferdy »

flok wrote:Given:

[D]K7/8/k3r3/3q1b2/4r3/5P2/4R3/8 w - - 0 0

(please ignore the fact that kings are check etc)

and:
pawn 100
knight 325
bishop 325
rook 500
queen 975

Am I right that the see for capturing the rook at e4 gives an see of:

500 (rook, the piece captured) + 100 (pawn, first attacker) - 325 (bishop, first protector) + 500 (rook) - 500 (rook) (ends here because no more attackers) and thus 275?
Try to look at it from side to move point of view.
1. Without early cutoff:
see = 0
see += +500-100+325-500 = 225
pxr bxp rxb rxr (or qxr)

2. With early cutoff:
see = 0
see += +500-100 = 400

Most people would go for case 2.

When doing see it is better to start from lowest attacker, this is why pxr first and not rxr.