LVGL Renderer Speedup

Make LVGL's software renderer draw hidden UI scenes in fewer RISC-V instructions, with every frame byte-identical to the original.

16 h per attempt8 vCPU · 16 GBExpert estimate 8 hPublic grader

Results

Every model's 8 attempts with web search over a copy of the web frozen at October 1, 2026, on the scale that runs from the task's baseline at 0% to its ceiling at 100%.

Each dot is one modelMean of 8Best of 8

Artifacts

What the top model on this task, by mean score, built.

The task

Make LVGL's software renderer draw hidden UI scenes in fewer guest instructions. The starting point is LVGL v9.6.0 in a baseline configuration, built as bare-metal RV32IMAC firmware for QEMU's virt machine with a 320×240 RGB565 display and one timer pass per 33 ms frame. Only LVGL's source tree and its configuration header are collected; the harness, the UI script that builds each scene, bundled libraries, linker script and compiler flags stay frozen. Every frame must match the baseline's byte for byte. Code plus read-only data may be at most twice the baseline's size, data plus bss (heap and framebuffer included) at most 16 KiB above it, and the stack at most 22 KiB. The code may add no inline assembly or sections, runs only from the firmware image and boot ROM, and uses only RV32IMAC and Zicsr. The build gets 900 s and each scene run 300 s. The agent gets 91 public dev scenes from the same families, with baseline counts and a scorer that runs the grader's code.

Trajectories

Step through all 112 attempts from the pass@8 sweep with web search over an October 1, 2026 snapshot: every turn, tool call and submission. The best reward was 71.2%, by Gemini 4 Argon on attempt 8. The results above come from these runs.

Failure analysis

Gemini 4 Argon averages 0.418 across its 8 attempts. Three attempts changed pixels in a graded scene and scored 0. Most of Argon's failures come from not testing large late rewrites on any new scenes, and from keeping a smaller memory heap after seeing it make draws fail.

Didn't test its large late rewrites on any new scenes: 25.0 points, found in 2 of 8 attemptsKept a smaller memory heap after seeing it make draws fail: 12.5 points, found in 1 of 8 attemptsImage scenes stayed slow, as in every attempt of every model: 11.3 points, found in 3 of 8 attemptsSpent late hours on tiny tweaks instead of the biggest remaining slow spots: 9.4 points, found in 2 of 8 attemptsScored: 41.8 points, mean reward 0.418 58.2 points lost
  1. Didn't test its large late rewrites on any new scenesFound in 2 of 8 attempts25.0
  2. Kept a smaller memory heap after seeing it make draws failFound in 1 of 8 attempts12.5
  3. Image scenes stayed slow, as in every attempt of every modelFound in 3 of 8 attempts11.3
  4. Spent late hours on tiny tweaks instead of the biggest remaining slow spotsFound in 2 of 8 attempts9.4
  5. ScoredMean reward 0.41841.8
Gemini 4 Argon's 8 attempts, 100 points in all: each attempt is worth 12.5 points, and the points an attempt lost count toward its main failure.

Example failure analysis

Attempt 5 · reward 0.000 · Didn't test its large late rewrites on any new scenes

It knew hidden scenes come from the same scene code as the public ones, but checked about 1,200 lines of late drawing rewrites only on the public scenes; a hidden scene broke.

What it did
It reached public S of about 3.6. Between submission 15 at 14.4 h and submission 16 at 15.8 h it rewrote border, shadow, fill, gradient, glyph, line, mask and image-transform code (8 files, 1,225 lines added). With about 12 minutes left it made one more pass on image recolour helpers. Each version passed all 91 public scenes and none was checked on new scenes. A hidden scene differed from the very first frame, with no failed allocations.
What would have worked
Record frames for newly generated scenes with the grader's record command and check the late rewrites on them, or stop rewriting near the deadline. Which change broke the scene is not known; passing attempts also made large late changes.
Evidence
  • Step 184It became clear to me that all the hidden scenes are generated by this *exact same* `/opt/lv/kit/app.c` file
  • Step 11698 files changed, 1225 insertions(+), 300 deletions(-)
  • Step 1171can I squeeze in *one more* clean optimization pass in `lv_draw_sw_transform.c` within the remaining 6 minutes?

Why it is hard

LVGL is one of the most widely used GUI libraries on microcontrollers, and on a chip without a GPU its software renderer sets the frame rate. Version 9.6 is already tuned. Every frame must stay byte-identical, so anti-aliased edges, soft shadows, gradients, translucent layers and rotated images must come out the same to the last bit: a change in blend order or rounding fails the run. Eight seeded families of scenes cover lists, dashboards, charts, text, windows, images, keyboards and mixed apps, many with moving, fading overlays that cast shadows, and a change that helps one family can do nothing for another. The closest public work, such as the Pixman and Skia blitters, does not plug into LVGL's draw pipeline.

How it is graded

The verifier builds the firmware offline and runs each hidden scene, drawn from the same eight families as the dev scenes, in a fresh QEMU 10.0.13. A plugin outside the guest counts every guest instruction and checks the execution rules; the frozen harness is not charged, and counts are exact, so a regrade repeats them. Bi is the baseline's instruction count over scene i's frames, and setup instructions above the baseline's are charged to the scene. A run stopped at 5 times the baseline's instructions gets Si = 0.2. The unmodified tree scores 0, a geometric-mean speedup of 6.64× scores 1, and breaking any rule on any scene scores 0, even a single wrong byte in one frame.

Si = min(Bi ÷ Ci, 50), with Ci = frame instructions + max(0, setup − baseline setup)
reward = clamp(ln S ÷ ln 6.64, 0, 1), where S is the geometric mean of Si

Anchors

AnchorRewardScoreMeaning
Floor0.0000%What a missing, invalid or rule-breaking submission scores
Baseline0.0000%The untouched starting point
Ceiling1.000100%The best result the metric allows
Regrade tolerance± 0.001Results closer than this tie

Environment

Domain
Software · Systems
Shape
Scaffolded
Agent time
16 h per attempt
Hardware
8 vCPU · 16 GB
Expert estimate
8 h
Task ID
lvgl-speed