Skip to content

fix(runtime): pin the Native SDK wrap-budget fix for content-sized labels - #75

Merged
SunkenInTime merged 1 commit into
masterfrom
agent/text-wrap-measure-seam
Sep 4, 2026
Merged

SunkenInTime merged 1 commit into
masterfrom
agent/text-wrap-measure-seam

Conversation

@SunkenInTime

@SunkenInTime SunkenInTime commented Sep 4, 2026 •

Copy link
Copy Markdown
Collaborator

Defect

Content-sized <text> labels at fractional positions wrapped their last glyph: "Star" / "t" on the pomodoro's main button, "fixtur" / "e" in noro-signal's source label, chip labels in the pomodoro mode row. Reproduced at master on the macOS headless capture path.

Root cause

Geometry pixel snapping rounds each frame edge on its own, so a label sized exactly to its measured text can lose up to one whole device pixel at render time. The Native SDK's wrap budget (textWrapMaxWidth) only handed back half a pixel. Receipt from instrumentation: a 34.77px "Start" paragraph sat at x = 92.62, snapped to [93, 127] (34px), and wrapped against a 34.5px budget.

Earlier hypotheses (CoreText measurement APIs disagreeing, ulp drift between intrinsic sizing and the line breaker) were measured and ruled out: both CoreText APIs agree to the ulp on the bundled Geist face.

Fix

  • fix(canvas): hand back a full snap pixel to the wrap budget SunkenInTime/native#33 hands back the full pixel (1/scale) and adds a regression test that replays the receipt through a mock measurement provider for both a plain label and a span paragraph; it fails on the old budget with two emitted runs.
  • This PR pins that commit (464ff65f) in runtime/native-sdk and the release audit.
  • test/fixtures/text-wrap places five exact-fit labels at fractional positions; the capture smoke asserts one laid-out line per text node for it and for noro-signal.

Verification (macOS, Zig 0.16.0)

  • Native SDK: zig build test and zig build test -Dwidget-profile=true pass on the pinned commit.
  • Weaver: npm run typecheck, npm test (fail 0), node cli/test/example-surface-smoke.mjs, npm run test:capture, npm run audit:release all pass with the rebuilt runtime.
  • Captures: text-wrap fixture 5 lines / 5 text nodes, noro-signal 15 / 15, pomodoro 8 / 8 (previously 8 / 4, 16 / 15, and 10 / 8).

Note: the fork PR is still open; the pin references its branch commit, matching how 9a499f16 was pinned before its merge.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

…bels

Content-sized <text> labels at fractional positions wrapped their last
glyph ("Star" / "t" in pomodoro, "fixtur" / "e" in noro-signal). Geometry
pixel snapping rounds each frame edge on its own and can shave a whole
device pixel off a label sized exactly to its text, but the Native SDK's
wrap budget only handed back half of that. SunkenInTime/native#33 hands
back the full pixel; this pins that commit (464ff65f).

test/fixtures/text-wrap places five exact-fit labels at fractional
positions, and the capture smoke asserts one laid-out line per text node
for it and for noro-signal, so a regression shows up as line count, not as
a pixel diff someone has to notice.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Sep 4, 2026

Copy link
Copy Markdown

Greptile Summary

This change pins the Native SDK text-measurement correction and adds coverage for labels whose width is exactly their measured text.

The release audit rejected a real alternate Native SDK commit and passed after the reviewed commit was restored. The new Text Wrap fixture compiled and rendered with five text nodes and five layout lines.

T-Rex validation blocked

The Noro Signal capture could not run on this Linux host because the required weaver-widget runtime is supported only on Windows and macOS. Its checked-in line-count assertion remains in place, but its rendered result needs verification on a supported native host. Configure VMs

Confidence Score: 4/5

The dependency pin and the dedicated exact-fit label fixture behave as intended in the available native runtime.

The release guard was exercised in both rejection and acceptance paths, and the new fixture rendered with one layout line per text node. The Noro Signal assertion could not be executed on its supported native renderer in this environment.

Files Needing Attention: Run test/capture-smoke.mjs on macOS or Windows to observe the Noro Signal line-count assertion with the production native widget runtime.

T-Rex T-Rex Logs

What T-Rex did

  • Validated the tracked Native SDK revision against the release-audit guard, switched the SDK worktree to an alternate revision which caused the audit to fail, and then restored the reviewed revision so the audit passed and the gitlink was confirmed.
  • Rendered the Text Wrap fixture with the portable runtime and observed five text-layout lines and five text nodes; the fixture TypeScript check passed, while the broader smoke command stopped earlier due to an unrelated image assertion.
  • Inspected the Noro Signal line-count assertion and its text-node counting helper; the capture could not start because the native widget runtime was not built, and Linux-only native runtime building is unsupported, so no native Noro Signal image or line-count result was produced.
  • Before capture, a git detach checkout produced a mismatch and exit code 1 for the audit attempt; after capture, the detached checkout matched the expected commit and the audit passed with exit code 0, confirming the gitlink.
  • Rendered evidence shows the Linux portable render produced a Text Wrap output with all five labels visible, and notes that Linux uses the portable linux-headless-estimator and cannot prove platform-native visuals; native rendering is macOS-only and no broad review was performed.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "fix(runtime): pin the Native SDK wrap-bu..." | Re-trigger Greptile

@SunkenInTime
SunkenInTime merged commit ab20771 into master Sep 4, 2026
9 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.

1 participant