Menu

FAQ3

Patrick Näf

Information source

Most of the information on this page has been taken from ​this message thread on fuego-devel.

Q1: What does "pondering" mean?

A: "Pondering" means that Fuego is doing calculations while the opponent takes his time for his turn. Enabling "pondering" thus increases Fuego's playing strength because it had more time for its calculations.

Pondering is enabled via the GTP command

uct_param_player ponder 1

Q2: What does "reuse subtree" mean?

A1: Fuego represents possible outcomes of future moves as a tree. Once a move is selected in the real game (by either Fuego or it's opponent), most of that tree becomes irrelevant. But there is a subtree (rooted at the selected move) that is still valid. Keeping that around saves Fuego some time with it goes to calculate it's next move.

A2: "Reuse subtree" means that Fuego is trying to re-use the relevant parts of a tree from a previous search. For example, say it searches from the empty 9x9 board and grows a tree of 10M (million) nodes. Then it chooses to play E5, and the opponent answers E3. Some part of the original tree will be a subtree reached after these two moves. Since they are strong moves, maybe 3M of the 10M nodes will be in this subtree. So when we ask Fuego again to choose a move, it will not start the search from nothing, but it will keep these 3M nodes and expand from that tree.

"Reuse subtree" is enabled via the GTP command

uct_param_player reuse_subtree 1

Q3: How does "pondering" interact with "reuse subtree"?

A1: Pondering cannot be used without "reuse subtree".

A2: "Reuse subtree" makes sense without pondering. It just means that the re-used tree is typically from two moves ago, when it was last Fuego's turn to think. If pondering is on, the tree will be just one move old, since Fuego was pondering after its previous move (E5 in the example) has already been played.

Q4: When pondering is disabled and then re-enabled, does Fuego continue with its calculations where it left off?

A1 (short): Yes.

A2 (long): Pondering is started in a different thread when starting to wait for the next GTP command and stopped when the next command is received (via SgSetUserAbort?() in GtpEngine::StopPonder?()). This ensures that the pondering search never overlaps with the execution of a GTP command handler so that no assumptions about thread-safety of the search and any of the GTP command handlers are necessary.

When a pondering search is stopped and started again, be it by disabling and enabling it or by stopping and starting pondering because of a new GTP command was received and handled, the usual reusing of the subtree happens. The UCT search stores the state at the root of the last search (see GoUctSearch::m_boardHistory) and compares it to the current state. In this case, it is the same position, so the subtree to be reused is the full tree.

Q5: How does changing the memory limit interact with "pondering" and/or "reuse subtree"?

A1: Changing the memory limit always causes the current search tree to be discarded - even if "reuse subtree" is enabled. The tree is also discarded regardless of whether the new memory limit is higher or lower than the old limit. The bottom line is that after a memory limit change the next search always needs to start from scratch.

A2: If "pondering" is enabled, Fuego briefly stops the pondering search when it receives the memory limit GTP command (see Q4/A2). The GTP command is processed and the new memory limit is applied. Because the search tree is discarded (see Q5/A1) memory consumption at first drops to a minimum. Pondering resumes after the GTP command has been processed. As the pondering search progresses, memory consumption increases until it reaches the new limit.

A memory limit of 1 GB is set via the GTP command

uct_max_memory 1000000000

Q6: What happens when I change the memory limit while Fuego is processing a GTP command?

A1: At first, nothing. You can only run one GTP command at a time, therefore the memory limit command is processed only after the first GTP command has been fully handled.

A2: The long-running command "genmove" can be interrupted, though, to immediately apply the changed memory limit.


Related

Wiki: FrequentlyAskedQuestions

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.