Repository navigation
Add controlled shared-reference routing - #28
mepcotterell wants to merge 12 commits into
Conversation
Preserve logical references while sharing compatible terminal geometry under an internal policy. Add strict baseline validation, owned suffixes, lifecycle handling, native SVG/PNG coverage, and routing benchmarks. Keep historical routing as the production default pending performance acceptance and maintainer visual review. Refs #27.
Current execution statusLatest optimization — 2026-10-22 Committed and pushed at Profiling the preceding revision found repeated full-suffix scans during candidate ranking. Departure classification now stops at the first nonzero control step and is computed once per candidate; length ranking avoids computing unused bend metrics. The exact length sum, right-exit preference, candidate tie order, geometry validation, and profile cap are preserved. Matched rendered comparison Both revisions used the same complete 14-case order, original policy-switch protocol, six fresh warm-asset public creations, five warmups, and 40 repaint/full-redraw samples. Hardware: Apple M2 Pro / 32 GiB / macOS 26.7.1; Electron 44.9.3 / Chromium 152.0.7977.167; 1536 × 960 CSS pixels. Public historical initialization, policy selection, and final redraw remain included. No agent builds/tests overlapped timing; ordinary desktop/security activity was present. Earlier three-case diagnostic runs and earlier browser versions are separate evidence.
Shared high-fan-in maximum improved about 13.3% in this matched run. Both stress cases still fail 300 ms in both policies. Do not treat modest changes in the other cases as proof that their dominant costs are resolved. Representative p95 full redraw remains ≤0.8 ms independent / ≤0.7 ms shared (limit 16); dense-48 p95 is 7.8 / 7.5 ms (limit 50). The raw-sample budget checker returns nonzero for the remaining failures. Correctness and native review
Next action: profile and reduce the remaining shared-scene validation and many-group visibility-search costs, including historical initialization, while preserving the original ≤300 ms maximum for both stress cases and the existing redraw budgets. Obtain documented maintainer review of final native pairs/state examples before any separately committed default enablement. No merge, release, issue closure, or maintainer approval is implied. Agent Brief: complete remaining routing acceptanceCategory: enhancement / performance The controlled implementation and its recorded engineering verification are complete. Historical routing remains the production default. The remaining work proceeds in this order: establish trustworthy performance measurements, fix measured startup costs, obtain maintainer review of the final exports, then verify and enable production routing only after its gates are satisfied. Starting evidence and open decisions
Existing diagnostic measurements show a 48-object/108-reference fresh-layout maximum of 332.8 ms independent / 330.2 ms shared, exceeding the 300 ms requirement. Shared p95 full redraw was 13.8 ms, within the 50 ms redraw budget. Shared fan-in-48 and many-groups startup reached 2389.0 ms and 12244.9 ms, respectively. Another project's CodeQL activity overlapped collection; the amount attributable to contention is unknown. Native comparisons already demonstrate fewer heads and less sampled unique shaft paint against the same controlled independent baseline: 4 → 3 heads / 4.70% less shaft for the small scene, and 12 → 7 heads / 17.49% less shaft for the dense scene. Engineering inspection exists; maintainer paired-output approval remains pending. Work sequence1. Establish isolated performance results before changing the router
Deliverable: Reproducible raw independent/shared reports and an environment record bound to the measured source and built assets. 2. Profile startup and optimize the dominant workCollect browser profiles separately from acceptance measurements. Attribute cost to public creation, value layout/DOM measurement, baseline routing, optional shared-path planning, validation, painting, policy selection, and final redraw. Record search/candidate counts alongside time. Investigate baseline construction and repeated work first: independent/shared startup costs are similar, and the recorded Choose fixes from profiling. Candidates to examine include repeated searches for equivalent arrival geometry, repeated obstacle/reservation preparation, ownership validation, and redundant solves during initialization. Preserve full-precision clearance, exact identity, canonical ordering, deterministic work limits, conservative admission, atomic fallback, and lifecycle behavior. For each fix, retain a focused before/after profile and run relevant geometry, lifecycle, and native-export checks. If changes touch cache isolation or transaction handling, add behavioral regressions where they close a real gap, including cross-visualizer isolation or forced whole-scene rollback when applicable. Deliverable: Small reviewable performance commits with measured attribution and correctness evidence. 3. Close criterion 20 under the original protocolRebuild final assets and run the complete isolated comparison.
Keep the original policy-switch measurement as the gate. Report the initial-policy experiment separately; it cannot replace a failure under the agreed method. Report state/style transition latency separately from redraw. Stress-case decision — settled 2026-10-21: apply the original ≤300 ms maximum of six fresh warm-asset layouts to both Deliverable: Final performance report with per-case results, valid-baseline status, all samples, comparisons, environment/provenance, and the stress-case decision. 4. Publish the final visual review package and close criterion 19Generate the package from the same source/bundles that passed performance acceptance. Make it accessible to the maintainer; local ignored artifacts alone are insufficient. Include paired controlled-independent/shared SVG and PNG output for small/dense aliases, plus theme, monochrome, reduced-size, narrow-layout, emphasis, reassignment, mutation, and restoration examples. Bind the package to its commit and bundle hashes. Provide a short review task sheet:
Record maintainer approval or concrete objections in the issue/PR. Address confusing geometry and regenerate affected evidence before the final decision. Explicitly show tiny labels at 50% and the long-label narrow export that expands beyond its input container. This review supports acceptance of the drawing convention for the recorded corpus; it does not establish student-learning or universal readability/accessibility outcomes. Deliverable: Accessible, source-bound review package and a documented maintainer decision. Criterion 19 stays open until that decision is recorded. 5. Verify the final candidate, then close criterion 22After performance changes and visual decisions are settled:
After the required performance acceptance and maintainer visual approval are documented, make production enablement a separate small commit. Exercise public visualizer creation and native SVG/PNG generation with sharing selected by default, including startup through that actual default path. The default-path measurement supplements the original acceptance protocol. Retain a straightforward way to revert the default. Record the final acceptance decision, update the issue checklist and PR description, and make this PR ready for review when the gates are complete. Deliverable: Final acceptance record bound to the enabled commit, passing applicable checks/CI, and explicit closure evidence for criteria 19, 20, and 22. Constraints
Starting points
|
Batch value sizing to avoid repeated table layout, construct fixed object rows directly with literal field text, and reuse collision and visibility-search work without changing route selection. Retain exact validators and the historical production default. Add broad-phase, sizing, and untrusted-field regressions. Refs #27.
Retain raw benchmark samples, timestamps, and geometry signatures. Add a reproducible 31-pair native SVG/PNG review package with provenance and publish it from the JDK 25 PR job. Keep maintainer visual approval and stress startup acceptance explicit before production enablement. Refs #27.
Reuse scene-scoped geometric checks for large owned cohorts, bound common quadratic corner lengths analytically, and preserve lazy departure validation. Keep exact ownership and clearance checks and preserve all 28 measured controlled route geometries. Apply the 300 ms fresh-layout limit to both stress cases with a raw-sample budget checker. Historical routing remains default because the stress gates are still unmet.
Profiling showed candidate sorting scanning full suffixes to recover departure direction and computing unused bend metrics. Determine the first nonzero control step once per candidate and calculate only the length needed for ranking, preserving its sum and tie order.
|
This work now depends on PR #29 — Separate layout coordination from connector routing: #29. PR #29 starts from Existing source-to-object semantics, the 300 ms stress limits, native visual review, and historical production default remain in force. Coordinator extraction alone does not establish a performance improvement or close acceptance criteria 19, 20, or 22. GitHub's native issue-dependency API rejected a pull request as a dependency target ( After each of the five plan steps, PR #29 will receive a completion comment with results, decisions, verification limits, and records carried forward. |
Keep measured-scene routing pure and coordinator-owned repair, rollback, and final paint. Preserve controlled sharing, indexed graph queries, both review packages, and the original performance acceptance protocol. Add source integration assertions without running them. Source integration only: generated bundles retain the coordinator baseline and require a parent-owned rebuild. No tests, builds, type checks, Java, browser, or benchmarks run in this checkout.
Merge dfaa8db as an actual ancestor, retaining transaction-local complete-candidate reuse and both upstream canvas regression cases. Resolve the planner call with controlled-policy forwarding. Keep generated bundles at the original coordinator baseline pending the parent's combined-source rebuild. No runtime validation performed in this checkout.
|
The coordinator prerequisite is implemented in PR #29, and its source is integrated into dependent PR #28. Current pushed heads are coordinator All five research/design/implementation/verification steps have comments on PR #29. The step-5 record contains the complete results, all 14 controlled cases, fresh stress samples, native-output differences, immutable evidence heads, and limitations. The acceptance brief is updated. The coordinator runtime passes 686 Python tests with 100% coverage, 300 frontend tests, and 34 Java examples / 415 images. Combined runtime CI passes 693 Python tests with 100% coverage, 367 frontend tests, examples, and both native review packages. The final commits change only two research-note statements. Final-head CI for PR #29 and PR #28 has now passed both JDK 21/25 jobs, builds, wheel checks, examples, and native artifact generation. PR #29 is ready for review; PR #28 remains draft. Acceptance is unchanged: criterion 19 needs documented maintainer review. Criterion 20 still fails the original maximum-of-six 300 ms startup gate: independent/shared fan-in-48 is 422.1/411.3 ms, and many-groups-12x4 is 1596.2/1559.2 ms. Dense-48 and the redraw budgets pass; all 28 controlled baselines are valid. Criterion 22 stays held, historical routing stays default, and PR #28 stays draft. No main merge, release, issue closure, or maintainer approval is implied. |
Depends on: PR #29 — Separate layout coordination from connector routing. This PR targets
mepcotterell/layout-coordinatorand contains that head as an ancestor.Summary
Repeated reference shafts and arrowheads can crowd a shared target. Controlled terminal-path sharing preserves each source's identity, dot, complete logical route, description, and interaction behavior while painting accepted shared intervals and heads once.
The integrated coordinator owns placement, measured geometry, bounded repairs, rollback, canvas allocation, and final paint. Routing remains pure over scene data. Optional sharing cannot move objects or degrade member routes to create a merge. Independent stack/global and heap strategy seams preserve the existing placement policies. Includes regenerated bundles, lifecycle/export regressions, benchmark tooling, and both native CI review packages. Refs #27.
Evidence
Coordinator integration and current acceptance — 2026-10-22
PR #28 now depends on PR #29 — Separate layout coordination from connector routing. Its base is
mepcotterell/layout-coordinator; the coordinator is also an actual ancestor of the combined source. Current pushed heads: coordinator9b9eebe4b61ac9df5b8b276b3a5f53b635d370d4, combined routing01eb6cfd684fa243ea8030bdf45ae88ffc7cb640. See the complete step-5 verification record.Criteria 19, 20, and 22 remain open. Historical routing remains the production default. The coordinator separates measured-scene routing from resizing, movement, bounded repair, canvas allocation, rollback, and paint. Independent stack/global and heap models retain the legacy placement policies. Global rearrangement and temporal optimization remain future proposals.
Current controlled performance
All 14 cases ran under both controlled policies using the original policy-switch protocol: six fresh public creations with warm assets, historical initialization, policy selection, font readiness and final redraw; five warmups; 40 repaints and 40 full redraws. Apple M2 Pro / 32 GiB / macOS 26.7.1, Electron 44.9.3 / Chromium 152.0.7977.167, 1536×960. No agent test/build/native-capture process overlapped timing. Browser-fetched bundle hashes matched clean runtime revision
c688db7adc28e74139d6bed98ff3113578d7d755. The final two-file documentation-only merge changes no runtime/input/test/bundle bytes.Both added stress cases still fail under both policies. The unchanged raw-sample checker exits 1 for these four failures. All 28 controlled baselines are valid and restored-state path checks pass. Representative full-redraw p95 is ≤1.1 ms independent / ≤1.2 ms shared (limit 16); dense-48 is 9.6 / 11.3 ms (limit 50). State/style transition measurements remain separate. No elapsed-time cutoff or initial-policy result replaces the original acceptance protocol. This run does not establish a broad performance improvement over the preceding feature revision.
Correctness and native review
c688db7passes the production build and 367 frontend tests in 27 files locally. Its completed CI run passes JDK 21/25, 693 Python tests with 100% coverage over 2,094 statements, frontend tests/build, wheel checks, and 34 Java examples / 415 images on JDK 25.cycle-defaulthas subpixel differences under both policies. The new coordinator native before/after comparison also has measured pixel/route differences; policy preservation does not imply pixel equality. Maintainer visual approval remains pending.7271983separately passes 686 Python tests / 100% coverage, 300 frontend tests, 9 focused native/navigation tests, and 34 Java examples / 415 images. Its main-only 11-case comparison is separate evidence: dense-48 maximum 222.8 ms and redraw p95 15.8 ms. It cannot substitute for the controlled stress gates above.Final-head CI is complete and successful: PR #29 /
9b9eebeand PR #28 /01eb6cfpassed Markdown, lint/types, JDK 21/25 frontend builds/tests, Python tests/100% coverage, wheel checks, and JDK 25 examples. Final counts are 686 Python / 300 frontend for the coordinator and 693 Python / 367 frontend for the combined branch. Each JDK 25 job produced 415 images across 34 examples. Linux CI reports 2,094 covered statements; the coordinator's local macOS result above reports 2,091. Release jobs were skipped.Downloaded final-head review artifacts are available: coordinator, combined coordinator, and combined shared references. The manifests record clean CI merge refs
588fb5b20bbae6f09f75318da914d4d4758db517andbaec40b0630363268bfcae29eb7783a0810192bb. All 74 coordinator, 76 combined-coordinator, and 35 shared-package input hashes match the current respective working-tree files; both coordinator manifests pass all seven checks and the shared package records 31 valid-baseline pairs. CI artifacts are separate captures and are not claimed pixel-identical to local macOS output.Earlier local runtime evidence retains its original immutable revision and is not relabeled as a new capture.
Next action: review the native before/after/state examples and record the maintainer's source-to-object traceability decision for criterion 19. Continue targeted profiling and reduction of high-fan-in and many-group startup work, including historical initialization, until both policies meet the original 300 ms maximum. Criterion 20 remains failed and criterion 22 remains held. No main merge, release, issue closure, default enablement, or maintainer approval is implied.
Merge Danger
Door: two-way
Historical routing stays the production default. This PR remains draft while visual review and stress startup gates are open.
Blast Radius: rendering
Placement coordination, route planning/painting, reference lifecycle and native exports are affected. Preserved policy is not a claim of pixel-identical output; review the recorded native differences.