Repository navigation
patcher: fused voice block 17.0 -> 13.2 ns/voice-sample; regenerate SDK for engine.vocoder - #186
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
0thernet
enabled auto-merge (squash)
October 10, 2026 21:46
- Hold intermediates a single fused loop writes and reads in locals instead of voice memory. - Read fan-ins straight from the global memory and add the voice sums inside the fused loop when the block is plain (no steal fade, no silence tracking), dropping the runner's copy loops. - Give nodes calling Math.sin/cos/tan/pow their own loop so the call does not spill every value of the shared loop. - Build the fused block per sample rate: the rate and constant controls become literals, and block constants computed from literals move out of the block function. - Read block-constant voice ports (pitch, note, velocity) as values. - Perf gate: 24 -> 18 calibration units, fused/interpreter 0.8 -> 0.56. Renders stay bit-identical (patch golden, PATCH_EXPECTED, fuse differential test, now also across sample rates). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hoisting them out as closure constants made the fused block about 8x slower on x64 JavaScriptCore (CI: 138 calibration units, 5.3x the interpreter) and gained nothing on arm64. The gate now prints what it measured. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second pass on the patch runner (after #184), plus the SDK regen main needs.
Speed (bench/perf/patch-runner.ts, 16 voices x 12 nodes, 48 kHz, exclusive lease, 15 runs)
Design target about 12.3; prototype interpreter 12.6, fused prototype 9.0.
What changed (src/audio/patch/fuse.ts, run.ts)
Bit-identical
Patch golden, PATCH_EXPECTED and every existing golden pass without re-pinning. The fuse differential test (random patches, fused vs interpreted bytes) now also runs one program at 48k/44.1k/48k/22.05k to cover the per-rate cache.
Gate (bench/perf/gate.test.ts)
SDK regen
#183 (generator) and #184 (engine.vocoder) landed together, so
core/sdk/patch-nodes.gen.tsand the spliced v1.ts block were missing the vocoder and patch-nodes-gen fails on main. This regenerates them withbun scripts/gen-patch-sdk.ts. The 11 four-ways failures on main come from lane 4; #185 fixes them.🤖 Generated with Claude Code