My "official" request to top engine programmers

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

Moderators: hgm, Rebel, chrisw

Rodolfo Leoni
Posts: 545
Joined: Tue Jun 06, 2017 4:49 pm
Location: Italy

Re: My "official" request to top engine programmer

Post by Rodolfo Leoni »

cdani wrote:
hgm wrote:The problem that scores of a variation get lost when you go deeper in a variation, and then return to (before) a previously analyzed one, is not related to persistent hash. The latter only makes it possible to transfer analysis between different sessions with the engine.

What you complain about (and also bugged me, when I started to do thorough analysis) is caused by a bad replacement strategy for hash entries. Most engines number the searches they do, and remember in the hash table which search was responsible for creating a stored entry, or remember what was the last search that actually used the stored information. If they then stumble on entries that are not used in any recent search (sometimes even just the current search), they assume the positions they refer to no longer are reachable from the current root position, and thus useless. They are treated as empty, and immediately overwritten.

This works very well in games, where no take-backs are done. Such as in the games used to determine the rating of the engine. For interactive analysis this is fatal, however: as soon as you go into an alterative variation, and play an irreversible move, all your previous analysis will be purged from the hash table, as the positions are no longer reachable. But of course they remain reachable, through the take-back you will sooner or later do to back-poropagate the score of the newly analyzed variation.

The solution is quite simple: engines should realize that an interactive analysis session is in fact a single search, where the low plies are governed by the user, and the root positions of the various analysis searches are not root positions at all, but just internal nodes of the tree the user is constructing. As such, they should not increment the search number during analysis. They are just not different searches, but part of the larger one.

In my engines incrementing the search number only before searches intended to play in a game ('thinking'), and leaving it as it was in an analysis search, did solve the problem.
Done here!
http://www.andscacs.com/downloads/andscacs091142.zip
(Windows version)
Can someone test it and see if it behaves better in analysis mode? I will try it also.
Thanks
Daniel, you are a great man!!!!

I always thought it, as ours peoples are a bit related. I live near Alghero, in Sardinia island, and it was a Catalan town. Its old name was "Alguier".

:) :) :)
F.S.I. Chess Teacher
User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

Re: My "official" request to top engine programmer

Post by cdani »

Rodolfo Leoni wrote:
cdani wrote: Done here!
http://www.andscacs.com/downloads/andscacs091142.zip
(Windows version)
Can someone test it and see if it behaves better in analysis mode? I will try it also.
Thanks
Daniel, you are a great man!!!!

I always thought it, as ours peoples are a bit related. I live near Alghero, in Sardinia island, and it was a Catalan town. Its old name was "Alguier".

:) :) :)
:-)

I have done also a version of the current Stockfish (only Windows x64 popcnt) that have this change:

www.andscacs.com/downloads/stockfish_x6 ... alysis.zip

In the zip file there are two versions:
stockfish_x64_modern_170708_analysis.exe
stockfish_x64_modern_170708.exe

The second is normal Stockfish so one can compare.

The change is:

Code: Select all

if (!Limits.infinite)
	TT.new_search();
I suppose that this is correct. Anyway just tell me.
User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

Re: My "official" request to top engine programmer

Post by cdani »

Rodolfo Leoni
Posts: 545
Joined: Tue Jun 06, 2017 4:49 pm
Location: Italy

Re: My "official" request to top engine programmer

Post by Rodolfo Leoni »

Testing your Andscacs release. It seems fine enough to prevent me from going to buying something for lunch.

It only misses a load/save hashes option and it'll be a great tool!
F.S.I. Chess Teacher
User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

Re: My "official" request to top engine programmer

Post by cdani »

Dann Corbit wrote:There was a project some time ago that did something like this.
The pv nodes were stored in a database as it played.
These pv nodes were reloaded into hash when the engine was started for the next game.

It was also possible to preload the hash with a huge database of EPD records, if you so desired.

It was called Stockfish PA GTB.

It was too much effort for the author to maintain.

The same thing happens to many other such projects (CFish is a good example).
I reviewed the code and seem that is only able to use .bin books and to save a log file, but no special hash management stuff.
Arpad Rusz
Posts: 273
Joined: Sat Apr 17, 2010 2:34 pm
Location: Budapest

Re: My "official" request to top engine programmer

Post by Arpad Rusz »

Another possibility to improve the analysis would be to add the ability to help the engine from outside during a running search. If the human user has some extra knowledge about some positions from the search tree (e.g. it recognizes a position as a fortress, or if he has checked the position in the Lomonosov tablebases) wouldn't be nice to communicate that to the engine?

The engine should accept a value attached to a fen string during the analysis and it has to save it as a permanent entry in the hash for example by a UCI command like this:

seed "fen string" "value"

Or even the engine itself could ask for help in some positions! Not only from the user but from another engine or a special software which does tablebase probes.

ask "fen string"
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: My "official" request to top engine programmer

Post by hgm »

WB protocol has the setscore SCORE DEPTH command for that. With that you can instruct the engine to use the given score for the current position for all search requests up to the given depth. If higher depth is requested, it should do a normal search. You would have to specify the position in a preceding setboard FEN command, or by moving to it.

Unfortunately there is no way yet to have XBoard send this command. I could make it use the move type-in dialog for tgat, I guess.
peter
Posts: 3186
Joined: Sat Feb 16, 2008 7:38 am
Full name: Peter Martan

Re: My "official" request to top engine programmer

Post by peter »

Hi Daniel!
cdani wrote:I reviewed the code and seem that is only able to use .bin books and to save a log file, but no special hash management stuff.
Thanks a lot for SF with less hash- aging, could it be called like that too?

I guess it works similar to UCI- options like "Persistent Hash" in Rybka or "Keep Hash Tables" in Shredder?

PA- GTB- SF had a "learning file" to which certain hash- entries were stored autmatically according to boundaries of eval- differences, user could adopt as well as the largeness of the stored file.

Yet it never got nearly as big as the hash tables themselves, so the princple seemed to be the one of learning files earlier versions of Shredder and Houdini had and Hiarcs still has.
:?:
Peter.
User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

Re: My "official" request to top engine programmer

Post by cdani »

peter wrote:Hi Daniel!
cdani wrote:I reviewed the code and seem that is only able to use .bin books and to save a log file, but no special hash management stuff.
Thanks a lot for SF with less hash- aging, could it be called like that too?

I guess it works similar to UCI- options like "Persistent Hash" in Rybka or "Keep Hash Tables" in Shredder?
Not really. As told by HGM, It just treats any hash entry as if it was from the current search during the whole infinite analysis session, to avoid discard that easy hash entries with newer but shallower depth.
peter
Posts: 3186
Joined: Sat Feb 16, 2008 7:38 am
Full name: Peter Martan

Re: My "official" request to top engine programmer

Post by peter »

Are we both talking about this one from Jeremy Bernstein?

http://www.open-chess.org/viewtopic.php?f=7&t=2663

The download-link given in that posting even works still
Peter.