All posts
v0.4.2

v0.4.2

Added

  • _ placeholder in specialized call handlers. The _ argument placeholder now works inside builtins routed through specialized codegen call handlers, not just generic calls.
  • Growable chunked BufferPool. Cedar's BufferPool now backs its registers with up to 64 lazily-allocated 256-buffer slabs (default cap raised from 256 to 16384 total). Slab pointers are stable across growth, so the audio thread's in-flight reads survive a hot-swap that armed new slabs on the compile thread. Hosts (nkido CLI play / serve / ui / render and the web/wasm worklet) call pool.ensure_capacity(required_buffers) off-cycle before publishing the new bytecode.
  • CompileResult::required_buffers. Codegen now reports the peak distinct buffer indices used by the program so hosts can size the pool exactly. Backwards compatible: hosts that ignore the field still work for programs that fit in the default slab.

Changed

  • Codegen sum/mix accumulator. sum() and mean() over arrays now emit one accumulator buffer + N-1 in-place ADD instructions instead of an N-1-buffer linear chain. Programs that fan out wide (e.g. unison(..., voices: 8) summed under poly) no longer exhaust the pool on the per-voice sum. Bit-identical output.
  • BufferAllocator reuses freed indices. Codegen now has a BufferAllocator::release(idx) that puts indices back into a LIFO free list. reset_to(mark) drains free-list entries past the mark. Used by the sum/mix accumulator and reserved for future refcount-driven release across general opcodes.
  • cedar::MAX_BUFFERS semantics. Previously the size of a single flat buffer array (256). Now the total addressable buffer index space (16384 by default). Per-slab size lives in cedar::SLAB_BUFFERS. The CEDAR_MAX_BUFFERS build flag still works; it must be a positive multiple of SLAB_BUFFERS.
  • BUFFER_ZERO is now an explicit constant. Pinned at 255 (last slot of slab 0) so it stays in the pre-allocated slab regardless of any future cap changes.

Fixed

  • Live IDE deep links 404'd on live.nkido.cc. Opening a shared patch (/p#code=…) or any non-prerendered route returned Netlify's "Page not found". The deploy never applied the repo's netlify.toml, so the SPA fallback rewrite, SharedArrayBuffer COOP/COEP headers, and immutable-asset caching were all missing in production. The deploy now applies netlify.toml and also ships _redirects / _headers in the build artifact.
  • scales dispatcher compile failure on a non-literal scrutinee. Selecting a scale with a runtime (non-literal) argument no longer fails to compile.