Skip to content

About

Offline chess studio for playing, analysis, puzzles and training

Topics

Resources

Code of conduct

Contributing

Stars

1 star

Watchers

0 watching

Forks

Ferrum Chess

Ferrum Chess icon

Ferrum Chess is an experimental native chess application in Rust. Chess features work offline: it uses iced for the interface, MIT-licensed cozy-chess for standard chess rules and SAN, and communicates with a separate local Stockfish process over UCI. The only network feature is a user-initiated update check; there are no automatic requests or application servers.

Implemented

  • Separate screens in the same window for play, analysis, game history and settings. The board grows with the available space; on small windows the whole workspace scrolls, while move lists and long histories scroll independently. Game, position and review controls are grouped in tabs instead of one long sidebar.
  • Play against Stockfish with selectable search depth, play two people at one board without automatic engine moves, or use the separate analysis workspace to explore a copy without changing the active game. Engine calculations run on a worker thread.
  • Finished games in play/local mode are automatically saved locally and listed newest first with result, mode and UTC time; select one to review and analyze a copy. On Windows the records are in %APPDATA%/FerrumChess/games; on Unix they are in $XDG_DATA_HOME/FerrumChess/games or ~/.local/share/FerrumChess/games. Each completion creates a separate immutable snapshot; undoing a result and finishing again creates another snapshot. Save/read errors and invalid records are reported. Existing v0.5.0 games cannot be recovered automatically. Engine analysis results are not saved across app restarts.
  • Save unfinished games explicitly with Save progress. The History screen lists saved sessions and asks for confirmation before replacing the current game. Moves, starting position, game type, player side, orientation and engine depth are restored; clocks are turned off on restoration and their remaining times are not saved. Sessions are separate local files under %APPDATA%/FerrumChess/sessions on Windows, or alongside the games directory on Unix. They are snapshots, not automatic crash recovery; saving a new snapshot does not overwrite earlier ones.
  • Optional local two-player clocks have 3+2, 5+3, 10+0 and 15+10 controls (minutes + Fischer increment in seconds). Start or pause manually. Moves are blocked while an enabled clock is paused. A flag ends the game, except that a bare opposing king cannot win on time. Review, navigating away from play, analysis and file dialogs pause the clock; changing the preset, undo, new game, restart, switching game types or loading a position resets it. Clock state is not stored in PGN.
  • Check for updates explicitly queries the official GitHub latest-release API over HTTPS and compares stable semantic versions. Only after a newer release is found does the interface offer to open its official page in the browser. No downloads or installations are automatic, and no check runs in the background or at startup. The request exposes your IP address and application-version User-Agent to GitHub; offline errors are shown without blocking chess.
  • Click a piece and its destination, drag from one square to another, or enter a UCI coordinate move such as e2e4. The board scales with the window and can be flipped independently of your side. Livius and Meridian SVG pieces, optional coordinates, legal destinations, checks, the last move and an engine hint arrow are displayed. Choose a promotion piece when a pawn reaches its last rank. A dragged piece follows the pointer.
  • Appearance settings include three board themes, two piece sets and coordinates. A non-interactive preview of the starting position immediately reflects the selected settings; settings are stored locally.
  • Step through and select earlier moves without changing the recorded game; return to the latest move to continue play. Analyze the entire main line locally with Stockfish, see progress, cancel, and select a reviewed move to inspect the engine's suggested alternative. Labels and centipawn losses are approximate, calculated from successive fixed-depth evaluations; they are not overall accuracy scores. Mate scores and terminal positions are not compared as centipawns; moves without comparable evaluations are shown as unrated.
  • New game, choose a side (starts a new game), restart, and undo. Undo normally takes back both a human move and the engine response against Stockfish, or one ply in local/analysis mode. Undo first reopens an explicitly ended game without removing a move.
  • Resign with confirmation; local players can confirm a draw by agreement. Claim a draw when the current position has occurred three times; five occurrences end the game automatically. Common dead-material cases are detected. Completed games reject further moves, and PGN results are retained on reimport.
  • Paste a standard FEN to start a fresh game from that position, or copy the displayed position FEN to the clipboard. Loading a FEN replaces the current game and its history.
  • Load/save UTF-8 PGN using a file dialog. The reader preserves Event, Site, White, Black, and Result, reads SAN and a standard FEN starting position, and rejects illegal moves. It skips comments, NAGs, and nested variations; it does not preserve them. Unsupported tags are discarded. One main-line game per file is supported.
  • The direct UCI adapter sends the recorded initial FEN and moves for each search, uses uci/isready, checks the engine's move against the board, limits each search to 15 seconds and reports timeouts, invalid output, or startup errors in the UI. Changing position or settings cancels the old search; the worker kills and reaps the child process.

Build and run

Install a current stable Rust toolchain with rustfmt and clippy, then:

cargo build --release
cargo run --release

For Linux local builds, iced/rfd may require native windowing libraries, for example libxkbcommon-dev libwayland-dev libasound2-dev libudev-dev libssl-dev pkg-config on Debian/Ubuntu. Install Stockfish separately for local builds: the application looks for stockfish.exe (or stockfish on Unix) beside its own executable, then on PATH. Alternatively set FERRUM_STOCKFISH to the executable path. For example, place stockfish.exe next to target/release/ferrum-chess.exe.

Before a PR run:

cargo fmt --all -- --check
cargo clippy --all-targets -- -D warnings
cargo test --all-targets

Set FERRUM_STOCKFISH when running tests to enable the real-engine integration tests. The --self-test command exercises a legal Stockfish reply and PGN round-trip without opening a window; it exits nonzero on failure. Unit tests also compile and run a tiny fake UCI executable to test protocol handling and cancellation.

Windows CI and releases

.github/workflows/release.yml is a hand-maintained workflow using cargo-dist for the Windows application build and WiX 4 for the MSI, with extra steps to include Stockfish. It is not a workflow generated by dist init: cargo-dist could not be installed in the restricted development environment. Regeneration and reconciliation with cargo-dist's generated workflow remain outstanding. dist-workspace.toml sets allow-dirty = ["ci"] for the hand-maintained workflow.

On pull requests and v* tag pushes the Windows job is intended to run formatting, Clippy, tests (including real Stockfish), a license audit, cargo-dist and MSI builds, and installation/engine/uninstallation smoke checks. PR packages are uploaded as two workflow artifacts: ferrum-chess-msi contains only the MSI, while ferrum-chess-windows-other contains the portable package, source archives and other files. Actions downloads are ZIP containers even for a single MSI; extract the MSI before running it. A tag push publishes a release only after these steps pass. The tag must exactly match the X.Y.Z version in Cargo.toml, e.g. v0.1.0. GitHub Releases provide the MSI as a direct download, plus standalone app and Stockfish EXEs, a portable ZIP containing both and license notices, the resolved Cargo.lock, Stockfish source/distribution archives, and SHA256SUMS.txt. Keep the source archives available with the distributed engine. Portable users must put both executables in the same directory (or use PATH). The MSI is unsigned and may trigger SmartScreen. Interactive installation offers an optional desktop shortcut, then displays a welcome/license screen, progress, and a completion screen; the application can then be opened from the Start menu. Machine-wide installation requires administrator approval. A silent install uses no desktop shortcut by default; pass DESKTOPSHORTCUT=1 to msiexec to request one. A newer MSI upgrades the preceding version. Uninstall an earlier prototype of the same version from Windows Settings before testing a newly built MSI of that version.

No Cargo.lock is checked in yet: create and commit one on a machine with registry access before relying on reproducible releases. A lockfile produced by the workflow is attached to its artifacts, but does not make earlier builds reproducible.

Ограничения и непроверенное

  • The user reported that the v0.6.0 interface and maximized-window scaling looked good. CI also checks the installer, license audit, Clippy, tests, silent install and uninstall, and engine/process smoke tests. The new appearance preview and session controls have not yet been manually tested.
  • CI checks that the installer contains the expected dialogs and tests a silent install; it cannot prove that the interactive wizard is visible and usable on a user's Windows desktop. Manual testing of installation, Start menu launch, gameplay and removal remains necessary for each installer release.
  • Only standard chess is supported. Checkmate, stalemate, current-position threefold claims, automatic fivefold repetition, and conservative dead-material cases (bare kings, one minor, or bishops all on one square color) are handled. Other dead positions are not exhaustively detected. A threefold claim based on an intended next move is not supported. Because cozy-chess caps its halfmove clock at 100, the 50-move threshold is currently treated as an automatic draw; the FIDE distinction between a claimable 50-move draw and an automatic 75-move draw is not implemented. FEN has no prior history, so repetitions before a FEN import cannot be detected.
  • The PGN reader deliberately implements a subset, not the full PGN specification: UTF-8, one game, ordinary one-line tag pairs and canonical SAN. Other tags, comments, annotations and variations are not round-tripped. An imported declared result ends the game; undo reopens it without removing a move, and restart clears it. Result conflicts with the terminal board are rejected.
  • Clocks are for local two-player games only, not engine games, and are not saved in PGN. Timeout adjudication recognises a bare opposing king, but other rare positions where no mate is possible are not exhaustively detected; it is not a tournament arbiter. There are no online games. CI checks state transitions and installation but does not verify actual visual accessibility or every interaction; the new appearance preview and saved-session interactions need manual Windows testing.
  • The UCI worker has deadlines and cancellation, but arbitrary external processes and OS I/O can still fail; only a trusted Stockfish binary should be used.

Licenses

Ferrum Chess's own code is licensed under either MIT or Apache-2.0, at your option. The direct chess dependency cozy-chess and its types crate are MIT; iced is MIT and rfd is MIT. deny.toml configures CI to reject GPL and unknown licenses in the resolved Windows dependency graph, permitting common MIT/Apache-compatible permissive licenses (including BSD, ISC and Unicode licenses). The earlier prototype passed this audit in Windows CI; dependency changes must be audited again before release. The manual update checker uses ureq (MIT/Apache-2.0), semver (MIT/Apache-2.0), serde_json (MIT/Apache-2.0), and open (MIT).

Stockfish is a separate executable under GPL-3.0-or-later, not an MIT/Apache library. Distribution must include its GPL notice and corresponding source; the proposed workflow includes the official Stockfish distribution and source archive. See Stockfish 17.1 source. The Livius and Meridian SVG piece sets by Martin Sedlák is distributed under the upstream public-domain dedication; source: chess_svg_piece_sets. The bundled Noto Sans Symbols 2 font is distributed under the SIL Open Font License 1.1. Consult counsel on distribution obligations if needed.

About

Offline chess studio for playing, analysis, puzzles and training

Topics

Resources

Code of conduct

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages