diff options
| author | Scott Gasch <[email protected]> | 2026-10-13 08:59:29 -0700 |
|---|---|---|
| committer | Scott Gasch <[email protected]> | 2026-10-13 08:59:29 -0700 |
| commit | f03bcac9ce3c6542310010bfbef2b126bb6ae861 (patch) | |
| tree | fb30befe5cdd08d126d38009a5a62ca3ef40e9f9 /src/main.c | |
| parent | 03545c4600df81b1a47dbc63fc606c065e857d8b (diff) | |
Minor changes; eval code was play tested as ~even.
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 57 |
1 files changed, 21 insertions, 36 deletions
@@ -49,7 +49,7 @@ Return value: char *p; Trace("Typhoon %s (built on %s %s, commit %s):\n", VERSION, __DATE__, __TIME__, GIT_COMMIT); - Trace(" Copyright (C) 2000-2007, Scott Gasch ([email protected])\n"); + Trace(" Copyright (C) 2000-2026, Scott Gasch ([email protected])\n"); Trace(" " REVISION); Trace(" " COMPILER_STRING); Trace(" Make profile used: %s\n", PROFILE); @@ -72,13 +72,7 @@ Return value: Trace(" Evaluation timing\n"); #endif #ifdef PERF_COUNTERS - Trace(" Performance counters\n"); -#ifdef TEST_NULL - Trace(" Testing nullmove prediction algorithms\n"); -#endif -#endif -#ifdef DUMP_TREE - Trace(" Search tree dumpfile generation enabled\n"); + Trace(" Performance counters enabled\n"); #endif Trace(" Hash sizes: %u Mb (main), %u Mb / thread (pawn)\n", (g_uHashTableSizeEntries * sizeof(HASH_ENTRY)) / MB, @@ -150,12 +144,7 @@ Return value: return(FALSE); } - // If the logfile we want to write already exists, back it up. - if (TRUE == SystemDoesFileExist(g_Options.szLogfile)) { - VERIFY(BackupFile(g_Options.szLogfile)); - } - ASSERT(FALSE == SystemDoesFileExist(g_Options.szLogfile)); - + // If the logfile we want to write already exists, just append to it. g_pfLogfile = fopen(g_Options.szLogfile, "wb+"); if (NULL == g_pfLogfile) { Trace("WARNING: Can't open logfile %s for write (%s); " @@ -452,23 +441,19 @@ Return value: **/ { - { - // 2026-09-16 diagnostic: allow forcing a fixed srand seed via - // TYPHOON_SEED for reproducing a specific run bit-for-bit - // (there's no --seed command-line flag) -- e.g. re-running the - // same debug_smoke_test.sh repro file to check whether a - // failure is deterministic or a genuine SMP timing race. - // TEMPORARY: revert once the split.c investigation is done, - // this isn't meant to be a permanent CLI feature. - const char *pszForcedSeed = getenv("TYPHOON_SEED"); - unsigned int uSeed = pszForcedSeed ? - (unsigned int)strtoul(pszForcedSeed, NULL, 10) : - (unsigned int)time(0); - Trace("srand seed: %u\n", uSeed); - srand(uSeed); - } + // 2026-09-16 diagnostic: allow forcing a fixed srand seed via + // TYPHOON_SEED for reproducing a specific run bit-for-bit + // (there's no --seed command-line flag) -- e.g. re-running the + // same debug_smoke_test.sh repro file to check whether a + // failure is deterministic or a genuine SMP timing race. + // TEMPORARY: revert once the split.c investigation is done, + // this isn't meant to be a permanent CLI feature. + const char *pszForcedSeed = getenv("TYPHOON_SEED"); + unsigned int uSeed = pszForcedSeed ? + (unsigned int)strtoul(pszForcedSeed, NULL, 10) : + (unsigned int)time(0); + srand(uSeed); InitializeOptions(argc, argv); - InitializeTreeDump(); InitializeEGTB(); InitializeSigSystem(); InitializeInteriorNodeRecognizers(); @@ -488,6 +473,7 @@ Return value: InitializeHashSystem(); InitEval(); #ifdef MP + Trace(" ...Multi-threaded search\n"); InitializeParallelSearch(); #endif VERIFY(PreGameReset(TRUE)); @@ -692,13 +678,12 @@ void MainProgramLoop() { FLAG fPonder; while (!g_fExitProgram) { - // Prepare to search or ponder memcpy(&pos, GetRootPosition(), sizeof(POSITION)); fThink = fPonder = FALSE; result.eResult = RESULT_IN_PROGRESS; result.szDescription[0] = '\0'; - + // What should we do? switch(g_Options.ePlayMode) { case I_PLAY_WHITE: @@ -786,10 +771,10 @@ Return value: { g_uInputThreadHandle = InitInputSystemWithDedicatedThread(); } - + // Enter the main work loop code... - MainProgramLoop(); - + MainProgramLoop(); + // If we get here g_fExitProgram is set -- clean up. Trace("MAIN THREAD: thread terminating.\n"); if (FALSE == MainProgramCleanup()) @@ -797,5 +782,5 @@ Return value: Trace("main: Main program cleanup code failed, aborting.\n"); exit(-1); } - exit(0); + exit(0); } |
