Repository navigation
fix(view): share typed expansions in layout drawn-set queries - #2134
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
This branch has not been deployed
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.
What and why
Layout validation materialized complete view trees just to determine which elements were drawn. After #1224 correctly expanded typed usages through their definitions, widely shared definitions multiplied those occurrences: a TMT diagnostic reached 1,000,000 nodes for 32,726 distinct elements in 132 seconds, despite the existing depth bound.
Renderer.DrawnInnow shares equivalent expansions in a query-only DAG, retaining owner, qualification, recursion barriers and remaining-depth coverage. Condensed member-graph reachability, effective-member and geometry caches, and guarded edge traversal avoid repeated work. Identity generation also caches metadata membership positions and identity annotation sites rather than rescanning metadata-heavy scopes. Full rendering retains its existing expansion and output; no rendering fold or size guard is introduced.Why shallower-depth reuse is safe
Drawnrecords view-wide semantic presence by element/relationship origin and owning declaration, not a separate result for every rendered occurrence. A cache entry is installed only after that walk completes, and reuse requires the same symbol, owner, qualification and reachable active recursion barriers in the same view. A previously completed shallower occurrence has at least as much remaining depth as a later deeper occurrence. Any additional descendants carried by its reused query node therefore already have a full-render witness at that shallower occurrence, with the same semantic owners; attaching that node deeper cannot introduce an element absent from the full view's drawn set. This argument concerns the union of drawn elements, not occurrence-by-occurrence diagram equivalence. Reuse in the opposite direction is prohibited: a cached deeper walk cannot satisfy a shallower request, which must expand with its larger remaining budget.Rendercontinues to build each occurrence independently at its actual depth.How it was verified
go build ./...,go vet ./...,gofmt -l .(empty),go test -timeout 45m ./...(135 passing packages),make lint, hygiene, document-ID and changelog checks pass. The repository timeout replaces the default 10-minute package timeout.TMT validation
Default validation was previously stopped after 20 minutes at about 10 GB RSS. Two unloaded query runs finish in 1m29.37s and 1m35.35s, with 7.42–7.91 GiB maximum RSS, exit 0, 0 errors and 254 warnings. This remains above the approximately one-minute target. The earlier pre-#1224 bisect baseline was about 51 seconds; a later unloaded
1ac2af4593rerun on the bisect input took 7.30 seconds and produced identical diagnostics. The old implementation also omits the typed expansion introduced by #1224.1ac2af4593, bisect inputdiagram-layout-unplacedbound-feature-typesname-conflictsubsetting-multiplicityOn the identical bisect input, 112 diagnostics are unchanged. All 10,016 removed name warnings were import collisions at
exposestatements, retired by #1635. The 55 added type warnings concern integer values bound toditSetup : second, covered by the feature-value conformance check from #1621. Two tree Route warnings disappear becausemodeandstatenow draw relationship edges; three interconnection Layout warnings concern declared ports that the current full rendering does not draw as standalone nodes. The query matches full rendering on all four TMT views containing these five layout changes. The fresh input additionally reports 35 sequence Layout warnings, 32 sequence Route warnings and 17 inheritedselfname conflicts; these are existing migration/sequence behavior, outside this change.TMT HTML documents
-render-documents <dir> -doc-form html, capped at 30 minutes, terminated with SIGKILL/exit 137 after 14m11.52s at 29.94 GiB RSS. Temporary measurement-only progress logging records all 104 plans evaluated without errors, 46 HTML documents completed in memory, and termination during HTML generation for TMT-SE How to Add an new Observation Workflow Document. The remaining 57 HTML documents were not reached. The set writer commits only after generating the complete set, so no files were committed. The Workflow document's IR evaluation alone took 474.00 seconds. Full-render memory growth remains a known limitation.The three other large documents complete when rendered individually, each capped at 30 minutes and exiting 0 with an HTML document rather than an error page:
Individual timings include loading and checking the model; they are not isolated HTML-formatting times. The bulk run did not reach these documents' HTML phase.
Checklist
make lintpass locallychanges/unreleased/🟢 Devin Review found nothing to fix · View findings