- In
ThreadPool::start_thinking (src/thread.cpp), store the current Thread/Worker pointer (e.g., Thread* thread = th.get(); auto* worker = thread->worker.get();) before creating the lambda. - Change the lambda capture list to capture those pointers by value (or move them in) and replace every
th->worker access with the captured pointer. - Rebuild and rerun multi-threaded regression tests (e.g., a CuteChess match with
Threads > 1) to confirm all workers are initialized properly and playing strength returns to normal.
Summary
- Cached each thread’s
Thread* and Search::Worker* before scheduling initialization work so the lambda operates on stable pointers instead of dereferencing the owning unique_ptr
Testing
- make -j build ARCH=x86-64
- ./revolution-v.2.72-dev-220925-chsteal <<‘EOF’\nuci\nsetoption name Threads value 4\nisready\nposition startpos\ngo depth 12\nquit\nEOF
Download Revolution uci chess engine