Skip to content

patcher: fused voice block (27.7 -> 17.6 ns/voice-sample) and engine.vocoder - #184

Merged
0thernet merged 2 commits into
mainfrom
patch-perf
Oct 10, 2026
Merged

0thernet merged 2 commits into
mainfrom
patch-perf

Conversation

@0thernet

Copy link
Copy Markdown
Member

Patch runner speed

The voice section now compiles to one generated function per program (src/audio/patch/fuse.ts, kernels.ts): input records and port offsets become literals, node kernels are inlined, and consecutive nodes share one per-sample loop (split where a node reads a whole block an earlier node in the loop writes). The reference interpreter stays behind fuse: false.

Bench (bench/perf/patch-runner.ts, 16 voices x 12 nodes, 48 kHz, exclusive lease, 2 x 40 runs):

median p95
origin/main 27.45 / 27.94 ns 27.87 / 29.33 ns
this PR, fused 17.58 / 17.56 ns 17.95 / 18.13 ns
this PR, fuse: false 27.91 / 29.13 ns 29.18 / 30.56 ns

Bit-identical: fuse.test.ts renders random patches fused and interpreted and compares bytes; the patch golden, PATCH_EXPECTED and every existing golden pass unchanged.

Gate: the calibrated patch-runner gate drops from 60 to 24 units (about 9.5 measured), plus a same-process fused/interpreter ratio gate (< 0.8, about 0.60 measured).

engine.vocoder

Wraps the vocoder's built-in carrier. convertToPatch keeps the vocoder field on the track (it also configures the vocoder stage, which runs on the whole patch voice), so a converted vocoder track and a synth track with a vocoder stage both render bit-identical (two new golden cases with a modulator track).

🤖 Generated with Claude Code

0thernet and others added 2 commits October 10, 2026 16:40
… engine.vocoder

The voice section compiles to one generated function per program: input
records and port offsets become literals, kernels are inlined and
consecutive nodes share one per-sample loop. Bit-identical to the
reference interpreter (differential test over random patches; goldens
unchanged). Bench gate tightened from 60 to 24 units plus a fused/interp
ratio gate. engine.vocoder wraps the built-in carrier; the vocoder stage
stays on the track.

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

vercel Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
dawg Ignored Ignored Preview Oct 10, 2026 9:05pm UTC

Request Review

@0thernet
0thernet enabled auto-merge (squash) October 10, 2026 21:05
@0thernet
0thernet merged commit 9c7935e into main Oct 10, 2026
14 checks passed
@0thernet
0thernet deleted the patch-perf branch October 10, 2026 21:21
0thernet added a commit that referenced this pull request Oct 10, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0thernet added a commit that referenced this pull request Oct 10, 2026
* patcher: enforce the SDK door for every patch verb (four-ways)

Lane 4 (#183) landed the SDK builder, so main's four-ways table had
eleven patch rows whose listed SDK gap had opened. Drop PATCH_GAPS and
name each verb's SDK door (patch(), fxPatch(), track.instrument, track.fx,
song.patches; patch mod: pat/irand and the baked automation lane). The
patch mod menu gap stays: the typed verb still refuses until pattern text
has a parser. Its refusal now points at SDK 1.35.0 mods:.

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

* sdk: regenerate patch node types for engine.vocoder (#184)

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@0thernet 0thernet mentioned this pull request Oct 11, 2026
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.

1 participant