Skip to content

perf(dictionary): train Zstd from raw term content - #989

Merged
aehlke merged 7 commits into
developfrom
feat/raw-only-online-zstd-20261128
Nov 29, 2026
Merged

aehlke merged 7 commits into
developfrom
feat/raw-only-online-zstd-20261128

Conversation

@aehlke

@aehlke aehlke commented Nov 29, 2026 •

Copy link
Copy Markdown

Summary

  • Train Zstd frames directly from raw term-entry bytes and publish replacements through the existing immutable-root format.
  • Route single and batched raw reads through the leased root so lookup keeps the right source across publication, restart, and import-owned staging at the committed high-water mark.
  • Re-admit prior v2 no-gain generations only when the durable receipt proves discovery found no frames; preserve completed or sampled generations.
  • Bound layout growth before staging each replacement batch and allow compatible in-flight v2 jobs to finish.

Verification

  • Node 22 targeted suite: 304 tests passed across nine files.
  • Hosted CI on this PR head passed JavaScript, TypeScript, unit tests, build, and the Chromium and Firefox extension E2E lanes. Chromium Anki deduplication also passed. Edge is skipped on PR runs.
  • The unchanged control at 4f8bdbd5298204bee3c4d14bd9d4d0c399dda53c passed its Chromium, Firefox, Edge, TypeScript, JavaScript, unit, and build lanes. Its manual-only Firefox Android Gecko RDP probe failed during emulator setup.
  • git diff --check passed. No local browser run was made.

The local browser qualification below was completed after these original hosted verification notes.

Local Chromium qualification

Tested head 769033e3f95e3005b982456bb7333bcbed9d36ad with the complete chrome-dev extension tree 2c45aa1e2755b61e9a5bae711e81b0f5a6ddcd04c3b5dca2d9364e6a3d33f651. The old/new/old startup control passed. An earlier failed startup used a package missing 101 assets.

  • Direct-raw upgrade. A previously imported 40-entry dictionary with a v2 no-gain checkpoint deferred with 8 MiB of available origin quota. After interruption, the same v3 job resumed and published six batches containing all 40 trained frames. The published root and ordinary hydrated termsFind digest matched after browser restart. Active term-content files fell from 450,231 to 27,535 bytes.
  • Full pinned VNDB. The previously imported 6,648,310-row dictionary had both generic compressed blocks and direct raw entries. It deferred safely under low quota and resumed the same job after shutdown. The optimizer found no net gain, retained the original 7,533,449 bytes of term content, and released all staging claims. The largest observed term-file snapshot held about 10.0 MB of additional data. All 27 foreground lookups and the lookup after terminal restart matched the baseline hydrated digest.

@aehlke
aehlke changed the base branch from main to develop November 29, 2026 04:18
@aehlke
aehlke marked this pull request as ready for review November 29, 2026 07:38
@aehlke
aehlke merged commit 4b61c57 into develop Nov 29, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant