Skip to content

Fix: FM Synth's voices pass the Octatrack base's frame guard and CPU budget - #1483

Merged
repeat98 merged 1 commit into
mainfrom
improvement/static-render-hook
Nov 12, 2026
Merged

repeat98 merged 1 commit into
mainfrom
improvement/static-render-hook

Conversation

@repeat98

Copy link
Copy Markdown
Owner
  • What was wrong or hard: FM Synth 0.1.2 puts its own renderer straight into the tracks' renderer slots (a detour at the frame builder's slot copy 0x4000d514, plus the STATIC table entry). The base's FLEX render hook never ran for an FM Synth track, so neither the frame guard nor the CPU budget (Improvement: a CPU budget admits Octatrack machines before they play #1482) counted, shed or silenced its voices. Three FM Synth tracks beside a busy eight-track pattern froze the unit on PLAY.

  • What this changes: The base checks every renderer at the frame builder's two calls (0x4000d43e, 0x4000d52c, two more frame-guard sites). Stock's renderers and the base's own go straight through. A renderer a module put there itself goes through mw_foreign_render:

    • its machine's track is refused (CPU budget, START, unpaid voice) or guarded with the silent source, like any other machine;
    • a STATIC or FLEX track nobody owns is guarded with stock's own render in its place, so it keeps playing.
    • No module changes. FM Synth's sites still install beside the new ones (catalogue_overlaps passes). New beta base d377cece; the five base-bound packages are relinked to it, their code unchanged.
    • Behaviour change: in a busy project the guard can now drop FM Synth notes that played before.
  • How I checked it: npm run pr:ready says Ready on main 1f5dcae41; the registry host test covers the guard, the stock fallback and the CPU refusal on the new path. On the owner's MKII, a RAM-booted dev twin of this branch (c44b117b), OS 1.40C, FM Synth 0.1.2 as a trial, one short run each:

    • cpu shows the FM Synth track (7.6 % of a frame at its longest); on the twin before, 0.0.
    • With the allowance set to 5 %, the track is refused and its render costs 0.0.
    • Three FM Synth tracks beside a busy eight-track pattern: played and stopped, frame max 124.6 %. The same setup froze the unit on the twin without this change (dfbf58d6).
    • With one FM Synth track over that pattern the guard skipped tens of thousands of renders across all eight tracks within seconds.
    • Not done: nobody listened, so how audible the dropped notes are is unknown; the release base d377cece itself was not run on a unit, only its dev twin; the trial counted one loader refusal on this twin that I did not trace (FM Synth installed and ran).
  • What the guides lacked or got wrong, and where I fixed it: nothing said that a module-written renderer escapes the guard; docs/MODULE_PERFORMANCE.md now says the base checks every renderer at the two calls.

Related to #1473.

🤖 Generated with Claude Code

…budget

The base checks every renderer at the frame builder's two calls, so a renderer a
module wrote into the slots itself is refused and guarded like a machine's own.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added the bug Something isn't working label Nov 12, 2026
@repeat98
repeat98 enabled auto-merge November 12, 2026 18:17
@repeat98
repeat98 merged commit 817c967 into main Nov 12, 2026
13 checks passed
ex1010 pushed a commit to ex1010/modwerk that referenced this pull request Nov 13, 2026
Upstream's repeat98#1483 rebuilt the base; this regenerates it with the engine price
change on top: Analog BD's recipe recaptured (identical copies and fills),
base and base-bound packages rebuilt, Sidechain 0.2.1's held entry pointed at
the new base (test_base_bound_trust caught it).

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