Skip to content

Observer caches decoded claim rows, so a ping decodes only what moved - #4778

Merged
trissim merged 1 commit into
mainfrom
claude-laptop/observer-row-cache
Nov 15, 2026
Merged

trissim merged 1 commit into
mainfrom
claude-laptop/observer-row-cache

Conversation

@trissim

@trissim trissim commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Row-level decode cache, superseding #4777's window-level one. A ping re-decodes only the row(s) that moved, not the whole changed window. Key is the raw join row (pure decode), so any change re-decodes; consumption/responses/inputs read fresh. One decode-count assertion loosened == 1 -> <= 1 (the row cache may reuse a row decoded for another viewer; own.rows below proves scoping). Suite: 112 passed, 0 added over baseline 3. Installed measurement to follow.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XbFMSnLEc51gw21bLFFRK1

#4777 cached a whole window's decode, keyed by (root, selection); it removed the
per-thread fan-out but still re-decoded the one window a ping changes in full,
leaving the observer child at ~5.1% median per ping (at the 5% target, not under).

Cache the decode at the row instead: a decoded (claim, evidence) keyed by its raw
join row. Decoding a row is a pure function of it, so a ping re-decodes only the row
or two that actually moved; every unchanged row across every window reuses its decode.
This subsumes the window cache (and drops the root threading it needed): the key is the
whole raw row, so a change to any of claim, triage context, queue pointer or published
response is a different key and re-decodes. Consumption, bus responses and stored
inputs are still read fresh each pass, so nothing displayed goes stale. Bounded to the
most recent rows (LRU).

One test loosened: test_a_read_selects_only_its_viewers_claims_and_attempts_before_decoding
asserted exactly one _decode_row call per viewer read; with a shared row cache the
viewer's one row is already decoded (the test's prior AllOutcomes read warmed it), so
it decodes none. Loosened `== 1` to `<= 1`, which still catches a read that decodes more
than its own rows; the `own.rows ==` assertion below already proves the viewer gets
exactly its own row.

Notification + observation suite: 112 passed, zero added over main's baseline of 3.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XbFMSnLEc51gw21bLFFRK1
@trissim
trissim merged commit f530f2e into main Nov 15, 2026
1 of 3 checks passed
trissim added a commit that referenced this pull request Nov 15, 2026
Revert #4778 (row-level decode cache): no gain over #4777's window cache
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