buying a new computer

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

Moderators: hgm, Rebel, chrisw

Gregory Owett
Posts: 249
Joined: Fri Mar 10, 2006 10:26 am
Location: France

Re: buying a new computer

Post by Gregory Owett »

Hi,
Tomorrow, I'll put several hours to study all this! :P :P :P
Thanks!
Uri Blass
Posts: 10281
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: buying a new computer

Post by Uri Blass »

jp wrote: Wed Jul 17, 2019 1:15 pm
Zenmastur wrote: Wed Jul 17, 2019 1:16 am
jp wrote: Tue Jul 16, 2019 4:56 pm
Zenmastur wrote: Tue Jul 16, 2019 7:29 am
jp wrote: Sat Jul 13, 2019 4:57 pm The NN engines are not currently playing the opening better than the humans.
Without evidence this seems like a very subjective statement. Have there been any matches between humans and top NN engines in which the humans won and which lasted long enough to determine that the opening phase was the decisive factor in the NN engine losing the match?
You sound focused on the results of games. We're not debating whether a human can beat an engine.
Opening theory is not created by one human. It's been the collective efforts of all humans and their machines.


I'm just waiting for an NN engine to play in its game a true good opening novelty that human GMs would then adopt. I don't think it has yet. I don't think NN engines have contributed to opening theory (yet) any more than traditional engines. People get excited, but just at the NN engine reproducing old human opening theory, not anything new.

But if someone can give examples where it has happened, of course I'd be very interested to see them.

Zenmastur wrote: Wed Jul 17, 2019 1:16 am Hmmm...

Then how did Lc0 win TCEC when playing against SF? Do you think it got lucky 100 games in a row?
Again, this has nothing to do with which engine is stronger than another engine. The endless Lc vs SF debate is a topic of other threads. (Briefly, it won't be settled because there will never be agreement about what is fair hardware and what are fair openings. When you watch TCEC, you see that Lc tends to win out of certain openings and SF out of certain other openings. Then the fans of one complain about the use of the opening that doesn't favor their preferred engine.)

We're talking about opening theory. Has Lc contributed to directly to opening theory, like humans do, i.e. by playing the novelties in tournament or match games and getting other humans to adopt them?

I don't think so, unless I've missed something.
Contributing to opening theory is not only finding novelties because theory is not a list of known best moves but positions that have some options that we do not know which option is better.

Finding that move A is stronger than move B when both moves are not novelties is clearly a direct contribution to opening theory.

I believe that engines are clearly stronger than humans in the opening and I am sure also that engines found many opening novelties(part of them may be considered wrongly as novelties of humans but humans found them thanks to analysis by engines).

Engines may be not stronger than the team of engines and humans that play in correspondence games but it is not a competition between engines and humans because humans use engines to analyze also in the opening.

If you use only games earlier to 2010 by humans to build your opening book then I believe that you will have a weaker book than a book that is simply generated by engine analysis and has only moves of strong chess engines.

You can generate that book simply by letting stockfish play against stockfish or against lc0 and add the lines that the engines play at very slow time control to the book(stockfish is not deterministic so the book is going to have some variety).

I guess that engines using engine's book are going to beat the same engine that use engine's book when other factors are the same(out of book it is simply stockfish against stockfish or lc0 against lc0).

Games that are not earlier to 2010 are games when people already use engines to analyze and I believe that even part of the games of 2010 already use analysis of engines).

Edit:For the book generated by engines you may also add lines against not the best line by using multi-pv and adding lines that are not best based on multi-pv analysis to the book not as lines to play but as lines to respond to when the response is going to be calculated by analysis of stockfish or lc0.

The idea is only that choosing the lines to respond to is not going to be based on analysis of earlier games but only based on analysis by engines.
dragontamer5788
Posts: 201
Joined: Thu Jun 06, 2019 8:05 pm
Full name: Percival Tiglao

Re: buying a new computer

Post by dragontamer5788 »

Uri Blass wrote: Thu Jul 18, 2019 12:42 am You can generate that book simply by letting stockfish play against stockfish or against lc0 and add the lines that the engines play at very slow time control to the book(stockfish is not deterministic so the book is going to have some variety).
I was thinking about this. Why aren't modern opening books just permanently stored MCTS trees?

