Fruit fly races on steroids?

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

petero2
Posts: 701
Joined: Mon Apr 19, 2010 7:07 pm
Location: Sweden
Full name: Peter Osterlund

Re: Fruit fly races on steroids?

Post by petero2 »

towforce wrote: Sat Apr 06, 2024 12:42 pm The big killer, that will get close to perfect play even with a bigger board, is the God algorithm.

The ultimate aspiration for chess: the knowledge of how to create a God algorithm for any size of board.
If you ignore performance of the algorithm, this is trivially achieved by the minimax algorithm.

If you don't ignore performance, a problem is that chess on an n x n board has already been proven to be exptime-complete. See the article "Computing a perfect strategy for n x n chess requires time exponential in n": https://www.sciencedirect.com/science/a ... 6581900169

A potential way out is that you write "close to perfect" and not "perfect". It seems odd to me though to call a non-perfect algorithm "the god algorithm".
User avatar
towforce
Posts: 11820
Joined: Thu Mar 09, 2006 12:57 am
Location: Birmingham UK

Re: Fruit fly races on steroids?

Post by towforce »

petero2 wrote: Sat Apr 06, 2024 1:24 pm
towforce wrote: Sat Apr 06, 2024 12:42 pm The big killer, that will get close to perfect play even with a bigger board, is the God algorithm.

The ultimate aspiration for chess: the knowledge of how to create a God algorithm for any size of board.
If you ignore performance of the algorithm, this is trivially achieved by the minimax algorithm.

If you don't ignore performance, a problem is that chess on an n x n board has already been proven to be exptime-complete. See the article "Computing a perfect strategy for n x n chess requires time exponential in n": https://www.sciencedirect.com/science/a ... 6581900169

A potential way out is that you write "close to perfect" and not "perfect". It seems odd to me though to call a non-perfect algorithm "the god algorithm".

Excellent find! 8-)

This paper proves what I said in my previous post - the game becomes exponentially more complex with increasing board size.

However, it doesn't prove the non-existence of a God algorithm (I have in the past explained why I think it's "very likely" that a God algorithm which is much smaller and quicker than most members of this forum (who mostly belong to a "deep search of a game tree" culture: no complaints about that - this is what worked best for most the existence of computer chess) would currently believe possible).

Super simple example:

[d]8/8/8/8/3k4/8/8/4KR2 w - - 0 1

