is phase a good indicator of game progress?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

brtzsnr
Posts: 433
Joined: Fri Jan 16, 2015 4:02 pm

is phase a good indicator of game progress?

Post by brtzsnr »

Hi!

Many engines (including mine) have implemented a variant of Tapered Eval [1]. Did anyone test how well the phase calculation as explained on CPW measures the game progress?

[1] https://chessprogramming.wikispaces.com/Tapered+Eval
jdart
Posts: 4366
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: is phase a good indicator of game progress?

Post by jdart »

The wiki is describing a linear taper based on a crude approximation of material value.

That is certainly a possible way to do it. I use a lookup table to map the material value (in a range of 0-31) to a scale (in the range 0-128) and then use that for tapering. I think that is a pretty common approach.

The table is roughly a sigmoid but with a fairly high exponent (see https://github.com/jdart1/arasan-chess/ ... coring.cpp around line 36), so that values < 12 are treated as completely within the endgame and values > 23 are middlegame/opening only.

--Jon
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: is phase a good indicator of game progress?

Post by Evert »

It's something that has been on my list for ages.

There's no reason different evaluation terms have to scale in the same way with "game phase". Passed pawn evaluation, king centralisation and king safety come to mind as evaluation terms that probably should scale differently.

I suspect it's one of those things that give you a big gain for doing it at all, and then it becomes harder to improve on that.
PK
Posts: 893
Joined: Mon Jan 15, 2007 11:23 am
Location: Warsza

Re: is phase a good indicator of game progress?

Post by PK »

king safety and king centralization can be possibly interlinked, but separating passers sounds like a good idea. most of the exchanges favour passers. for other factors there should be a point where exchanges don't modify anything.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: is phase a good indicator of game progress?

Post by Evert »

PK wrote:king safety and king centralization can be possibly interlinked,
Maybe, but there is a conceptual difference. King safety is what you need if the opponent has the material to launch an attack on the king's position. If he doesn't have that, it may or may not be safe to have the king walk out on the centre of the board. The distinction is a subtle one, and perhaps not worth a great deal (in terms of Elo).

Conceptually, I don't distinguish "opening" and "endgame" as phases, but "king-stays-in-castle", "king-joins-battle", "run-with-pawns" and "hunt-the-king".
but separating passers sounds like a good idea. most of the exchanges favour passers. for other factors there should be a point where exchanges don't modify anything.
It should depend on whether an exchange constitutes "progress".

Now, chess is really a fairly straightforward game in terms of strategy: try to get a small advantage, then amplify it to the point where it gets you an extra pawn, then trade away all extra pieces, promote the pawn and mate the king.
CRoberson
Posts: 2055
Joined: Mon Mar 13, 2006 2:31 am
Location: North Carolina, USA

Re: is phase a good indicator of game progress?

Post by CRoberson »

Back in the 90's and before CPUs used a superscalar design, division was time consuming. So, we used tables for various values. Most used 3 tables
for each value that needed progression (opening, middle and endgame). There were multiple methods for deciding stage. This method had issues with
search instability. I went to using 5 sets of tables for 5 stages of the game which improved the search.

The current techniques for phase adjustment are superior to the old way.
jdart
Posts: 4366
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: is phase a good indicator of game progress?

Post by jdart »

Now, chess is really a fairly straightforward game in terms of strategy: try to get a small advantage, then amplify it to the point where it gets you an extra pawn, then trade away all extra pieces, promote the pawn and mate the king.
Many pawn-up endgames are draws. Especially (and notoriously) Bishop endgames.

--Jon
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: is phase a good indicator of game progress?

Post by Evert »

CRoberson wrote:Back in the 90's and before CPUs used a superscalar design, division was time consuming. So, we used tables for various values. Most used 3 tables
for each value that needed progression (opening, middle and endgame). There were multiple methods for deciding stage. This method had issues with
search instability. I went to using 5 sets of tables for 5 stages of the game which improved the search.

The current techniques for phase adjustment are superior to the old way.
Someone correct me if I'm wrong, but my understanding is that this superiority is due to avoiding evaluation discontinuity. There is no logical reason for all terms to scale in the same way.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: is phase a good indicator of game progress?

Post by Evert »

jdart wrote:
Now, chess is really a fairly straightforward game in terms of strategy: try to get a small advantage, then amplify it to the point where it gets you an extra pawn, then trade away all extra pieces, promote the pawn and mate the king.
Many pawn-up endgames are draws. Especially (and notoriously) Bishop endgames.
Sure - you have to make sure you don't trade away your advantage; I guess that defines what I meant by "extra pieces". In broad strokes I think what I said is fair though, but the devil is in the details.
brtzsnr
Posts: 433
Joined: Fri Jan 16, 2015 4:02 pm

Re: is phase a good indicator of game progress?

Post by brtzsnr »

Is it possible that the discontinuity came from improper tuning? Now, with Texel Tuning method, or SPSA one can tune all variables at once so there should be very little instability due to different ranges of evaluation funtions.