Repository navigation
ADFA-3305: Re-mint a 768 KiB dictionary on a larger sample - #53
davidschachterADFA wants to merge 5 commits into
Conversation
remint_dictionary.py now defaults to a 768 KiB dictionary trained on up to 3,600 rows within 128 MiB (--sample-size 1200, --training-bytes), where it used the first mint's 256 KiB and up to 900 rows within 32 MiB. Measured on the 2026-10-19 ship-time database, 4 seeds each, packed and compressed as the pipeline does: 89,063,424 file and 70,517,587 .br bytes against 90,726,400 and 72,436,600 (-1,662,976, -1,919,013), every row and template verified byte-identical. The larger sample is what makes a large dictionary work: with the old one, two of four 768 KiB seeds stored 4-5 MB more than 256 KiB, and a 1 MiB dictionary could not be filled. The brotli CLI's window was not the cause (an explicit -w 24 gave identical bytes). 768 KiB beats 512 KiB by more than the seed spread; 1 MiB had one seed in four store 17.6 MB more, so it is not the default. On a Pixel 6 Pro, page load times and the app's memory showed no measurable difference. Two tests pin the defaults: what remint() hands the sampler and trainer, and what the command line passes. Both fail on the old defaults. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018CMZQuXT3GT7nEct2w4tg3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018CMZQuXT3GT7nEct2w4tg3
622534d to
0f4ce35
Compare
|
Rebased onto #48's review fixes (15db30a), so this branch was force-pushed: 622534d -> 0f4ce35. 🤖 Generated with Claude Code |
Independent Claude review (head 0f4ce35)The change does what its body says. A re-mint with no size flags now trains a 768 KiB dictionary on up to 3,600 rows within 128 MiB. On a copy of the 3.0.0 ship-time build, a default
R53-01. "Who else gets the new size" says the Android-docs workflows' re-mint of the master gets 768 KiB, "and so does the database today's release ships". CLAUDE.md:116-120 says "The ship-time copy is always re-minted last, so what ships has the re-mint's size". CLAUDE.md:41-43, in the paragraph about
So what ships today keeps 256 KiB. After #49 merges, nothing in CI re-mints at all, and the new default reaches a shipped file only through the ship-time pipeline, once that exists. Nothing breaks, but the text tells a release reader the opposite. Fix: say the new default applies to a re-mint run by hand ( R53-02. The docstring says that with the larger sample, 768 KiB's "seeds spread 0.33 MB, as 256 KiB's do". From the per-seed logs of the measurement runs (
768 KiB's spread is twice 256 KiB's at the small sample and ten times it at the large one. The conclusion still holds: 768 KiB's worst seed (45.98 MB) stores less than 512 KiB's best (46.37 MB). Separately, "one seed in four stored 17.6 MB more" (body and docstring) doesn't name what it is more than. 63,202,482 is 17.55 MB above 768 KiB's best and 17.98 MB above 1 MiB's own best. Fix: drop "as 256 KiB's do", or give the 256 KiB spreads, and name the baseline of the 17.6 MB. R53-03. The body's "Phone" bullet and the docstring's "no measurable difference in page load time or memory between a 256 KiB and a 768 KiB dictionary" come from two databases. The 768 KiB one was trained on the 900-row sample, the "768 KiB, 900 rows" row: R53-04. The body's Change list says " Checked and sound
🤖 Generated with Claude Code |
CodeOnTheGo's compress_docdb.yml only Brotli-compresses the master from Drive and release.yml bundles that file, so today's release keeps the master's 256 KiB dictionary. The Kotlin and Java workflows don't call the re-mint; only the Android pair does, and #49 removes it. CLAUDE.md now says the new default applies to a re-mint run by hand and to the ship-time pipeline once one exists, and its 2026-08-20 paragraph about the master is back to the master's 256 KiB. (R53-01) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018CMZQuXT3GT7nEct2w4tg3
…abase 256 KiB's seeds spread 0.16 MB on the small sample and 0.03 MB on the large one, not 0.33 MB as 768 KiB's do; the comparison that holds is that 768 KiB's worst seed stores less than 512 KiB's best. The 1 MiB outlier is 17.55 MB above 768 KiB's best. The phone check ran the 768 KiB database trained on the small sample, the table's second row: same dictionary size as this default, different bytes. (R53-02, R53-03) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018CMZQuXT3GT7nEct2w4tg3
The docstring and CLAUDE.md contrast the re-mint's 768 KiB with the first mint's 256 KiB on up to 900 rows within 32 MiB, but nothing pinned the latter: with populate_db.DEFAULT_DICT_SIZE at 768 KiB every test passed. This one fails on that mutant. (R53-04) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018CMZQuXT3GT7nEct2w4tg3
Response to the reviewAll four findings are addressed (0f4ce35..fc9b5da).
🤖 Generated with Claude Code |
ADFA-3305
remint_dictionary.pynow re-mints a 768 KiB dictionary trained on up to 3,600 rows within 128 MiB (--sample-size 1200,--training-bytes), instead of the first mint's 256 KiB on up to 900 rows within 32 MiB. On the ship-time database that is 1.66 MB less file and 1.92 MB less.br. Stacked on #48.Measured
The 2026-10-19 ship-time database, 4 seeds each, every row and template verified byte-identical, packed with
rebuild_database.py --pack Content,TooltipTexts --page-size 4096,.brwithbrotli -q 11 -w 24:.br-w 24gave byte-identical output to the CLI's default for every dictionary.Change
REMINT_DICT_SIZE,REMINT_SAMPLE_SIZE,REMINT_TRAINING_BYTES, used byremint()and the command line.populate_db.py's first mint keeps 256 KiB: the ship-time copy is always re-minted last.Who else gets the new size
Nothing that ships re-mints yet. CodeOnTheGo's
compress_docdb.ymlonly Brotli-compresses the master from Drive andrelease.ymlbundles that file, so today's release keeps the master's 256 KiB dictionary. The new default applies to a re-mint run by hand and to the ship-time pipeline once one exists. Of this repo's workflows only the Android docs pair calls the re-mint, and #49 removes it; the Kotlin and Java workflows don't. The app onstagereads a dictionary of any size:DocumentationCompression.ktchecks only a minimum of 8 bytes (from reading the code; the device check above used the ADFA-3305 build, not astagebuild). Training reads 86-93 MiB of text instead of about 22 MiB: in the review, sampling took 3.1 s and zstd training 15.7 s and 121 MB of memory (256 KiB: 3.8 s, 62 MB), and a default 4-seed run on the ship-time build 16 min 11 s with 8 workers.Tests
Two new tests pin what
remint()hands the sampler and trainer, and what the command line passes. Both fail on #48's head (15db30a), on the old defaults. Rebased onto #48's review fixes; the command-line test's stand-in forremint()now accepts its newbefore_writekeyword. A third, from the review, pins the first mint's defaults (256 KiB, 300 rows, 32 MiB); it fails withpopulate_db.DEFAULT_DICT_SIZEat 768 KiB. 39 tests pass under pytest and as a plain script.🤖 Generated with Claude Code
https://claude.ai/code/session_018CMZQuXT3GT7nEct2w4tg3