Skip to content

Commit 9468a24

Browse files
committed
docs(P-036): address Codex review — SCC-level cache keys, span re-projection
Two P2 review points on the "Incrementality and caching" section, both accepted: - Recursive SCCs: per-method keys that embed callee summary hashes are circular inside a recursive component (A's key needs B's cached summary and vice versa). The cacheable unit for a recursive component is now the SCC itself, keyed by the members' local inputs plus dependencies OUTSIDE the component — reconstructible bottom-up over the acyclic condensation. Cross-member hashes are validated after load, never used for lookup. - Evidence spans: a semantic body hash survives pure line movement while cached spans go stale. Cache hits reuse semantic effects and evidence structure only; spans are re-projected from current frontend facts at diagnostic time (the existing "formatting is a projection" rule), i.e. a cached span is valid only with the source-map version it was minted against. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015de4MezSeUnZBoWq1fFU5M
1 parent 3373763 commit 9468a24

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

‎docs/proposals/P-036-interprocedural-semantic-architecture.md‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,27 @@ callee summary dependency hashes
627627
configuration/profile hash
628628
```
629629

630+
Two consequences of that key shape must be designed in rather than discovered
631+
in production:
632+
633+
- **Recursive SCCs cache at SCC granularity.** Inside a recursive component,
634+
each member's callee dependency hashes include the other members, so
635+
per-method keys cannot be reconstructed before some entry is retrieved. The
636+
cacheable unit for a recursive component is the SCC itself: its key derives
637+
from the members' local inputs (body hashes, signatures, domain/config
638+
versions) plus the dependency hashes of summaries *outside* the component —
639+
all reconstructible bottom-up over the acyclic condensation. Per-method
640+
entries inside the component stay locally addressable; their cross-member
641+
dependency hashes are validated after loading, never used for lookup.
642+
- **Evidence spans are a projection, not cached truth.** A semantic body hash
643+
deliberately survives edits that only move code (inserting lines above an
644+
otherwise unchanged method), but source spans captured in cached evidence do
645+
not. A cache hit may reuse semantic effects and evidence *structure* (stable
646+
IDs and edges); the spans rendered to users are re-projected from the current
647+
frontend facts at diagnostic time — the same "formatting is a projection"
648+
rule the evidence section imposes. Equivalently: a cached span is valid only
649+
together with the source-map version it was minted against.
650+
630651
Changing a leaf method invalidates:
631652

632653
1. its local CFG/summary;

0 commit comments

Comments
 (0)