Live data from Hacker News

No reachable chess position with more than 218 moves

lichess.org

121–130 of 195 posts

Re: No reachable chess position with more than 218 moves

#121
post #59

They dont really spell it out but they mean "from this position the player has 218 possible legal moves to choose from"

Ah, wow, I read the article wrong all this time, thank you. I thought they meant "the maximum number of moves you can make to reach any chess position is 218", and I was wondering why the article made no sense to me.

I thought the same, but no doubt pawn promotion rules dramatically increase the depth needed to reach certain positions.

Re: No reachable chess position with more than 218 moves

#122

Earlier quoted context omitted.

Unless I missed something, though, the highest bound the author reported for the relaxation was 271 2/3 moves, which is obviously significantly higher than 218...

I think that was an intermediate model. The author updated it, then Gurobi solved the new model to optimality (i.e., the bound became equal to the value of the best solution found). > With this improved model, I tried again and after ~23 000 seconds, Gurobi solved it to optimality!

> Gurobi solved the new model to optimality (i.e., the bound became equal to the value of the best solution found).

Ah, I was not aware that that's what this language indicated. Thanks for helping me understand more!

I've used Gurobi (and other solvers) in the past, but always in situations where we just needed to find a solution that was way better than what we were going to find with, say, a heuristic... I've never needed to find a provably optimal solution...

Re: No reachable chess position with more than 218 moves

#123
post #76

Am I missing something, or is the configuration shown initially not actually reachable? It's white to move, yet the black pawns are in their starting location and the black king has no adjacent empty square, it's entombed by its pawns and the white bishop so the configuration could not have been reached.

[flagged]

Thanks for the condescension. It really helps me file your comment's suggestions appropriately.

Here's a general rule of thumb: If the options are

a) answer someone's question, and

b) answer someone's question but also then spend triple the word count telling them it was a stupid question

Then picking (b) makes you an asshole. If all you had written was your first sentence this could have been a pleasant interaction for us both.

Re: No reachable chess position with more than 218 moves

#124
post #25

Am I missing something, or is the configuration shown initially not actually reachable? It's white to move, yet the black pawns are in their starting location and the black king has no adjacent empty square, it's entombed by its pawns and the white bishop so the configuration could not have been reached.

The black pawns are on white's side of the board.

That's what I missed. Thank you :-)

Re: No reachable chess position with more than 218 moves

#125
post #26

Am I missing something, or is the configuration shown initially not actually reachable? It's white to move, yet the black pawns are in their starting location and the black king has no adjacent empty square, it's entombed by its pawns and the white bishop so the configuration could not have been reached.

Proof is provided here for one of them: https://lichess.org/study/PLtuv3v5/zWPNxbSA To be clear you're misunderstanding the position though. Black pawns are NOT in starting position. They've moved all the way across the board. Those are white pawn starting positions.

Yep that's what I was missing. Thank you for the link.

Re: No reachable chess position with more than 218 moves

#126
post #38

What is the least number of bits that can describe any reachable chess board? update: article says there are approximately 8.7x10^45 reachable chess positions and https://github.com/lechmazur/ChessCounter says this is an upper bound. (this would correspond to about 153 bits)

The king can reach any of 64 tiles. Rooks, queens, and knights can also do so, but they can also be captured, so 65 states for those 5 pieces. Bishops can only reach half of those tiles, so those two pieces get 33 states each. Pawns are interesting: they can promote into 4 pieces that each can move 64 tiles, they can be captured, or they can move into a somewhat variable number but 20-30ish positions as a pawn, or about 290 states per pawn. This means it takes 111.something bits to represent the board position of a color, or rounding up, 224 bits to represent the board positions of both black and white. En passant and castling restrictions don't add to the bit representations once you round up, since that's just 1 extra state for several pieces. That's probably the most compact representation for a fixed-size direct board representation.

For a sparse representation, note that both kings have to exist, so you can represent the live pieces with a base-10 number of n digits with n + 2 64-bit numbers representing piece position, and a little bit extra information for castling and en passant legality. If half the pieces are gone (a guesstimate for average number of pieces on the board), that amounts to about 180 bits for a board representation.

Move history requires about 10 bits per move (pair of white/black turns, with a ply of around 32 = 5 bits), which means you get to 18 moves, which appears to be somewhat shorter than the halfway point of an average chess game.

To be honest, it looks to me like getting more compact than the upper hundreds will require building impossibly large dictionaries.

Re: No reachable chess position with more than 218 moves

#127
post #43
post #41

Earlier quoted context omitted.

Piece type and color fit in 4 bits. So, either a fixed-length encoding of the whole board, 64 * (4 bits) = 256 bits = 32 bytes. Or, sparse variable length encoding of pieces only, 6 bits to index each of 64 squares, = 10 bits * piece count. E.g. initial position takes 32*10 = 320 bits or 40 bytes.

That's a fine upper bound, but it doesn't minimize but usage since it also can represent illegal positions.

While this is an upper bound for a "board position", it should be noted that it is not an upper bound for a "game state". That includes the (unbounded) whole board position history because of the threefold repetition rule. If you ignore that (and the fifty-move rule which can alternatively be kept using a six-bit counter), you also need the castling state and the en passant state. Plus one bit of the player on move, obviously :-)

Re: No reachable chess position with more than 218 moves

#128
post #80

Genuinely interested in being educated here: If Gurobi's integer programming solver didn't find a solution better than 218, is that a guarantee that there exists no solution better than 218? Is it equivalent to a mathematical proof? (Let's assume, for the sake of argument, that there's no bugs in Gurobi's solver and no bugs in the author's implementation of the problem for Gurobi to solve.) I guess I'm basically aski…

I'm not sure about Gurobi or how the author used it in this case. But in general, yes: these combinatorial solvers construct proof trees showing that, no matter how you assign the variables, you can't find a better solution. In simpler cases you can literally inspect the proof tree and check how it's reached a contradiction. I imagine the proof tree from this article would be an obscenely large object, but in principle you could inspect it here too.

Re: No reachable chess position with more than 218 moves

#129

Earlier quoted context omitted.

I thought “there is no chess problem that is both reachable from starting position and requires more than 218 moves to solve”

There are no more than 218 ways to interpret this title

It'll take at most 218 comments on HN to figure out the meaning of the submission title

Re: No reachable chess position with more than 218 moves

#130
post #84
post #59

Earlier quoted context omitted.

Ah, wow, I read the article wrong all this time, thank you. I thought they meant "the maximum number of moves you can make to reach any chess position is 218", and I was wondering why the article made no sense to me.

Is that weird? I feel like it’s plausible though. Very rare to have chess games with more than 200 moves.

It’s also rare to have one with more than 50 moves. I’m curious if this class of observation will help establish a true bounds. Especially because we don’t have a definition of what it means - my instinct is to first do that, so “infinity” isn’t the obvious upper bound.
Post reply on HN