Repository navigation
resolve.h: IdentityNarrower class walks take their state explicitly (FILE-PILE stage A) - #837
joyful-ii-V-I wants to merge 3 commits into
Conversation
…FILE-PILE stage A) The ancestor walk (step 2) and the subclass dispatch walk (step 3) shared hidden members: keyScope was built by one method and read as the input of another, hits was the output channel of eight methods, and classWalk held first the nameable classes and then the walk frontier. - ClassLevelWalk (level, next, seen, hits) owns the walk state and is passed as a parameter to every step that changes it; forEachLevel is the one level loop both walks use. The instance stays IdentityNarrower scratch. - memberKey builds "Class::callee"; the key is an explicit parameter of appendOwnedDefinitions / appendSpecializationDefinitions. - inheritedDefinitions / subclassDefinitions return the memoised answer instead of copying it into a shared buffer; nameable and nameableHits each hold one thing. Output-neutral by construction (same visit and insertion order). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ey now explicit parameters) Seven IdentityNarrower helpers gain a ClassLevelWalk& (or the key) in place of the hidden members they read and wrote; every caller is in the same struct and updated in the same commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…name collision) portablebuildcheck #7 resolves a range-for's callee by name; a new by-value queue() made src/backhops.h:841's m_back.queue().putsIn() read as a range-for over a temporary's member. Rename only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
CI round 1: the 7 failing jobs were all portablebuildcheck #7. It resolves a range-for's callee by name, so the new by-value |
|
@coderabbitai review |
Action performed
|
FILE-PILE dogfood, stage 1a:
src/resolve.hIdentityNarrowerclass walks (stage A only). This is a readability refactor and should not change output.Cause
The cause is shared state. The ancestor walk (step 2) and the subclass dispatch walk (step 3) passed their inputs and results through
mutablemembers:keyScope("Class::callee") was built byvisitAncestor/appendClassDefinitionsand read as the real input ofappendOwnedDefinitions/appendSpecializationDefinitions.hitswas the output channel of 8 methods.classWalkheld the nameable classes first and the walk frontier later.Change
ClassLevelWalk(level, next, seen, hits) owns the walk state. Every step that changes it takesClassLevelWalk&explicitly.forEachLevelis the one level loop that both walks use. The instance is still IdentityNarrower scratch, reused across the resolve loop as before.memberKeybuilds the key. The key is now an explicit parameter.inheritedDefinitions/subclassDefinitionsreturn the memoised answer directly instead of copying it into a shared buffer. It stays valid until the nextnarrow, the same contract as before.nameableandnameableHitseach hold one thing.Not in this PR: stage B (Narrower's
fieldWalk/ guarded walk twins). It waits for lane/d3-swappable, and this diff stays off its hunks.Numbers
--deps/map md5, cold and warm, on envoy/cockroach/vscode: 12/12 SAME.history_unread/churnflip, going in both directions. That is the git-history read being cut off under load. None of these repos is C-family, and Rule 2 class identity only runs on C-family code.--deps/map md5 + peak memory), requested in M2_TO_M5_1127_RESOLVE_CANARY.md.inheritedDefinitions,subclassDefinitions, which start a walk on the owned scratch). 8 methods now take the walk explicitly.api-surfacecontract-change rows gated. Each is a parameter that replaces a hidden member, on private helpers of one struct, with all callers updated here. They are acked in.ripwire_quality_acks.paramsrows remain.Blind review
An Opus high reviewer was given only the diff and the file: no scores, no brief. Verdict: BETTER.
nameable,nameableHits,ClassLevelWalk) each say what they hold.forEachLevellambda plus the capturedansweredflag, andmemberKey's shared buffer.markVisited, and a note on thememberKeyaliasing.🤖 Generated with Claude Code
Summary by CodeRabbit