mirror of
https://github.com/official-stockfish/Stockfish.git
synced 2026-07-22 20:57:10 +00:00
check for material key validity in tbprobe
During recent work on threat inputs, there was a hard-to-debug crash in tbprobe caused by incorrectly computing st->materialKey. This PR adds correctness checking to pos_is_ok and a faster check in tbprobe that will actually run in CI (because pos_is_ok checking is disabled even in debug mode, for performance purposes). closes https://github.com/official-stockfish/Stockfish/pull/6410 No functional change
This commit is contained in:
committed by
Joost VandeVondele
parent
3f2405bf4e
commit
229bd1e2e3
@@ -169,6 +169,7 @@ class Position {
|
||||
|
||||
// Position consistency check, for debugging
|
||||
bool pos_is_ok() const;
|
||||
bool material_key_is_ok() const;
|
||||
void flip();
|
||||
|
||||
StateInfo* state() const;
|
||||
@@ -180,6 +181,7 @@ class Position {
|
||||
private:
|
||||
// Initialization helpers (used while setting up a position)
|
||||
void set_castling_right(Color c, Square rfrom);
|
||||
Key compute_material_key() const;
|
||||
void set_state() const;
|
||||
void set_check_info() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user