Skip to content

perf(row-model): fuse the adopted identity sweep's verdict and key reads (+ cycle triage doc) - #534

Merged
blove merged 2 commits into
mainfrom
blove/perf-cycle-2026-08-29
Aug 30, 2026
Merged

blove merged 2 commits into
mainfrom
blove/perf-cycle-2026-08-29

Conversation

@blove

@blove blove commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

What

Two commits from the 2026-08-29/30 nightly perf cycle:

  1. Triage doc (docs/superpowers/specs/2026-08-29-next-perf-cycle-brainstorm.md): the Remaining 50k filter-settle levers: rebuild body (~19%) and residual HAMT (~12%) #490 confirmation round was aborted on regime preconditions (load 6.4–18.5, swap exhausted, VM pinning cores — no bar claimed); the inherited lever shares are flagged as pre-M2 attribution; the columnar verdict cache is closed on a ceiling argument (~1% target term); one lever survives.
  2. The surviving lever, built: under adoption (every warm keystroke — filter-only set-query above the sync gate), carryRecord paid two evaluation-cache WeakMap gets on the same key per survivor — filterVerdict looked the entry up, failed the verdictPlan guard by design, and discarded it; fillSortKeysFromPrevious looked the same key up again in the same adopted map to hit its early return. ~500k redundant lookups per 50k keystroke settle. The fused sortKeysIfPasses answers both from one get. The un-adopted lane is untouched.

Certification (load-independent — no timing claim)

New evaluationCacheLookups work counter, scoped to the identity-carry path:

  • Adopted-lane pin: exactly one lookup per swept row (10 000 at 10k). Pre-fusion it read 10 050 (10 000 sweeps + 50 survivors × 1 redundant get) — the defect, quantified. Mutation-verified: disabling the fused arm fails the pin at exactly 10 050.
  • Un-adopted control: pins 10 100 (verdict get per swept row + the fill's two gets per survivor), so a "fusion" that merely stopped counting cannot pass.
  • Old behavior survives: the verdict is still recomputed under the new plan (adopted memos still miss the guard) — pinned by the flipped visible set (the new filter keeps exactly the 50 rows the old one rejected, in unchanged order); sortKeyCarries/Evaluations stay 0 on the adopted lane.

Verification

  • row-model 719/719, grid-core 169, core 7, renderer-dom 168, react 1570/1570
  • pnpm build + pnpm api clean — zero public report drift (row-model-internal)
  • lint + prettier clean; rebased on 494e533f

Honesty notes

  • The ms payoff is unmeasured and not claimed — the machine never reached a fit regime (load 6–18 throughout). It rides with the still-owed Remaining 50k filter-settle levers: rebuild body (~19%) and residual HAMT (~12%) #490 controls-in-band confirmation round, which stays the first item for a quiet machine.
  • Correction from the triage doc's port claim: nothing was ever LISTENING on 4173 — the held sockets were dead CLOSED client FDs. Future port guards should use lsof -sTCP:LISTEN.

🤖 Generated with Claude Code

Brian Love and others added 2 commits August 30, 2026 07:49
The nightly cycle's objective 1 (controls-in-band confirmation of the
#490 arc's estimate-met 120ms bar) did not run: 1-min load 6.37 against a
<5 precondition, swap exhausted (8775M/9216M), a VM at 258% CPU, and port
4173 held by a parallel session. No bench, no trace, no bar claimed — the
arc's verdict stays estimate-met at ~116 fit-estimate.

Objective 2 is done as load-independent static analysis. Central finding:
the lever list inherited from the arc is pre-M2 attribution of a 127ms
window, and both #518 and M2 targeted the runner term since. In
particular the "~10% snapshot HAMT reads" lever looks mis-attributed —
every flat-root rows.get is viewport-sized, and the identity lane's build
path takes no store get at all.

One real candidate survives: under adoption the identity lane pays two
WeakMap gets on the same key per survivor (filterVerdict discards the
entry it looked up, then fillSortKeysFromPrevious looks it up again to
hit an early return), plus two instanceof revalidations — ~500k redundant
lookups per 50k keystroke settle. Fusing them is proposed with a
pre-registered falsifiable prediction, gated on the re-trace.

The columnar verdict cache is closed rather than deferred: it can only
cache filter-predicate evaluation, which the compiled path already
reduced to ~1% of the settle window, so its saving is bounded at ~1ms
before paying for commit-side clears. That explains the two prior flat
A/Bs rather than excusing them on regime.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…from one cache read

Under adoption (every warm keystroke — a filter-only set-query above the
sync gate), carryRecord paid two evaluation-cache WeakMap gets on the
same key per survivor: filterVerdict looked the entry up, failed the
verdictPlan guard by design, and discarded it; fillSortKeysFromPrevious
then looked the same key up in the same (adopted) map to hit its early
return, behind two instanceof revalidations. ~500k redundant lookups per
50k keystroke settle.

The fused sortKeysIfPasses answers both questions from ONE get: the
verdict is still recomputed under the new plan (the memo guard still
fails for adopted entries), the keys are the same unguarded sortKeys
read the fill's early return performed, and a lineage-miss falls back to
the fill's accessor arm with a keys-only seed. The un-adopted lane is
untouched.

Certified by a new evaluationCacheLookups work counter (counts the
identity-carry path's cache reads only): the adopted-lane pin asserts
ONE lookup per swept row (read 10_050 for 10_000 sweeps + 50 survivors
before the fusion; mutation-verified — disabling the fused arm fails it
at exactly 10_050), and the un-adopted control pins 10_100 so a fusion
that merely stopped counting cannot pass. Verdict correctness is pinned
by the flipped visible set (the new filter keeps exactly the 50 rows the
old one rejected).

Zero public report drift (pnpm api clean). row-model 719, grid-core 169,
core 7, renderer-dom 168, react 1570 — all green. The ms payoff is
unmeasured (load 18 machine) and not claimed; it rides with the owed
#490 confirmation round.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
pretable Ignored Ignored Aug 30, 2026 2:49pm

Request Review

@blove
blove enabled auto-merge (squash) August 30, 2026 14:49
@github-actions

Copy link
Copy Markdown
Contributor

Vercel preview ready

Preview: https://pretable-hbxz35j5e-cacheplane.vercel.app
Commit: 1c663151baef2545b956f76bcc8bcf4f3be23acd

Updated automatically by the deploy-preview job.

@blove
blove merged commit c4a6f5a into main Aug 30, 2026
20 checks passed
@blove
blove deleted the blove/perf-cycle-2026-08-29 branch August 30, 2026 15:06
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.

1 participant