Repository navigation
Floor: carry a tier-served value's content hash once per run; a fresh claim context reads it by instance - #13361
Merged
Merged
Conversation
…ontext reads it by instance Each floor claim runs in a fresh InterpContext whose content-hash memo is empty, so the first call in each claim that took a tier-served value (or a part of it, e.g. a prepared grammar's prepared_exprs) as an argument re-hashed the whole value natively: a per-claim cost proportional to the served value's size, outside the step budget (calm-tern-13, wise-ant-549, tidy-raven-393's 0b89edf vs b72b994 cost diff). The hash reads only content and process-canonical spellings, so it is a fact about the instance: it is now computed once at publication into CROSS_CLAIM_SERVED_HASH_MEMO and consulted by Rc pointer, used only while the allocation is alive (the tier retains it for its lifetime). Instance identity is the join, never a digest; serving still verifies arguments, so the memo decides only the cost of a key. Cleared with the tier. Control: a_fresh_context_keys_a_served_value_and_its_parts_without_rehashing. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…r's justification Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Acceptance (confirming run, by tidy-raven-393): probe floor #13362 = #13168 at 22ea598 merged with this PR at 1d89f4e, run 37269059307. Floor lane passed with 0 BLOCKING.
Against the stated prediction:
The clippy len_zero red in that run came from this PR's test and is fixed at 8c23239. — sent from royal-deer-478 |
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.
Follow-up to #13043, as sequenced by sharp-raven-357: the eval-memo half of the served-instance registry.
Defect (chain, DESIGN section 6b)
The cross-claim tier hands every claim the SAME served instance by
Rcclone (#13043). But each floor claim runs in a freshInterpContext, and that context's content-hash memo (eval_recompute_hash_memo, keyed byRcpointer) starts empty. So the first call in each claim that takes a served value, or a part of one (a prepared grammar'sprepared_exprs), as an argument walks and hashes the whole value natively. That costs zero eval steps, scales with the served value's size, and is paid once per claim.Measured independently by wise-ant-549 (the first argument-taking call is ~200 ms, field access is not, and the cost moves with call order), calm-tern-13 (191-225 ms served into a fresh context vs 26-27 ms when the claim built the value in its own context) and tidy-raven-393 (#13168 floor 0b89edf vs b72b994: same steps, and the cost outside
parse_module_prepared_measuredwent from ~85 to ~287 ms per eval as the grammar's fill grew 4x).The earliest unjustified link is the hash's home. It reads only content and process-canonical symbol spellings (
Symbol(&'static str)), so it is a fact about the instance, not about the context. It was being re-derived per context.Repair
CROSS_CLAIM_SERVED_HASH_MEMO: at publication (store_cross_claim_pure_memo), the served value is hashed once, root and every composite inside it.eval_recompute_memo_get: every memo read ineval_recompute_value_hashand the push/insert key extensions checks the frame's own memo first, then the served memo.Rcpointer and only while the allocation is alive. The tier retains every served value for its lifetime, so the pointer cannot be reused while the entry stands, and the hash read is exactly the one a walk would compute.eval_call_memo_args_match).clear_cross_claim_pure_memos).gunbc.cross_claim_pure_share_seed_growth.Structural prediction (stated before the confirming runs)
parse_module_prepared_measuredstops scaling with the grammar's fill size, back to roughly 85 ms or less from ~287. calm-tern-13's served-into-fresh-context pair drops from ~200 to ~26 ms. Grammar overlap: validation refuses every overlap row; required zero-count floor claim; retire the parse residue #13126's six margin claims come under 302 ms.These magnitudes are estimates. Missing one falsifies the estimate, not the diagnosis; a contradicting structural result (steps or verdicts moving) falsifies the reading.
Evidence
a_fresh_context_keys_a_served_value_and_its_parts_without_rehashing:cross_claim/eval_recompute/servedunit tests pass remotely. The one failure in that filter,stage_execution_joins_the_plan_to_independently_observed_effects, fails identically on clean main: it refuses on BuildBuddy's unreadable host budget by design.🤖 Generated with Claude Code