Skip to content

fix(viz): the first rung's delta sits past the introduction it would cross - #590

Merged
eschizoid merged 1 commit into
mainfrom
fix/first-rung-delta
Oct 7, 2026
Merged

eschizoid merged 1 commit into
mainfrom
fix/first-rung-delta

Conversation

@eschizoid

@eschizoid eschizoid commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

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 the pr label 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 window first, previous window under 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_clear is 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 window sits under its blue dot, previous window under 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 the pr box 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) and just e2e-sync green on the branch over main (the CLI is untouched), re-running on this head.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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_beside plus an intro_box/intros computation on the first rung, and a per-rung delta_x closure that routes the first rung through the new helper and all others through the existing delta_left_x.
  • Applied delta_x at both delta draw sites (the record/PR branch and the non-record branch), binding the delta's top so 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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

@eschizoid
eschizoid force-pushed the fix/first-rung-delta branch from 0aa6328 to 1a685b8 Compare October 7, 2026 21:25
@eschizoid
eschizoid changed the base branch from chore/toolchain-bump to main October 7, 2026 21:25
@eschizoid
eschizoid requested a balanced review from Copilot October 7, 2026 21:25
@eschizoid
eschizoid force-pushed the fix/first-rung-delta branch from 1a685b8 to 9f917b0 Compare October 7, 2026 21:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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

Comment thread src/viz/Curve.roc Outdated
@eschizoid
eschizoid force-pushed the fix/first-rung-delta branch from 9f917b0 to 3cf5d16 Compare October 7, 2026 21:33
@eschizoid
eschizoid requested a balanced review from Copilot October 7, 2026 21:33
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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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

@eschizoid
eschizoid merged commit f092a20 into main Oct 7, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

power view: the first rung's delta overprints the window introductions when the two bests are close

2 participants