Skip to content

amyboard: add Display.hline/vline and document the display drawing API#1062

Merged
bwhitman merged 1 commit into
mainfrom
claude/frosty-moser-d153fa
Jun 30, 2026
Merged

amyboard: add Display.hline/vline and document the display drawing API#1062
bwhitman merged 1 commit into
mainfrom
claude/frosty-moser-d153fa

Conversation

@bwhitman

Copy link
Copy Markdown
Collaborator

What

  • Add hline(x, y, w, col) and vline(x, y, h, col) to the Display class in amyboard.py, as thin forwards to the underlying framebuf (which supports them natively) — matching the existing line/rect/fill_rect primitives.
  • Enumerate the full set of Display drawing methods in the sketch-generator system prompt (amyboardworld_db_api.py) so the model only uses methods that actually exist.

Why

The sketch generator AI naturally reaches for display.hline(...), which the Display class did not expose, producing a runtime crash:

AttributeError: 'Display' object has no attribute 'hline'

hline/vline are trivial framebuf forwards, so implementing them is more robust than telling the model to avoid them. The expanded prompt guidance lists the exact drawing API surface (fill, fill_rect, rect, line, hline, vline, pixel, text, scroll) and notes there is no circle/ellipse/print, so the model stops inventing methods.

Rollout notes

  • The amyboard.py change ships in firmware — it takes effect once an AMYboard is reflashed/upgraded.
  • The prompt change takes effect on the next Railway deploy (auto on push to main) and immediately stops the generator from emitting unsupported calls, covering older firmware too.

🤖 Generated with Claude Code

The sketch generator AI naturally reaches for display.hline(), which the
Display class did not expose, raising AttributeError at runtime. Add hline
and vline as thin forwards to the underlying framebuf (which supports them
natively), matching the existing line/rect primitives.

Also enumerate the full set of Display drawing methods in the generator
system prompt so the model only uses methods that exist.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🔌 AMYboard PR preview

Editor + flasher: https://amyboard-pr-1062.vercel.app/editor/

This preview bundles this PR's firmware — its flasher only flashes this build (not the release). Rebuilt on every push; removed when the PR closes.

The hardware CI has been kicked off and should return within a few minutes, stand by!

@github-actions

Copy link
Copy Markdown

🌷 Tulip Web PR preview

Tulip Web: https://tulip-pr-1062.vercel.app/run/

Flash a Tulip to this build: on-device run tulip.upgrade(pr=1062).

Rebuilt on every push; removed when the PR closes.

@github-actions

Copy link
Copy Markdown

🎛️ HW CI (physical bench)

AMYboard (USB-MIDI + AMY zP → audio): ✅ PASS — flashed this PR’s firmware; all checks matched the references.

Tulip (TULIP4_R11; serial-REPL audio + WiFi screenshot): ✅ PASS — flashed this PR’s firmware; all checks matched the references.

⬇️ Artifacts: recordings · screenshot · serial logs · run logs

Self-hosted bench. Audio spectral-compared to ref/hwci_basic.wav + ref/tulip_basic.wav; Tulip screenshot pixel-compared to ref/tulip_screenshot.png. Both analog outs share one capture card, so the tests run sequentially.

@bwhitman bwhitman merged commit 6d7b3f9 into main Jun 30, 2026
3 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