Deep Check: will this book open on my e-reader?¶
A book can look perfect in Bookx and still make your e-reader stop answering: a font that the reader's text engine cannot cope with, a stylesheet that sends it in circles, one chapter it chokes on. Deep Check finds out before you send the book. It opens a copy of the book in a real reader engine, with a stopwatch, and when that goes wrong it removes parts of the copy until the problem disappears, so it can tell you which part is the reason.
Today: from the command line
Deep Check is available as bookx-cli check --deep (see below). Running it from the Send to Device
window comes in a later release; this page will be extended then.
What it does¶
- Opens the book in KOReader's text engine (crengine), in a separate program with a hard time limit (12 seconds by default). It paginates the book and paints the first pages and a spread over the rest, because some problems only show when a page with the bad part is drawn.
- If the book hangs, crashes or is very slow (several times slower than a book of that size should be), it searches for the cause: first which kind of file matters (fonts, images, stylesheets, chapters …), then which file, then, for a stylesheet or a chapter, which rule or element in it. Each step opens a trimmed copy; several copies are opened at the same time. Typically that is 15 to 40 test opens: seconds to a few minutes.
-
It tells you in plain words, for example:
Hangs KOReader 2026.07.1 (crengine) (no answer after 12 s). Removing the font OEBPS/fonts/RMDEVA.OTF fixes it, referenced from OEBPS/page_styles.css line 5. Removing OEBPS/page_styles.css would also fix it, but takes more of the book with it. Fix: remove the @font-face rule (OEBPS/page_styles.css line 5) and the font OEBPS/fonts/RMDEVA.OTF. The repaired book was tested again and opens fine (212 pages, 0.4 s). -
With
--fix OUT.epubit writes the repaired copy and opens it again on the same engine to prove it works. Your original is never changed.
The answer is remembered by the file's content and the engine version, so asking again about the same file is instant.
Fonts and style rules that caused a problem once are also remembered: a plain bookx-cli check then warns about the
same font in another book immediately, without running the engine.

A deep check of a book whose font makes KOReader hang (real output of the real engine on a generated test book).
What it needs¶
- KOReader's Linux build, downloaded when you first ask. It is never part of Bookx: not in the Flatpak, the
.deb, the.rpm, the tarball or any other package (a check in the release process enforces it). Nothing is downloaded until you run a deep check or the command below. The download is one KOReader release (about 30 MB, 91 MB unpacked) fromgithub.com/koreader/koreader, shown with progress, checked against a fingerprint built into Bookx (a file that does not match is deleted and never used), and can be cancelled with Ctrl-C. Nothing else is downloaded, and nothing about your books leaves your computer. - Where it is kept:
~/.cache/bookx/deep-check/koreader/(the cache folder of your user;BOOKX_PROBE_CACHEmoves it). - Offline: without a network the download fails with a clear message ("are you offline?") and nothing is installed; a deep check then reports that it could not run. Once the engine is installed, deep checks work completely offline. Offline mode (see Privacy) stops the download.
- A 64-bit Linux computer (x86-64 or ARM). On Windows and macOS Deep Check is not available.
- For the strongest protection,
bubblewrap(bwrap) andprlimit(util-linux). With them the test program runs with no network, no access to your files other than its own temporary copy, and limits on memory and time. Without them (inside a Flatpak, for example) it still runs under a hard time limit and is always stopped completely, but it is not cut off from the network or your files; the result says so.

bookx-cli deep-check status: whether KOReader is installed, where, how big, and which isolation is used.
Download ahead of time, see it, remove it¶
bookx-cli deep-check install-engine # download and verify KOReader now (about 30 MB), with progress
bookx-cli deep-check status # installed? which version, where, how much disk space (--json)
bookx-cli deep-check uninstall # delete it again and free the space
bookx-cli check book.epub --deep downloads the engine by itself the first time if it is missing; add --no-download to
forbid that. Deleting the folder by hand has the same effect as uninstall. In the app (a later release) the download
will run as a job in the Jobs panel, can be cancelled there, and will be started only when you press Download.

bookx-cli deep-check install-engine: the download with its progress, then the checksum check.
Limits: what it does not tell you¶
- It says something about KOReader (its crengine), the reader on most Kobo, Kindle, Boox, PocketBook and Android e-readers that run it. It says nothing about the built-in reader of a device: a Kobo's own software, a Kindle's own reader. There is no way to run those on a computer.
- It is not a guarantee. A book that passes can still fail on a device that is slower, has less memory, a different KOReader version or different settings (the test uses KOReader's defaults). "Slow" is judged by a desktop computer, an e-reader's processor is much slower.
- It finds problems that make the reader hang, crash or crawl. It does not check that the book looks right.
- The search can be inconclusive: when it ran out of its test budget (120 test opens or ten minutes), was cancelled, or when the problem did not repeat (it is then marked flaky). The report says which.
- It only works on EPUB files.

Diagram: what a deep check covers and what it cannot say. It cannot be photographed: it is a statement about devices.
Command line¶
bookx-cli check book.epub --deep # the normal check, then the deep one
bookx-cli check book.epub --deep --fix repaired.epub # also write a repaired copy and test it again
bookx-cli check book.epub --deep --json # for scripts
bookx-cli check book.epub --deep --timeout 20 # give slow books more time (seconds, default 12)
bookx-cli check book.epub --deep --no-download # never fetch KOReader; say so if it is missing
| Option | Meaning |
|---|---|
--deep |
also open the book in the reader engine (the normal structural check always runs first) |
--engine koreader |
the engine (koreader is the only real one; mock exists for tests) |
--timeout SECONDS |
hard limit of one test open (default 12) |
--max-probes N |
most test opens the search may use (default 120) |
--jobs N |
test opens at the same time (default: half the processor cores, at most 4) |
--fix OUT.epub |
write a repaired copy and test it again on the same engine |
--no-download |
do not download KOReader (a message says how to get it) |
--no-cache |
ignore remembered results |
Exit codes: 0 nothing found; 1 a problem was found (the structural check found errors, or the book hangs, crashes or
is slow, or the search could not finish); 2 Deep Check could not run (engine missing and --no-download, no network, an
unsupported computer). With --json the report is the deep entry of the output, next to errors and issues.

A book that opens fine (real output).
Where things are: the KOReader copy, remembered results (results.json) and learned warnings (signatures.json) live in
~/.cache/bookx/deep-check/. The environment variable BOOKX_PROBE_CACHE moves that folder; BOOKX_KOREADER_DIR points
at an unpacked KOReader folder (lib/koreader) you already have, and skips the download.
Questions and answers¶
Why does Bookx download KOReader instead of including it?
It is about 94 MB, it is somebody else's program, and most people never need it. Bookx fetches it only when you ask for a deep check, and only the one version it was tested with.
Does it send my book anywhere?
No. The only connection is the one-time download of KOReader from github.com. The book is opened on your computer, in a temporary copy that is deleted afterwards.
It says the problem is a font. Is the font bad?
Not necessarily. It means this reader version cannot cope with this font. The font may work in other readers. The fix removes the font so the reader uses its own; the text then looks different.
The result says \"inconclusive\" or \"flaky\".
Inconclusive: the search ran out of time or test opens before it was sure; try again with a larger --max-probes or
--timeout. Flaky: the same book failed once and passed the next time, so Bookx does not name a cause. Run it again.
How do I make sure no test program stays running?
Bookx stops the program and everything it started, every time (also when you cancel), and deletes its temporary
folder. If Bookx itself is killed in the middle, the test program ends with it when bubblewrap is used; without it, a
test program can stay until its own time limit (60 seconds of processor time) is used up.