It's 29 moves to checkmate here (link). On a 100x100 board, a similar position might be hundreds of moves to mate, and the search tree would be many orders of magnitude larger. However, it's still just as easy to get the checkmate, because a well known pattern exists. The evidence strongly suggests simple patterns also exist from which an algorithm to accurately evaluate any chess position can be built (obviously a more complicated one than required for the above position - but a lot less complicated than you'd expect).
The simple reveals itself after the complex has been exhausted.
chesskobra
Posts: 257
Joined: Thu Jul 21, 2022 12:30 am
Full name: Chesskobra

Re: Fruit fly races on steroids?

Post by chesskobra »

petero2 wrote: Sat Apr 06, 2024 1:24 pm
If you ignore performance of the algorithm, this is trivially achieved by the minimax algorithm.

If you don't ignore performance, a problem is that chess on an n x n board has already been proven to be exptime-complete. See the article "Computing a perfect strategy for n x n chess requires time exponential in n": https://www.sciencedirect.com/science/a ... 6581900169

A potential way out is that you write "close to perfect" and not "perfect". It seems odd to me though to call a non-perfect algorithm "the god algorithm".
Why is the complexity growing exponentially with board size relevant? We are dealing with 8x8 board, and the difficulty of finding a perfect algorithm has nothing to do with exponential complexity as a function of board size.
petero2
Posts: 701
Joined: Mon Apr 19, 2010 7:07 pm
Location: Sweden
Full name: Peter Osterlund

Re: Fruit fly races on steroids?

Post by petero2 »

chesskobra wrote: Sun Apr 07, 2024 12:14 am
petero2 wrote: Sat Apr 06, 2024 1:24 pm
If you ignore performance of the algorithm, this is trivially achieved by the minimax algorithm.

If you don't ignore performance, a problem is that chess on an n x n board has already been proven to be exptime-complete. See the article "Computing a perfect strategy for n x n chess requires time exponential in n": https://www.sciencedirect.com/science/a ... 6581900169

A potential way out is that you write "close to perfect" and not "perfect". It seems odd to me though to call a non-perfect algorithm "the god algorithm".
Why is the complexity growing exponentially with board size relevant? We are dealing with 8x8 board, and the difficulty of finding a perfect algorithm has nothing to do with exponential complexity as a function of board size.
You should ask the person I was responding to, who brought bigger boards into the discussion by writing this:
towforce wrote: Sat Apr 06, 2024 12:42 pm The big killer, that will get close to perfect play even with a bigger board, is the God algorithm.
It seems relevant to know what has already been proven to be theoretically impossible before trying to solve a problem.
User avatar
towforce
Posts: 11820
Joined: Thu Mar 09, 2006 12:57 am
Location: Birmingham UK

Re: Fruit fly races on steroids?

Post by towforce »

chesskobra wrote: Sun Apr 07, 2024 12:14 amWhy is the complexity growing exponentially with board size relevant? We are dealing with 8x8 board, and the difficulty of finding a perfect algorithm has nothing to do with exponential complexity as a function of board size.

That is completely correct!

This thread is really about what, deep down, we want from computer chess - and my answer to that is a God algorithm. We're actually closing in on unbeatable engines on the 8x8 board (the draw-death issue is already very serious in correspondence chess), but today's methods for building chess engines would probably not extrapolate well to larger boards (by which I mean that I think that the "draw problem" would instantly disappear on a larger board), whereas a systematic method for creating God algorithms in chess-like games might.
The simple reveals itself after the complex has been exhausted.
User avatar
towforce
Posts: 11820
Joined: Thu Mar 09, 2006 12:57 am
Location: Birmingham UK

Re: Fruit fly races on steroids?

Post by towforce »

petero2 wrote: Sun Apr 07, 2024 7:08 am
towforce wrote: Sat Apr 06, 2024 12:42 pm The big killer, that will get close to perfect play even with a bigger board, is the God algorithm.
It seems relevant to know what has already been proven to be theoretically impossible before trying to solve a problem.

The study you linked certainly proves that (if I may be permitted to simplify) the complexity of chess increases exponentially with the board size.

It does not prove that the size of an algorithm needed to generate a correct static evaluation of a position without search in such a game increases exponentially with board size, though: the evidence suggests that it doesn't.
The simple reveals itself after the complex has been exhausted.
petero2
Posts: 701
Joined: Mon Apr 19, 2010 7:07 pm
Location: Sweden
Full name: Peter Osterlund

Re: Fruit fly races on steroids?

Post by petero2 »

towforce wrote: Sun Apr 07, 2024 10:37 am
petero2 wrote: Sun Apr 07, 2024 7:08 am
towforce wrote: Sat Apr 06, 2024 12:42 pm The big killer, that will get close to perfect play even with a bigger board, is the God algorithm.
It seems relevant to know what has already been proven to be theoretically impossible before trying to solve a problem.
It does not prove that the size of an algorithm needed to generate a correct static evaluation of a position without search in such a game increases exponentially with board size, though
The article does not have to consider whether the algorithm is doing "search" or not (and how to define what "search" means), since it proves results that are valid for any algorithm that can be executed on a Turing machine. In particular it shows that if an algorithm is able to determine the game-theoretical value of any position, there exist positions for which the algorithm has a runtime larger than polynomial in the board size. (This assumes the 50-move draw rule does not apply though to the generalized chess variant.)

A direct quote from the article:

This implies that there exists d > 0 and infinitely many positions p such that an algorithm for deciding whether White (Black) can win from that position requires at least c^(|p|^d) time-steps to compute, where c > 1 is a constant and |p| is the size of p. Generalized chess is thus provably intractable, which is a stronger result than the complexity results for board games such as Checkers, Go, Gobang and Hex which were shown to be Pspace-hard.
User avatar
towforce
Posts: 11820
Joined: Thu Mar 09, 2006 12:57 am
Location: Birmingham UK

Re: Fruit fly races on steroids?

Post by towforce »

petero2 wrote: Sun Apr 07, 2024 10:32 pmThe article does not have to consider whether the algorithm is doing "search" or not (and how to define what "search" means), since it proves results that are valid for any algorithm that can be executed on a Turing machine. In particular it shows that if an algorithm is able to determine the game-theoretical value of any position, there exist positions for which the algorithm has a runtime larger than polynomial in the board size. (This assumes the 50-move draw rule does not apply though to the generalized chess variant.)

A direct quote from the article:

This implies that there exists d > 0 and infinitely many positions p such that an algorithm for deciding whether White (Black) can win from that position requires at least c^(|p|^d) time-steps to compute, where c > 1 is a constant and |p| is the size of p. Generalized chess is thus provably intractable, which is a stronger result than the complexity results for board games such as Checkers, Go, Gobang and Hex which were shown to be Pspace-hard.

To help anyone who's interested, here's a direct link to the paper PDF - link.

Assuming that the paper is, in general, correct, then the part of the paper that REALLY MATTERS is the section called "POLYNOMIALITY OF TRANSFORMATION", which is a little over half a page long, and is on page 213 of the paper.

This proves that in the given position, the number of moves (more accurately, the complexity of the game tree) it would take to get from that position to the win rises exponentially with the size of the board. I have no argument whatsoever with this proof - it looks entirely correct to me.

However, their proof assumes that there is no other way to prove the win other than to play out all the possible ways the game could go.

It is utterly trivial to show that this is wrong. Take another look at this position:

[d]8/8/8/8/3k4/8/8/4KR2 w - - 0 1

This position is won for white, with 29 moves to mate (see my previous post about this position for the EGTB link). I am going to prove it's won another way, without reference to the EGTB, as follows:

IT'S CONSPICUOUSLY OBVIOUS THAT WHITE IS WON IN THIS POSITION

What I mean by that is:

1. The position has a pattern which is known to be won

2. All chess players who are not beginners know this pattern

Now imagine a similar position on a 100x100 chess board. The kind of proof discussed in that paper would now be intractably large (as would a game tree of all possible games from that position - assuming that the 50-move rule becomes the "5000 move rule"). Using the mechanism described in the paper, you could reasonably say that it couldn't be proven to be a win in a reasonable amount of time on a cheap computer.

However, using my proof above ("it's obvious"), you can say it's won. It will take hundreds of moves to win rather than the 29 moves it takes on an 8x8 board, but its still a provable win.

Continuing the theme of "obvious statements", there are going to be many positions on a 100x100 board (and even on an 8x8 board) where there are not known patterns to quickly tell you whether white can win. But the point is that I have disproven the assertion that the paper proves that "This implies that there exists d > 0 and infinitely many positions p such that an algorithm for deciding whether White (Black) can win from that position requires at least c^(|p|^d) time-steps to compute...". The paper only proves that, in similar positions*, the distance to the win can rise exponentially with the board size. It has nothing whatsoever to say about patterns and heuristics.

*a simplification for clarity
The simple reveals itself after the complex has been exhausted.
User avatar
hgm
Posts: 28017
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Fruit fly races on steroids?

Post by hgm »

towforce wrote: Sat Apr 06, 2024 12:42 pmMany ways have been suggested to reduce the draw rate - but none of them will work for long, except for... bigger boards. The complexity of chess increases exponentially with board size.
We could try this creation of mine, called Makromachy:
theme=MV firstRank=1 satellite=makrom
files=14
ranks=14
promoZone=1
maxPromote=2
promoChoice=Q,M,G,RH,CN,V,CH,C,Z
graphicsDir=*/graphics.dir/alfaeriePNG/
squareSize=35
graphicsType=png
theme=DD
whitePrefix=w
blackPrefix=b
borders=0
firstRank=1
useMarkers=1
newClick=1
protected=23
captureMatrix=/"18/19^^^^=/"/19^^^^%=
pawn::fmWfceFifmnDifmnH::a4-n4
warrior::fmWfmnnDfceFbhcN:quickpawn:a2-c2,l2-n2
vao::mBpcB::d1,k1
zebra::::d2,k2
camel::::b1,m1
elephant::yafpabmBFA:elephantferz:e3,j3
knight:N:afyafyafpabmFN::c3,l3
bishop::::a3,n3
cannon:CN:::e1,j1
champion:CH:yafpabmRWAD::c1,l1
rook::::e2,j2
dragon horse:DH:BW:promotedbishop:b3,m3
dragon king:DK:RF:promotedrook:a1,n1
rhino:RH:[W?fsB]::g1
griffon::[F?fsR]:gryphon:f1
archbishop:::cardinal:k3
marshall:::chancellor:d3
queen::::h2
archer:AR:WA::f3,i3
bat:BA:B(paf)12cB::g3,h3
raven:FA:R(paf)12cR:bird2:f2,i2
eagle:EA:Q(paf)12cQ:bird:h1
terror::QNADcamK:dragon:g2
king::KispO9::i1
(I don't design chess variants very often, but in this case I wanted to demonstrate a novel idea to make large variants more exciting: there are some 'flying pieces' who can jump over arbitrary many other pieces, and thus can endanger the King from the very beginning. E.g. getting a white Bat on n9 would be checkmate, and you can threaten this with the first move.)
chesskobra
Posts: 257
Joined: Thu Jul 21, 2022 12:30 am
Full name: Chesskobra

Re: Fruit fly races on steroids?

Post by chesskobra »

towforce wrote: Sun Apr 07, 2024 11:50 pm
However, their proof assumes that there is no other way to prove the win other than to play out all the possible ways the game could go.

It is utterly trivial to show that this is wrong. Take another look at this position:

[d]8/8/8/8/3k4/8/8/4KR2 w - - 0 1

This position is won for white, with 29 moves to mate (see my previous post about this position for the EGTB link). I am going to prove it's won another way, without reference to the EGTB, as follows:

IT'S CONSPICUOUSLY OBVIOUS THAT WHITE IS WON IN THIS POSITION

What I mean by that is:

1. The position has a pattern which is known to be won

2. All chess players who are not beginners know this pattern


Continuing the theme of "obvious statements", there are going to be many positions on a 100x100 board (and even on an 8x8 board) where there are not known patterns to quickly tell you whether white can win. But the point is that I have disproven the assertion that the paper proves that "This implies that there exists d > 0 and infinitely many positions p such that an algorithm for deciding whether White (Black) can win from that position requires at least c^(|p|^d) time-steps to compute...". The paper only proves that, in similar positions*, the distance to the win can rise exponentially with the board size. It has nothing whatsoever to say about patterns and heuristics.

*a simplification for clarity
I have not read the paper, but petero2 quoted "there exist infinitely positions for which deciding ... requires ... steps to compute". This does not mean there are no simple positions where the win can be proved easily. There could also be infinitely many simple positions as in your example. The result also does not imply that the distance to win will grow exponentially. You could for example have a small depth but high width requiring "exponentially many time-steps to compute", which is not the same as "exponentially large distance to win".