Commit 88b35fa
Fix table lookup for equal-strength material configs
PieceConfig canonicalizes side ordering by total strength (stronger
side -> White), but only swapped when bs > ws, leaving the bs == ws
case with no tiebreak. For equal-strength asymmetric material (e.g.
KQP vs KRR, both 1000), the canonical orientation then depended on
which color held which pieces on the probed board, so cfg.name()
produced "KQPKRR" or "KRRKQP" depending on the input.
Since tables are opened by cfg.name(), half the orientations of every
such material computed a filename that doesn't exist on disk and
probing wrongly reported table-not-found.
Add a deterministic tiebreak mirroring Piece_Config::sort_pieces in
the C++ generator: when totals are equal, the side with more
high-value pieces (more queens, then rooks, ...) becomes White, so
cfg.name() reproduces the generator's on-disk filename.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 5f7ee3d commit 88b35fa
1 file changed
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
149 | 161 | | |
150 | 162 | | |
151 | 163 | | |
| |||
154 | 166 | | |
155 | 167 | | |
156 | 168 | | |
157 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
158 | 173 | | |
159 | 174 | | |
160 | 175 | | |
| |||
0 commit comments