Skip to content

[Dots] Fix calculation of scoring (infer it from ownership)#38

Merged
KvanTTT merged 4 commits intomasterfrom
dots-fix-scoring
Jan 17, 2026
Merged

[Dots] Fix calculation of scoring (infer it from ownership)#38
KvanTTT merged 4 commits intomasterfrom
dots-fix-scoring

Conversation

@KvanTTT
Copy link
Owner

@KvanTTT KvanTTT commented Jan 17, 2026

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the calculation of scoring for the Dots game variant by inferring it from ownership rather than using complex heuristics based on intermediate game state. The changes simplify the scoring logic and improve code quality through const correctness and C++17 style improvements.

Changes:

  • Refactored Dots scoring calculation to infer from ownership instead of computing from state (activeColor, placedColor, territory, grounding)
  • Added const qualifiers to pointer parameters in training data writing functions
  • Improved CMake configuration to enable AVX2 by default on non-ARM platforms
  • Enhanced Windows CI to test both OPENCL and EIGEN backends

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
cpp/neuralnet/nninputs.cpp Simplified Dots scoring logic to infer from ownership array; removed complex heuristics and replaced with direct ownership-to-scoring mapping
cpp/dataio/trainingwrite.h Added const qualifiers to finalFullArea, finalOwnership, and finalWhiteScoring parameters
cpp/dataio/trainingwrite.cpp Added const qualifiers and refactored ownership checking logic using C++17 init-statements in if-conditions for clarity
cpp/CMakeLists.txt Changed AVX2 default from disabled to enabled on non-ARM platforms; improved ARM architecture detection and messaging
.github/workflows/build.yml Added matrix strategy to test both OPENCL and EIGEN backends on Windows; removed conditional artifact upload restriction

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if (!hist.rules.isDots) {
if (Color finalFullAreaAtLoc = finalFullArea[loc]; finalFullAreaAtLoc != C_EMPTY) {
//Mark full area points that ended up not being owned
rowOwnership[pos+posArea] = static_cast<int8_t>(finalFullAreaAtLoc == nextPlayer ? 1 : -1);
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The static_cast<int8_t> here is inconsistent with lines 713 and 715 where no cast is used for similar assignments to rowOwnership[pos]. Since rowOwnership is an int8_t* array, the implicit conversion from integer literals is safe and the cast is unnecessary. For consistency, consider removing the cast or applying it to all similar assignments.

Suggested change
rowOwnership[pos+posArea] = static_cast<int8_t>(finalFullAreaAtLoc == nextPlayer ? 1 : -1);
rowOwnership[pos+posArea] = (finalFullAreaAtLoc == nextPlayer ? 1 : -1);

Copilot uses AI. Check for mistakes.
@KvanTTT KvanTTT merged commit aae9353 into master Jan 17, 2026
4 checks passed
@KvanTTT KvanTTT deleted the dots-fix-scoring branch January 17, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant