Esempio n. 1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="def"></param>
        public SuiteTestRunner(SuiteTestDef def)
        {
            Def = def;

            // Create and warmup both engines (in parallel)
            Parallel.Invoke(() => { EngineCeres1 = Def.Engine1Def.CreateEngine() as GameEngineCeresInProcess; EngineCeres1.Warmup(); },
                            () => { EngineCeres2 = Def.Engine2Def?.CreateEngine() as GameEngineCeresInProcess; EngineCeres2?.Warmup(); },
                            () => { EngineExternal = Def.Engine2Def?.CreateEngine(); EngineExternal?.Warmup(); });
        }
Esempio n. 2
0
        /// <summary>
        /// Leela sometimes cheats and exceeds node budgets; try to compensate for that.
        /// </summary>
        /// <param name="limitOrg"></param>
        /// <returns></returns>
        static SearchLimit MakeCeresSearchLimit(SuiteTestDef def, UCISearchInfo searchInfo, SearchLimit limitOrg)
        {
            // Can't change unless both were nodes per move limits that were the same
            if (searchInfo == null ||
                limitOrg.Type != SearchLimitType.NodesPerMove ||
                def.ExternalEngineDef.SearchLimit.Type != SearchLimitType.NodesPerMove ||
                def.ExternalEngineDef.SearchLimit.Value != limitOrg.Value)
            {
                return(limitOrg);
            }

            // Otherwise try to exactly match how many Leela searched if it went over
            if (searchInfo.Nodes > limitOrg.Value)
            {
                return(new SearchLimit(SearchLimitType.NodesPerMove, searchInfo.Nodes));
            }
            else
            {
                return(limitOrg);
            }
        }