Computer based Opening theory

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
User avatar
lucasart
Posts: 2957
Joined: Mon May 31, 2010 11:29 am
Contact:

Computer based Opening theory

Post by lucasart » Sat Dec 28, 2013 1:26 am

I've generated a 4 ply opening book using nothing more than my engine. Basically I start from the starting position, do a perft(4) and eliminate all nodes (interior and leaves) where a 12-ply search returns a score outside acceptable bounds +/-70cp:
http://open-chess.org/viewtopic.php?f=5&t=2551

This was really a fun experiment, and provided me with a great opening suite for testing my engine. It's as diversified and shallow as it can be, and contains 52967 positions which enough for most engine testing purposes.

But it could be improved and generalized:
* code it in a GUI like XBoard, so it can be engine agnostic.
* make the diversity of the book (branching factor) tunable in a couple of ways: using multi PV feature of the engine (fixed factor) or tweaking the 70cp threshold.
* genrate a proper book in PolyGlot format, rather than an EPD file.
* parallelize the book generation, and do it recursively with a global hash table to eliminate more efficiently transpositions.

Has anyone ever done that ?
Is anyone interested ? HGM ?

It would be really great. The idea would be to create entirely computer based opening theory. Human opening theory is flawed and biaised: very poor diversity and many dubious lines that comp analysis show to be unsound.

PS: I can't attach files on this forum, so I use Open Chess. Ideally please answer on Open Chess instead (but most people are here and Open Chess is a bit dead).
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.

bob
Posts: 20348
Joined: Mon Feb 27, 2006 6:30 pm
Location: Birmingham, AL

Re: Computer based Opening theory

Post by bob » Sat Dec 28, 2013 3:03 am

lucasart wrote:I've generated a 4 ply opening book using nothing more than my engine. Basically I start from the starting position, do a perft(4) and eliminate all nodes (interior and leaves) where a 12-ply search returns a score outside acceptable bounds +/-70cp:
http://open-chess.org/viewtopic.php?f=5&t=2551

This was really a fun experiment, and provided me with a great opening suite for testing my engine. It's as diversified and shallow as it can be, and contains 52967 positions which enough for most engine testing purposes.

But it could be improved and generalized:
* code it in a GUI like XBoard, so it can be engine agnostic.
* make the diversity of the book (branching factor) tunable in a couple of ways: using multi PV feature of the engine (fixed factor) or tweaking the 70cp threshold.
* genrate a proper book in PolyGlot format, rather than an EPD file.
* parallelize the book generation, and do it recursively with a global hash table to eliminate more efficiently transpositions.

Has anyone ever done that ?
Is anyone interested ? HGM ?

It would be really great. The idea would be to create entirely computer based opening theory. Human opening theory is flawed and biaised: very poor diversity and many dubious lines that comp analysis show to be unsound.

PS: I can't attach files on this forum, so I use Open Chess. Ideally please answer on Open Chess instead (but most people are here and Open Chess is a bit dead).
I am assuming this would include a ton of nonsensical openings like a4 a5 h4 h5 and such?

User avatar
lucasart
Posts: 2957
Joined: Mon May 31, 2010 11:29 am
Contact:

Re: Computer based Opening theory

Post by lucasart » Sat Dec 28, 2013 3:10 am

bob wrote: I am assuming this would include a ton of nonsensical openings like a4 a5 h4 h5 and such?
Yes. I know it sounds crazy, but that is the intent. So long as there is no objective blunder, the line is accepted. I want the most diversity possible and the shallowest book possible here. It's to create a book for engine testing, where you also want to test the capacity of the engine to develop its pieces without (or almost without) book.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.

mar
Posts: 1832
Joined: Fri Nov 26, 2010 1:00 pm

Re: Computer based Opening theory

Post by mar » Sat Dec 28, 2013 3:13 am

Sounds like fun :)
Thanks for sharing.

I'll probably try multipv filtering to reduce BF and examine interesting lines more deeply, maybe gradually lowering from n moves at root down to 1 to see how deep it can go.

jdart
Posts: 3510
Joined: Fri Mar 10, 2006 4:23 am
Location: http://www.arasanchess.org

Re: Computer based Opening theory

Post by jdart » Sat Dec 28, 2013 3:14 am

You can certainly use computers to help generate and tune an opening book, but evals by themselves do not mean much in the early stages of the opening. Lots of openings involve temporary loss of material for long term advantage, and even though computers reach large depths now, the compensation can be outside the horizon of the search.

--Jon

User avatar
lucasart
Posts: 2957
Joined: Mon May 31, 2010 11:29 am
Contact:

Re: Computer based Opening theory

Post by lucasart » Sat Dec 28, 2013 3:17 am

jdart wrote:You can certainly use computers to help generate and tune an opening book, but evals by themselves do not mean much in the early stages of the opening. Lots of openings involve temporary loss of material for long term advantage, and even though computers reach large depths now, the compensation can be outside the horizon of the search.

--Jon
I know. What I'm doing is putting a rather loose filter on the eval (70cp is very permissive), to generate the most diversity. I will then do some post filtering and proceed by stages. For example filter the 4-ply book a bit stricter, and perhaps with other engines (by (ab)using cutechess-cli) before generating the 5-ply one out of it, etc.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.

Uri Blass
Posts: 8039
Joined: Wed Mar 08, 2006 11:37 pm
Location: Tel-Aviv Israel

Re: Computer based Opening theory

Post by Uri Blass » Sat Dec 28, 2013 5:10 am

lucasart wrote:
bob wrote: I am assuming this would include a ton of nonsensical openings like a4 a5 h4 h5 and such?
Yes. I know it sounds crazy, but that is the intent. So long as there is no objective blunder, the line is accepted. I want the most diversity possible and the shallowest book possible here. It's to create a book for engine testing, where you also want to test the capacity of the engine to develop its pieces without (or almost without) book.
I am not against the idea of computer based theory and it can be useful also for humans who prepare for tournaments but
I consider 1.a4 as unsound and I think that it is better to allow only lines when a player does not do mistakes of more than 0.2 pawns when the analysis is based on a deep search(at least 1 hour of search).

I think that the difference between 1.e4 and 1.a4 is more than 0.2 pawns when hopefully the difference between the best reply to 1.e4 and 1.e4 c5 is less than 0.2 pawns so c5 is going to be accepted.

I would like to have some opening book that include computer evaluation for every move when the evaluation is based on at least one hour of search (otherwise the users do not need the book to see the evaluation because doing a short analysis is going to be faster).

Uri Blass
Posts: 8039
Joined: Wed Mar 08, 2006 11:37 pm
Location: Tel-Aviv Israel

Re: Computer based Opening theory

Post by Uri Blass » Sat Dec 28, 2013 5:13 am

jdart wrote:You can certainly use computers to help generate and tune an opening book, but evals by themselves do not mean much in the early stages of the opening. Lots of openings involve temporary loss of material for long term advantage, and even though computers reach large depths now, the compensation can be outside the horizon of the search.

--Jon
I agree that the compensation can be outside the horizon of the search and it is a good reason to allow at least one hour for every search in order to make these cases relatively rare.

User avatar
lucasart
Posts: 2957
Joined: Mon May 31, 2010 11:29 am
Contact:

Re: Computer based Opening theory

Post by lucasart » Sat Dec 28, 2013 6:35 am

Uri Blass wrote: I am not against the idea of computer based theory and it can be useful also for humans who prepare for tournaments but
I consider 1.a4 as unsound and I think that it is better to allow only lines when a player does not do mistakes of more than 0.2 pawns when the analysis is based on a deep search(at least 1 hour of search).
Oh 1. a4 is nothing! In my 4-ply book there are lines like
[pgn]1. f3 Na6 2. Kf2 Nb8[/pgn]
This opening is plain stupid. None of the moves make much sense or achieve anything in terms of developpement. But that doesn't really matter to me. Objectively speaking, and despite all the human preconceived ideas about opening theory, the resulting position is relatively balanced and perfectly playable. It looks like black lost 2 tempo, but on the other hand white hasn't achieved much in terms of developpement with his two stupid moves, and will need to work in reparing the damage of the opening later. It's really the leaf positions I'm interested in, for engine testing. And by engine testing, I mean these tens of thousand of games we routinely play at fast TC to test patches. Of course, such an opening book would not be suitable for any serious chess player wanting to learn openings. It's all about maximum diversity and the ability to test my engine in the opening.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.

Modern Times
Posts: 2142
Joined: Thu Jun 07, 2012 9:02 pm

Re: Computer based Opening theory

Post by Modern Times » Sat Dec 28, 2013 7:30 am

lucasart wrote:It's all about maximum diversity and the ability to test my engine in the opening.
It seems like a good approach to me. Of course chess960 would be better :D

Post Reply