I haven't tried my idea above yet but I think that the data that this scheme will produce can be used further in the game tree so it only needs to be cleared every new game. It is even possible that the values can be saved when the program exits and retrieved when it runs again. It will serve like a set of precomputed piece square tables that learns every new game.Edsel Apostol wrote:Your scheme is what I thought first before I came up with my idea. I've just realized now that my idea will only work if it is in a fixed single depth search. I forgot to take into account that it will be used in an iterative deepening framework.mcostalba wrote:Ok, you posted yours so it is correct I post mine:mcostalba wrote:Yes, I had a _similar_ idea but still no time to test it.Edsel Apostol wrote: I have this idea to use a new history table every fifth ply (subject to tuning) and to initialize it at every 5th first grandchild node of each root move and the succeeding 5th first grandchild from that 5th first grandchild node. This way a history table will only be used for 5 plies and it will only be used by that certain branch of the tree.
Actually my idea is slightly different but at the same time _very_different in possible results.
If tests will be good I will post results.
It is similar to yours but instead of nodes "of each root move" I only consider PV nodes and of this node I only consider the first move, i.e. the PV move.
IOW I setup an history table for first move of root move list.
All the following moves will use this table.
When fifth ply is reached and we are in PV, then I setup another table for the _first_ move of the PV node: all the moves _below_ that move will use this new table.
In my scheme on a search of say 20 plies I have 5 tables only, on your scheme you have much more and I have doubts it can work
Note that in Stockfish (I don't know in your Twisted logic) history is weighted by depth, also if first main table will end up storing data of side branches at very high ply, this should not compromise history quality because their relative weight is very small.
My scheme also, handles nicely the asymmetry between the size of the PV move sub-tree and of the remaining ones (that are much smaller).
I think this scheme is what more is near to the concept of one history table per subtree and I have expectations it will work.
The reason why I scrapped that first idea in favor of mine is that the fifth or tenth ply of the PV move may not be close positionally to the fifth or tenth ply of non PV nodes, therefore the contents of that history table from the PV node might not be a representative of the subtree on non PV nodes.
I think the most probable idea would be to use the number of pawns to index what history table to use. I came up with this idea because I think that a position with 5 pawns for white and 5 pawns for black for example will be close to other positions with similar number of pawns, therefore the history data from this positions will be very similar and their values can be trusted. This scheme will be independent of ply and depth so it will not be affected by deeper search.
This idea can be used in the extreme by using the position's pawn structure as index to its own history table. If there is just a way to hash the positions pawn structure into less than a hundred distinct index, then we will have a persistent history table that learns every time the engine searches.
I can't explain my idea clearly. This idea revolves around my theory that the history values are relevant for any position as long as the pawn structure is similar or related.
Maybe someone clever here can invent a method who can hash into a distinct index a similar set of pawn structure.