verifying my understanding of see

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

Post Reply
User avatar
flok
Posts: 899
Joined: Fri Mar 14, 2008 1:33 pm
Location: Gouda, the Netherlands
Contact:

verifying my understanding of see

Post by flok » Mon Feb 20, 2017 3:49 pm

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: 22207
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Contact:

Re: verifying my understanding of see

Post by hgm » Mon Feb 20, 2017 4:07 pm

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.

User avatar
flok
Posts: 899
Joined: Fri Mar 14, 2008 1:33 pm
Location: Gouda, the Netherlands
Contact:

Re: verifying my understanding of see

Post by flok » Mon Feb 20, 2017 7:35 pm

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: 131
Joined: Fri Dec 16, 2016 10:04 am
Contact:

Re: verifying my understanding of see

Post by abulmo2 » Mon Feb 20, 2017 7:44 pm

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: 22207
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Contact:

Re: verifying my understanding of see

Post by hgm » Mon Feb 20, 2017 8:33 pm

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: 2898
Joined: Fri Jan 21, 2011 11:42 pm
Location: NL
Contact:

Re: verifying my understanding of see

Post by Evert » Mon Feb 20, 2017 10:03 pm

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: 3596
Joined: Sun Aug 10, 2008 1:15 pm
Location: Philippines

Re: verifying my understanding of see

Post by Ferdy » Tue Feb 21, 2017 2:48 am

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.

Post Reply