Skip to content

Improvement: fit Elektron upgrades to the unit's limit (optimal packer, Digitone II) - #1761

Merged
repeat98 merged 10 commits into
repeat98:base/digitone-ii-nextfrom
prodbysmolec:improve/elektron-update-fit
Nov 19, 2026
Merged

repeat98 merged 10 commits into
repeat98:base/digitone-ii-nextfrom
prodbysmolec:improve/elektron-update-fit

Conversation

@prodbysmolec

@prodbysmolec prodbysmolec commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator
  • What was wrong or hard: Piece 3 of the Digitone II goal starts here. The Digitone II refuses an OS upgrade over about 2 MiB decoded: Transfer reached 99 % and the unit kept its OS (Machine: Digitone II base for OS 1.12 (from the Digitakt II base) #1760's record). The pinned kit packs the main OS with Modwerk's greedy packer, which never uses the format's offset-reuse code, so a Digitone II build came to about 2.15 MB and could not be flashed. Builds on Machine: Digitone II base for OS 1.12 (from the Digitakt II base) #1760 (and Improvement: Digitone II build path (linker profile and carried device) #1750): this branch contains their commits, so please review it after them.

  • What this changes: pack.ts gains packOptimal / packSectionOptimal: an optimal parse of the same bit format over bit costs, with the offset-reuse code (gamma 2, no offset byte). Elektron's own stock 1.12 stream uses that code about 33,000 times, and the Elekloader 0.11 image that ran on a unit 46,000 times, so the boot code depacks it. pack() is unchanged, so every recorded codec vector and every other machine's build stays the same. fit-update.ts's fitUpdate(built, stock) leaves a build within its device's limit as it is; past the limit it packs the main OS again with the optimal parse, writes and seals it with the kit's own writer, checks it with the kit's verifier and refuses it if it still does not fit. The limit is update_max in the Digitone II's device.json (0x200000, as Elekloader 0.11's profile; the unit refused 2.15 MB and took 1.92 MB), exposed as UPDATE_LIMITS beside the carried device. useDigiBuild runs every site build through fitBuilt, which returns the kit's result untouched for a device with no known limit, so only Digitone II builds can change; the Digitone II is not among the site's build machines yet, which comes with the flashing step. Tests: the optimal packer round-trips synthetic inputs and is never larger than greedy on compressible ones; the limits. Goal page row and changelog.

  • How I checked it: npm run pr:ready (Ready). On my own stock 1.12: the base image the unit refused (kit-packed, main OS 699e1698…) through fitUpdate: repacked to 2,002,808 bytes decoded (limit 2,097,152), the same main OS, the kit's verify passed; an image already within the limit comes back byte for byte. On the Digitone II base's main OS the optimal parse gives 1,247,774 stored bytes, the greedy packer 1,395,261 (Elekloader 0.11: 1,164,092; stock: 1,131,340), in about 2.5 s.
    Tested on a unit: the fitted image ed19b2f9 (base 7a60d82e + hello-marker-dn2 + hooks-check-dn2, main OS packed by packOptimal), Digitone II: Transfer sent it whole, it booted, marker and all hook bars behaved as with the Elekloader-packed image, stock 1.12 restored

  • On a unit (19 November 2026, record): the image fitUpdate packed from the refused one (2,002,808 bytes decoded) flashed with Transfer and booted on my Digitone II; its hooks behaved as before and sound was normal; stock 1.12 flashed back. So the boot code depacks Modwerk's offset-reuse stream.

  • What the guides lacked or got wrong, and where I fixed it: the goal page's flashing row says what exists and what is not wired yet; the verification record has the run of the fitted image.

🤖 Generated with Claude Code

…date limit

The Digitone II refuses an upgrade over about 2 MiB decoded, and the kit's greedy packer leaves its main OS larger
than that allows. pack.ts gains packOptimal: an optimal parse of the same bit format that also uses the offset-reuse
code, which Elektron's own packer uses and the boot code depacks; pack() is unchanged, so every recorded vector holds.
fit-update.ts repacks a build past the device's limit (device.json's update_max), writes and seals it with the kit's
own writer and verifies it, and refuses one that still does not fit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the enhancement New feature or request label Nov 19, 2026
prodbysmolec and others added 4 commits November 19, 2026 02:51
…ge offers it

Only a device with a known limit (the Digitone II) is touched; every other machine's result is returned as the kit
built it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the unit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@prodbysmolec
prodbysmolec marked this pull request as ready for review November 19, 2026 02:14
…c sweep has

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
repeat98 and others added 3 commits November 19, 2026 09:00
…ates

Fix: enforce contributor and release quality gates
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@prodbysmolec
prodbysmolec changed the base branch from main to base/digitone-ii-next November 19, 2026 08:40
@repeat98
repeat98 merged commit 4dbaf9f into repeat98:base/digitone-ii-next Nov 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants