Repository navigation
Improvement: fit Elektron upgrades to the unit's limit (optimal packer, Digitone II) - #1761
Merged
repeat98 merged 10 commits intoNov 19, 2026
Conversation
…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>
…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
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>
…ates Fix: enforce contributor and release quality gates
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.tsgainspackOptimal/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'sfitUpdate(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 isupdate_maxin the Digitone II'sdevice.json(0x200000, as Elekloader 0.11's profile; the unit refused 2.15 MB and took 1.92 MB), exposed asUPDATE_LIMITSbeside the carried device.useDigiBuildruns every site build throughfitBuilt, 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 OS699e1698…) throughfitUpdate: 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
fitUpdatepacked 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