Commit graph

8 commits

Author SHA1 Message Date
vrubelroman
67c91b6e0d Web version: no engine-file or folder buttons in a browser's settings; docs: the review check (359 of 359 positions the same as on the computer), checks of stage 2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 16:43:28 +03:00
vrubelroman
027860901d Web version: My games after the samples (a new library opens on the classics); stage 2 browser check
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 16:39:51 +03:00
vrubelroman
48de2debcf Web version: engine settings without threads and memory; review check reads the browser's storage as JSON; docs for stage 2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 16:37:38 +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
4ccf8099a5 Web version on the site: /app/ from website/static/app, precompressed Brotli/gzip
The site serves precompressed copies next to its files (the program is 19 MB,
6.3 MB in Brotli); the built program goes to website/static/app (ignored by git,
taken into the image); the device page's screenshots by the site's own paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 15:33:26 +03:00
vrubelroman
30eac472ff Web version: what the browser lacks is not offered, files dropped on the window, checks, docs
The interface hides what the platform does not have (platform::CAPS): play,
new databases, adding to a database, preparation, translation, their
shortcuts and the Translation tab. Files dropped on the window open like
chosen ones (in a browser; the desktop program takes no drops, as before),
with «Release to open» while they are dragged over it.

/app/: ?phone=android and ?phone=ios show those variants of the device page.

apps/web/check: device.test.mjs (14 devices: computer, iPhone, iPad as a Mac,
Android phone and tablet, desktop-site modes, Chromebook, touch laptop) and
app.mjs (headless Firefox: the device page in three languages without the
program, the program, a PGN opened by Ctrl+O and the file chooser, a dropped
PGN, a game of the classics, moves, «Download PGN», e2-e4 on the board, the
settings after a reload). All pass.

docs/dev/web.md: the architecture, the platform layer, what is not built for
a browser, the build and the checks, what comes next; docs/dev/uci.md and
desktop.md updated, web/README.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 15:18:45 +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
2703e5de38 uci: the engine as a Web Worker in a browser, on the same protocol machine; game-review: the process job is native
On WebAssembly the engine is a Web Worker: a line of UCI is one message each
way, the protocol machine is driven by the worker's messages and by timers set
for its deadlines; the handshake does not block (Engine::start_worker gives a
Starting, polled until readyok). EngineHandle has the same methods as the
process one, minus those that block or name a process. Option and search
checks are shared by both transports.

tests/worker.rs runs the worker transport against a fake engine in JavaScript
in headless Firefox (apps/web/check/uci-worker.mjs: wasm-bindgen-test-runner
serves, a WebDriver BiDi client reads the outcome): handshake, analysis and
stop, coalescing of rapid requests without mixing output, an engine hung on
stop, a crash, and every handshake failure. 5 of 5 pass.

game-review: the job in engine processes (run and its workers) moves to
job/engines.rs, built where there are processes. .cargo/config.toml: the
getrandom backend of WebAssembly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 14:29:12 +03:00