Skip to content

Compiler flags for max field size and sgf selfplay/gatekeeper names#41

Merged
KvanTTT merged 12 commits intomasterfrom
compiler-flags-and-sgf-selfplay-names
Feb 2, 2026
Merged

Compiler flags for max field size and sgf selfplay/gatekeeper names#41
KvanTTT merged 12 commits intomasterfrom
compiler-flags-and-sgf-selfplay-names

Conversation

@KvanTTT
Copy link
Owner

@KvanTTT KvanTTT commented Jan 31, 2026

No description provided.

@KvanTTT KvanTTT self-assigned this Jan 31, 2026
@KvanTTT KvanTTT force-pushed the compiler-flags-and-sgf-selfplay-names branch 3 times, most recently from 607b707 to 3a9ee40 Compare February 1, 2026 18:58
@KvanTTT KvanTTT force-pushed the compiler-flags-and-sgf-selfplay-names branch from 3a9ee40 to 032c843 Compare February 1, 2026 21:19
@KvanTTT KvanTTT requested a review from Copilot February 1, 2026 21:19
@KvanTTT KvanTTT marked this pull request as ready for review February 1, 2026 21:21
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 introduces timestamp-aware file naming and seeds for selfplay/gatekeeper, improves compilation metadata reporting, adds configurable compile-time board-size limits, enhances rules presets (including Dots variants), and extends CI/build support (including Eigen backend).

Changes:

  • Add TimeStampHandler and wire it into selfplay/gatekeeper/training-data writing to generate deterministic, collision-resistant filenames and seeds, plus switch compile-time reporting to a numeric YYYY-MM-DD-HH-MM-SS format.
  • Refactor rules handling to use named presets (including new Dots presets like bbs/notago), add Rules::operator<, and improve GTP capabilities (new info command, Dots config cleanup).
  • Update CMake and CI to allow configurable COMPILE_MAX_BOARD_LEN* compiler flags and to build/test both OpenCL and Eigen backends, including a runtime Eigen-thread sanity check.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
cpp/tests/testtrainingwrite.cpp Adjusts the createTestTrainingDataWriter helper to pass the new TimeStampHandler* parameter (as nullptr) to the updated TrainingDataWriter constructor.
cpp/neuralnet/trtbackend.cpp Refactors buildActivationLayer to use straight if chains with a single ASSERT_UNREACHABLE and a nullptr return for unknown activations, improving control-flow clarity and return-path completeness.
cpp/main.h Declares Version::getCompilationDateTime(bool csv = false) as part of the version/build metadata API.
cpp/main.cpp Adds Eigen backend support in main (including a thread-count check and user guidance) and switches compile-time reporting to use the new getCompilationDateTime helper with numeric formatting.
cpp/game/rules.h Adds bool operator<(const Rules& other) const; to support ordered containers over Rules (e.g., std::map<Rules, string> for presets).
cpp/game/rules.cpp Implements Rules::operator<, introduces preset maps and initializePresets(), rewrites parseRulesHelper and toStringNoSgfDefinedPropertiesMaybeNice to use presets (including new Dots presets like bbs/notago), and integrates them into existing parsing APIs.
cpp/game/common.h Adds Dots-specific rule name constants DOTS_NOTAGO_STANDARD_RULES ("notago") and DOTS_BBS_STANDARD_RULES ("bbs") used by the new presets.
cpp/dataio/trainingwrite.h Extends TrainingDataWriter’s constructor signature to accept a TimeStampHandler*, stores it in the class, and makes minor formatting tweaks.
cpp/dataio/trainingwrite.cpp Wires the TimeStampHandler* into TrainingDataWriter to generate timestamped .npz filenames when available, leaving the old random-hex naming as a fallback when no handler is provided.
cpp/core/datetime.cpp Changes DateTime::getCompactDateTimeString() format to YYYY-MM-DD-HH-MM-SS, aligning with the desired compact, numeric timestamp format for filenames and compile-time reporting.
cpp/core/TimeStampHandler.h Introduces the TimeStampHandler class interface for generating timestamped filenames and an associated random seed derived from the timestamp.
cpp/core/TimeStampHandler.cpp Implements TimeStampHandler, generating a compact timestamp plus a short random suffix, ensuring both cross-machine uniqueness and local collision avoidance via existence checks.
cpp/configs/gtp_dots.cfg Removes the now-unnecessary rules = dots line so Dots configurations rely on the dots flag and rule presets instead of a special string rule name.
cpp/command/selfplay.cpp Integrates TimeStampHandler into selfplay: log filenames, model config dumps, training-data filenames (TrainingDataWriter), SGF output, and game seeds are now based on a shared timestamp-derived seed.
cpp/command/gtp.cpp Adds a new info GTP command (and includes it in knownCommands) that returns CSV-style app/build info plus current model internal names.
cpp/command/gatekeeper.cpp Integrates TimeStampHandler into gatekeeper: log filenames, per-model config dumps, and SGF output now use timestamped filenames, and a timestamp-derived seed is available (currently only used for logging/seeding consistency).
cpp/CMakeLists.txt Adds core/TimeStampHandler.cpp to the build, and introduces configurable COMPILE_MAX_BOARD_LEN_X/Y for DOTS_GAME and COMPILE_MAX_BOARD_LEN when using USE_BIGGER_BOARDS_EXPENSIVE, with helpful status messages.
.github/workflows/build.yml Updates the Linux build workflow to build with both OPENCL and EIGEN backends via a matrix, installs Eigen dev headers, keys CMake cache by backend, and names artifacts per backend.

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

