1. The Core Problem
Legacy codecs (FLAC, WAV, ALAC) compress multitrack audio stems in isolation, creating three major inefficiencies:
- Multitrack Redundancy: Compressing 20+ stems individually duplicates shared timing, transients, and microphone leakage across files.
- Destructive Edits: Simple DAW edits (fades, mutes) force slow, destructive re-rendering of entire audio files to disk.
-
Version Bloat: Saving project revisions (
Mix_v1,Mix_v2) duplicates identical, unmodified audio tracks.
2. What We Built
-
loom-core(Rust Engine): Single-track FLAC-compatible encoder (Fixed 0-4, Burg MEM LPC, Levinson-Durbin, NLMS adaptive filtering, 5/3 CDF Wavelets, IntMDCT, Golomb-Rice, rANS, tANS) + session-aware multitrack container with inter-stem residual prediction coupling, KLT covariance matrices, and DAG topologies. - Non-Destructive Edit Overlays: On-the-fly rendering of linear, sigmoidal, exponential, and cosine fades, gain automation, and mute regions during decoding ($O(1)$ header updates).
-
Frame Version Diffing: PCM frame MD5 fingerprinting and delta compression (
encode_diff/apply_diff). -
loom-cli&loom-bench: 17 CLI subcommands, 28 passing test suites (cargo test), and Criterion empirical benchmark runner. -
research/Platform: 24 publication-grade academic research manuscripts covering DSP math and information theory.
3. Key Issues Fixed During Development
Problem / Bug Technical Root Cause Fix Implemented LaTeX'_' allowed only in math mode
Raw underscores inside \text{...} blocks exited math mode in KaTeX/MathJax.
Replaced text underscores with hyphens (e.g., \text{track-meta-m}).
Broken GitHub Math Formatting
GitHub Markdown required empty lines surrounding $$...$$ blocks.
Automated spacing script to insert blank lines around display math blocks.
Broken Table of Contents Anchors
Inline LaTeX math inside Markdown headers broke link anchors.
Converted header math titles to clean text (e.g., (O(log K))).
Mid-Side Reconstruction Rounding
Signed right shift (>> 1) caused off-by-one errors on negative odd integers.
Applied bit-exact math: left = mid + ((side + 1) >> 1) and right = mid - (side >> 1).
SIMD Hardware Acceleration
Serial dot-product loops constrained predictor throughput.
Integrated 256-bit AVX2/SSE2 and AArch64 ARM NEON (autocorr_neon) vector intrinsics.
4. Empirical Benchmark Highlights
- Multitrack Session Savings: 8-stem DAW session compresses to 488,503 bytes (13.85% ratio) in Loom vs 647,112 bytes (18.34% ratio) for 8 separate FLAC files (24.51% higher storage savings).
- Decoding Throughput: 176.83 MB/s for drum transients; 141.29 MB/s for silence backfill.
- Seek Latency: 4.42 ms range extraction latency for a 1-second slice.