суббота, 10 октября 2026 г.

A mountain of AI math, a few precious bytes

Co-authored by Phillip Torrone and Mikey Sklar.

We once had a Trinket M0 build fail because the firmware was eight bytes too big. A lot of our CircuitPython build optimization is handling all the error strings and their translations. That is the scale we work at now folks, and now we have a way to keep getting more bytes.

OpenAI released 722 math manuscripts, so we wanted to see whether any of that work could give us a little more room on a board. The company hasn’t disclosed that collection’s dollar cost. We do have some numbers from its earlier work.

462 AI agents: 722 OpenAI math papers read, 8 with any use, 1 trick used; 1,854 Adafruit repos scanned, 253 problems flagged, 54 confirmed in source
One afternoon of agents: the OpenAI papers on one side, Adafruit’s own repos on the other.

September’s separate Navier–Stokes effort ran “on the order of 10,000 concurrent agents” and produced approximately 130 billion output tokens. The result arrived after about 88 hours, then took another 17 hours to formalize in Lean. The estimate is that it cost “millions of dollars,” according to Axios.

Those output tokens would cost about $6.5 million at GPT-6 Astra’s current base rate of $50 per million output tokens. That’s a retail-price comparison though, and OpenAI used a different, unreleased model, and its internal costs likely differ. Inputs, training and other expenses are excluded. That comparison describes September’s effort; the October collection’s cost is still undisclosed. But does the math have any uses?

Good question! We found a connection with overlap packing. The equation is simple: STRAWBERRY + BERRYPIE = STRAWBERRYPIE. When possible, store shared bytes once. Across 51 GFX fonts, our packer saved 3,865 bytes, about 2.1% of bitmap data, with identical rendering. Ordinary greedy packing delivered those savings, soooo the new mathematical bound added nothing in our initial examples. Ah well – BUT WAIT!

Overlap packing stores shared bytes once: STRAWBERRY plus BERRYPIE becomes STRAWBERRYPIE; an Uncanny Eyes eyelid map shrinks from 16.4 KB to 6.3 KB
The one OpenAI math idea we used: store shared bytes once.

The paper “A Polynomial-Time 2-Approximation for Shortest Common Superstring”, sent us looking in a useful direction, even though the savings came from an existing technique.

My March article about Eric Lengyel’s SLUG renderer led into type, image and animation experiments that helped lead to CircuitPython Turbo. Studying GPU techniques gave us some ideas for small CPUs.

One month, three people, a lot of flash back

Mikey’s roundup covers 17 flash-related pull requests merged from September 10 through October 10, 2026:

  • Mikey Sklar: 3 merged PRs. Stronger ESP32-C5/C6 message compression and smaller printf and USB-name code on tiny boards. Sources: #11528, #11543, #11546.
  • Dan Halbert: 7 merged PRs. Storing qstr strings in one blob, smaller ulab operators, tighter translations, and SAMD code savings, with Dan directing, measuring and reviewing Claude’s work. Sources: #11369, #11373, #11403, #11404, #11407, #11410, #11537.
  • Vladimír Smitka: 7 merged PRs. Smaller mDNS and AES code, removing RP2040 time-zone code, recovering a Pico W linker gap, and trimming float helpers, fonts and property objects. Sources: #11365, #11371, #11379, #11533, #11534, #11535, #11536.
Flash PRs merged Sep 10 to Oct 10, 2026: Mikey Sklar 3 merged, Dan Halbert 7 merged, Vladimír Smitka 7 merged
Who freed what, September 10 to October 10, 2026.

Reported savings, board by board

Stacked bars of separate PR-reported savings: ESP32-C6 14.4 KB, Pico W 10.0 KB, Metro M4 8.9 KB, Pico 6.5 KB, Trinket M0 3.3 KB, and ESP32-C5 2.9 KB. Colors identify Mikey Sklar, Dan Halbert, and Vladimír Smitka. The hatched 4.1 KB on Pico W is recovered linker capacity. Totals combine different builds; Trinket includes a 204-byte sibling-board proxy. One KB is 1,000 bytes.
Chart research and original graphic by Mikey Sklar. Redrawn from the PR-reported figures for this article.

These bars add the before-and-after numbers reported in individual PRs. They are not a fresh build measuring the whole month’s combined gain. Revisions and configurations differ: the ESP32-C6 total combines TinyC6 and Feather C6 results, and the Trinket M0 total includes a 204-byte measurement from the related Feather M0 Basic. The ESP32-C5 bar uses the measured Russian-language firmware result, 2,928 bytes, rather than the 3,672-byte translation-generator estimate. Here, 1 KB means 1,000 bytes.

The hatched 4,096 bytes on Pico W are reclaimed linker capacity, not a smaller firmware image. These are space savings; some changes trade speed for size, including #11403‘s ulab operators. Open PRs #11527 (certificate bundle) and #11548 (UARTLogger II) are excluded as of October 10.

We thought the big wins were used up. Then Smitka found Daniel Engel’s hand-written Thumb-1 math routines, first proposed in 2018 and still unmerged. With Smitka’s float helpers already merged, our five-board report shows Engel’s routines freeing about 1.8 KB more per board. Tested float multiply/divide loops took 18% less time on Feather M0; one conversion got slower. We emailed Engel offering help getting it upstream.

Count the extra space once

Of the 2,972 bytes reported saved by Engel routines versus the original GCC library, 1,172 bytes were already saved by shared float helpers. Replacing those helpers therefore implies 1,800 additional bytes. This compares reported measurements, not a new build.
Engel comparison adapted from Mikey Sklar’s original graphic, with the overlapping savings separated.

For Trinket M0, the report gives 2,972 bytes saved by Engel’s routines. The shared helpers in #11536 had already saved 1,172 bytes. Replacing them gives an additional 1,800 bytes by comparison, rather than adding another 2,972 on top. This compares reported measurements with different baselines; it is not a new combined-build measurement.

We went off looking in some AI mathematics data dumps, and ended up helping get a human’s eight-year-old assembly code into use. I’ll take it.

Think of this like CERN’s particle collider… an enormous instrument for discovering how the universe works, with findings shared beyond the laboratory. Mathematics are in undiscovered territory, we don’t make it, we discover it. These systems help explore it, once the results are checked and shared, people far from the original project can use them.

Credit the discovery (who cares who found it, it was always there)…how to do more is where it’s at. Then let’s compete over who makes it useful to the most people. Pair mathematicians with engineers on the front like of bytes squeezing or whatever. Share the paper, the code, the failed experiment.

And if some of that work helps the firmware fit, we’ll use it to make CircuitPython better and better.

related



from Adafruit Industries – Makers, hackers, artists, designers and engineers! https://ift.tt/1U3KStw
via IFTTT

Комментариев нет:

Отправить комментарий

Know us

Our Team

Tags

Video of the Day

Contact us

Имя

Электронная почта *

Сообщение *