Opening Aliases
Status: TEMPLATE. Sections below are scaffolds for collaborative authoring. This doc will eventually carry the full name → ECO table; for now we’re sketching the resolution rules and the taxonomy of opening names we support.
User-facing opening names (e.g., “Sicilian Najdorf”) map to ECO ranges (e.g., B90-B99). This doc defines the canonical map and the resolution rules. It’s chess-domain reference data, not architectural design.
The map is consumed by frontends and translated to the eco_in(range)
header predicate (see PREDICATE-LIBRARY.md).
Why this lives in a separate doc
Section titled “Why this lives in a separate doc”Cover: name-to-ECO is chess-domain reference data that grows and gets corrected over time; separating it from the predicate spec lets it be sourced/curated independently. Different shape of document — a reference table, not a design.
Resolution rules
Section titled “Resolution rules”Cover: how name strings are matched against the alias table.
- Case-insensitive.
"sicilian"=="Sicilian"=="SICILIAN". - Whitespace normalized. Multiple spaces collapse; leading/trailing trimmed.
- Hyphens / dashes treated as spaces.
"Caro-Kann"and"Caro Kann"both resolve. - Most-specific match wins.
"Sicilian Najdorf"resolves to B90-B99, not the more general"Sicilian"B20-B99. - Unrecognized name → error (no silent fallback to a too-broad range).
Open question: do we support partial matches?
"Najdorf"alone — resolve to Sicilian Najdorf, or require the full “Sicilian Najdorf”? The risk: “Najdorf” could also refer to the Najdorf Defense in the French (it doesn’t, but the principle).
Open question: do we surface ambiguous matches (multiple opening names share a substring)?
"king's"could match “King’s Indian”, “King’s Indian Attack”, “King’s Gambit”, “King’s English”.
Major opening families (table — to fill)
Section titled “Major opening families (table — to fill)”Cover: the canonical name → ECO-range table. Authoring this is the bulk of this doc’s eventual content. Group by ECO letter for clarity.
A — Flank openings and irregular
Section titled “A — Flank openings and irregular”Open list:
English— A10-A39English Symmetrical— A30-A39Reti— A04-A09 (subset)King's Indian Attack— A07-A08Bird's Opening— A02-A03Sokolsky(1.b4) — A00Larsen's Opening(1.b3) — A01- …
B — Semi-open games (1.e4 not followed by 1…e5)
Section titled “B — Semi-open games (1.e4 not followed by 1…e5)”Open list:
Sicilian— B20-B99Sicilian Najdorf— B90-B99Sicilian Dragon— B70-B79Sicilian Scheveningen— B80-B89Sicilian Sveshnikov— B33Sicilian Taimanov— B40-B49Caro-Kann— B10-B19Pirc— B07-B09Modern— B06Scandinavian— B01Alekhine— B02-B05- …
C — Open games (1.e4 e5) and French
Section titled “C — Open games (1.e4 e5) and French”Open list:
French— C00-C19French Winawer— C15-C19French Tarrasch— C03-C09French Advance— C02Ruy Lopez— C60-C99Italian— C50-C59Italian Giuoco Piano— C53Italian Evans Gambit— C51-C52Petroff— C42-C43Scotch— C44-C45Vienna— C26-C29King's Gambit— C30-C39Bishop's Opening— C23-C24- …
D — Closed games and semi-closed (1.d4 d5 / 1.d4 Nf6)
Section titled “D — Closed games and semi-closed (1.d4 d5 / 1.d4 Nf6)”Open list:
Queen's Gambit— D06-D69Queen's Gambit Declined— D30-D69Queen's Gambit Accepted— D20-D29Slav— D10-D19Semi-Slav— D43-D49Catalan— E00-E09 (E-section even though it’s a 1.d4 opening)London— A48 + D02 (multi-ECO; transposes from A48 also)- …
E — Indian defences
Section titled “E — Indian defences”Open list:
King's Indian Defence— E60-E99King's Indian Sämisch— E80-E89Nimzo-Indian— E20-E59Queen's Indian— E12-E19Catalan— E00-E09 (cross-listed)Bogo-Indian— E11Grünfeld— D80-D99 (cross-listed from D)- …
Open question: multi-ECO openings (London = A48 + D02, Catalan logged under E but also reachable via 1.d4) — does the alias resolve to a union or to one chosen range? Probably union.
Sourcing
Section titled “Sourcing”Cover: where the authoritative ECO mappings come from, and how to propose corrections.
Open question: which source do we adopt?
- ECO encyclopedia (Sahovski Informator, 1974-) — historical authority but commercial, copyrighted text.
- Wikipedia’s chess-openings tables — open, generally accurate but not formally authoritative.
- Lichess’s openings.tsv — open, broad coverage, used in their product. Probably the cleanest first source.
- ChessBase’s PGN ECO-classification database — comprehensive, commercial.
Editorial approach: import Lichess’s open database, then patch corrections as users surface them. Each correction is a one-line change with a rationale comment.
Edge cases
Section titled “Edge cases”Cover: cases where simple “name → range” isn’t enough.
- Transpositional openings. “London” can be reached from both 1.d4 d5 2.Nf3 Nf6 3.Bf4 (D02) and 1.d4 Nf6 2.Nf3 g6 3.Bf4 (A48). The alias resolves to the union of both ranges.
- Sub-sub-variations. “Sicilian Najdorf Poisoned Pawn” — depth at which we stop adding aliases. Probably 3 levels deep is sufficient for V1.
- Personal names as openings. “Carlsen’s setup”, “Kasparov’s Sicilian” — out of scope; players don’t have ECO codes.
- Non-ECO classifications. “Hippopotamus”, “Owen’s Defence”, “Borg” — these have ECO codes, just unusual names. Include them.
Format
Section titled “Format”Cover: the data file format the engine reads.
Open question: where does the table live at runtime?
- A compiled-in C array — fastest, but adding entries requires a rebuild. Suitable for the canonical set.
- A separate
openings.csvshipped alongside the binary — easy to edit, requires loading at startup.- Both — compiled-in canonical set + user-extensible CSV overlay.
For V1, suggest compiled-in array (the table is small enough that even the full set is < 500 entries × 50 bytes ≈ 25 KB; no startup cost).