d3fc6f2bfada18e6ae7887b79ed1e4c650ca37e1
3
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
cb167fcbd8 |
usage: CodexModelEffort's allocation bar is a packed row a call, not a visit (#2278)
TestCodexModelEffortLetsUnrelatedCallsGo held a build of
CodexModelEffort to a visit of the log and a half. Since
|
||
|
|
1313b047f5 |
usage: a Codex thread's model and effort are read through the request index
CodexModelEffort, which the Sessions list asks for, read the ledger again on every build: sessions.AgentCalls(since, "codex") opened all of Codex's shards (12k rollouts, 15.6k shards on the reporter-sized sandbox) after any new call, beside the Requests page reading the same files into its own index (#3493). It now reads through the request index as a page does: readRequestBlocks (moved out of queryPage), the page's pairing and visit (pairedRows, moved out of buildRequestBlocksOf), and the sums added row by row as they are visited (effortSums), so a build after a call reads only the files that changed, and the first of the Sessions list and the Requests page reads them for both. The LogCalls path still builds from codexEffortRows. The visit's row is one per visit now: as a returned closure's local it was moved to the heap, one allocation a row, which TestRequestPageAppendDoesNotRepriceHistory caught (10890 allocations over 8000 records against 2000). Measured before the rebase onto |
||
|
|
227b864a45 |
usage: CodexModelEffort keeps only the gateway calls a Codex session file's call can be matched to (#2776)
CodexModelEffort built the whole ledger of the period and kept the rows
that carry a Codex thread. Every gateway call became a Record (in
gatewayRecords' slice), a packed row (gatewayMatchesDetails' chunk) and
a priced Row (ledgerMatched), all held at once, though only a gateway
call paired with a Codex session file's call by its response id can
carry a thread. On the 720k-call sandbox this build was 7.6 GB of the
start's 18 GB allocated and most of its peak.
codexEffortRows visits the log once and keeps only the gateway calls
with a response id, request id or session (native, else magpie's) that
one of the session files' calls has, or an agy call when one is agy's.
No other gateway call can change gatewayMatchesDetails' answer: the
request-id match looks up only the locals' ids, the fallback groups are
looked up only by the locals' sessions, and a response id's uniqueness
is counted over every call that has it, all of which are kept. Only the
paired calls are priced into rows, and the rows are the whole ledger's
thread rows in the same order, so the sums (floats included) are the
same.
TestCodexEffortRowsAreTheWholeLedgers compares the rows with the whole
ledger's for All, Today and 7d, with Codex's reader and every agent's:
a pair by response id, an ambiguous response id, a session-and-tokens
match, a call two days old, and unrelated calls around them. With the
session test dropped from matchingRecords by hand it is red (all,
every agent: the session-matched call shows as a row of its own).
TestCodexModelEffortLetsUnrelatedCallsGo builds over 3000 unrelated
gateway calls and allows a visit of the log and a half. With the old
build put back (LedgerOf): red, 18,347,128 bytes against a visit's
1,198,680. With the fix: 1,321,824 against 1,321,744.
720k-call sandbox, cold start, the four first asks together, back to
back (load 48.7 then 14.7, so the times are not comparable; the memory
is what this measures):
before (beb9c40d5): peak RSS 4411 MB, heapSys 5513 MB, live 574 MB
after: peak RSS 2427 MB, heapSys 2413 MB, live 542 MB
manage?agent=codex answered in 41.5 s before, 23.1 s after.
Full suite on this series' final tree (aa678b482 before this note was
added), rebased on origin/main
|