2026-10-18 01:54:06 +03:00
|
|
|
// No console window for release builds on Windows.
|
|
|
|
|
#![cfg_attr(all(windows, not(debug_assertions)), windows_subsystem = "windows")]
|
|
|
|
|
|
|
|
|
|
mod analysis;
|
|
|
|
|
mod app;
|
|
|
|
|
mod assets;
|
|
|
|
|
mod board;
|
ChessPenguin 0.5.0: find games by position on a board
The "Board" pane next to the game list (Ctrl+B): moves played on it filter
the list to the games that reach the position by any move order, together
with the filters; the moves played next are listed with games, a results
bar, average rating and last year. Games reached by another order are
marked and "only this order" narrows the list; strongest games first.
A game opens at the found position; "Find in database" (Ctrl+Shift+F)
searches the position of the game on screen.
Large ChessBase databases: a fast main-line walk (moves built from the
board), pruning by material and pawns, the .cbb search booster when valid;
Mega Database: 0.4 s for the starting position, under 0.1 s deeper.
PGN databases and books: positions of all games, variations included,
kept in memory once built.
Also: × to clear filter and search fields; "Open as a new game" opens at
the last move; the "Moves" column is now "Length".
Docs: decision 13, design (docs/design/board-search.md), research
(position-search, position-index), dev notes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 08:42:08 +03:00
|
|
|
mod board_search;
|
Translation of game comments
When a game's comments are in another language, ChessPenguin offers to translate
them into the reader's: with the ChatGPT Plus/Pro subscription (Sign in with
ChatGPT: OAuth with PKCE in the browser, a loopback callback, tokens refreshed
one at a time), or an OpenAI-compatible API key (DeepSeek, OpenAI, Gemini, a
model on this computer with Ollama or LM Studio, another address). After the
first consent, games in other languages are translated as they are opened;
[Original | Translation] (Ctrl+Shift+T) switches back.
Only comment text is sent; the model gets strict instructions and a glossary,
and every answer must keep the moves and squares of the original, or the
comment stays in the original with a mark. Translations are never written to
the PGN; a cache keeps them per language. Keys and tokens live in a 0600 file
apart from the settings. Settings › Translation holds the target language,
when to translate, the connection, permissions and the cache.
Also: the monospace font and three glyphs of Noto Sans Math are text fallbacks,
so arrows and the evaluation signs ⩲ ⩱ ⌓ no longer show as boxes.
Reviewed by the designer and the tester agents (two rounds).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 21:03:03 +03:00
|
|
|
mod chatgpt;
|
2026-10-19 09:33:37 +03:00
|
|
|
mod engine_download;
|
|
|
|
|
mod engine_offer;
|
2026-10-18 11:53:30 +03:00
|
|
|
mod engines;
|
2026-10-19 12:21:09 +03:00
|
|
|
mod examples;
|
2026-10-18 01:54:06 +03:00
|
|
|
mod game_view;
|
2026-10-21 19:15:21 +03:00
|
|
|
mod graphics;
|
2026-10-18 01:54:06 +03:00
|
|
|
mod i18n;
|
ChessPenguin 0.4.0: large ChessBase databases with a filter panel
Mega Database (11.7 million games) opens in under a second: a .cbh with
20,000 records or more is read in place, a game is converted to PGN when
opened. Filter panel on the right (player with suggestions, colour,
opponent, tournament, annotator, years, Elo rule, result, ECO, moves,
comments, variations), applied live in the background with cancellation.
Fixes: a ChessBase game unreadable from its first move (Chess960) crashed
the import; databases mixing UTF-8 and single-byte texts were decoded as
Cyrillic.
Docs: decision 12, design (docs/design/large-databases.md), format research
and acceptance criteria, QA report 2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 01:02:36 +03:00
|
|
|
mod large_db;
|
2026-10-18 01:54:06 +03:00
|
|
|
mod library;
|
|
|
|
|
mod notation;
|
2026-10-19 21:10:22 +03:00
|
|
|
mod online;
|
|
|
|
|
mod online_ui;
|
2026-10-19 23:20:37 +03:00
|
|
|
mod reference;
|
Game analysis: whole-game engine review with graph, report and notation marks
- Separate background engine job over the main line (go nodes N), live engine
paused meanwhile; header button with progress/cancel, Shift+A.
- Lichess-method metrics: win %, move/game accuracy, inaccuracy/mistake/blunder,
ACPL, accuracy per game phase.
- Evaluation graph under the board, Report tab, engine badges and better lines
in the notation (preview on click), launch dialog with quality/threads/memory
and time estimate.
- Results cached in ~/.cache/chesspenguin/analysis; [%eval] read from PGN.
- Write analysis to the game as one undo step (chess-core: Game::annotate,
Game::edit_group).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 11:03:23 +03:00
|
|
|
mod review;
|
Move notation: Latin letters, figurines or the interface language's letters
Settings › Board & pieces: Nf3, ♘f3 as on Lichess, or Кр Ф Л С К (German
K D T L S, French R D T F C, Spanish and Italian R D T A C; in English the
Latin letters), with a sample per option and a line of a game. Only the shown
label changes (san::show): the game, PGN, copied games, the analysis written
into a game, the reference cache and every comparison stay Latin SAN. Applied
in the move list, engine lines, the reference tab, board search and the
analysis report. The figurines are egui's chess glyphs cut out to a 4.7 KB
font, a little smaller and on the baseline. Latin remains the default.
Reviewed by the designer and the tester agents.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 21:18:53 +03:00
|
|
|
mod san;
|
2026-10-18 01:54:06 +03:00
|
|
|
mod settings;
|
|
|
|
|
mod settings_ui;
|
|
|
|
|
mod sound;
|
Translation of game comments
When a game's comments are in another language, ChessPenguin offers to translate
them into the reader's: with the ChatGPT Plus/Pro subscription (Sign in with
ChatGPT: OAuth with PKCE in the browser, a loopback callback, tokens refreshed
one at a time), or an OpenAI-compatible API key (DeepSeek, OpenAI, Gemini, a
model on this computer with Ollama or LM Studio, another address). After the
first consent, games in other languages are translated as they are opened;
[Original | Translation] (Ctrl+Shift+T) switches back.
Only comment text is sent; the model gets strict instructions and a glossary,
and every answer must keep the moves and squares of the original, or the
comment stays in the original with a mark. Translations are never written to
the PGN; a cache keeps them per language. Keys and tokens live in a 0600 file
apart from the settings. Settings › Translation holds the target language,
when to translate, the connection, permissions and the cache.
Also: the monospace font and three glyphs of Noto Sans Math are text fallbacks,
so arrows and the evaluation signs ⩲ ⩱ ⌓ no longer show as boxes.
Reviewed by the designer and the tester agents (two rounds).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 21:03:03 +03:00
|
|
|
mod translate;
|
|
|
|
|
mod translate_ui;
|
2026-10-20 07:55:59 +03:00
|
|
|
mod update;
|
|
|
|
|
mod update_ui;
|
2026-10-18 14:00:19 +03:00
|
|
|
mod viewed;
|
2026-10-18 01:54:06 +03:00
|
|
|
mod widgets;
|
|
|
|
|
|
|
|
|
|
fn main() -> eframe::Result {
|
2026-10-19 19:07:47 +03:00
|
|
|
// `chesspenguin --bench <database> [report.txt]`: timings instead of the window
|
|
|
|
|
// (`docs/dev/import.md`, "Замер на другой машине").
|
|
|
|
|
let args: Vec<std::ffi::OsString> = std::env::args_os().skip(1).collect();
|
|
|
|
|
if args.first().is_some_and(|a| a == "--bench") {
|
|
|
|
|
let Some(db) = args.get(1) else {
|
|
|
|
|
eprintln!("usage: chesspenguin --bench <database> [report.txt]");
|
|
|
|
|
std::process::exit(2);
|
|
|
|
|
};
|
|
|
|
|
let cache = settings::Settings::cache_dir().map(|d| d.join("boosters"));
|
|
|
|
|
let result = match args.get(2) {
|
|
|
|
|
Some(file) => std::fs::File::create(file)
|
|
|
|
|
.and_then(|mut f| chess_import::bench::run(db.as_ref(), cache.as_deref(), &mut f)),
|
|
|
|
|
None => chess_import::bench::run(db.as_ref(), cache.as_deref(), &mut std::io::stdout()),
|
|
|
|
|
};
|
|
|
|
|
if let Err(e) = result {
|
|
|
|
|
eprintln!("bench: {e}");
|
|
|
|
|
std::process::exit(1);
|
|
|
|
|
}
|
|
|
|
|
return Ok(());
|
|
|
|
|
}
|
2026-10-21 19:15:21 +03:00
|
|
|
crate::i18n::set_lang(settings::Settings::load().language);
|
|
|
|
|
graphics::install_panic_hook();
|
|
|
|
|
let mode = graphics::choose();
|
2026-10-18 01:54:06 +03:00
|
|
|
let options = eframe::NativeOptions {
|
|
|
|
|
viewport: egui::ViewportBuilder::default()
|
|
|
|
|
.with_app_id("io.github.vrubelroman.chessPenguin")
|
|
|
|
|
.with_title("ChessPenguin")
|
|
|
|
|
.with_inner_size([1400.0, 900.0])
|
2026-10-24 10:14:10 +03:00
|
|
|
.with_min_inner_size([640.0, 480.0])
|
2026-10-18 01:54:06 +03:00
|
|
|
// X11 uses this; on Wayland the icon comes from the .desktop entry matching the app id.
|
|
|
|
|
.with_icon(
|
|
|
|
|
eframe::icon_data::from_png_bytes(include_bytes!("../assets/icon-256.png"))
|
|
|
|
|
.unwrap_or_default(),
|
|
|
|
|
),
|
2026-10-21 19:15:21 +03:00
|
|
|
wgpu_options: graphics::options(mode),
|
2026-10-18 01:54:06 +03:00
|
|
|
..Default::default()
|
|
|
|
|
};
|
2026-10-21 19:15:21 +03:00
|
|
|
let result = eframe::run_native(
|
2026-10-18 01:54:06 +03:00
|
|
|
"ChessPenguin",
|
|
|
|
|
options,
|
|
|
|
|
Box::new(|cc| {
|
|
|
|
|
assets::install(&cc.egui_ctx);
|
|
|
|
|
Ok(Box::new(app::App::new(&cc.egui_ctx)))
|
|
|
|
|
}),
|
2026-10-21 19:15:21 +03:00
|
|
|
);
|
|
|
|
|
if let Err(e) = &result {
|
|
|
|
|
if graphics::retry(&e.to_string()) {
|
|
|
|
|
return Ok(());
|
|
|
|
|
}
|
|
|
|
|
graphics::fatal(&e.to_string());
|
|
|
|
|
}
|
|
|
|
|
result
|
2026-10-18 01:54:06 +03:00
|
|
|
}
|