Skip to content

Improvement: Octatrack base 0.7.9 refuses a module effect that would overload the frame, and the pick box shows its CPU - #1711

Closed
repeat98 wants to merge 8 commits into
mainfrom
improvement/effect-cpu-price
Closed

repeat98 wants to merge 8 commits into
mainfrom
improvement/effect-cpu-price

Conversation

@repeat98

@repeat98 repeat98 commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner
  • What was wrong or hard: A module effect was admitted by the CPU meter alone, an average over seconds, at 85 %. The frame guard works frame by frame, and effect work in the frame (Tape Echo's, in stock's delay routine) can't be dropped, so the guard drops machine renders instead. On an Octatrack MKII a third Tape Echo, picked with the meter at about 76 %, left Amiga on T4 crackling: the guard dropped 4,782 of its renders, about 70 a second, while the meter read 72 %. The box after a pick showed the DSP and memory an effect took, but not its CPU.
  • What this changes:
    • Price in the package: an effect's package carries its CPU price, resources.cpuPrice for a frame-interrupt measure, in tenths of a percent rounded up, in the FX page recipe's spare bytes 46-47 (build.py page_section, scripts/octatrack-module-page.mjs, the dev packer's copy). Older bases never read those bytes, and every current effect declares 0 or none, so no released package changes.
    • Frame share: the base (status.c) keeps the frame interrupt's share of each frame from the frame guard's own sums, twice a second over four seconds, and the last play's figure while stopped, as for the meter.
    • Refusal: a pick of a module effect is refused with CPU FULL ("TAPE ECHO NEEDS +x%") when that share plus its price, less the price of the module effect the slot runs, reaches mw_frame_line. The 85 % meter refusal stays as it was. Effects without a price are judged by the meter alone.
    • The line, 60 % of a frame, measured: MKII, the owner's project with Amiga and three Tape Echos playing, mean frame share 44 %. With the guard's share lowered, it skipped nothing at 65 % and 114 renders in 5 s at 60 %, so at its normal 80 % it starts dropping once the mean is within about 16 points of it.
    • CPU in the pick box: the box after a pick shows CPU in place of POOL: the frame share against the line, and +/- what the effect adds.
    • Base 0.7.9 (7214d65f…): the next free number after Octatrack base: DSP hook chains, so several packaged DSP machines share a hook site #1418's 0.7.8 on main. Refreshed on 18 November 2026: main merged, the base regenerated (+776 container bytes since 0.7.8, 48,660 free), the base-bound packages re-bound (their bytes unchanged; Sidechain 0.2.2 no longer lags since Octatrack base: DSP hook chains, so several packaged DSP machines share a hook site #1418), and status.c declares its drawing surface only in the device build, so the host test test_status.c compiles under -Werror again (it was this PR's red module-suites (sdk)).
    • Re-pinned hashes: the reviewed adapter recipes (candidate, machine, reconstruction, standalone) pin build.py and the page script by hash, so both are re-pinned to the new sources, as Improvement: Octatrack base 0.7.5 never removes a module whose window is open, and drops the stock-run scans #1475 did. Please review that part.
  • How I checked it:
    • Host tests: test_status.c covers the frame share, the refusal at and under the line, swaps, stock and NONE, stopped picks and the pick box's CPU row; they fail with the line moved by one. test_fxpage.c reads the price.
    • npm run pr:ready: Ready.
    • Unit runs: below.
  • Tested on a unit: development twins of this source on an Octatrack MKII (OS 1.40C), RAM-booted, the owner's set trialled without Keep (no Analog BD: twins refuse base-bound packages):
    • Twin 8100c69d (line 70 %): three Tape Echos and Amiga playing. Mean frame share 43.9 %, frame max ~87 %, CPU meter 65-67 %, nothing skipped. Guard share lowered: 70 % and 65 % skipped 0; 60 % skipped 114 in 5 s; 50 % about 2,800.
    • Twin f5550969 (line 60 %), with a private copy of Tape Echo 0.1.6 whose recipe names a 30 % price: playing, pick:T6:FX2:TAPE_ECHO was refused, with "CPU FULL T6 FX2 / TAPE ECHO NEEDS +50% / CPU 123% / CHANGE ONE FIRST". T6 FX2 stayed NONE. Bank A Part 1's working copy was byte-equal before and after the test, and its saved copy was untouched.
    • Not tested on a unit: the release build 7214d65f… itself, and the pick box's CPU row on the screen. On the twin the box after a pick did not open for any pick (Air Chorus, Vibrato, stopped or playing). That box is older than this change: it compares the slot's id when the loader reports the selection complete, and the slot changed about 114 ms later. This needs its own fix.
  • What the guides lacked or got wrong, and where I fixed it: docs/MODULE_PERFORMANCE.md said the base reads no effect price. It now says where an effect's price goes and how the base admits it, with the MKII figures. The base's README notes the frame admission.

Follow-ups, not in this pull request:

  • Tape Echo needs its measured price (npm run device:price -- tapeecho) in its own release; until then the base still judges it by the meter.
  • On the twin without Analog BD the same project played at a meter of about 66 % instead of 84 %, so Analog BD's ColdFire cost should be measured on the tester image.

🤖 Generated with Claude Code

repeat98 and others added 3 commits November 17, 2026 22:33
…overload the frame, and the pick box shows its CPU

A module effect's package carries its CPU price in its FX page recipe (bytes 46-47, from resources.cpuPrice; older
bases ignore them). The base keeps the frame interrupt's share from the frame guard's sums and refuses a pick with
CPU FULL when that share plus the price, less the price of the effect the slot runs, reaches mw_frame_line (60 %,
measured on an MKII). The box after a pick shows CPU in place of POOL. Effects without a price are judged by the meter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the enhancement New feature or request label Nov 17, 2026
repeat98 and others added 5 commits November 18, 2026 11:06
…after #1418); build.py and page-script pins refreshed

Generated base files take main's side and are regenerated next.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…bound packages re-bound; sizes recorded (+880 since 0.7.8, 48,556 free)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e host test compiles under -Werror

#1711 moved every use of it behind #ifndef MODWERK_HOST; the host build then failed on an unused variable (test_recipe.py's test_status.c, the red module-suites (sdk) check).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…kages re-bound, sizes recorded (+776 since 0.7.8, 48,660 free)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@repeat98

Copy link
Copy Markdown
Owner Author

Folded into #1745, the single Octatrack base 0.7.9 release. The frame share and the CPU row in the pick box are in it. The price inside the package is not: once #1709 writes prices into manifests it would change released packages. Refusing a pick by its CPU price comes next, with the price carried in the module set, so a price still needs no new release. Closing in favour of #1745.

@repeat98 repeat98 closed this Nov 18, 2026
repeat98 added a commit that referenced this pull request Nov 18, 2026
Octatrack base 0.7.9: Part Edit menu, resting modules, kept effects after a power cycle, status word, CPU in the pick box (folds #1678 #1694 #1610 #1742 #1711)
Zac-Kyoti pushed a commit to Zac-Kyoti/modwerk that referenced this pull request Nov 19, 2026
…on by price comes with set-carried prices

The in-package price (repeat98#1711's recipe bytes) would change released packages once repeat98#1709 writes prices into manifests,
so the packers are back to main's; fxpage.c keeps no price. status.c keeps the frame share and the pick box's CPU row.

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

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant