Repository navigation
feat(sdk): split the visual renderer into compile and solve, reuse it in WASM, derive parity coverage (3b/6) - #1579
Merged
Merged
Conversation
added 6 commits
October 31, 2026 17:22
🦋 Changeset detectedLatest commit: 8b2cffa The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
🎨 Token Changes ReportTokens Changed (0)Original Branch: This comment was automatically generated by the token diff tool. 🤖 |
Contributor
🧩 Component Schema Changes ReportNo component schema changes detected.This comment was automatically generated by the component schema diff tool. 🤖 |
Contributor
Run report for 8b2cffacTotal time: 7m 53s | Comparison time: 15m 56s | Estimated savings: 8m 2s (50.5% faster)
Expanded report
Changed files |
This was referenced Oct 31, 2026
Merged
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.
Squash merge is fine; the next slice is rebased onto the result.
Description
Slice 3b of 6 from #1569, into
next/visual-recipes, now rebased onto the merged 3a (#1578). It splits the visual renderer into a compile step and a solve step, reuses compiled recipes in the WASMDataset, and adds visual parity tests that derive their coverage from the data.Renderer (
sdk/core/src/visual.rs)tokenandrelationshipbinding becomes its ranked candidates (CompiledVariant). It is the only step that needs the graph.solve) takes aCompiledVariantand a request, evaluateswhenconditions and places the parts. It is a pure function of its arguments and needs no graph.SceneCacheholds compiled variants per size and mode for one graph, so a matrix of requests compiles each recipe once.build_scene_cachedis the cached entry point;build_scenekeeps its signature and results.Datasetkeeps oneSceneCache, so repeatedrenderSceneandrenderSvgcalls reuse compiled recipes.recipe_snapshots), the new golden SVGs and the scene and SVG output. None changed in this slice.be069b50.Parity tests (
sdk/wasm/test/visual-runtime-parity.test.js)packages/design-data/visuals/. Option axes come frompackages/design-data/components/<name>.json: booleans are false/true, enums are every declared value plus unset; states come from the component's states. Free-form options useextraCases.Datasetand by the JS runtime (visual-runtime.js) and compared.sdk/wasm/test/fixtures/visual-golden/(3 scenes per component, 5 components) are checked against both engines.VISUAL_PARITY_FULL=1runs the full option matrix instead of the sample (timeout raised to 60m);VISUAL_PARITY_SITE_DIR=<dir>reuses a prebuiltdata.jsoninstead of building the site in the test (moon sets it from the new cachedsdk-wasm:site-datatask);VISUAL_PARITY_UPDATE=1rewrites the golden SVGs so a drift shows up as a reviewable diff.Related Issue
Part of #1569 (sliced under bead p6ga.9).
Motivation and Context
Recompiling a recipe on every render made scenes and SVGs slow to produce in a loop, and parity coverage was hand-listed, so a new recipe or option could be missed. Deriving coverage from the recipes and component data keeps both engines checked as the data grows.
How Has This Been Tested?
Rebased onto the merged 3a (#1578) in a clean worktree:
cargo fmt --checkandcargo clippy --workspace --all-targets -- -D warningsmoon run sdk:test sdk-wasm:test design-data:validate design-data:validate-dataset tokens:verifyLegacyOutput --force: sdk 1672 passed (2 skipped), sdk-wasm 118 passed; no snapshot, golden or legacy output changed--fail-on-warnings(8 files valid),node .github/scripts/check-ci-coverage.mjs,pnpm ai:checkgit diff pnpm-lock.yamlis emptyReview guide
sdk/core/src/visual.rs:compile_recipe,compile_variant,CompiledVariant,SceneCacheandsolve. Check thatbuild_scenestill goes through the same two steps.sdk/wasm/src/dataset.rs: thescenesfield andbuild_scene_cachedcall.sdk/wasm/test/visual-runtime-parity.test.js, thensdk/wasm/moon.yml(site-datatask) andava.config.js..changeset/wasm-visual-compile-solve.md.Screenshots (if appropriate):
Not applicable.
Types of changes
Refactor and performance change with tests; no behavior change.
Checklist: