In fruit, stage is a simple function of pieces captured. In Abbess, the stage is a lookup of the 1071 possible permutations of pieces on the board: Index=Pawns*63 + Minors*7 + Majors
so that every possible piece combination can have its own stage.
That is obviously bad, because I don't have adequate data to tune every combination. But at the same time, I disagree with a simple subtraction of pieces -- how much a Knight loss changes the phase should be different if you have only 5 pieces left than if it is in the first 5 moves. Also, you should be in 100% endgame well before you are down to K vs. K. So, I want to switch to something formula driven, but more tunable than just the parameters in Fruit.
Robert Pope wrote:My current code for game phase is really bulky, so I was looking at what some other programs do. I was reading a description of (I think) Rookie's evaluation, and I noticed that it was basing the game phase on the remaining pieces of the opponent, rather than all pieces. Is this common practice, or is it just as common to use all pieces?
While I was wondering about that, I wandered over to the chess programming wiki, and it appears that Fruit uses all pieces, but pawns have zero impact on the game phase. Did I read that right?
It is a bug to use the sum of pieces instead of opponent pieces. Think of king safety and passers. But it is a bug of the same order of magnitude as, say, worrying about opposite square colors for the bishop pair bonus: one of zero practical impact, if you consider winning or losing games. Many programs now copy the Fruit design with score tuples, and for that you need one scalar game phase. You don't need to follow.
Wether or not to ignore pawns is also rather arbitrary. The tuner will resolve any differences.
Surely you don't mean a different "phase" for each side, since evaluation has to cover both sides? I don't see how this would be a "bug" at all. And doing it twice would have some computational cost.
If the piece counts are different for the two sides, I doubt the phase scaling matters much anyway, the game is already out of hand most of the time.
I was just looking at my code while thinking about this. You would also have to maintain two pairs of scores, one for black and one for white if you are going to scale each according to the material for the other side.
bob wrote:I was just looking at my code while thinking about this. You would also have to maintain two pairs of scores, one for black and one for white if you are going to scale each according to the material for the other side.
bob wrote:I was just looking at my code while thinking about this. You would also have to maintain two pairs of scores, one for black and one for white if you are going to scale each according to the material for the other side.
Robert Pope wrote:My current code for game phase is really bulky, so I was looking at what some other programs do. I was reading a description of (I think) Rookie's evaluation, and I noticed that it was basing the game phase on the remaining pieces of the opponent, rather than all pieces. Is this common practice, or is it just as common to use all pieces?
While I was wondering about that, I wandered over to the chess programming wiki, and it appears that Fruit uses all pieces, but pawns have zero impact on the game phase. Did I read that right?
It doesn't really matter in practice.
If there is a significant imbalance in material, the game is probably already won/lost anyways.
It does make the resolution twice as coarse, which has a negative effect.
The steps are also twice as big though, with every exchange.
Good point...
So it really is a "moot point" as to whether you use both sides or just one side.
Not entirely. The things that are probably affected most by the phase scoring are things related to king safety/centralization (there are more but let us just restrict ourselves to these). Whether or not you're centralizing your king or not, or care for attacks on the king are determined more by the opponent material then your own.
When you're clearly up some material that difference is probably not important, but when you do have compensation for the material in a number of pawns (possibly even passers) then it is not that clear anymore.
Another thing is related to autotuning, where you try to define evaluation terms as clean as possible to avoid noise.
pijl wrote:Not entirely. The things that are probably affected most by the phase scoring are things related to king safety/centralization (there are more but let us just restrict ourselves to these). Whether or not you're centralizing your king or not, or care for attacks on the king are determined more by the opponent material then your own.
When you're clearly up some material that difference is probably not important, but when you do have compensation for the material in a number of pawns (possibly even passers) then it is not that clear anymore.
Another thing is related to autotuning, where you try to define evaluation terms as clean as possible to avoid noise.
So you suggest keeping the black and white scores separate, and then scaling them according to the opposite side's material??
BTW, while I scale everything, king safety self-scales as pieces are removed because each piece removed reduces the threats on the king.
bob wrote:Surely you don't mean a different "phase" for each side
A "phase" for each material-dependent term. Not every term responds in the same manner to material changes. The relative piece values are generally not even the same. It would be a miracle if they did.