f2eb56c6bbde1300dddc402861b59cd4e45e0215
3
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
f2eb56c6bb |
usage: a first start pairs the history a few weeks at a time, not at once (#2278)
With no sums on disk (a first install, or a version that counts rows
otherwise), the page's cells, the heatmap's days and Codex's effort
before the cut were built from one pairing of the whole history. Every
gateway block was priced, every session row's message id went into one
set, and every call into one match map. On the owner's history that
was ~212 MB of the warm-up's 341 MB in use and the cold start's peak.
coldSpans builds them as a day's start advances them (pageAdvance),
14 days at a time. A span pairs the chunks with a row from heatReach
before it to heatReach after. Each chunk's oldest row is kept by its
serial. A gateway block not priced yet is priced by a pricer of the
span alone, and its rows go back to the pool after the span. The
recent days are then paired as on any kept start.
The page's cells come out in another order (by span, then chunk), so
TestSettledCountedAsVersioned now sorts them before it hashes. The
sorted hash is the same for a pairing at once and in spans, so
settledCountVersion stays. Tests that count a pairing of every chunk
use pairAtOnce (coldSpan 0).
Run on mote at the pushed head (rebased on
|
||
|
|
f45c3c96b6 |
usage: a day's first start advances the kept sums from the last cut, not a pairing of all history (#2278)
The page's cells, the heatmap's days and Codex's effort before the last
days are kept on disk (page-v1.json, heat-v1.json, effort-v1.json) under
a key that names the cut, today minus two days at midnight. The cut moves
each midnight, so each user's first start of a day found none of them,
and paired the whole history again three times. On the 240k-row bench
history that peak was 506-538 MB, against 235-325 MB for a start of the
same day.
Each file now also holds the cut and since its sums were counted at.
When the current key misses, the file's sums still stand if the key at
their own cut is the same: the chunks are split again at that cut, named
as heatSettledKey names them, and compared with the file's key. Then
only the chunks of the days since that cut are paired. The rows between
the two cuts are added to the kept sums, and the sum is written under
the current key. The heatmap also drops days before a since that moved
forward a week. A full pairing is left for a first install, a raised
version, or a settled chunk that changed.
settled_version_test blanks a page's cut and since, as it blanks its key
and at. They say when the cells were counted, not how, so
settledCountVersion stays at 1. Files written before this commit have no
cut, so the first day change after the upgrade still pairs everything
once.
Run at 9cd9cfed0 (rebased on
|
||
|
|
fb3aef575b |
usage: settled days are kept across an upgrade that counts them the same (#2278)
The settled summaries (heat-v1.json, page-v1.json, effort-v1.json)
were keyed by requestDiskBinary, which hashes this package's source.
14 of the last 39 releases changed that source. After each of those
upgrades, every user's first start paired the whole history three
times (page, heatmap, Codex effort), and that is the cold start's
footprint peak.
heatSettledKey now names the counting by sessions.CallCacheVersion and
a new settledCountVersion constant. requests-v1.bin and the gateway
log's disk file still use requestDiskBinary, so a session file is
still read again after any source change. Only the pairing is kept.
TestSettledCountedAsVersioned is the guard. It runs a cold page,
heatmap and effort build over a fixed fixture in UTC: five Codex calls
with their gateway calls, cache reads, five efforts, an unmatched
Claude call with cache writes, and a 500. It hashes what the three
files keep, with keys and times stripped, and compares the hash with a
golden value. A change that counts a row differently fails it until
settledCountVersion and the golden are raised together. It guards only
what the fixture reaches.
Run on mote at this tree (rebased onto
|