@KvanTTT KvanTTT force-pushed the compiler-flags-and-sgf-selfplay-names branch from 032c843 to 68b8235 Compare February 1, 2026 21:39
@KvanTTT KvanTTT requested a review from Copilot February 1, 2026 21:44
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

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.


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

Comment on lines 4 to 17

using namespace std;

class TimeStampHandler {
public:
explicit TimeStampHandler(Rand& rand);
[[nodiscard]] string generateFileName(const string& path, const string& ext) const;
[[nodiscard]] string getCurrentRandSeed() const;

private:
string currentDateTime;
uint64_t currentDateTimeRand;
string currentRandSeed;
string fileNameFriendlyRandSuffix;
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

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

Avoid using namespace std; in a header file, since it injects all of std into every translation unit that includes this header and can cause name collisions; prefer qualifying with std:: or using using declarations only in source files.

Suggested change
using namespace std;
class TimeStampHandler {
public:
explicit TimeStampHandler(Rand& rand);
[[nodiscard]] string generateFileName(const string& path, const string& ext) const;
[[nodiscard]] string getCurrentRandSeed() const;
private:
string currentDateTime;
uint64_t currentDateTimeRand;
string currentRandSeed;
string fileNameFriendlyRandSuffix;
#include <string>
#include <cstdint>
class TimeStampHandler {
public:
explicit TimeStampHandler(Rand& rand);
[[nodiscard]] std::string generateFileName(const std::string& path, const std::string& ext) const;
[[nodiscard]] std::string getCurrentRandSeed() const;
private:
std::string currentDateTime;
std::uint64_t currentDateTimeRand;
std::string currentRandSeed;
std::string fileNameFriendlyRandSuffix;

Copilot uses AI. Check for mistakes.
cpp/main.cpp Outdated
{
#ifdef USE_EIGEN_BACKEND
if(Eigen::nbThreads() == 0) {
cout << "There is no Eigen threads." << endl;
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

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

The message text "There is no Eigen threads." is ungrammatical; consider changing it to something like "There are no Eigen threads." for clarity.

Suggested change
cout << "There is no Eigen threads." << endl;
cout << "There are no Eigen threads." << endl;

Copilot uses AI. Check for mistakes.
@KvanTTT KvanTTT force-pushed the compiler-flags-and-sgf-selfplay-names branch from 68b8235 to 024c89d Compare February 2, 2026 12:05
@KvanTTT KvanTTT requested a review from Copilot February 2, 2026 12:07
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

Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.


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

@KvanTTT KvanTTT force-pushed the compiler-flags-and-sgf-selfplay-names branch from 024c89d to 63780ce Compare February 2, 2026 15:36
@KvanTTT KvanTTT merged commit 3b565ce into master Feb 2, 2026
5 checks passed
@KvanTTT KvanTTT deleted the compiler-flags-and-sgf-selfplay-names branch February 2, 2026 15:41
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.

2 participants