MCTS stores the following information:
1. Number of visits
2. WDL information (#Wins / #Losses / #Draws)

Given these two bits of information, the "UCT", upper-confidence bounds applied to tree search, gives an algorithm for the best next move to pick. UCT balances "exploration" (choosing losing positions on the chance that you might find a strong position) vs "exploitation" (choosing the winning position because you've seen more wins come out of that branch). Isn't that all that opening theory is?

Its just a big exploration vs exploitation problem. Which is arguably "solved" by the UCT / MCTS algorithm.

--------

Now tuning the proper MCTS meta-heuristics (ex: exploration parameter traditionally set to sqrt(2)), is itself its own journey. And setting the right time-controls for the search is also important (set Stockfish to depth 40 and you'll never get anything done. Set it to depth 10 and maybe all the games are too shallow to really be useful, but the generation would be far faster).

A "rollout" is just a full gameplay between engines.

Bah, I have too many project ideas, not enough time to work on them all. Someone else can take this idea if they want, lol. I'll probably never get around to trying it out. It does give an idea of how to apply a super-parallel (potentially GPU-based) sequential alpha-beta tree search to the chess community. Write a simple Alpha-Beta engine for the GPU, and run 10,000+ games in parallel on the GPU (each GPU-thread gets its own chess engine, all engines sharing the Transposition table). The 10,000+ games will try to create a "Permanent MCTS Tree" for an opening book. Lol.

Or maybe just use Stockfish vs Leela as the engines, with suitable time controls.
Dann Corbit
Posts: 12538
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: buying a new computer

Post by Dann Corbit »

dragontamer5788 wrote: Thu Jul 18, 2019 12:51 am I was thinking about this. Why aren't modern opening books just permanently stored MCTS trees?

MCTS stores the following information:
1. Number of visits
2. WDL information (#Wins / #Losses / #Draws)
Or, perhaps, why aren't modern opening books database files that contain:
1. Number of visits
2. WDL information (#Wins / #Losses / #Draws)
3. Depth of search
4. ce score
5-999: whatever else you want to collect.

An opening book should be a collection of pv nodes with as much data attached to the nodes as we can possibly find useful.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
jp
Posts: 1470
Joined: Mon Apr 23, 2018 7:54 am

Re: buying a new computer

Post by jp »

Uri Blass wrote: Thu Jul 18, 2019 12:42 am
jp wrote: Wed Jul 17, 2019 1:15 pm We're talking about opening theory. Has Lc contributed to directly to opening theory, like humans do, i.e. by playing the novelties in tournament or match games and getting other humans to adopt them?

I don't think so.
Contributing to opening theory is not only finding novelties because theory is not a list of known best moves but positions that have some options that we do not know which option is better.

Finding that move A is stronger than move B when both moves are not novelties is clearly a direct contribution to opening theory.

I believe that engines are clearly stronger than humans in the opening and I am sure also that engines found many opening novelties(part of them may be considered wrongly as novelties of humans but humans found them thanks to analysis by engines).
If NN engines were to find that move A is stronger than move B when it's not known before, as evidenced by NN engines demonstrating lots of wins by playing move A, then the human GMs would still adopt move A and it would become the preferred move (over B). Then, yes, it would be a contribution to opening theory AND we would see that it has happened. It's the same question. Has that happened? I don't know of any examples, but would be interested in seeing them.

We were talking about whether NN engines have so far contributed more to the latest opening theory (not one human's opening knowledge, nor what a human can come up with in an opening OTB) than traditional engines. I see no sign that they have.
jp
Posts: 1470
Joined: Mon Apr 23, 2018 7:54 am

Re: buying a new computer

Post by jp »

Uri Blass wrote: Thu Jul 18, 2019 12:42 am You can generate that book simply by letting stockfish play against stockfish or against lc0 and add the lines that the engines play at very slow time control to the book (stockfish is not deterministic so the book is going to have some variety).
I think SF and all traditional engines are highly deterministic and that's a problem when you want variety.
You think SF is quite non-deterministic and (elsewhere, for other purposes) that's a problem when you don't want variety.

The main source of variety if you just let SF loose with the same parameters, hardware, time/nodes, is just the multi-threading. If you use a single thread, there's none. I'm not sure multi-threading gives enough variety for what I'd want.

What makes you believe SF gives a lot of variety?
dragontamer5788
Posts: 201
Joined: Thu Jun 06, 2019 8:05 pm
Full name: Percival Tiglao

Re: buying a new computer

Post by dragontamer5788 »

Dann Corbit wrote: Thu Jul 18, 2019 1:27 am
dragontamer5788 wrote: Thu Jul 18, 2019 12:51 am I was thinking about this. Why aren't modern opening books just permanently stored MCTS trees?

MCTS stores the following information:
1. Number of visits
2. WDL information (#Wins / #Losses / #Draws)
Or, perhaps, why aren't modern opening books database files that contain:
1. Number of visits
2. WDL information (#Wins / #Losses / #Draws)
3. Depth of search
4. ce score
5-999: whatever else you want to collect.

An opening book should be a collection of pv nodes with as much data attached to the nodes as we can possibly find useful.
I guess I was pushing MCTS specifically. The mathematical MCTS "understanding" of a node is that it is a a "armed bandit" (American slang for "slot machine"). If you have a room filled with hundreds-of-thousands of slot machines, the MCTS methodology was created to "solve" the slot machine problem (aka: Multi-armed Bandit problem).

How do you "search" for the best slot machine, in a room filled with many, many slot machines? Where the "best" slot machine is the one that gives you the highest win-rate (or the lowest loss-rate). MCTS is a exploration vs exploitation methodology that will asymptotically find the best slot machine (if given enough time). It is also proven to be the fastest asymptotic complexity for the multi-armed bandit problem. (Much like how Knuth proves alpha-beta pruning to be the best asymptotic search for speeding up minimax... MCTS has been mathematically proven to solve the multi-armed bandit problem)

So other algorithms can be faster only by a constant factor compared to MCTS (where "faster" is the number of times a node is visited). Something faster may exist, but it will be in the same complexity class as MCTS.

All the math behind the multi-armed bandit problem, MCTS, and all that seems to elegantly map to the opening book. Far better than say, PV-search, Alpha-beta, or other concepts.

----------

In effect: a given position in an opening book is a "slot machine". It has some win/loss ratio, but we don't know it, and the only way to find out is to repeatedly play that slot machine and collect statistics. But we have other slot machines (other positions) we also need to collect statistics from. MCTS seems to be an unusually good "match" to the opening book problem.
Uri Blass
Posts: 10281
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: buying a new computer

Post by Uri Blass »

jp wrote: Thu Jul 18, 2019 1:48 am
Uri Blass wrote: Thu Jul 18, 2019 12:42 am You can generate that book simply by letting stockfish play against stockfish or against lc0 and add the lines that the engines play at very slow time control to the book (stockfish is not deterministic so the book is going to have some variety).
I think SF and all traditional engines are highly deterministic and that's a problem when you want variety.
You think SF is quite non-deterministic and (elsewhere, for other purposes) that's a problem when you don't want variety.

The main source of variety if you just let SF loose with the same parameters, hardware, time/nodes, is just the multi-threading. If you use a single thread, there's none. I'm not sure multi-threading gives enough variety for what I'd want.

What makes you believe SF gives a lot of variety?
My experience with stockfish shows that it has a lot of variety.
I also know that when stockfish played lc0 from the opening position in TCEC it was usually stockfish that is quilty for not repeating the same game twice and not lc0.


Here is some result of analysis of the opening position did not save all the analysis and I show only depth 20.
I ran the opening position many times to depth 20 and got 4 different opening moves when e4 and d4 are the most common.

I do not have a tool to run stockfish and clear the hash and do it again and again and I did it manually but I could get 4 different moves with it at depth 20 in the opening position(note that Nc3 is relatively rare).

FEN: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
Stockfish_19071415_x64_modern:

run 1:

20/26 00:02 6,024k 2,133k +0.75 1.d4 e6 2.Nf3 Nf6 3.Bf4 d5 4.e3 Bd6 5.Bxd6 Qxd6 6.Nbd2 0-0 7.Be2 c5 8.0-0 cxd4 9.exd4 Bd7 10.c4 Qc6 11.a3 dxc4 12.Nxc4

run 2:

20/31 00:03 7,494k 2,311k +0.64 1.e4 e6 2.d4 d5 3.Nc3 Bb4 4.exd5 exd5 5.Bd3 Nf6 6.Nf3 0-0 7.0-0 c5 8.dxc5 Bxc5 9.Bg5 Nc6 10.Bxf6 gxf6 11.Qd2 Ne5 12.Kh1 Nxd3 13.cxd3

run 3:


20/35 00:03 9,636k 2,494k +0.37 1.Nf3 d5 2.d4 e6 3.c4 Nf6 4.e3 Be7 5.Nc3 0-0 6.Be2 dxc4 7.0-0 a6 8.a4 c5 9.dxc5 Nc6 10.Qxd8

run 4:

20/32 00:03 10,422k 2,646k +0.53 1.Nc3 d5 2.d4 Nf6 3.Bf4 e6 4.e3 Bd6 5.Bd3 Bxf4 6.exf4 Bd7 7.Nf3 0-0 8.0-0 Nc6 9.a3 h6 10.Be2 Ne7 11.Ne5



I also ran many time stockfish when clearing the hash after every move to produce a tree(could not reproduce Nc3 again at depth 20 but could reproduce all the other moves.

Here is the pgn.(3 different moves happened more than once and after the first move black also has some moves and I suspect more variety if depth is bigger than 20)

[pgn][Event "Computer chess game"] [Site "URIBLASS-THINK"] [Date "2019.07.18"] [Round "?"] [White "Stockfish_19071415_x64_modern"] [Black "Stockfish_19071415_x64_modern"] [Result "*"] [BlackElo "2000"] [ECO "A04"] [Opening "Reti Opening"] [Time "03:57:53"] [WhiteElo "2000"] [Termination "unterminated"] [PlyCount "1"] [WhiteType "program"] [BlackType "program"] 1. e4 {(1.e4 e5 2.Nf3 Nc6 3.Bc4 Nf6 4.Nc3 Bc5 5.d3 d6 6.0-0 Na5 7.Bb3 0-0 8.Bg5 Nxb3 9.axb3 Be6 10.Na4 Bd4 11.c3 Bb6 12.d4 exd4 13.cxd4) +0.66/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 am
Location: Tel-Aviv Israel

Re: buying a new computer

Post by Uri Blass »

I suggest the following experiment to check variety of chess engines.
Of course you need to develop a special tool to do it.

Run the engine against itself in the first 10 moves(20 plies) for million times at some time control that you choose(let say 1 second per move) and tell me how many different games you get and how many different final positions you get.

I expect stockfish to produce more than 10000 different positions and of course theory is more than 20 plies.

Assuming you use time control of 1 second per move it means that 20 plies take 20 seconds and you need 20 million seconds for my experiment.

Maybe more realistic is to run it only for 10000 games and I expect more than 2000 final positions in this case.
User avatar
Ovyron
Posts: 4556
Joined: Tue Jul 03, 2007 4:30 am

Re: buying a new computer

Post by Ovyron »

jp wrote: Thu Jul 18, 2019 1:35 am If NN engines were to find that move A is stronger than move B when it's not known before, as evidenced by NN engines demonstrating lots of wins by playing move A, then the human GMs would still adopt move A and it would become the preferred move (over B). Then, yes, it would be a contribution to opening theory AND we would see that it has happened. It's the same question. Has that happened? I don't know of any examples, but would be interested in seeing them.
Just because an engine scores very well with move A, and just because move A is clearly best with correct play, doesn't mean that move A has any value for the GM, because the GM will have no clue about how to continue the game once the opponent plays something not memorized. If it did, you'd have seen GMs play move A, but for their interests (beating other human GMs) there's much better alternatives, some that may even have an engine playing really bad from them, or that are clearly bad with correct play.

But human GMs will play incorrectly. To know what I mean, play a match Shredder 8 v latest Stockfish and see how it's completely destroyed, then realize human GMs play even worse than Shredder 8. Shredder 8 has no clue about how to play what would be clearly best opening theory, humans would do worse than it, so they play opening theory that is suboptimal because their opponents aren't going to find the correct moves that'd refute it.
Your beliefs create your reality, so be careful what you wish for.