glinscott / leela-chess

**MOVED TO https://github.com/LeelaChessZero/leela-chess ** A chess adaption of GCP's Leela Zero
http://lczero.org
GNU General Public License v3.0
760 stars 298 forks source link

Port LZGo "Reduce time uncertainty" #296

Open killerducky opened 6 years ago

killerducky commented 6 years ago

In particular forking off the tree destruction seems like a good idea. https://github.com/gcp/leela-zero/pull/1163

apleasantillusion commented 6 years ago

Perhaps relevant to this, I've noticed that sometimes our time management "saves" time incorrectly. I had posted one example in Discord, and @killerducky had requested I add a note about this here.

The full log is rather long, so I've added a pastebin: https://pastebin.com/PFy0AiPk.

Essentially, it seems that under some conditions, even when we've hit 1 second and 100 nodes, the playouts/elapsed_time is still much lower than full speed, and the engine incorrectly estimates that the top move cannot be changed in the remaining time.

In the above example, my full speed is around 6.5 knps, so it would only take a couple seconds at full speed for any move to overtake e6, which has only 13k visits.

Instead, the search terminates after 1.48 seconds of the 60 seconds requested.

On that particular hardware setup, I can reproduce that example every time, but I've found it difficult to find an example that can easily be reproduced on multiple hardware configs.

I'm not sure if the behavior I observed is related to the proposed change or not; perhaps something else to consider is placing a max on the savings, i.e., requiring that some percentage of the target time always be used.