Repository navigation
Observer caches decoded claim rows, so a ping decodes only what moved - #4778
Merged
Merged
Conversation
#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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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