Chooses a move the way search does, but scores each root move on a worker thread,
so the 90 ms a depth-3 search costs (T161) does not drop the caller's frames. The
split is synchronous and cheap; one threads.spawn task per root move carries the
subtree, and ai.firstWins combines the scores in root order, so the choice is
deterministic. Inside the node budget the move is exactly the one search returns:
every subtree runs the same alpha-beta with a full window, and exact per-move scores
in the same order pick the same winner. Past the budget, or when cancelled, this
resolves { move: null } the way the synchronous search does.
Chooses a move the way
searchdoes, but scores each root move on a worker thread, so the 90 ms a depth-3 search costs (T161) does not drop the caller's frames. The split is synchronous and cheap; onethreads.spawntask per root move carries the subtree, andai.firstWinscombines the scores in root order, so the choice is deterministic. Inside the node budget the move is exactly the onesearchreturns: every subtree runs the same alpha-beta with a full window, and exact per-move scores in the same order pick the same winner. Past the budget, or when cancelled, this resolves{ move: null }the way the synchronous search does.