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
- 6bb7c20estatus: window 2026-11-09mre
- 5db84974Log: Apollo window GO, AP56b started, BS1 copy removedmre
- e84586a7Mission AP56bmre
- 15917f03Record PR workflow rule (gitoria#50)mre
- 942ac995status: paused workers statemre
- 44b934e5log: respawn cleanupmre
- 03a80097Log: Anton GC A/Bmre
- c7cdef62Log: Apollo STOP, workers pausedmre
- d0c083fbLog: usage stopmre
- c6d464e5Log: Apollo GO backlog, AP56 and BS1 startedmre
- 1eb6f1a1Missions AP56, BS1mre
- 4871f8adLog: AP52 live on day52, browser gate greenmre
- d9bf2988Merge ap52: day52, tracker#58 server argument, #51 modal close rule, #56 keyed season rowsmre
- c4a60ef2Log: RT52 retest passed, AP52 startedmre
- 83760a55Browser gate: search results belong to the address form of the typed text (tracker#52 navigate replace)mre
- 6e951d91AP52: show-page rows are keyed records; closing a season is one upsert and removes (tracker#56, hybriel#331)mre
- 3bb4ccddAP52: modal close button refers to its nested rule with Style.buttonModalX (tracker#51, hybriel#333)mre
- ba16933fAP52: login callback and title route are static handlers taking the server as third argument (tracker#58, hybriel#332)mre
- 85153900AP52: re-vendor Hybriel set day52 (source 77cfca31, bin 0a8ed496)mre
- 7c051eddLog: hybriel#338 answermre