Commit graph

19 commits

Author SHA1 Message Date
vrubelroman
1b4d30900e feat: refine opening repertoire training 2026-11-03 19:04:22 +03:00
vrubelroman
f694bc768b Web version: databases read in a worker, the shelf's counts, Chrome and Edge remember chosen files
The page's reader: a Web Worker with a second instance of the program reads
a database (PGN, CBV, ZIP, 7Z) and gives back its text and index; the page
puts it together without reading it again (chess_core::PgnIndex,
PgnDatabase::into_index / from_index, serde behind a feature). A 13 MB CBV:
the longest frame 17 ms in Firefox, 67 ms in Chromium (1000 ms before).
platform::open_database is the same on both sides: away from the screen,
done when read. The shelf's cards count the games the same way (one file
at a time); the counts are kept through platform::fs.

Chrome, Edge (File System Access): a chosen file's handle is kept in the
browser's storage; at the next visit the file is read again by itself when
the browser allows it, else the card offers «Allow reading» (the browser's
own question). Files of different visits get folders of their own.

Checks: t.choose(files, open) for both browsers (in Chromium the handles of
the site's private file system stand for the dialog's); app.mjs checks the
draft, the question on leaving and the remembered file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 17:50:54 +03:00
vrubelroman
000821887f Web version: the engine's location as a type, the browser's history and Back, the question on leaving, the draft of an unsaved game
EngineLocation: an engine starts from its program on a computer, from the
address of its Web Worker's script in a browser; analysis, the review job,
the judge and the settings take it instead of a path.

platform::page: a game on the screen is an entry of the browser's history,
so Back is «← Library» (with the same questions); unsaved changes or a
running review make the browser ask before the page is left. The draft of an
unsaved game is written every 5 s while it has changes and offered at the
next start (Open / Delete); a saved or left game takes it away.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 17:35:30 +03:00
vrubelroman
61ccd763bc Web version, stage 2: Stockfish 19 in workers, live analysis, game review on N workers, My games, files, keys
game-review: what the job does for one target (the full search, the second
best without the move played, the shallow ones) becomes a machine without I/O
(job/work.rs), driven by the engine processes on a computer (job/engines.rs,
the same searches as before) and by Web Workers in a browser
(job/workers.rs: a dispatcher polled from the frames, never blocking). The
analysis cache goes through a CacheStore (a folder, or the program's files of
the platform).

The browser's engine: Stockfish.js 19.0.1 (npm stockfish, GPL-3.0), its
single-threaded build served beside /app/ (engine/, build.sh checks the
package's sha512), its 99 MB wasm downloaded only through the engine offer,
checked against its SHA-256 and kept in Cache Storage; workers get it as a
blob: address. Live analysis (lines, arrows, the bar) and the review run on it;
the review uses one worker per logical CPU, at most 8.

My games (the web version): a PGN in the browser's storage, always on the
shelf; Ctrl+S puts a game there (its own record, or a new one); deleting with
undo. chess-core's store gives the bytes of append/replace/remove/restore, so
the platform writes them into the browser's files; on a computer the files
are written as before. Settings: Browser data (used and free space, keeping
the data for good, Download all as PGN, deleting the engine).

Files: a file of the last visit offers Choose the file again; Keep a copy in
the browser (refused with the room it needs when the browser gives too
little); files over 1 GB are not opened, with a word on why. No reference tab
and no search by position in the web version. Keys: Alt+Left, plain 1-6,
Ctrl+C, N in the library (the browser keeps Ctrl+W/N/1-6/Shift+C).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 16:35:22 +03:00
vrubelroman
3e69a5d57c Web version, stage 1: the interface as a library over a platform layer; apps/web
apps/desktop becomes a library (chesspenguin_app: the interface) and a thin
binary; apps/web starts the same interface in a page's canvas (eframe's
WebRunner). cfg(web) (build.rs) marks WebAssembly in a browser.

The platform layer (apps/desktop/src/platform): the program's folders, files,
background work, the files the user opens or saves, the clipboard and what
the platform offers (CAPS). On a computer it is the system as before; in a
browser the program's data lives in IndexedDB behind an in-memory file tree
loaded before the start, the files the user opens are read into it for the
session (only read), background jobs run on the page's thread after the
frame, the clipboard is read through the browser's API, sounds play through
audio elements, a game is saved as a download.

