Skip to content

Add Syzygy support for giveaway/suicide/atomic variants#9

Open
Belzedar94 wants to merge 3 commits intomasterfrom
variant-syzygy-support
Open

Add Syzygy support for giveaway/suicide/atomic variants#9
Belzedar94 wants to merge 3 commits intomasterfrom
variant-syzygy-support

Conversation

@Belzedar94
Copy link
Copy Markdown
Owner

@Belzedar94 Belzedar94 commented Sep 16, 2025

Summary

  • add a variant-aware Position::set overload and salt materialKey with the active Variant*, so Syzygy keys differentiate chess, giveaway/suicide, atomic, etc.
  • introduce VariantTBConfig metadata (suffixes, pawnless suffixes, magic bytes) plus a VariantConfigMap that maps each registered Variant* to the appropriate config at startup
  • enumerate tablebases for chess, giveaway/antichess, suicide, and all atomic variants (atomic, nocheckatomic, atomar), using the new config map rather than the old all-variants loop
  • load tables with the correct classical Stockfish filename (KRvK, etc.) and map to PieceToChar via the variant’s template when the immutable piece order is needed
  • port MV-Stockfish’s antichess “threat” probing (sprobe_ab/sprobe_captures) and introduce a THREAT probe state so giveaway/suicide DTZ behaves like upstream; atomic keeps its connected-king tweaks
  • wire up a runtime suffix/loader that opens .gtbw/.stbw/.atbw and their pawnless companions, using the variant-specific magic numbers in mapped()

Details

  • build the engine normally (ninja or make build)
  • run lints/CI as usual
  • spot-check table probing:
    1. load the engine with Syzygy paths pointing to standard .rtbw/.rtbz → verify chess probing still works
    2. place a giveaway/antichess table position (e.g., KRvK with .gtbw) → confirm WDL/DTZ results match MV-SF
    3. place a suicide position (*.stbw) → verify THREAT and DTZ output
    4. place an atomic position (*.atbw) and ensure the connect‑kings logic still matches expectations

Repository owner deleted a comment from openhands-ai bot Sep 17, 2025
@Belzedar94
Copy link
Copy Markdown
Owner Author

@codex , the bench changed because you modified the materialKey to make it variant-specific. This could potentially make sense since the TB probing uses that. However, there are two problems with that:

  1. The material key absolutely has to be deterministic
  2. Instead of hacking something together with the variant-tablebase association, it should have something similar as for the endgame code (EndgameEval) and basically hardwire the variant to tablebase association using a variant object property.

@chatgpt-codex-connector
Copy link
Copy Markdown

Summary

Testing

  • make -C src build ARCH=x86-64-modern

View task →

Repository owner deleted a comment from openhands-ai bot Sep 17, 2025
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.

1 participant