Skip to content

Fix: the module-memory check counts base 0.8's larger module record; pool readings on a 0.8.2 twin - #2284

Merged
repeat98 merged 3 commits into
mainfrom
fix/module-pool-readings-1126
Nov 26, 2026
Merged

repeat98 merged 3 commits into
mainfrom
fix/module-pool-readings-1126

Conversation

@repeat98

Copy link
Copy Markdown
Owner

Fix: the module-memory check counted 16 to 32 bytes too few per module on base 0.8. Players won't notice anything: the 768 KiB pool doesn't change, and a set is now priced exactly as the 0.8 loader takes it. This also unblocks the Mini Verb 0.2.4 (#2027), Euclid 0.1.6 (#1868) and Repitch 0.2.2 (#1866) releases. Each of them dropped the pool test below its ten measured packages.

What works: module-set.ts now sizes the loader's per-module record from the base's site events. Six rolled-back pool readings on the owner's MKII, on a twin of today's base 0.8.2, equal the corrected extent byte for byte: Mini Verb 0.2.4 3,424 bytes, Euclid 0.1.6 10,480 bytes and Repitch 0.2.2 2,720 bytes, each read twice. The 21 November readings, taken on base 0.7, still match their own layout of 736 bytes.
What is broken: nothing known.
Who must act: nobody. The owner asked for the readings and this record on 26 November 2026 ("do (b)"), and it merges on green.
On a unit: yes. Twin 46c30886a7e8f3f6… of base 0.8.2 (build_core.py with the beta flags and --dev, built from main 48f4a9b9c), RAM-booted. Six npm run device:price -- --memory --readings 1 trials, every one rolled back, with the inventory empty afterwards.

Why

loader.h's runtime_module has 9 bytes for each hook: hook[], order[] and runtime_dsp's hook_offset[]. Base 0.8 added two site events (59 instead of 57), so each module has 63 hooks.

The ColdFire compiler (m68k-elf-gcc -mcpu=54455, sizeof(struct runtime_module)) gives:

  • 736 bytes at ef6099b0a, the source of the 21 November record's twin;
  • 754 bytes at 48f4a9b9c.

The loader rounds the record and its site records up to 16 bytes. So base 0.8 takes 16 bytes more for most modules and 32 for one with no patched sites, like Mini Verb. #2178 had fixed the record at 736 from the 21 November readings, which were taken on a 0.7 twin.

The site now computes MODULE_RECORD = (187 + 9 * (4 + SITE_EVENTS) + 1) & ~1 from site-events.json. poolExtent takes an older base's record size as an optional argument.

The pool test now reads both records. It checks the 21 November readings with that record's own loaderLayout.moduleBytes (736) and the new readings with the current model. The owner approved this test change on 26 November 2026. Without it, the corrected model would fail every 0.7 reading by design, since those were taken on a base with a smaller record.

The new readings get their own dated record, docs/verification/2026-11-26-octatrack-module-pool-allocation.json. Its method gives the reason: the 21 November twin 8850f539 does not rebuild byte for byte from ef6099b0a. The symbols are identical, but the configuration hash differs, both with and without controller rows.

Checked:

  • npx vitest run src/engine/elekloader/module-set-memory.test.ts src/engine/elekloader/module-set.test.ts: 73 passed.
  • A scratch probe of this branch's poolExtent on the three release packages (from their PR branches) gives 3,424, 10,480 and 2,720. With moduleRecord = 736 it gives 3,392, 10,464 and 2,704.
  • npm run pr:ready.

Each module PR gets back to ten measured packages once it merges main after this.

What the guides lacked: nothing said the module record's size depends on the base's site events. The comment above MODULE_RECORD in module-set.ts now says it.

🤖 Generated with Claude Code

repeat98 and others added 3 commits November 26, 2026 17:22
…ord, which the pool test reads too

The 21 November record's twin (8850f539) does not rebuild byte for byte, so the
readings of Mini Verb 0.2.4, Euclid 0.1.6 and Repitch 0.2.2 go into a dated record
of their own twin, and module-set-memory.test.ts counts both (owner, 26 Nov 2026:
"do (b)"). Readings to follow in this commit's record.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pool readings on a 0.8.2 twin

loader.h's runtime_module holds 9 bytes a hook; base 0.8's 59 site events (57 on 0.7) make it 754 bytes, not
the 736 module-set.ts assumed since #2178, so the site under-counted every module by 16-32 bytes on 0.8.
MODULE_RECORD now follows the base's site events (the ColdFire compiler gives 736 at ef6099b, 754 at
48f4a9b). Six rolled-back trials on twin 46c30886 (base 0.8.2, main 48f4a9b), two each: Mini Verb 0.2.4
3424, Euclid 0.1.6 10480, Repitch 0.2.2 2720 bytes, each equal to the corrected extent. They go into a dated
record of their own; the pool test reads both records, the 21 November one with its own 0.7 layout (owner,
26 Nov 2026: "do (b)").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant