Identifying combinations in a game

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

zamar
Posts: 613
Joined: Sun Jan 18, 2009 7:03 am

Re: Identifying combinations in a game

Post by zamar »

mcostalba wrote: This is my definition of a winning combination

1) A move that does not increase the eval more then LOWER_THRESHOLD for the following DEPTH_LIMIT_1 plies

2) A move that after DEPTH_LIMIT_2 plies makes the eval jump high

3) A move that keep a very high eval for as long as the analisys goes deep.


In a line conditions are:

Eval(ply) - Eval(0) < LOWER_THRESHOLD for ply < DEPTH_LIMIT_1
Eval(ply) - Eval(0) > HIGHER_THRESHOLD for ply > DEPTH_LIMIT_2

Where DEPTH_LIMIT_1 < DEPTH_LIMIT_2


And now the new trick:

4) Called eval_second_best the evaluation of the second best move after deep analysis then must be:

Eval(ply) - eval_second_best > SECOND_BEST_THRESOLD for ply == MAX_DEPTH.

So parameters are:

DEPTH_LIMIT_1
DEPTH_LIMIT_2
LOWER_THRESHOLD
HIGHER_THRESHOLD
SECOND_BEST_THRESOLD
MAX_DEPTH
Your definition looks very promising, and it's best I've seen so far. However Imagine a position where first two plies in pv are "obvious only moves", but the third move is a start of deep combination. With your definition the first "obvious only move" (could be fx. a forced capture) also gets classified as combination.

Or did I miss something?
Joona Kiiski
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: Identifying combinations in a game

Post by mcostalba »

zamar wrote: However Imagine a position where first two plies in pv are "obvious only moves", but the third move is a start of deep combination. With your definition the first "obvious only move" (could be fx. a forced capture) also gets classified as combination.

Or did I miss something?
In this case the combination starts before the obvious move :-)
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Identifying combinations in a game

Post by bob »

mcostalba wrote:
bob wrote:
mcostalba wrote:
bob wrote: Then, for a starting point, a move that looks bad (negative eval) for a very shallow search but which later proves to win material, not lose it, we call a "winning combination.
IMHO you can lift the negative eval at start (has no sense) and keep the big jump in eval (no need to win material, also this constrain has no sense, could also mate as example).

The only metrics should be the evaluation value.

Another thing that is missed is the comparison with siblings moves otherwise in a winning position every move is a winning combination.

This is my definition of a winning combination

1) A move that does not increase the eval more then LOWER_THRESHOLD for the following DEPTH_LIMIT_1 plies

2) A move that after DEPTH_LIMIT_2 plies makes the eval jump high

3) A move that keep a very high eval for as long as the analisys goes deep.


In a line conditions are:

Eval(ply) - Eval(0) < LOWER_THRESHOLD for ply < DEPTH_LIMIT_1
Eval(ply) - Eval(0) > HIGHER_THRESHOLD for ply > DEPTH_LIMIT_2

Where DEPTH_LIMIT_1 < DEPTH_LIMIT_2


And now the new trick:

4) Called eval_second_best the evaluation of the second best move after deep analysis then must be:

Eval(ply) - eval_second_best > SECOND_BEST_THRESOLD for ply == MAX_DEPTH.

So parameters are:

DEPTH_LIMIT_1
DEPTH_LIMIT_2
LOWER_THRESHOLD
HIGHER_THRESHOLD
SECOND_BEST_THRESOLD
MAX_DEPTH
I had suggested the negative eval so that the move would look bad at first glance. Otherwise if it is just a "normal-looking move" that springs a deeper trap, one could luck into it just because it looks normal to start with,
Please take a good look at condition 4, after that I think it should be clear why your above exposed case is already taken care of.
I do not see how that protects against the case where the opponent plays Bxc3 (taking the knight, and prior to that move material is even). The search is going to show that bxc3 is the best move and is clearly better than any other alternative (including the second-best move) but this is not a combination or tactical shot, just recapturing to restore material balance...
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: Identifying combinations in a game

Post by mcostalba »

bob wrote:
I do not see how that protects against the case where the opponent plays Bxc3 (taking the knight, and prior to that move material is even)..
In this case is condition 1 that fails.
zamar
Posts: 613
Joined: Sun Jan 18, 2009 7:03 am

Re: Identifying combinations in a game

Post by zamar »

mcostalba wrote:
zamar wrote: However Imagine a position where first two plies in pv are "obvious only moves", but the third move is a start of deep combination. With your definition the first "obvious only move" (could be fx. a forced capture) also gets classified as combination.

Or did I miss something?
In this case the combination starts before the obvious move :-)
Not necessarily. Last move by the opponent could be (and quite likely is) a blunder. But okay, then one could argue that those obvious moves are also part of combiation, hmm...
Joona Kiiski
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: Identifying combinations in a game

Post by mcostalba »

zamar wrote: Not necessarily. Last move by the opponent could be (and quite likely is) a blunder. But okay, then one could argue that those obvious moves are also part of combiation, hmm...
I don't claim this alghortim is ALREADY 100% correct, but it's a first cut. If someone implements it and checks some games I think should be not difficult, with the REAL RESULTS in our hands to tweak the last bits and have a workeable chess combination detector.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Identifying combinations in a game

Post by bob »

mcostalba wrote:
bob wrote:
I do not see how that protects against the case where the opponent plays Bxc3 (taking the knight, and prior to that move material is even)..
In this case is condition 1 that fails.
I have seen two types of positions that cause a problem here.

1. The recapture initially looks bad, but as you go deeper you realize that it is perfectly safe.

2. The capture initially looks good, but if you go deep enough you realize that it is not safe and you have to play an "in-between" move first, and then play the recapture that is now safe.
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: Identifying combinations in a game

Post by mcostalba »

bob wrote:
I have seen two types of positions that cause a problem here.

1. The recapture initially looks bad, but as you go deeper you realize that it is perfectly safe.
In this case THIS is a viable combination: something that seems bad but at the end is good :-)
bob wrote: 2. The capture initially looks good, but if you go deep enough you realize that it is not safe and you have to play an "in-between" move first, and then play the recapture that is now safe.
Then the capture as first move do not pass condition 1, while the "in-between" move passes as it should because THAT's the starting of the combination.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Identifying combinations in a game

Post by bob »

mcostalba wrote:
bob wrote:
I have seen two types of positions that cause a problem here.

1. The recapture initially looks bad, but as you go deeper you realize that it is perfectly safe.
In this case THIS is a viable combination: something that seems bad but at the end is good :-)
bob wrote: 2. The capture initially looks good, but if you go deep enough you realize that it is not safe and you have to play an "in-between" move first, and then play the recapture that is now safe.
Then the capture as first move do not pass condition 1, while the "in-between" move passes as it should because THAT's the starting of the combination.
I don't call something a "combination" if there is no gain of any kind. It is just a "legal" move... Here is one example of a problem:

[D]5r1k/6p1/1n2Q2p/4p3/8/7P/PP4PK/R1B1q3 w - -

That came from a game between Belle and Cray Blitz in 1981. Qxb6 looks good to a very shallow search. It looks less good to a deeper search (most will discover Qxb6 is unplayable almost instantly today, not in 1981). Bxh6 leads to a forced draw and is the correct move here.

What is interesting is

(a) Qxb6 looks like a winner until a deeper search shows it is not.

(b) Bxh6 leads to a forced draw, rather than any sort of win in material, although other moves get worse over time...

There are a lot of positions that are hard to classify. One move clearly better than the rest. Obvious move bad on deep inspection. A simple move that leads to a deep win. A simple move that leads to nothing with deep analysis, while to shallow analysis it appears to be winning. All are tough to recognize...
Rein Halbersma
Posts: 741
Joined: Tue May 22, 2007 11:13 am

Re: Identifying combinations in a game

Post by Rein Halbersma »

bob wrote: There are a lot of positions that are hard to classify. One move clearly better than the rest. Obvious move bad on deep inspection. A simple move that leads to a deep win. A simple move that leads to nothing with deep analysis, while to shallow analysis it appears to be winning. All are tough to recognize...
OK, let's analyze that in terms of Marcel's constraints::

1) "One move clearly better than the rest."

Eval(ply) - eval_second_best > SECOND_BEST_THRESOLD for all ply

2) "Obvious move bad on deep inspection."

Eval(ply) - Eval(0) > LOWER_THRESHOLD > 0 for ply < DEPTH_LIMIT_1
Eval(ply) - Eval(0) < HIGHER_THRESHOLD < 0 for ply > DEPTH_LIMIT_2
Eval(ply) - eval_second_best > SECOND_BEST_THRESOLD for ply < DEPTH_LIMIT_1

the "obvious clause" is given by the 1st and 3rd lines. The "bad clause" by the 2nd.

3) "A simple move that leads to a deep win"

This would appear to be a special case of a combination where there are at shallow depths multiple reasonable looking moves by the opponent (the simple clause), but in each case there is a deep refutation. Other suggestions?

4) "A simple move that leads to nothing with deep analysis, while to shallow analysis it appears to be winning."

Eval(ply) - Eval(0) > HIGHER_THRESHOLD > 0 for ply < DEPTH_LIMIT_1
0 < Eval(ply) - Eval(0) < LOWER_THRESHOLD for ply > DEPTH_LIMIT_2
DEPTH_LIMIT_1 < DEPTH_LIMIT_2

It seems that when thinking a bit carefully about these classes, it is more or less clear what is meant. E.g. take a look at the remarks that GM's make about games in newspaper articles: they are usually about missed combinations, avoided combinations, refutations of obvious ideas etc. There might be some more classes, but I think that most are classifiable in terms of simple rules.