Dfen
Canonical DFEN normalization, shared with the dicechess-analytics position store.
The position dedup key (normalized_fen in analytics) and the opening-book key (OpeningBook.key) are the first four DFEN fields. Raw dicechess.engine.domain.FenParser.serialize writes an en-passant target after every pawn double-push, even when no capture is possible. In Dice Chess a turn spans several micro-moves, so the en-passant field at turn end is path-dependent: the same tactically-identical position serializes under many en-passant variants (target set vs cleared), which fragments the position store and the opening-book / equity samples.
normalizedFen removes that ambiguity with the X-FEN convention: an en-passant target is kept only when the side to move can actually capture it. Whether a capture exists is a move-generation property, so this lives next to PawnGeneration rather than in the pure-domain dicechess.engine.domain.FenParser (which must stay free of move-generation knowledge, and whose serialize/parse round-trip must remain intact).
The four-field result is, by contract, byte-for-byte the analytics normalized_fen. Any change here is a cross-repository breaking change and must be mirrored in the analytics normalizer and its round-trip test.
Attributes
- Source
- Dfen.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Dfen.type