Repository navigation
fix(class): keep every multiplicity and role at its own end - #593
Merged
Merged
Conversation
Sol's library build lost two of five samples on data accuracy, and three on the class-drawn check, after #588: Member to Reservation runs straight up in one run, the "reservations" role found no spot clearly its own line's at Reservation, and walked down that run until it stood just above Member. A multiplicity or role now only takes a spot beside its own end: its middle within 110 units of the end's tip (the class-drawn check's reach) and the line's other tip half again as far off as its own, and 8 units further. That also keeps a self-loop's labels out from between its two runs. With no spot both beside its end and clearly its own line's, it stays beside its end, and the placements run again keeping room for labels; one that reads at most 5% longer than the placement it replaces may now take over. The class fuzz gains the end invariant: main misplaced 17 end labels across the 240-model full run and 74 across eight more seeds, none now. On those eight seeds, 8 labels whose room would cost crossings now stand at their end but nearer a neighboring line (81 findings on main, 12 now). Across the 100 saved class builds from the evals, three scenes change, each only in that one end's labels, and each now passes the class-drawn check. The renderer test checks every class fixture, and a new fixture and story carry Sol's build. Fixes #589
Contributor
Sketchi Excalidraw Workspace PreviewStatus:
|
Contributor
Sketchi Eval Harness PreviewStatus:
|
Contributor
Sketchi Playground / Studio PreviewStatus:
|
Contributor
Sketchi Icons PreviewStatus:
|
Contributor
Sketchi Web PreviewStatus:
|
This branch was successfully 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
Class diagrams keep every multiplicity and role at its own end. After #588, Sol's
library-system-class-v2build put thereservationsrole at the Member end of Member → Reservation instead of the Reservation end. The judge failed 2 of 5 samples on data accuracy, and 3 failed theclass-drawncheck (relationship-12 to role).Why it happened
Member → Reservation is a single vertical run, so the end's "first run" is the whole line. At the Reservation end, no spot was clearly attributed to that line, so the role walked down the run until it found one. That spot sat just above Member: 185 px from its own tip, 62 px from the other. The same walk misplaced end labels before #588 (23 in the full fuzz run); #588 changed which models hit it.
Change
class-diagram.ts): a multiplicity or role only takes a spot beside its own end. Its middle must be within 110 units of the end's tip (the same reach as theclass-drawncheck), and the line's other tip must stand at least half again as far off, and 8 units further, by fix(class): set every class label clearly on its own line #588's attribution rule. This also keeps a self-loop's labels out of the space between its two runs. When no spot is both beside its end and clearly on its own line, the label stays beside its end and fix(class): set every class label clearly on its own line #588's label-room retry runs. That retry may now take over when it reads up to 5% longer than the placement it replaces; before, it could not read longer at all. Without that, retries that cleared every label at equal routing quality were rejected for aspect changes like 2.78 → 2.79.reservationsstays at Reservation.classStressFixtures.memberReservationsholds Sol's actual build, shown in Storybook asDiagram Types/Class › Roles At Their Ends.Evidence
class-drawnfailuresPreview replay (
pr-593-sketchi-studio): I replayed all 40 round-30 class builds (Sol and Sonnet, every v2 class scenario) against prod and against this preview.reservations, 167 px from its own tip and 14 px from Member's. The preview misplaces none, and neither has a label nearer another line.class-drawnfailure.Before/after PNGs are in
/home/anandpant/Development/shpitdev/sketchi/.memory/r30-slices/589-png/:before/,after/: local headless resvg exports of main and this branch, for Sol's r30 build (sol-library-c7ac.png), the new fixture, and the three changed corpus builds.prod-replay/,preview-replay/: real PNGs from prod and from the preview for the three affected Sol samples, plus one Sol observer and one Sonnet library build, with the grade and end-check outputs.Verification
pnpm ci:localpasses.pnpm nx run diagram-excalidraw:class-fuzz(full: 240 models, 120 text-fit rounds) passes.pnpm nx affected -t test-browserpasses.Fixes #589