dtx

Endgame analysis using tablebases, EGTB generation, exchange, sharing, discussions, etc..
notnale
Posts: 43
Joined: Sun Aug 17, 2008 6:36 am

Re: dtx

Post by notnale »

syzygy wrote:Perform 1 ply and probe the table again. By definition, the position after 1 ply is d-1 plies from a zeroing move. The value returned by the table for that position is either k or k-1.
This isn't true if the ply was a zeroing move
syzygy
Posts: 166
Joined: Sun Aug 03, 2008 4:02 pm

Re: dtx

Post by syzygy »

notnale wrote:
syzygy wrote:Perform 1 ply and probe the table again. By definition, the position after 1 ply is d-1 plies from a zeroing move. The value returned by the table for that position is either k or k-1.
This isn't true if the ply was a zeroing move
True, but if you can convert right away to a winning position (or if you're forced to convert right away to a losing position), then the value of d is known anyway.

Btw, I think in my previous post I should not have written "d = 2k or d = 2k-1" but "d = 2k or d = 2k+1". If d = 100 or 101, then the position is a draw. If d = 98 or 99, then the position is a win. So it makes sense to map 98/99 to 49 and to map 100/101 to 50. A position that is mate or converts immediately has d = 0, so k = 0. DTZ50 values are k = 0, 1, ..., 49. For move-counter > 0, the position is cursed if d + move-counter >= 100. Anyway, not too important at the moment. As long as it's done right in the generator and probing code, things will work.
koistinen
Posts: 92
Joined: Fri May 02, 2008 7:59 pm
Sign-up code: 0
Location: Stockholm

Re: dtx

Post by koistinen »

syzygy wrote:
notnale wrote:
syzygy wrote:Perform 1 ply and probe the table again. By definition, the position after 1 ply is d-1 plies from a zeroing move. The value returned by the table for that position is either k or k-1.
This isn't true if the ply was a zeroing move
True, but if you can convert right away to a winning position (or if you're forced to convert right away to a losing position), then the value of d is known anyway.

Btw, I think in my previous post I should not have written "d = 2k or d = 2k-1" but "d = 2k or d = 2k+1". If d = 100 or 101, then the position is a draw. If d = 98 or 99, then the position is a win. So it makes sense to map 98/99 to 49 and to map 100/101 to 50. A position that is mate or converts immediately has d = 0, so k = 0. DTZ50 values are k = 0, 1, ..., 49. For move-counter > 0, the position is cursed if d + move-counter >= 100. Anyway, not too important at the moment. As long as it's done right in the generator and probing code, things will work.
A position can convert with either a black or white move so the exact number of half-moves might make a difference.
In practice and with few pieces on the board it is only supposed to matter much if there are pawns left.

Anyway, what do you mean by "converts immediately"? Is that without side to move making a move?
syzygy
Posts: 166
Joined: Sun Aug 03, 2008 4:02 pm

Re: dtx

Post by syzygy »

koistinen wrote:A position can convert with either a black or white move so the exact number of half-moves might make a difference.
I know, and this means that it is required to be able to determine dtz50 as number of plies. If both wtm- and btm-tables are available, then these tables can store dtz50 as number of moves, because that is sufficient to reconstruct dtz50 as a number of plies. (However, it probably makes more sense to keep only the smallest table of the DTZ50-pair (wtm, btm) and make wtm and btm WDL50-tables available for access during search. In this case the DTZ50-table must store the number of plies, or play will (theoretically) suffer. If maxDTZ50 < 50, number of moves is again sufficient because it is OK to lose one ply.)

Note: the fact that a position can convert with either a black or white move is the reason that compression improves by storing distances as a number of full moves. If compression can be improved without sacrificing "50-move rule perfect play", then it makes sense to do it.
Anyway, what do you mean by "converts immediately"? Is that without side to move making a move?
I mean a position for which the side to move plays a move that zeros the move-counter. Thus if the winning side is to move, then the winning side has a winning capture or pawn push. If the losing side is to move, that side can only play captures or pawn pushes.

Such a move does not count as one of the 100 plies necessary to trigger the 50-move rule, so I would say the position has dtz50 = 0. Then a distance of 100 means the position is a draw. (Of course it's also possible to shift the values by 1: immediate conversion corresponds to dtz50 = 1, dtz50 >= 101 means draw.)

Hmmm, I guess a move that mates does not count for the 50-move rule either, right? (In theory the winning side could claim a draw immediately before mating his opponent, but that does not make sense. The opponent cannot claim a 50-move rule draw when he's already mated, I suppose.) So positions that reach mate in 1 ply also have dtz50 = 0 (in plies).
notnale
Posts: 43
Joined: Sun Aug 17, 2008 6:36 am

Re: dtx

Post by notnale »

As I understand the rules, checkmate ends the game immediately and hence, a draw cannot be claimed.

By the way, what exactly, does a WDL50 table store?
syzygy
Posts: 166
Joined: Sun Aug 03, 2008 4:02 pm

Re: dtx

Post by syzygy »

notnale wrote:By the way, what exactly, does a WDL50 table store?
A WDL50-table stores for each position a W, a D or an L, giving the outcome of the game under optimal play by both sides assuming move-counter = 0 (and taking into account the 50-move rule).
notnale
Posts: 43
Joined: Sun Aug 17, 2008 6:36 am

Re: dtx

Post by notnale »

So what would it be used for? Evaluating possible future positions in the computers search tree?
syzygy
Posts: 166
Joined: Sun Aug 03, 2008 4:02 pm

Re: dtx

Post by syzygy »

notnale wrote:So what would it be used for? Evaluating possible future positions in the computers search tree?
Exactly. WDL50-tables are much smaller, which means they can be probed faster (e.g. because more positions can be cached in RAM).

Once the position on the board is in the tablebases, the engine will need to know the exact dtz50-values for the positions that it can move into. So then DTZ50-tables must be probed.

Another case in which the engine might want to probe the DTZ50-tables is when the search has shown that a loss is unavoidable. In that case it might be interesting to aim for a lost position with a high dtz50-value to maximize drawing chances.
notnale
Posts: 43
Joined: Sun Aug 17, 2008 6:36 am

Re: dtx

Post by notnale »

Unfortunately, there are no hard and fast rules on how to attempt to swindle against a fallible opponent.

There are various hereustics you could use, for example, make the move that gives the most opportunities for the opponent to blunder, make the move that maximizes DTC/DTZ, try to convert into endgames that are considered difficult for humans, etc.
But ultimately, it is impossible to say that any one strategy is better then any other, because they all rely on flaws in the opponent, which vary widely and are poorly defined and unpredictable.
Post Reply