Repository navigation
fix(view): fold repeated definition expansions in views over 10,000 nodes - #2192
Merged
Merged
Conversation
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
The shared view walkers now link the repeated-expansion counter, protection and notice machinery into the core used by layout validation. The gzipped js core grows from 7,391,901 bytes at develop 904e302 to 7,406,377, an increase of 14,476 compressed bytes. Query execution still disables folding. Plain develop 0ad055b measures 7,391,881 bytes. After integrating it, the folded build measures 7,406,375 bytes with the generated library snapshot and 5,740,214 without it under go1.27.4. Raise the core budget from 7,400,000 to 7,450,000 and record both measurements; the other artifact budgets remain unchanged.
With Go 1.27.4 and the generated library snapshot, sysml-wasm measures 11,483,242 compressed bytes on develop 0ad055b and 11,504,481 with repeated view expansions folded: 21,239 additional bytes (0.185%). Raise the combined gzip budget from 11,500,000 to 12,000,000 to leave room for further growth. Keep the engine, browser REPL and syntax budgets unchanged. Co-Authored-By: jason.han <hanhuijun@gmail.com>
After merging develop bc95b41, measure the snapshot-backed core at 7,408,199 gzip bytes (5,740,899 without the snapshot) and combined sysml-wasm at 11,505,952, against 11,480,824 on plain bc95b41. The previously recorded 0ad055b comparison remains 11,483,242 to 11,504,481 combined bytes. Only refresh the measured comments; keep the approved core 7,450,000 and combined 12,000,000 budgets and all other budgets unchanged. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…view-expansions Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # tests/wasm/combined_test.go
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Finish the fold notice before releasing render-scoped plans and definition symbols in Render and RenderExposed. Returned renderings and their clones retain only the notice and scalar fold counts. Measure threshold totals on a separate, unfinished rendering. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Share the member emission predicate with omission, size measurement and fallback definition notices. Ignore undrawn actions, included case references and members excluded from mixed structural walks. Keep tree parameters pinned before omission and exclude them from fallback definitions. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Give the rendering convention row the status marker required by validation-census, retaining the explicit distinction from a specification requirement. Co-Authored-By: jason.han <hanhuijun@gmail.com>
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
Repeated definition expansions can dominate large tree and interconnection views. Fold equivalent inherited expansions only when the unfolded expanded-node occurrence count exceeds 10,000. Activation uses memoized subtree sizes capped at 10,001 without materializing a rendered tree. Views below the threshold retain byte-identical output.
A later occurrence folds only to an earlier fully emitted equivalent occurrence expanded at least as deeply. The representative with the most remaining depth wins, with ties resolved by walk order. Own and redefined features remain. Positioned elements, edge endpoints and the ancestors needed to reach them are protected; folding happens only at complete expansion boundaries and preserves
Render().Drawn() == DrawnIn().Equivalence uses the rewrite-aware query key. Empty keys, occurrences rewritten into association lines or relationship dots, and their descendants cannot become representatives. Regressions cover connection definitions/usages, generic references typed by connection definitions, n-ary connections, dependencies and missing rewrite IDs. This builds on #2134's shared typed-expansion queries and #2178's rendered-edge parity.
A folded occurrence says:
The existing backend notice mechanisms emit:
HTML displays the notice above both SVG and source figures. The threshold remains internal, with no new CLI flag or validation diagnostic.
The two review fixes release render-scoped fold plans and definition pointers when rendering finishes, after constructing the unchanged notice, on both rendering entry points. Returned renderings and clones retain neither map, including below the threshold. Interconnection omission, expansion sizing and note fallback share the walk's drawn-member predicate, so ignored actions and other members the walk does not draw cannot inflate fold counts or produce false notices. Tree parameters remain pinned and excluded from expansion counts.
The branch integrates develop through af6ab41f2f, including #2184, #2146, #2189, #2133 and #2185.
The core compressed wasm budget increases in its own commit from 7,400,000 to 7,450,000 bytes. The combined budget remains 12,000,000, already on develop in #2187. Engine, syntax and browser REPL budgets are unchanged.
Specification basis
Repeated-definition folding, depth-dominant representative selection and the 10,000-occurrence threshold are a tool rendering convention, not a specification requirement. The pinned 2026-09 graphical notation defines no normative requirement for this policy. The rendering guide and view compliance source describe the convention without claiming specification conformance for elision. The compliance row includes the required implemented-status marker, allowing validation census and document-count checks to evaluate it normally.
How it was verified
Acceptance is on 670d7c7125, with develop af6ab41f2f as the DocGen baseline.
gofmt -l .,make lint, view/document tests, hygiene, changelog and doc-ID checks pass. The full native commandgo test -count=1 -p 2 -timeout 45m ./...passes in 1,528.698 seconds after all five required training, pilot, specification-example, library-XMI and PSSM corpus downloads, with their require variables enabled. The full tools module passes.RenderExposed, unchanged notice text, action-only and mixed members, drawn parts beside ignored actions, tree parameters, fallback names, depth dominance and protected/rewrite members. All 299 fixture views pass forced-threshold drawn-set parity.make docs-countsleave no tracked changes. Validation/notation census checks pass. Incoming generated assets come from the develop merges above.OPENSYSML_REQUIRE_WASM=1 make wasm-check.Browser REPL headroom is 17,276 bytes (0.107%) on the accepted head and 18,070 bytes (0.112%) in the detached combination.
Checklist
make lintpass locallychanges/unreleased/make docs-countsleave committed baselines current🟢 Devin Review found nothing to fix · View findings