Improve CLI error handling a bit

Reduce the number of *easy* ways to hit UB or an uncaught exception. This builds on Sopel's work on FEN validation.

Obviously SF is not and will never be a security boundary, but at least we can reduce the number of reports about uncaught `std::stoi` out of range, etc.

I also added a gentle fallback to `NumaConfig` specifically because that's something that (as a dev) I frequently set by hand in the CLI, but happy to revert if that's too annoying of a change.

closes https://github.com/official-stockfish/Stockfish/pull/6844

No functional change
This commit is contained in:
Timothy Herchen
2026-07-10 20:16:02 +02:00
committed by Joost VandeVondele
parent 48a9118251
commit cd75d31127
12 changed files with 215 additions and 44 deletions
+3 -3
View File
@@ -180,9 +180,9 @@ class Position {
bool dtz_is_dtm() const; // Pawnless && (3-men || 4-men-minors-only)
// Position consistency check, for debugging
bool pos_is_ok() const;
bool material_key_is_ok() const;
void flip();
bool pos_is_ok() const;
bool material_key_is_ok() const;
std::optional<PositionSetError> flip();
StateInfo* state() const;