From 93f1e82cedbf2fcd45ac413cbf2a654e0f65f0b3 Mon Sep 17 00:00:00 2001 From: Aargh Rai Date: Thu, 27 Aug 2026 22:21:14 +0530 Subject: uci tests --- src/engine/thread.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'src/engine/thread.c') diff --git a/src/engine/thread.c b/src/engine/thread.c index 1bb9a83..bbf2605 100644 --- a/src/engine/thread.c +++ b/src/engine/thread.c @@ -70,13 +70,10 @@ void *child_thread(void *_args) { // nothing active right now: idle until the root publishes the next // iteration's block or the search is stopped if (sp == NULL) { - static _Thread_local int spins = 0; - if (++spins == 5000000) fprintf(stderr, "CHILD %d STUCK stop=%d (ptr=%p)\n", args->id, atomic_load(&args->stop), (void*)&args->stop); sched_yield(); continue; } - fprintf(stderr,"CHILD %d found sp\n",args->id); // register as a worker at this block so Merge knows the headcount atomic_fetch_add(&sp->workers, 1); @@ -174,7 +171,6 @@ void *root_thread(void *_args) { ? __pool_alloc(args->split_points, args->sp_pool_capacity) : NULL; - fprintf(stderr,"ROOT iter %d sp=%p\n",depth,(void*)sp); if (sp != NULL) { // Split (ยง2.4): snapshot the root node and hand the whole move list to // the pool; the root works the list alongside its workers. @@ -221,16 +217,9 @@ void *root_thread(void *_args) { if (split_point_merge(sp)) { atomic_store(&sp->state, SPLITPOINT_STATE_FREE); } - fprintf(stderr,"ROOT iter %d waiting w=%d\n",depth,atomic_load(&sp->workers)); - int spins=0; while (atomic_load(&sp->state) == SPLITPOINT_STATE_ACTIVE) { sched_yield(); - if (++spins==1000000) fprintf(stderr,"ROOT STUCK iter %d w=%d idx=%d\n",depth,atomic_load(&sp->workers),atomic_load(&sp->next_move_idx)); } - while (atomic_load(&sp->state) == SPLITPOINT_STATE_ACTIVE) { - sched_yield(); - } - fprintf(stderr,"ROOT iter %d done\n",depth); result.score = atomic_load(&sp->best_score); result.best_move = sp->best_move; -- cgit v1.2.3