The daemon grew past 100 GB on a 90k-document corpus. The governor capped
the lexical build's input text (recommendLexicalCorpusBytes) but not the
in-memory BM25 index built from it, which runs ~8x the text for
SubwordAwareBackoff.
- ResourceGovernor::recommendLexicalIndexBytes(): live-heap grant for the
BM25 indexes, 6.25% of the memory budget (256 MiB to 4 GiB), scaled by
pressure.
- scaleBudgetForPressure() replaces three copies of the pressure switch
in the recommend*Bytes() budgets.
- The lexical build reads the grant, sizes Simeon's reservations from it,
checks the live index size before each document and re-polls the
governor every 256 documents; the grant only shrinks mid-build. Over
the grant it stops and search stays on FTS5.
- testing_endStartupGrace() lets tests reach Critical and Emergency.
- third_party/simeon: Bm25Index memory_bytes(), max_memory_bytes,
try_add_doc(), bounded reservations, validate() and fuzzers
(trvon/simeon#4).
On the 90k corpus a traced daemon run held the lexical index at 3.6 GB,
under its 4 GiB grant.
Signed-off-by: trvon <me@trevon.dev>