parsecache — the closed corpus of top-parser parses
parsecache runs the open neural parsers (Stanza, Trankit, spaCy trf, SuPar, hopsparser, COMBO) over our corpora one slice at
a time, checks each result token for token against Mova's tokens, packs it with treestore
and records a done-marker with hashes. The Eel runs it as its parse-cache round (tools/eel),
holding the GPU lease. The cache feeds the 0.6 agreement step (Mova's parse + the top parsers + the old Sol/Opus
parse → the agreer (internal, not part of the open release) → the hint for Sol). It is internal and never published; the cache layout and reading API are
in Open parsers: witnesses and tests.
cargo build --release -p parsecache
parsecache pin PLAN PINNED_PLAN # hash the bridges and every model file into the plan
parsecache next PINNED_PLAN # the next undone (parser, corpus, slice)
parsecache round PINNED_PLAN OUT_DIR --device gpu|cpu --threads N --round K
parsecache status PINNED_PLAN # per item: slices done / total, sentences, parse seconds
parsecache complete PINNED_PLAN LANG # the slices every parser of LANG has finished (the agreer's input)
parsecache coverage PINNED_PLAN LANG # per slice: which parsers have finished it
parsecache get ROOT EPOCH LANG PARSER_KEY CORPUS SENT_ID
parsecache doc ROOT EPOCH LANG PARSER_KEY CORPUS DOC_KEY
parsecache verify STORE_DIR [--decode] # every slice file against its done-marker
parsecache agree A.conllu B.conllu # per-column agreement of two bridge outputs (a tuning check)
From Rust: parsecache::Cache::open(root).sentence(epoch, lang, parser_key, corpus, sent_id).
The plan
A JSON file: cache_root, epoch, parsers_dir; parsers (id, lang, arg — the bridge's parser name,
version, python, bridge, model_paths, cpu, optional env); corpora (id, lang, licence, cpu,
optional only — a list of slice ids — and a kind):
| kind | source | slice | options |
|---|---|---|---|
treestore | dir, a store of wikicorpus records (Mova's own trees) | <stem>.<part>, articles_per_slice articles | model |
conllu | path, one CoNLL-U file | s<first>, sentences_per_slice sentences | |
docs | list, lines key<TAB>path of Markdown/LaTeX-ish files; prose lines split by mova-parse and Mova's tokenizer | d<first>, docs_per_slice documents | |
pairs | path, a parallel TSV (#id<TAB>en<TAB>fr…), the column side, Mova's tokenizer | p<first>, sentences_per_slice rows | split (a cell holds several sentences, numbered :1, :2…), id_prefix, max_words |
sentences | dir of shards <stem>.tsv.zst (lines sent_id<TAB>text<TAB>forms, forms joined by U+001F) written by an exporter | one finished shard (.part files are not finished) | max_words (default 150) |
A pairs file is read through a row index under <cache_root>/_index/ (the byte offsets of exactly the rows the
whole-file read keeps, with the file's size and modification time; a changed file is indexed again), so a round of a
file of many gigabytes reads only its slice. Slices done before the index have the same rows and input hash.
shard_line and write_shard (source.rs) write the sentences format; the Wikipedia exporter that uses them is
private. Sentences over max_words words (tables or lists run together) are left out: they blow the GPU parsers up.
order is a list of entries, served in that order:
| entry | meaning | done units |
|---|---|---|
{parser, corpus} | one parser over the corpus, slice by slice | its done slices |
{corpus, parsers: [...]} | slice-major: every listed parser finishes a slice (in listed order) before the next slice starts | complete slices |
{"sequence": [entries]} | the entries in order, each to its end | the sum |
{"sample": [{corpus, parsers, key, decay}, …], "seed": n} | slice-major over all the members' slices in a fixed pseudo-random order, so coverage is broad early: each slice gets the key ln(u)/w, u uniform from SHA-256 of (seed, key, slice), w = 1 or, with decay h, h/(h+i) for the i-th slice (weighted sampling without replacement, Efraimidis & Spirakis 2006); members sharing a key (two sides of a parallel corpus) come up slice by slice together; a new slice never moves the others | complete slices |
{"interleave": [entries], "shares": [k, …], "balance", "since"} | the members advance together: the member with the least done per share goes next (ties in listed order; shares default to 1); done is counted in units, or with "balance": "seconds" in the round seconds of done-markers written since since (unix seconds), so shares are shares of GPU time; a member with no work ready does not stop the others | the sum |
Slice-major entries give a growing body of slices that every parser of the language has finished, which the
agreement step needs. A slow parser goes in its own member with a small share (a lagging lane) and in the plan's
lagging list: parsecache complete PLAN LANG lists the slices every other parser of the language has finished
(corpus, slice, sentences, lagging_done; --with-lagging only those the lagging parsers finished too). That list is
the agreer's input. pin adds bridge_sha256, models (path, bytes, SHA-256) and key to every parser. A round
checks the bridge hash and every model file's size; verify-models rehashes them.
A parser may carry runtime: launcher (a Python file run as python -I LAUNCHER BRIDGE <arg> <work>) and env.
It changes how the same pinned bridge runs, not what it is: pin adds runtime.launcher_sha256, a round refuses a
changed launcher, the parser key leaves the runtime out (the slices stay in the same store directory), and every
done-marker records the runtime it ran with. The launcher in use is
bridge_runtime.py, kept internal with the agreer (sharded bridge processes, Stanza
batch sizes; measured in Open parsers: witnesses and tests; Trankit's guard against
sentences over 510 XLM-R pieces, MOVA_TRANKIT_GUARD, in
Open parsers: witnesses and tests). No runtime: the bridge
runs as before.
Rounds may run side by side: a round claims its slice with <slice>.claim.json (created with create_new) beside the
done-markers and skips slices other live rounds hold; a claim whose process is gone (or older than the plan's
claim_stale_seconds, default 6 h) is moved aside to <claim>.stale-… and taken over. The store model is installed
no-clobber (the first round's model.bin wins) and index.tsv is rewritten under index.lock. When every undone slice
is claimed the round reports deferred. parsecache agree A.conllu B.conllu prints the per-column agreement of two
bridge outputs over the same input.
A slice runs on the CPU only when its parser and its corpus both say "cpu": true (small corpora); otherwise a CPU
round reports deferred and the slice waits for the GPU.
Checks
The bridge must return every sentence in order, with the same id and the same forms (a space inside a token is sent
as U+00A0, an empty token as _) and heads in range; otherwise the round fails and nothing is marked done. Each
slice file is decoded back and compared byte for byte with the records before its done-marker is written. A slice
with a done-marker is never redone.
A round's own folder keeps round.json and bridge.log. Its work/ (the bridge input and the parser's raw
<arg>.conllu) is removed once the slice's rows are packed, decoded back and marked done; their hashes stay in the
marker (input_sha256, output_sha256) and round.json gives work_removed_bytes. A failed slice keeps its work/
for the look. Before 2026-11-16 the lane kept every work/ (about 6 GB a day of plain tokens and CoNLL-U).
Limits
- The bridges are Python (the only Python in the pipeline); they write UPOS, XPOS, HEAD and DEPREL, not lemmas or
features (
_). - Determinism of GPU parses is up to the parsers' GPU arithmetic; the check of two identical runs is in docs/parsers.md.
- One treestore model per (parser, corpus), trained on that corpus's first slice; later slices use it as it is.
The CPU lane
parsecache lane PINNED_PLAN OUT_DIR [--load-max 14] [--max-threads 10] [--sleep 300] [--stop FILE] [--once]
A standing, load-aware lane for CPU parsers (plan cpu-a2: spaCy lg en/fr over the Eel plan's seeded sample order,
parallel corpora first, into the main cache, so the agreer reads it). Before every slice it reads the 5-minute load
average: at or above --load-max (default 0.7 · online CPUs) it sleeps, below it it runs one CPU slice with
(cpus - load) / 2 threads, at least 1 and at most --max-threads. A STOP file ends it before the next slice; done
slices are never redone. OUT_DIR/lane-status.json has the last decision. Run as the user unit mova-cpuparse
(peta/deploy/parse/mova-cpuparse.service: Nice=19, idle IO, CPUQuota=1000%, MemoryMax=16G).
Licences: a main plan refuses NC and research-only parsers (check_licence: UDPipe, UDify, or
"licence_class": "nc" | "research-only"); an analytics plan may hold them.
This page in Markdown https://md.mova.elamur.ai/free/en/docs/tools/parsecache/