Skip to content

Grain 0.2.0: EDGE, Flex recording fix, POS lock fix - #2426

Merged
repeat98 merged 23 commits into
repeat98:mainfrom
AForceTrulyEvil:grain-0.2.1-personal
Dec 2, 2026
Merged

repeat98 merged 23 commits into
repeat98:mainfrom
AForceTrulyEvil:grain-0.2.1-personal

Conversation

@AForceTrulyEvil

@AForceTrulyEvil AForceTrulyEvil commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Grain 0.2.0: EDGE, Flex recording fix, POS lock fix

One release for 0.2.0. It contains all of #2115 (EDGE). Package db1cb96a: the unit results below were run on 520215cb; db1cb96a differs from it only in the waveform view's display code (every engine and render function compiles identically).

Unit results (author's MKI, OS 1.40C, package 520215cb)

  • Frame cost: first instance 16.1 % (0.1.3 read 33.3 %, about 52 % less); a second instance adds 8.6 %.
  • Admission: admitted on the empty pattern; refused on the medium pattern (105.3 %). The scene without Grain was not measured on its own. This needs your decision on release-cost.
  • XVOL lock byte: lock copy, paste and clear, and the track switched to Flex and Static with the lock kept, crossfader moved: no volume jump.

Not done

npm run test:procedure has not been run, so the performance record (cycles, stress, stamp) is not updated. The checks stay red on Grain's pending gates: that record, the medium-pattern cost and the owner approval. I am not planning more test runs for now.

Tested on a unit: base 0.8.2 (24e480c4), package db1cb96a, author's Octatrack MKI, OS 1.40C: the final build played for more than an hour with Grain on tracks T1 and T3, POS locks, copy, paste and clear, recording, and the XVOL lock byte test. Earlier frame-cost and lock readings were taken on 520215cb, which differs only in the waveform view's display code.

Edge cases

Case Why this change makes it a risk How run Result
POS eighths in the XVOL lock byte stock's byte reused by hand on the MKI, 520215cb: lock copy, paste, clear, track on Flex and Static, crossfader pass
Recording Grain into a Flex buffer the stock PCM copy is skipped on the MKI on 28 November, an earlier build of the same change (TESTING.md) pass: skipped renders fell from about 600 a second to 161 in about seven minutes
Grains at the sample's ends EDGE is new on the MKI on 23 November, package 8a4555de, an eight-tone sample pass in CLMP, WRAP and BNCE; STOP played as expected
Frame cost engine path changed device:price --curve on the MKI, 520215cb fail: refused on the medium pattern (105.3 %); admitted on the empty one
Waveform view display code changed after the unit runs on the MKI with the final build, more than an hour pass

Guides: nothing.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, these are real fixes: the recording glitch (#2186) and the POS lock (#2334) both bite players. A few things before this can go out:

  1. Merge main in (merge, don't rebase). The branch conflicts with main right now, so most checks haven't run.
  2. One pull request for 0.2.0. This branch carries all of #2115 (EDGE) under the same version 0.2.0. Please pick one: finish everything here and close #2115, or move these fixes into #2115 and close this one. Please also retitle it as the release, not a personal build.
  3. The Flex recording fix patches POLY8's site. It detours 0x400041C4, which POLY8 already detours. The set check refuses two modules on the same bytes even when a conflict is declared. A conflict would also mean nobody could pick Grain and POLY8 together. The way through is a shared hook for that site on the Octatrack's cumulative base draft that both subscribe to (propose a hook). If you want EDGE and the POS fix out sooner, ship those now and send the recording fix once the hook is in. If you agreed something else with me elsewhere, please link it here.
  4. The POS eighths live in stock's XVOL lock byte. The guide allows bytes inside a stock record only with a test that fills the stock features stored nearby and shows both sides stay intact: lock copy, paste and clear, and the track switched back to a Flex or Static machine with the lock still there, so XVOL doesn't jump (a module owns what it saves). Please add that test and its result.
  5. The test record on the final package. Run npm run test:procedure -- grain on the exact package, with the edge cases these changes touch (recording into Flex, POS locks, EDGE). Include the frame-cost curve for this version: evidence/frame-cost.json is still 0.1.3's, and the 17-20 % saving should show there (the test procedure).

Then run npm run pr:ready and push.

@repeat98

Copy link
Copy Markdown
Owner

Thanks for these. On top of the review above, a few things I noticed:

  1. The package is still Grain 0.2.0-experimental: EDGE, four ways to treat the sample's edges #2115's build (e8d7c794…, byte for byte), so it doesn't contain the recording or POS-lock fixes. Please rebuild it from this source and run the unit checks on that package.
  2. EDGE's stored 0 is CLMP. Every project saved with 0.1.2 or 0.1.3 has 0 in that byte and played WRAP, so after a sync those projects would sound different. Could 0 mean WRAP, with CLMP on another value? Then saved projects play as before.
  3. After merging main, let npm run modules:generate rewrite frame-costs.json. The branch currently puts an older 0.1.2 reading over 0.1.3's.
  4. Please add release-note lines for the recording and POS fixes (only EDGE has one), and update "No stock code is patched" in manifest.py now that there's a detour.
  5. The description says the output is bit-identical, but TESTING.md says it isn't bit-exact. Which is right?

@AForceTrulyEvil

Copy link
Copy Markdown
Contributor Author

Hi Jannik, thanks for the review.

On EDGE's default (point 2): I'd like to keep CLMP as the default, because it's how most granular instruments behave, and the wrap-around in 0.1.2 and 0.1.3 isn't. The difference is limited to the edges of the sample: it only affects grains that SPRY would push past the start or the end, so with POS at or near either end. Everywhere else a saved project sounds the same, and WRAP restores the old sound. I'll make that clear in the release notes.

I'll go through your other points and the maintenance review, and push when they're done.

@repeat98

Copy link
Copy Markdown
Owner

Thanks for explaining. CLMP as the default for EDGE is fine with me, as an exception: it only changes grains SPRY pushes past an edge, and WRAP brings the old sound back. Please say that plainly in the release notes, as you offered: projects saved with 0.1.2 or 0.1.3 can sound different near the sample's start and end, and EDGE on WRAP restores them.

One thing to add with your next push: since Grain and POLY8 now wrap the same site, please list poly8 in compatibility.conflicts in the manifest (it's empty at the moment), so the site doesn't offer the two together.

The other points from my comment above still stand. Thanks!

@AForceTrulyEvil AForceTrulyEvil changed the title Grain: Flex recording fix, POS p-lock fix, sub-step position locks, ~17-20% cheaper per track Grain 0.2.0: EDGE, Flex recording fix, POS lock fix Dec 1, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this has come a long way. The branch is up to date with main and this is now the one pull request for 0.2.0. POLY8 is listed as a conflict, and the XVOL lock test has its result (copy, paste, clear, and the track back on Flex and Static). 0.2.0 has its own frame-cost curve: 16.1 % against 0.1.3's 33.3 % is a real gain. The description now has the unit line and the edge-case table, and the final package played for over an hour on your MKI.

What still stands:

  1. The checks stop on the owner's approval. The only failure is that Grain's owner-approved update still covers 0.1.3. Only the owner can add one for 0.2.0, and the medium-pattern cost is with them for a decision now. You don't need to do anything for this one. Once it is in, the remaining checks run, including the cross-module check on the recording fix's site.
  2. The test-procedure record. npm run test:procedure -- grain on package db1cb96a is still required. The owner's decision on cost doesn't replace it (the test procedure).
  3. Please close #2115, since this pull request now carries EDGE.

The rest of my review from 29 November is settled.

repeat98 and others added 2 commits December 2, 2026 11:19
The owner approved 0.2.0 for release on 2 December 2026. The record binds
package db1cb96a and native source 1345af6d, and waives current-build
hardware, worst-case cycles, complete memory bounds and the release cost
(105.3 % of a frame on the medium pattern).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Run without the unit on 2 December 2026: software checks, beside every
other module, the build and the DSP cost model passed; the unit steps are
recorded as not run, and the hardware results stay the author's.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants