Repository navigation
fix(viz): the first rung's delta sits past the introduction it would cross - #590
Conversation
cf1b1cc to
1f2a36a
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
The change is correct and well-tested per static review, but it is a GUI layout fix whose visual result (and the EXPECT_TESTS=224 whole-graph pin) can only be confirmed by a live just viz run and the viz test harness, which cannot be executed here.
0 open findings
What changed in this PR
This PR fixes #588 in the viz power-curve view (src/viz/Curve.roc). On the first rung, three window introductions (best ever, previous window, this window) are drawn 14px to the right of the rung, while the rung's signed delta label sat 10px right at the midpoint of its two dots. When the two bests were close (≈40W apart at minimum window height), the delta's box vertically overlapped an introduction and the texts overprinted. The fix adds a pure helper delta_x_beside that, for the first rung only, pushes a delta whose 10-tall box crosses an introduction box to 6px past the widest one it crosses, leaving it at the usual 10px-right position when it crosses none. This mirrors the last-rung collision fix (#586). Every other rung's placement is unchanged.
Changes:
- Added
delta_x_besideplus anintro_box/introscomputation on the first rung, and a per-rungdelta_xclosure that routes the first rung through the new helper and all others through the existingdelta_left_x. - Applied
delta_xat both delta draw sites (the record/PR branch and the non-record branch), binding the delta'stopso the box's vertical extent is known. - Bumped the two viz coverage pins in
tools/roc-viz.sh(EXPECT_TESTS 223→224, EXPECT_VIZ_ASSERTS 258→264) to cover the one added expect block (5 continuation lines).
| File | Description |
|---|---|
| src/viz/Curve.roc | Adds first-rung intro collision boxes and delta_x_beside, routes both delta draws through a delta_x closure, and pins the behaviour with a new expect covering crossing one/two/none and the box boundary. |
| tools/roc-viz.sh | Bumps the two viz assertion/test-count pins to account for the single added expect block. |
Notes from verification (no action needed): the intros collision boxes (lines 155-157) use conditions identical to the actual introduction draw conditions (lines 109-117), so the delta only avoids introductions that are actually rendered; all six expect cases compute correctly; and the pinned assertion count resolves to exactly 264 via the gate's own grep.
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
1f2a36a to
8c9e481
Compare
4bf3113 to
0aa6328
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
The target fix is a correct, well-tested GUI label-layout change whose visual result needs a live just viz run to confirm, and it is presented atop the large inherited #568 platform migration that must merge and rebase first.
0 open findings
🧠 Review effort: Balanced
0aa6328 to
1a685b8
Compare
1a685b8 to
9f917b0
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
This is a GUI-layer rendering change whose final visual correctness can only be confirmed by a live just viz run, and the integration geometry (delta-vs-label box placement) is not directly unit-testable, so it warrants human sign-off.
1 open finding
🧠 Review effort: Balanced
9f917b0 to
3cf5d16
Compare
Fixes #588. The first rung carries the three introductions 14px right of it and its delta at the midpoint of its two dots, each placed from its own value alone, so when the two bests were within about forty watts the delta crossed an introduction, and when they were within a few the two introductions crossed each other. The introductions are now laid out in the order of the dots they name, each pushed below the one before it when the two would cross, and the delta moves up or down to the nearest edge that clears them (and, on a record, the pr label), keeping its x so it never reaches the second rung. Rungs beyond the first are unchanged.
3cf5d16 to
5566e51
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
The core fix is GUI label geometry whose visual correctness (no overprint across real window heights) is reachable only through the render path and can be confirmed only by a live just viz run, which cannot be verified automatically.
0 open findings
1 resolved since last review
🧠 Review effort: Balanced

Fixes #588.
The first rung carries the three introductions (
best ever,previous window,this window) 14px right of it, and its delta at the midpoint of its two dots, each placed from its own value alone. When the two bests were within about forty watts the delta's box crossed an introduction, and when they were within a few watts the two introductions crossed each other, and the texts overprinted. The introductions are now laid out in the order of the dots they name (Curve.layout_intros), each pushed below the one before it when the two would cross, so the labels always read in the dots' order; the delta then moves up or down to the nearest edge that clears every placed box (Curve.top_clear), and on a record at the first rung theprlabel too, keeping its x so it never reaches the second rung. The draw reads the same laid-out list the delta avoids, so the two cannot drift apart. Rungs beyond the first are unchanged.Proof: expects pin the layout for a window best a few watts above the previous (
this windowfirst,previous windowunder it), three bests within a few pixels (best, this window, previous window stacked), labels that do not cross keeping their offsets, and a single label; mutants (no push, no sort, sorted by label instead of dot) each fail them.top_clearis pinned for a box crossing one placed box (to the nearer edge), two stacked boxes (the nearest edge clearing both, in either order), none, with none placed, touching an edge exactly on either side, and a tie resolving to the edge below; mutants (first clear edge wins, last wins, either boundary made non-strict) each fail them. viz expects 227 at pins 227/279. Live, against a copy of the current database with the previous window's 5s best planted fourteen watts under this window's:this windowsits under its blue dot,previous windowunder it beside the grey dot, and the delta above both at the blue dot's level, where the previous build overprinted all three. Reached by the render only: the wiring of the laid-out list into the draw, and theprbox in the record case (the data has no record at the first rung).just check, viz-check, viz-test, skill-shapes, blob-safety and command-claims all 0 on the 2026-09-27 nightly;just e2e(1261) andjust e2e-syncgreen on the branch over main (the CLI is untouched), re-running on this head.