SwiftChessTools 1.0.0
Initial public release.
Added
- Added the
ChessUCIproduct with typed command formatting for UCI engine
input and typed parsing for UCI handshake, option, readiness, status,
bestmove, andinfooutput, including ponder moves, search metadata,
score bounds, MultiPV indexes, principal variations, refutations, current
lines, tablebase and Shredderbase hits, CPU load, and White-positive score
normalization helpers. - Added
Docs/ChessUCITutorial.mdand parser/formatter-heavyChessUCITests
coverage for engine commands, registration commands, position commands,
search limits, engine identification, option declarations, readiness/status
markers, best moves, promotions,(none),0000, officialinfofields,
centipawn and mate scores, malformed output, unknown lines, score
normalization, and public construction APIs. - Added
Docs/ChessUITutorial.mdas the public ChessUI walkthrough, covering
board model ownership, move callbacks, promotion handling, perspective,
highlights, read-only boards, piece and theme pickers, evaluation bars, move
lists, status display, accessibility, and ChessUI scope boundaries. - Added
ChessBoardMoveAttemptandChessBoardInteractionModeto make
ChessUI move callbacks and board interaction policy explicit before the
public release. - Added VoiceOver-oriented
ChessBoardViewsquare activation so assistive
interactions can select a source square, hear legal destinations, activate a
destination, and report the sameChessBoardMoveAttemptvalues as tap and
drag gestures. - Added
ChessGameStatusViewandChessGameStatusDisplayStateso apps can
render caller-suppliedGameStatusvalues and optional draw-claim actions
without moving game-state ownership into ChessUI. - Added
ChessBoardModel.showsCoordinateLabelsso apps can show or hide board
rank and file coordinate labels. - Added
ChessBoardArrow,ChessBoardArrowStyle, and
ChessBoardModel.arrowsso apps can render engine-independent board
annotations such as primary, secondary, tertiary, or custom move arrows. - Added selectable built-in ChessUI piece sets: Sashite Merida,
Art Deco Monochrome, Brutalist Monochrome, Origami Monochrome,
Circuit Board Monochrome, Blueprint Monochrome, and Sports Monochrome. - Added
ChessPieceSet.availableSetsso apps can query the bundled piece-set
registry at runtime. - Added selectable built-in ChessUI board themes: Classic Green, Warm Walnut,
Blue Study, Marble, Blueprint, Art Deco Monochrome, Circuit Board, and Sports
Court. - Added
ChessBoardTheme.availableThemesso apps can query the bundled board
theme registry at runtime. - Added
ChessPieceSetasset resolution coverage, per-piece-set ChessUI
snapshots, per-board-theme ChessUI snapshots, and ChessWorkbench UI coverage
for selecting each built-in set and theme. - Added
ChessEvaluation,ChessEvaluationBar, and normalized display-state
helpers so apps can render caller-supplied centipawn, mate, or unavailable
evaluation states without wiring an engine into ChessUI. - Added ChessUI evaluation-bar mapping tests and ChessWorkbench UI coverage for
evaluation samples, placement, orientation, White-side selection, label
visibility, and centipawn scale controls. - Added pure ChessUI accessibility helper tests for board-square labels, hints,
legal destination speech, captures, promotion choices, read-only boards,
interaction modes, and move-animation blocking. - Added
ChessMoveRecord,ChessMoveRecordBuilder, andChessMoveListView
so apps can render scrollable caller-supplied SAN move records without adding
PGN parsing or game-history ownership to ChessUI. - Added move-record builder tests, ChessUI move-list render coverage, and
ChessWorkbench UI coverage for move-list updates after legal board moves. - Added horizontal
ChessMoveListViewlayout support and ChessWorkbench
controls/tests for switching between vertical and horizontal move-list
presentations. - Added consumer-controlled
ChessMoveListViewscroll indicator visibility and
a ChessWorkbench toggle for showing or hiding move-list scroll bars. - Added
PGNSerializer,PGNGame,PGNTagPair,PGNResult,
PGNMoveRecord,PGNNumericAnnotationGlyph, and typed PGN parser/exporter
errors toChessCore. - Added validated mainline PGN parsing, multi-game database parsing,
FEN-backed PGN support, comment and NAG preservation, and deterministic PGN
export. - Added
PGNGame.finalStatus,finalOutcome, result/status consistency
helpers, and validatingPGNGameexport so manually constructed game records
must replay to their stored final position, final status, and result. - Added PGN coverage for Lichess-style comments, a Lichess CC0 sample, result
mismatches, malformed syntax, invalid SAN, FEN-backed games, castling,
promotion, underpromotion, en passant, disambiguation, and export round trips. - Expanded PGN coverage with a Lichess CC0 mini-corpus, deterministic generated
legal-game round trips, 10 long generated stress games, compact movetext and
escape-line tolerance, and additional SAN ambiguity fixtures. - Expanded the checked-in Lichess CC0 PGN corpus with 15 additional historic
standard games covering real-world external results, checkmates, castling,
promotions, and promoted-queen SAN disambiguation. - Expanded ChessCore rule-engine and game-state invariant coverage for pins,
single and double check, king exposure, castling restrictions, en passant,
promotion, stalemate, move counters, castling rights, game copies, and
board-only position counts. - Added
Docs/ChessCoreTestingStrategy.mdto document the ChessCore
correctness-corpus approach and current rule/game-state coverage boundaries. - Expanded the ChessCore rule-engine corpus with additional perft positions,
castling stress cases, pinned-piece fixtures, protected-piece captures,
promotion, en-passant, and simple endgame coverage. - Added deterministic FEN and SAN notation round-trip tests over generated legal
games plus targeted SAN ambiguity, en-passant check, and promotion-checkmate
fixtures. - Added
Docs/ChessCoreTutorial.mdandDocs/ChessCoreGlossary.mdas
ChessCore-only learning references for rules, notation, PGN, and terminology. - Added a
python-chesscoverage audit matrix to the ChessCore testing
strategy to guide future original Swift test expansion without adding a
dependency or copying GPL-licensed fixtures. - Expanded high-priority ChessCore audit coverage for legal move generation,
castling, en passant, SAN parsing, and PGN import/export edge cases, including
a 27-position perft corpus. - Added
GameStatus,GameOutcome,GameDrawReason,GameDrawClaim, and
GameRepetitionKeyso ChessCore consumers can inspect checkmate, stalemate,
insufficient material, dead positions, fifty/seventy-five-move rules, and
threefold/fivefold repetition state. - Added hardened GameStatus coverage for material edge cases, real-move draw
threshold transitions, halfmove resets, illegal en-passant repetition keys,
status precedence, and game-like knight repetitions. - Added
Game.replay(initialPosition:moves:),Game.reset(to:moveHistory:),
Game.claimDraw(_:),GameReplayError, andGameDrawClaimErrorso
consumers can rebuild game state from concrete moves, reuse game objects, and
model explicit fifty-move or threefold draw claims. - Added
PositionValidator,PositionValidationIssue,
PositionValidationError, andFENSerializer.validatedPosition(from:)for
strict semantic validation of syntactically parsed FEN positions. - Added
PositionValidationResult,FENValidationResult,
PositionValidator.validationResult(for:), and
FENSerializer.validationResult(for:)so callers can inspect FEN syntax and
semantic position diagnostics without using throwing control flow. - Added
Position.standard,Position.standardStartingFEN,Game(), and
Game.applyLegal(move:)as ergonomic ChessCore entry points for standard
games and safe app-boundary move application. - Added
Examples/ChessCoreRecipes, a ChessCore-only command-line example for
PGN import/export, FEN validation, status reporting, and safe move
application. - Added PGN result/status validation so terminal checkmate and automatic-draw
final positions reject incompatible PGN result markers during import and
export. - Added coverage for game replay/reset, explicit draw claims, semantic FEN
validation, PGN terminal result/status conflicts, and result-aware generated
PGN stress games. - Expanded ChessCore hardening coverage for PGN dialect imports, terminal
positions, semantic FEN validation, SAN stress cases, and a 40-position perft
corpus cross-checked with a temporarypython-chessoracle. - Added a second ChessCore hardening layer for multi-issue FEN semantic
validation, every-legal-move SAN stress round trips, automatic draw precedence
overlaps, checked insufficient-material positions, and generated game-status
invariants. - Added oracle-backed ChessCore hardening with a checked-in
python-chess
corpus covering 53 exact legal-move/status positions and 48 generated
move-count/status positions, generated legal-game mutation invariants, and an
expanded PGN dialect corpus for escaped tags, result boundary comments,
semicolon/empty comments, Lichess clock/eval/EMT fields, arrow/square
annotations, and repeated tags. - Added
DeadPositionAnalyzerplus ChessCore status/PGN coverage for material
dead positions, sealed immobile pawn-barrier dead positions, symmetry
invariants, false-positive guards, and dead-position result validation. - Expanded dead-position hardening with additional material-theory fixtures,
trapped-piece pawn-barrier fixtures, capture-based near-miss fixtures, and a
status/analyzer performance smoke test. - Added public parser error types for malformed input:
FENParsingError,SANParsingError, andMoveParsingError. - Added ChessUI move feedback for position updates made with
setFEN(_:animatedMove:):
pieces now animate from the source square to the destination square, and the
most recent move's source and destination squares remain highlighted. - Added public ChessUI configuration for move feedback:
moveAnimationDuration,showsLastMoveHighlight,lastMoveHighlightColor,
lastMoveSquares, andclearLastMoveHighlight(). - Added ChessUI smoke tests covering move-feedback state and direct FEN
assignment behavior. - Added ChessCore perft tests for standard reference positions, broader SAN
parsing coverage, and focused legal-move coverage around en-passant targets. - Added ChessUI model tests for legal-move highlighting, hints, promotion
state, and board configuration defaults. - Added ChessUI snapshot tests with checked-in references for board
orientation, selection, last-move highlighting, promotion UI, and color
schemes. - Added a simulator-backed ChessUI XCUITest harness that drives the real board
through tap moves, drag moves, invalid moves, promotion, black perspective,
legal-move indicators, and last-move highlights. - Added the macOS
ChessWorkbenchmanual workbench under
Examples/ChessWorkbenchso package-level UI and rules checks live with
SwiftChessTools. - Added a macOS
ChessWorkbenchUITestsXCUITest suite that drives the example
app through board rendering, legal and invalid moves, full-square destination
taps, FEN updates, markers, promotion UI, copy feedback, and reset behavior. - Added
Scripts/test-all.shto run the SwiftPM tests, the simulator-backed
ChessUIHarnessUI tests, and the macOSChessWorkbenchUI tests together. - Added GitHub Actions CI for the SwiftPM test suite.
- Added public readiness docs, contribution guidance, issue templates, and a
README screenshot.
Changed
- Expanded DocC coverage comments across the public
ChessCoreandChessUI
symbols in preparation for generated public package documentation. - Expanded DocC discussion and examples for the main
ChessCoreandChessUI
entry points, including model ownership, validation, notation, PGN replay,
board callbacks, display-only arrows, evaluation bars, move lists, status
display, themes, and piece sets. - Changed
ChessBoardViewsquare accessibility labels and hints to describe
selected pieces, legal destinations, captures, wrong-side pieces, read-only
boards, and move-animation wait states. - Changed
ChessBoardMoveHandlerandChessBoardView.onMove(_:)to pass one
ChessBoardMoveAttemptvalue instead of six positional closure arguments. - Replaced
ChessBoardModel.validatesMovesandallowsOpponentMoveswith
ChessBoardModel.interactionMode, covering read-only, legal-only,
illegal-attempt reporting, and free-setup board behavior. - Removed ChessUI's thin
FENValidatorwrapper; callers should use
ChessCore.FENSerializervalidation/parsing APIs directly. - Removed ChessUI's broad public
View.modifierhelper extension. - Changed
PGNSerializer.pgn(from:)to validate the suppliedPGNGameand
throwPGNSerializationErrorwhen the model is internally inconsistent or
its result conflicts with a terminal final status. - Replaced the bundled legacy piece PNGs with self-contained prefixed piece
asset families that can be added or removed one set at a time. - Marked
PieceColor,PieceKind,Square, andMoveasSendableso they
can be used in concurrent, value-semantic ChessUI display state. - Marked
Board,Bitboards,Piece, andPositionasSendableso
validated PGN game records can remain concurrency-safe value types. - Made
Game.positionpublicly read-only; useGame.apply(move:),
Game.replay(initialPosition:moves:), orGame.reset(to:moveHistory:)to
change game state. - Clarified that
Game(position:moveHistory:)stores move history as metadata
only and does not replay moves or rebuild counters/repetition state. - Changed
Game.drawClaimsso terminal positions and already-claimed draws no
longer expose claimable draw rules. - Reworked the ChessCore tutorial and glossary around the current public APIs,
including PGN, semantic validation, game status, and dead-position behavior. - Clarified public-facing package docs so Stockfish integration is described as
a separate project, not a required sibling checkout for SwiftChessTools. FENSerializer.position(from:),SANSerializer.move(for:in:),
Move.init(string:), andGame.apply(move:)for coordinate strings now
report malformed input with thrown errors instead of trapping.- Renamed the primary ChessUI public board API to
ChessBoardView,
ChessBoardModel, and the current board styling types. - Renamed inherited ChessCore APIs and internals for the current package shape,
includingFENSerializer,SANSerializer,Game.apply(move:), and the
move-generation types. - Renamed the promotion picker dismissal API to
dismissPromotionPicker(). - Increased the default ChessUI move animation duration to
0.45seconds so
longer piece moves are easier to see. - Direct assignment to
ChessBoardModel.fennow clears move-specific animation
and highlight state because a raw FEN string does not identify the previous
source square. ChessBoardModelnow records invalid FEN input infenError; failed FEN
updates leave the current board unchanged.
Fixed
- Adjusted ChessUI board coordinate-label placement so rank numbers sit
slightly lower and file letters sit slightly farther from the square edge. - Fixed SAN serialization for en-passant captures so PGN import/export can
round trip en-passant SAN such asexd6. - Fixed SAN parsing normalization so pawn-file SAN such as
bxc5remains
distinct from piece SAN such asBxc5. - Fixed legal move generation so king captures are never emitted as legal moves.
- Fixed check detection so adjacent kings count as attacks.
- Fixed castling generation so castling rights alone are not enough when the
corresponding rook is missing from its starting square. - Fixed FEN parsing so adjacent empty-square digit runs such as
11are
rejected instead of accepted as valid piece placement. - Fixed PGN parsing so a UTF-8 byte-order marker at the start of input is
ignored instead of being treated as movetext. - Fixed repetition tracking for draw rules by adding a rules-relevant
repetition key that includes board layout, side to move, castling rights, and
legal en-passant availability. - Fixed draw-claim precedence so checkmate, stalemate, insufficient material,
seventy-five-move automatic draws, and fivefold repetition remain authoritative
over claimable draw rules. - Fixed semantic FEN validation so an en-passant target with a nonzero halfmove
clock is rejected as internally inconsistent. - Fixed public parser failure behavior so malformed FEN, SAN, and coordinate
moves are handled as recoverable errors. - Fixed move animation startup so SwiftUI renders the piece at the source square
before animating it to the destination, avoiding a visual snap. - Changed ChessUI piece rendering to use SwiftUI package asset images, avoiding
AsyncImageraces without introducing UIKit or AppKit dependencies. - Fixed legal-move filtering so a non-pawn move to the current en-passant target
square is not simulated as an en-passant capture. - Fixed ChessUI tap hit testing so the full board square is interactive when
selecting pieces or clicking destination squares.