tracker
All repositories: gitoria
5.8 KB
# Report 043 — trkmem part 1 (tracker#45): stop materialising whole tables at boot (branch w43-trkmem, STOPPED at step 3, quota)Commits: 1d465d3 re-vendor plugins to Hybriel master f9614007 (libmpackdb.so sha256 6fb3b9d6…, #202; bin/ = master zig-out, git-ignored) ·55bbd61 lib/bootscan.hl: ONE streamed pass per table · (then) slices tried and reverted, people-view log line + allShows/allEpisodes for tools restored ·last commit "boot scans back to iterate". Worktrees kept: T9/wt (new), T9/old (6648ba4). Storage copies deleted, no process/port left.## What changedlib/bootscan.hl: titles pass → catalog lists + genres (noteIndexShow), slug map (noteSlugsOf), search title entries (indexShow), short ids(noteShortIdRow), cast photos (noteCastProfiles); episodes pass → catalog latest/upcoming (noteIndexEpisode, finishIndex); people pass →search person entries, short ids, person slug map, TMDB ids, /people's order (viewEntryOf + finishPeopleView). Each module keeps its lazybuild from the same per-record functions (iterate instead of find). follows/watches/franchises scans stream. project.hl calls bootScan().The only `find(null,null)` left at boot: none (moveCopiedSummaries once-only: dailysync.hl:234, updates while scanning).## Same output16 pages (/, /movies, /series, /shows, /genres, /genres/Drama, /people, /search?q=love, /search?q=tom+hanks, /person/Tom-Hanks,/series/The-Simpsons, /movies/The-Godfather, /my/shows + 2 pager URLs) fetched old vs new from a copy each, only the build hash `v=<16 hex>` and theservice-worker "at" timestamp normalised: **16/16 identical** (T9 evidence pages-old/, pages-new/). Weak spots: the `?page=N` URLs gave thepage-1 HTML on both (wrong query form), /my/shows was probably the signed-out page (cookie not accepted) — the people view order and searchindex are covered by /people, /search. No internal dump of the indexes was written.## Measurements (copy of T6 tar, jobs OFF incl. franchise seed, no .env, HL_GC_STATS=1; machine load 12–15 for old, 14–33 for the final new runs — TIMES NOT COMPARABLE, MEMORY IS)| run | first 200 | RSS at boot / 60 s later | VmHWM | GC before listening (n, pause sum) ||---|---|---|---|---|| old cold | 331 s | 14.0 GB / 14.0 GB (after pages 9.7 GB) | 17.5 GB | 46 collections, 199 s || old warm | 356 s | 12.5 GB / 0.7 GB | 14.9 GB | || new cold (iterate, first version, load 14) | 206 s | 3.9 GB / 5.9 GB after pages | 6.1 GB | 115, 73 s || new warm (iterate, first version) | 142 s | 6.5 GB / 0.24 GB | 7.0 GB | || new cold (final code, load 24–29) | 442 s | 4.5 GB / (0.02 GB, a trim moment) | 5.5 GB | || new warm (final code, load 28) | 347 s | 4.4 GB / 0.39 GB | 5.5 GB | |Peak 17.5 → 5.5–6.1 GB (-65 %), boot scan alone 117 s at load 14 (old: search 62 + shortids 41–52 + people view 75–127 + catalog = ~200+ s).RSS at 60 s swings 0.01–6 GB: the runtime returns/keeps memory in jumps (not analysed). Still 4–6 GB resident after pages.Page TTFB (3 each, ms; old cold / new first version cold / new final cold), first request then warm:/ 13 / 134 / 320 · /movies 232→11 / 368→91 / 675→180 · The-Simpsons 11.7 s→176 / 1.8 s→429 / 3.4 s→916 · Tom-Hanks 19.5 s→3.7 s / 16 s→3.2 s / 6.6 s→6.2 s · search 24 / 13 / 82.(the new runs' warm pages are slower only because of the machine load; Tom-Hanks costs 3–6 s on EVERY load in old and new — a first-load of 16–22 s: notpart 1, worth its own ticket.)## FINDING for Atlas: `iterate(null,null)` is eager, slices are not the answer hereplugins/mpackdb/mpackdb.zig find_all decodes the whole file in one native arena before the first row (confirmed), so iterate frees rows onlyafter the full decode; the peak still contains the decoded table (HWM 5.5–6 GB, the old 17.5). T10's slices.hl (range('id', lo, hi)) triedin bootscan: titles 114 s (iterate 31–35 s), episodes 141 s (30 s) — at load 24 vs 14, so partly load — and the **people pass failed**:`reading 'id': the value is Number, which has no members` at slices.hl:40 (r from range('id', lo, hi) on persons is a Number — probablyrange() answers keys/offsets or something else on that table; repro: persons table, depth 3, any slice; not minimised). Memory with slices: live290 MB, table_cap 16 M (vs 1.25 GB / 134 M), i.e. slices cut live memory by 4x — worth fixing, but slices give KEY order (the full scans gavefile order; ties in /people and search change). The proper fix is a streaming/cursor find_all in the Zig plugin (Hybriel) or a `range` that does notfail. Also: key order breaks 'same output' for ties, so each slice user must accept that.T10's note: people.hl photoQueue fetches 621 K people in one tick (needsPhoto) — unchanged here, chunk it over peopleView.ids in part 2.## Gates (step 3) — NOT FINISHEDOn the first version (iterate): kinds 32/0, franchises 53/0, browser 304 passed / 3 failed: two were mine (the log line `people view: N people, X cast photos inN ms` that tests/browser.mjs reads, and tools/count-incomplete.hl importing allShows) — both fixed in the last commit; the 3rd (cast photos"the start counted 4 photos") also reads that log line. pager was killed mid-run, franchiseseed and check-theme not run, the old tree's gates not run(load > 30). Next: `bash T9/scripts/gates.sh T9/wt new` then `… T9/old old` (ports 8710–8716 set), when the load is low; rerun browser to see 304/0.## Part 2 (jobs): find(null,null) sites leftmerge.hl:85,107,113,155,159 · backfill.hl:46,95,136 · details.hl:53 · credits.hl:111 · collections.hl:46,50,51 · franchiseseed.hl:93,237 ·dailysync.hl:234 · franchises.hl:244,351,455,470,476,482,512 · genre tables (small): catalog.hl:290, shows.hl:115,322, search.hl:251, people.hl:158.tools/ keep allShows/allEpisodes (shows.hl) on purpose.Scripts: T9/scripts/{run.sh,seq.sh,gates.sh,extract.sh}; evidence: atlas-evidence/T9/ (run-*.txt, prev/ = first-version runs, gate-new-*.log, pages-*).
Branches
Latest commits
- d2e6d26bMerge branch 'records-park55' into mainTracker
- f567f025|||PR records: park #55, no Claude workers ruleTracker
- c21aff6bMerge branch 'records-hm55c' into mainTracker
- 9ba258d3|||PR records: HM55b resultTracker
- 64f2d300Merge branch 'records-hm55b2' into mainTracker
- ae3b80dc|||PR records: HM55b briefTracker
- 7ef3cb3bMerge branch 'records-st55' into mainTracker
- fec2e080|||PR records: STATUS HM55Tracker
- 8e174918Merge branch 'records-hm55b' into mainTracker
- b1ecee57|||PR records: HM55 stateTracker
- 28eab08cMerge branch 'records-hm55' into mainTracker
- d3edaa05|||PR records: HM55 start, PROCEDURES.mdTracker
- 3059f86cMerge branch 'records-design-rule' into mainTracker
- 421a4809|||PR records: his-design rule (Apollo 2026-11-13)Tracker
- d1390692Merge branch 'records-dp75b' into mainTracker
- a4d1a7d2|||PR records: later steps checked, branch auditTracker
- e070e16fMerge branch 'records-dp75' into mainTracker
- 642b4fa8|||PR records: DP75 day62 live, AP62 briefTracker
- bfc4ea4dMerge branch 'ap62' into mainTracker
- 2c95ac46|||PR AP62: re-vendor Hybriel set day62 (source 70341ad2, bin a54f5f08)Tracker