What a browser does not have is not built for it: updates, the online games
window and its probe, engine processes (analysis starts a Web Worker there;
the review and preparation jobs, Rodent and the judge are native), blocking
requests (engine, Maia and Rodent downloads report no download for the
platform, translation reports that it makes no requests). The desktop
program behaves as before; its build finds unused code (the web build
compiles parts it never shows).

apps/web: the entry point, the page /app/ (device check before anything large
is loaded: phones and tablets get the page about the apps in the site's nine
languages, keys app_* in website/site/i18n), build.sh (wasm-bindgen, profile
web), a static server and headless Firefox checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 15:09:17 +03:00
vrubelroman
f02f140394 Opponent prep: the desktop screen (dialog, report, engine run)
The «Prepare against…» entry points in the library (the filter panel's button
when a player is set, the game row's context menu, Ctrl+Shift+P), the dialog
(database, the player's spellings with the similar names apart, colour, book)
and the report screen in the stack between the library and the game: the
repertoire tree with transpositions, opening names, scores and the book
column, the openings table by family and variation, the errors tab (repeated
errors and by opening), the board of the chosen position with the line under
it, and the games of the selection, which open in the game screen at that move
with «⬅ Back to preparation».

The engine run reuses the game analysis job over the distinct opening
positions of the chosen colour: the launch dialog shares the engine picker and
the quality/threads/memory grid with review.rs (quality «Fast» by default, its
own setting), marks appear as positions are evaluated, «Stop» keeps what was
done, the evaluations and the report are cached under <cache>/prep. One engine
job per program: game analysis and the live engine are blocked meanwhile.

Core: targets and counts by colour (`targets_for`, `missing_for`), the book
step keeps its per-position counts (`book_counts`) for the tree column.
Narrow windows: the board stacks over the lists under 804 px and folds into a
button under 720 px of height; the right column is split explicitly (a nested
bottom panel is not reserved from the content above it in egui).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-28 15:43:15 +03:00
vrubelroman
9e00d046b0 play: a game against Maia's rules as a crate (ending, pause, resignation judge)
Some checks are pending
CI / check (push) Waiting to run
CI / windows-build (push) Waiting to run
CI / macos-build (push) Waiting to run
How a game ends, Maia's pause and her resignation judged by an engine move
from the desktop's play.rs into crates/play; the judge wakes the app through a
callback and takes engine options (Android's EvalFile). The desktop uses it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 01:10:34 +03:00
vrubelroman
bb2ef38ef6 trainer: the opening trainer as a crate shared by the desktop and Android
Some checks are pending
CI / check (push) Waiting to run
CI / windows-build (push) Waiting to run
CI / macos-build (push) Waiting to run
apps/desktop/src/train.rs moves to crates/trainer; the rule of a move (right,
the last one, wrong) becomes Training::judge, the desktop uses it; the app
names the stats file (set_file). The line's last move comes in plain SAN; the
desktop shows it its own way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 01:00:11 +03:00
vrubelroman
9cd28b9039 Play against Maia: dialog, clocks, game screen, result strip
«⚔ Play» (Ctrl+G) opens «Play against the computer»: name and rating
(optional), strength 600–2600 (or weaker/as me/stronger), colour, Lichess time
controls, custom, no clock. The game screen in play mode: clock cards above
and below the notation (read-only), take back, resign (abort before the first
moves); no engine, analysis or editing. Maia answers in a background thread
with a human-like pause bounded so she never loses on time; stale answers are
dropped. Endings: mate, stalemate, no material, threefold, fifty moves, time
(draw when the other side cannot mate), resignation; then the result strip
(Analyse, Rematch, New game, Save to a database) and an ordinary game with the
tags of a played game and [%clk]. Leaving during a game asks (resign and add /
resign and leave / keep playing), the clocks wait meanwhile. maia reads the
published PyTorch checkpoint directly (zip + a small pickle reader that refuses
everything but tensors); maia_download fetches it on request (pinned revision,
SHA-256). Dev hooks CP_PLAY, CP_PLAY_AUTO, CP_MAIA. Russian texts; the other
languages follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 04:10:02 +03:00
vrubelroman
0f66486a22 Own databases: create PGN bases, add, save, delete games; library logging
Some checks are pending
CI / check (push) Waiting to run
CI / windows-build (push) Waiting to run
CI / macos-build (push) Waiting to run
Desktop: «✚ New database» on the shelf (Ctrl+Shift+N), «Add to database…»
(Ctrl+Shift+S, 💾, ☰) for any game — new, pasted, from a ChessBase, online or
legacy-encoded database — into a PGN of the user's choice; Ctrl+S saves the
changes back into the game's own PGN (its record is replaced) or adds the game
when the source is read-only; the game data editor (F2, the title, ☰) asked once
when a new game is first added; duplicate check (same players, date, moves →
replace / add as new, no Enter); delete from the table with a question and Undo
(Ctrl+Z, 6 s, waits under the mouse); UTF-8 copy for legacy-encoded files with
the restored letters; online and ChessBase stay read-only. Writes are explicit:
append, or an atomic rewrite through a temporary file and a rename (through a
symlink, keeping the mode, syncing the folder), refused when the file changed on
the disk. chess_core::pgn::store: append/replace/remove/restore/write_utf8_copy,
find_same_game, pgn_date; Game::remove_tag and order_roster. Settings: your
name (annotator), the folder for new databases, the last target. Nine languages.

Also: library warnings (wgpu, winit) go to chesspenguin.log, CP_LOG_FRAMES=1
traces egui_wgpu frames (the GNOME hang hunt); dev hooks CP_OWN, CP_PASTE,
CP_COMMENT, CP_KEYS with Ctrl+, CP_SETTINGS=interface.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-25 00:46:47 +03:00
vrubelroman
7f23bca320 Android: the app updates itself; one release check for the desktop and the phone
Some checks are pending
CI / macos-build (push) Waiting to run
CI / check (push) Waiting to run
CI / windows-build (push) Waiting to run
- crates/releases: the latest release on GitHub, its files and SHA-256 sums, shared by
  the desktop updater and the phone (desktop update.rs keeps its installers).
- mobile-api check_release: a newer release with its APKs and sums; a desktop-only
  release is no update, one without the light APK's sum cannot be checked.
- Android (android-ui.md §25): a check at start and on return once a day (switch and
  «Check now» in About), a card over the databases, a sheet through the install
  permission, the download (DownloadManager), the SHA-256, the full build keeping its
  engine network, and PackageInstaller; the state survives restarts, the update's
  snackbar waits for a screen. Network state permission for both builds (the full one
  crashed without it). Debug builds may ask a test server (CP_UPDATE_API).
- Release notes on GitHub come from this version's CHANGELOG section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 18:42:27 +03:00
vrubelroman
f6072cb7c3 Android: games from Lichess and Chess.com, newest first, with «Download new games»
The downloads of the desktop (lookup by nickname, one database per site or both in one,
resuming without duplicates, games still being played fetched once they end) move into a
shared crate, online-games; the desktop keeps its window on top of it.

On Android, «Add a database» → «Games from Lichess and Chess.com»: a nickname, what each
site has, the download with its progress. It belongs to the app, not to the screen: the
list of databases shows how it goes and says how it ended. «Download new games» in the
database's menu and over its games list fetches only the new ones. The games of a
downloaded database are listed from the most recent one (by UTC date and time, both sites
interleaved). Both builds may now use the internet, only when the user asks.

Reviewed by an independent tester and designer (docs/design/android-ui.md §23, §24).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 16:37:16 +03:00
vrubelroman
1661e238d8 Android: game report — mistakes, blunders and accuracy, as on the desktop
The game analysis of the desktop (evaluations of the main line, judgements, accuracy,
cache and the engine job) moves into a shared crate, game-review, so both apps give the
same numbers. The desktop uses it unchanged in behaviour.

On Android, ⋮ → «Game analysis» runs Stockfish over the main line in its own process
(the live engine waits): an evaluation graph and a status row between the board and the
notation, marks in the notation, the better line of an error on the board, a report sheet
with both players side by side. Games with [%eval] and games analysed before show their
report at once. The analysis stops with the screen and goes on after it, also after the
phone is turned, and is cached as it goes.

Reviewed by an independent tester and designer (docs/design/android-ui.md §21, §22).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 14:10:58 +03:00
vrubelroman
005601afb2 Website: new features and fresh screenshots; no missing glyphs in the app
The site lists the reference tab, games from Lichess and Chess.com, translated
comments and self-update, and the notation and animation under "Make it
yours", in six languages. Thirteen screenshots (three new: reference,
translation, online games) on the owner's green board with Merida pieces, the
"looks" one on another board. The translation shot shows a real ChatGPT
translation of our own German comments to Reti-Tartakower 1910, put into the
screenshot cache once (shots/translate-for-shots.py); the shots send nothing.

The app: "✕" next to the Chess.com nickname, "⌂" in board search and "✓" in
translation texts had no glyph (empty boxes): replaced by the bundled 🗙, 🏠
and ✔. A test now checks every character of the translations and the string
literals against the character maps of the bundled fonts. The online games dev
hook takes two nicknames.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 23:47:14 +03:00
vrubelroman
1d901b61ff Translation of game comments
Some checks are pending
CI / macos-build (push) Waiting to run
CI / check (push) Waiting to run
CI / windows-build (push) Waiting to run
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
vrubelroman
9f661c9e3c First start in the system language; sample databases named in it
Some checks are pending
CI / macos-build (push) Waiting to run
CI / check (push) Waiting to run
CI / windows-build (push) Waiting to run
The first start (no settings file yet) picks the first of the system's preferred
languages that ChessPenguin has, otherwise English (sys-locale, MIT OR Apache-2.0).
A language chosen in the settings is kept. The sample databases get names in the
interface language.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 12:24:40 +03:00
vrubelroman
50eb5e6623 Stockfish on request instead of bundled; macOS (Apple Silicon) builds
Some checks are pending
CI / check (push) Waiting to run
CI / windows-build (push) Waiting to run
CI / macos-build (push) Waiting to run
Packages no longer carry Stockfish (about 14 MB instead of 95): the first
analysis without an engine offers to download the official Stockfish 19
"universal" build from GitHub (pinned per platform with its SHA-256, checked
before use, unpacked into the user's local data directory, test-started),
then starts the analysis the user asked for. Settings -> Engines: download
with progress and cancel, "file not found" with download again, removal with
confirmation; "Choose engine file…" for any other engine. A system stockfish
is offered first when there is one. ChessPenguin's Stockfish = bundled
(Flatpak) or downloaded.

macOS: release job and CI job on macos-14 build ChessPenguin.app (icon,
Info.plist, ad-hoc signature) in a .dmg; Homebrew paths for a system
stockfish. Not signed by Apple yet.

Decisions 14-15; design docs/design/engine-download.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 09:33:37 +03:00
vrubel
bb7d3b3fa6 Open ChessBase databases (.cbh, .cbv) and zip/7z archives
Some checks are pending
CI / check (push) Waiting to run
CI / windows-build (push) Waiting to run
New crate chess-import converts non-PGN sources to PGN in memory and returns
a PgnDatabase, so the library, notation and analysis work unchanged:
- .cbv archives (container rewritten after uncbv), .cbh with companion files
  (layout after the public Morphy format description): games, variations,
  comments with per-database code page detection, NAGs, squares/arrows, set-up
  positions, time spent, book chapters (guiding texts) as move-less records;
- ChessBase figurines become piece letters, diagram/object markers handled,
  Western names in Cyrillic databases read correctly;
- .zip/.7z with PGN (own encoding each), .cbh and .cbv; duplicates skipped;
- .cbz/encrypted archives and 2CBH rejected with clear messages.
Library: '+ Add database', format shown, import notes; comments keep
paragraph breaks. Tests on the user's sample books (skipped when absent).

Also: AUR PKGBUILD for 0.2.0 with the bundled Stockfish.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 13:18:27 +03:00
vrubel
8188b584aa ChessPenguin 0.1.0
Some checks are pending
CI / check (push) Waiting to run
CI / windows-build (push) Waiting to run
Native chess database for Linux: PGN library, notation with variations and
comments, UCI engine analysis, move entry and export.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 01:54:06 +03:00