Hi @lightvector,
Thank you for your amazing work on KataGo. I'm working on a small research modification and have run into a compilation issue I hope you can help with.
What I changed
I modified getPlaySelectionValues in searchresults.cpp to add a new move-selection rule based on group-relative normalized Q-values (similar to GRPO in RL). The original code selects the move with the most visits (argmax(N)). My modification selects the move with the highest z-score of Q-values within the candidate group.
I added a boolean parameter useGroupComparison in searchparams.h to toggle between the two rules.
The problem
My code compiles successfully with zero errors (VS 2026 Preview, MSVC 19.44, CMake + OpenCL backend), but the resulting katago.exe will not start at all — no output, no error message, no GTP prompt. It exits silently.
The official precompiled katago.exe (v1.15.3, OpenCL) runs perfectly on the same machine.
What I've tried
- Clean build multiple times
- Both CUDA and OpenCL backends (same result)
- Verified all required DLLs are present (
OpenCL.dll, zlib.dll, MSVCP140.dll, VCRUNTIME140.dll, etc.)
dumpbin /dependents shows identical DLL dependencies between the official exe and my compiled exe
- The official precompiled exe works perfectly in both GTP and match modes
My environment
- Windows 11, RTX 4060 Ti (16GB)
- Visual Studio 2026 Preview (MSVC 19.44.35227)
- CMake 4.2.3
- CUDA 12.4, OpenCL backend
- CMake config:
cmake ..\cpp -G "Visual Studio 17 2022" -A x64 -DUSE_BACKEND=OPENCL -DZLIB_INCLUDE_DIR=... -DZLIB_LIBRARY=...
My suspicion
Could this be a toolchain compatibility issue with VS 2026 Preview? Has anyone successfully built KataGo with VS 2026? If not, would switching to VS 2022 (v143 toolset) likely resolve this?
The diff
In searchparams.h, added after useNonBuggyLcb:
bool useGroupComparison; //Use group-relative normalized Q values for move selection
In searchresults.cpp, at the end of getPlaySelectionValues (the full version with lcbBuf and radiusBuf parameters), inserted before return true;:
if(useGroupComparison && numChildren > 0) {
// 第一步:收集所有有效候选的 Q 值和对应索引
double qValues[NNPos::MAX_NN_POLICY_SIZE];
int qIndices[NNPos::MAX_NN_POLICY_SIZE];
int validCount = 0;
for(int i = 0; i < numChildren; i++) {
if(playSelectionValues[i] > 0) {
const SearchChildPointer& childPointer = children[i];
const SearchNode* child = childPointer.getIfAllocated();
if(child != NULL) {
qValues[validCount] = (rootPla == P_WHITE ? 1 : -1) * child->stats.utilityAvg.load(std::memory_order_acquire);
qIndices[validCount] = i;
validCount++;
}
}
}
// 第二步:如果有至少 2 个有效候选,计算标准化 Q 值并替换
if(validCount >= 2) {
double sum = 0.0;
for(int j = 0; j < validCount; j++) sum += qValues[j];
double mean = sum / validCount;
double varSum = 0.0;
for(int j = 0; j < validCount; j++) {
double diff = qValues[j] - mean;
varSum += diff * diff;
}
double stdDev = sqrt(varSum / validCount);
if(stdDev > 1e-10) {
for(int j = 0; j < validCount; j++) {
double aValue = (qValues[j] - mean) / stdDev;
if(aValue < 0) aValue = 0;
playSelectionValues[qIndices[j]] = aValue + 0.01;
}
}
}
}
Any guidance would be greatly appreciated. Thanks again for your incredible work on KataGo!
Hi
@lightvector,Thank you for your amazing work on KataGo. I'm working on a small research modification and have run into a compilation issue I hope you can help with.
What I changed
I modified
getPlaySelectionValuesinsearchresults.cppto add a new move-selection rule based on group-relative normalized Q-values (similar to GRPO in RL). The original code selects the move with the most visits (argmax(N)). My modification selects the move with the highest z-score of Q-values within the candidate group.I added a boolean parameter
useGroupComparisoninsearchparams.hto toggle between the two rules.The problem
My code compiles successfully with zero errors (VS 2026 Preview, MSVC 19.44, CMake + OpenCL backend), but the resulting
katago.exewill not start at all — no output, no error message, no GTP prompt. It exits silently.The official precompiled
katago.exe(v1.15.3, OpenCL) runs perfectly on the same machine.What I've tried
OpenCL.dll,zlib.dll,MSVCP140.dll,VCRUNTIME140.dll, etc.)dumpbin /dependentsshows identical DLL dependencies between the official exe and my compiled exeMy environment
My suspicion
Could this be a toolchain compatibility issue with VS 2026 Preview? Has anyone successfully built KataGo with VS 2026? If not, would switching to VS 2022 (v143 toolset) likely resolve this?
The diff
In
searchparams.h, added afteruseNonBuggyLcb:In
searchresults.cpp, at the end ofgetPlaySelectionValues(the full version withlcbBufandradiusBufparameters), inserted beforereturn true;:Any guidance would be greatly appreciated. Thanks again for your incredible work on KataGo!