1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/*
DDS, a bridge double dummy solver.
Copyright (C) 2006-2014 by Bo Haglund /
2014-2018 by Bo Haglund & Soren Hein.
See LICENSE and README.
*/
/// @file debug.h
/// @brief Debug configuration flags and statistics support.
/// @defgroup utility_debug Debug Utilities
/// @{
/// @brief Debug flag performance impact summary.
///
/// A number of debug flags cause diagnostic output files to be generated.
/// One file per thread is created. Performance impact varies significantly:
///
/// <table>
/// <tr><th>Mode</th><th>Clock Ticks</th><th>File Size (KB)</th></tr>
/// <tr><td>No debugging</td><td>66</td><td>--</td></tr>
/// <tr><td>DDS_TOP_LEVEL</td><td>63</td><td>8</td></tr>
/// <tr><td>DDS_AB_STATS</td><td>71</td><td>36</td></tr>
/// <tr><td>DDS_AB_STATS + DDS_AB_DETAILS</td><td>75</td><td>64</td></tr>
/// <tr><td>DDS_AB_HITS</td><td>680</td><td>12004</td></tr>
/// <tr><td>DDS_TT_STATS</td><td>68</td><td>8</td></tr>
/// <tr><td>DDS_TIMING</td><td>125</td><td>8</td></tr>
/// <tr><td>All Together</td><td>720</td><td>--</td></tr>
/// </table>
///
/// @note These measurements are from a single hand, single-threaded execution
/// with ~207,000 AB nodes and ~63,000 trick nodes. Times are approximate;
/// actual performance depends on hardware and hand complexity.
/// @name Debug Configuration Flags
/// Enable individual debug modes to generate diagnostic output files.
/// @{
/// @brief Enable all debug output files.
/// Convenience flag that enables all debug modes below simultaneously.
// #define DDS_DEBUG_ALL
/// @brief File extension for debug output files.
/// @brief Log data about each call to the top-level AB routine.
/// Generates detailed information about solver entry points and parameters.
// #define DDS_TOP_LEVEL
/// @brief Enable AB search statistics (node counts, timing, etc.).
/// Records alpha-beta search performance metrics for optimization analysis.
// #define DDS_AB_STATS
/// @brief Enable detailed AB search statistics.
/// Must be combined with DDS_AB_STATS for enhanced diagnostic output.
// #define DDS_AB_DETAILS
/// @brief Log transposition table hits and misses.
/// Tracks which positions are stored to and retrieved from the TT cache.
// #define DDS_AB_HITS
/// @brief Enable transposition table usage statistics.
/// Reports memory efficiency and hit rates of the position cache.
// #define DDS_TT_STATS
/// @brief Enable timing of AB search and related functions.
/// Measures execution time and attempts to calculate exclusive (non-overlapping) times.
// #define DDS_TIMING
/// @brief Enable detailed timing breakdown.
/// Requires DDS_TIMING; provides per-function timing details.
// #define DDS_TIMING_DETAILS
/// @brief Enable move generation quality statistics.
/// Analyzes the effectiveness of move ordering heuristics.
// #define DDS_MOVES
/// @brief Enable detailed move generation statistics.
/// Requires DDS_MOVES; provides per-move-type analysis.
// #define DDS_MOVES_DETAILS
/// @brief Enable scheduler timing (provided by build system).
/// Logs thread pool scheduling decisions and timing.
/// @}
/// @name Performance Counters
/// @brief Statistics counters for profiling and analysis.
/// @{
/// @brief Number of available counter slots for performance tracking.
constexpr int COUNTER_SLOTS = 200;
/// @brief Global array of performance counters.
/// Each thread may use these counters for statistics collection.
/// Size: COUNTER_SLOTS (200) entries.
extern long long counter;
/// @}
/// @}