Skip to content

perf(resolve): seed the dictionaries once per session, and log where each resolve's time goes (#1429) - #1493

Merged
athvin merged 1 commit into
mainfrom
perf/1429-single-core
Nov 30, 2026
Merged

athvin merged 1 commit into
mainfrom
perf/1429-single-core

Conversation

@athvin

@athvin athvin commented Nov 30, 2026 •

Copy link
Copy Markdown
Owner

Closes #1495

Part of #1429. #1429 stays open until er-dev measures p95 under 300 ms.

Post-merge is part of this pull request. The ledger below records whether
the follow-up work actually happened. /land-pr closes it.

What

  • Dictionaries seeded once. A persistent ResolveCache seeds the nickname lexicon and ignore-words tables once per content hash, instead of dropping and re-inserting them on every call.
  • Per-call timing.
    • er_cli logs one resolve timings event per call: seed, standardize, prefilter, prepare, predict, select, total, plus corpus_candidates (the corpus rows the prefilter kept).
    • er-server logs resolve inputs loaded: the time to read the model, config and dictionaries, and the dictionary sizes.
  • Benchmark threads. resolve_latency_at_scale runs single-threaded by default (ER_RESOLVE_THREADS) to match the 1-CPU web-api pod.

Why

After #1482, er-dev resolve was p50 1660 / p95 2015 ms, with the pod pinned at about 0.8 of its 1-CPU limit. Single-threaded, the local 520k benchmark runs p50 260 / p95 282 ms. So er-dev's extra ~1.4 s is something only production has. The prime suspect is the per-call dictionary reseed: those tables are tiny in the fixtures and large in production. The timing events confirm or rule that out on the next pass, without another round of guessing.

Proof

Risk & rollback

  • Dictionaries: a dictionary change on disk changes the hash and reseeds.
  • Logging: two info events per resolve call.
  • Rollback: git revert <merge-sha>.

Post-merge ledger

Closed by: unclosed

  • main is green with this change on it — the merge SHA, and the run
    that proves it. A later head SHA with this commit as an ancestor counts;
    a cancelled run with zero jobs does not:
  • images built, or correctly never ran because nothing that goes into
    an image changed:
  • deploy converged — proved by a line the running process emitted, not
    by the image digest and not by the workflow conclusion:
  • the push-only surface no pull request can pre-test (deploy, drift,
    kind's nightly leg) is green, or knowingly red for a reason that is not
    this change:
  • the board card reached Done through the automation rather than by
    hand, and the issue closed:
  • follow-ups are open for everything deferred here — numbers:
  • what was learned is written down where the next session will find it
    (a skill, a reference, memory) — or nothing new was learned:

Specific to this change

  • er-dev resolve latency and the resolve timings breakdown from the web-api logs, 55 calls on p3live:

🤖 Generated with Claude Code

…each resolve's time goes (#1429)

After #1482 er-dev resolve was p50 1660 / p95 2015 ms (pod at its 1-CPU limit).
Single-threaded, as that pod runs, the local 520k benchmark is p50 260 /
p95 282 ms. So er-dev's extra ~1.4 s is something only production has. The
prime suspect is the dictionaries: every call dropped and re-seeded the nickname
lexicon and ignore-words tables, which are tiny in the fixtures and large in
production.

- A persistent ResolveCache seeds the dictionaries once per content hash.
- er_cli logs one 'resolve timings' event per call (seed, standardize,
  prefilter, prepare, predict, select, total, and the corpus candidates kept).
  er-server logs 'resolve inputs loaded' with the model, config and dictionary
  load time and the dictionary sizes. The next er-dev pass shows where any time
  remains.
- resolve_latency_at_scale times single-threaded by default
  (ER_RESOLVE_THREADS), matching the pod.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@athvin
athvin merged commit e1b7ef0 into main Nov 30, 2026
43 of 44 checks passed
@athvin
athvin temporarily deployed to marketing-preview November 30, 2026 07:33 — with GitHub Actions Inactive

This branch was previously deployed

1 inactive deployment
marketing-preview — 630e39ab Deployed Nov 30, 2026 by athvin via remove closed PR previews #192
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resolve: per-call dictionary reseed and no phase timings on er-dev (#1429 follow-up)

2 participants