@@ -48,6 +48,7 @@ type AnalysisRunContext = {
4848 legalMoves : string [ ]
4949 legalMoveCount : number
5050 maiaCandidateMoves : string [ ]
51+ forcedCandidateMoves : string [ ]
5152 maiaPolicy : Record < string , number >
5253 kSf : number
5354 targetDepth : number
@@ -186,6 +187,9 @@ class Engine {
186187 const maiaCandidateMoves = Array . from (
187188 new Set ( options ?. maiaCandidateMoves || [ ] ) ,
188189 ) . filter ( ( move ) => this . moves . includes ( move ) )
190+ const forcedCandidateMoves = Array . from (
191+ new Set ( options ?. forcedCandidateMoves || [ ] ) ,
192+ ) . filter ( ( move ) => this . moves . includes ( move ) )
189193 const maiaPolicy = Object . fromEntries (
190194 Object . entries ( options ?. maiaPolicy || { } ) . filter (
191195 ( [ move , prob ] ) => this . moves . includes ( move ) && Number . isFinite ( prob ) ,
@@ -200,6 +204,7 @@ class Engine {
200204 legalMoves : [ ...this . moves ] ,
201205 legalMoveCount : this . legalMoveCount ,
202206 maiaCandidateMoves,
207+ forcedCandidateMoves,
203208 maiaPolicy,
204209 kSf : kSfFromOptions || 0 ,
205210 targetDepth,
@@ -761,10 +766,13 @@ class Engine {
761766 0 ,
762767 MAX_MAIA_DEEPEN_MOVES ,
763768 )
769+ const targetDeepeningMoves = Array . from (
770+ new Set ( [ ...maiaTopMoves , ...runContext . forcedCandidateMoves ] ) ,
771+ )
764772 const maiaMidDepth = Math . min ( MAIA_MID_DEPTH , targetDepth )
765773
766774 if ( maiaMidDepth > plan . screeningDepth ) {
767- for ( const move of maiaTopMoves ) {
775+ for ( const move of targetDeepeningMoves ) {
768776 if ( ! this . isActiveRun ( runContext . positionId ) ) {
769777 return
770778 }
@@ -881,7 +889,7 @@ class Engine {
881889 yield streamingEval
882890 }
883891
884- for ( const move of maiaTopMoves ) {
892+ for ( const move of targetDeepeningMoves ) {
885893 if ( ! this . isActiveRun ( runContext . positionId ) ) {
886894 return
887895 }
@@ -1665,6 +1673,7 @@ class Engine {
16651673 legalMoves : [ ...this . moves ] ,
16661674 legalMoveCount : this . legalMoveCount ,
16671675 maiaCandidateMoves : [ ] ,
1676+ forcedCandidateMoves : [ ] ,
16681677 maiaPolicy : { } ,
16691678 kSf : 0 ,
16701679 targetDepth : this . currentTargetDepth ,
0 commit comments