Commit d4c0ae6d by PLN (Algolia)

docs(tasks): archive the Foundry phase-2 loops chain (overnight 2026-06-23)

Structured archive of the night's 11 completed tasks (#5-#13,#16-#18 + audio fix) —
grader/tierlist/correlation/finder/naming/merge, with the load-bearing learnings and
measured numbers (ρ=0.34, recall 0.27→0.34, the 56min→coarse-to-fine + silent-window
∞ + PLP-octave + HTTP/1.0-audio gotchas). Blog/video source material; the board now
shows only live work (#19 auto-tune, #20 batch-explore).
parent 5ac5cd0f
...@@ -59,3 +59,85 @@ snapshot in `board-archive.md`. Newest first. ...@@ -59,3 +59,85 @@ snapshot in `board-archive.md`. Newest first.
DarkReader can fight a dark theme — suspect the inverter before re-tuning to a phantom. DarkReader can fight a dark theme — suspect the inverter before re-tuning to a phantom.
- **Deps:** Spawned #63 (cross-app SPA landing — the tide-table index shipped; tying in the - **Deps:** Spawned #63 (cross-app SPA landing — the tide-table index shipped; tying in the
React surfaces remains). Set the foundation the emotion-engine work (#89–#92) built on. React surfaces remains). Set the foundation the emotion-engine work (#89–#92) built on.
---
# The Foundry — phase-2 loops chain (overnight, 2026-06-23)
One session built the entire url→stems→**loops** chain end to end: grader, tierlist,
correlation, finder, naming, GUI, plus engine2 (merge) and audio hardening. Every claim
below is measured; honest negatives kept honest.
## #8 — engine2 Roformer VRAM spike
- **Done:** `research/engine2_spike/spike.sh`; commit 1a201df.
- **Learnings:** Roformer FITS the 6GB RTX 2060 (peak 3051 MiB, ~0.55× realtime) — the
wall was never VRAM, it was Python: py3.14 breaks (beartype rejects audio-separator's
`Callable|None` hints); a py3.12 venv works (`~/.virtualenvs/audio-separator`).
- **Deps:** fed #9.
## #10 — Loop grader (the katana), engine/grade.py
- **Done:** pure `grade(wav)->LoopGrade` (S/A/B/C/D + per-rule subscores + flags); commit edb6225.
- **Learnings:** (1) librosa 0.11 tempo is `librosa.feature.tempo`, NOT `.rhythm.tempo` — a
swallowed AttributeError flat-lined bar-consistency at 0.50 for every file. (2) seam =
CONTINUITY = the 2nd difference `|x0-2x[-1]+x[-2]|` at the wrap, not the single-sample step
(the step metric punishes a clean wrap at a zero crossing — a perfect sine scored 0.40).
- **Deps:** reused by #5, #7, #11, #18, #19.
## #11 — Hall of Fame tierlist (data + impeccable viz)
- **Done:** `build_tierlist.py` (1690 loops/97 kits) + `tierlist.html`; commits f88273b, 4c9a831.
- **Learnings:** grade↔.tidal-usage Spearman ρ=+0.34 (rubric points right). The CONFOUND is
the insight: FX kits (risers 16×, weird_dialogs) tier LOW correctly — sweeps aren't loops,
so the grader tells loops from transitions; custom `f*` palette validates from the other
side (fsynth/fguitar A). Only 34/97 kits carry a usage token (folder-name vs `s`-token).
Showed the confound in the scatter rather than hiding it (trust the instrument).
## #12 — Correlation engine (provenance recovery), engine/correlate.py
- **Done:** NCC sample↔stem matcher + `build_provenance.py`; 482/1690 matched (29%),
cross-stem alignment 0.34; commit 7a79dc8.
- **Learnings:** a hand-cut loop is a literal slice → NCC peaks ~1.0 (foreign ~0.03). TWO
load-bearing bugs: (a) naive all-pairs full-res took 56 MIN → fixed with coarse-to-fine
(rank stems on a frame-RMS ENVELOPE, precise NCC on top-3, ~40× cheaper, minutes); (b)
SILENT-WINDOW BLOWUP — catastrophic cancellation in the sliding-variance cumsum drove the
normaliser to ~0 in quiet regions, so silence scored ∞ and faked perfect matches (a run
reported a bogus 55%/0.69, ~440 false positives). Floor the window norm at 5% of global
energy + clamp NCC to [-1,1]. Also: py3.14 mp defaults to FORKSERVER → COW-global trick
fails (empty globals per worker); pin `mp.get_context("fork")`.
## #5 + #18 — Loop finder (engine/loops.py) + v2
- **Done:** §1 pipeline (PLP→beat-sync SSM→Foote→scored windows→Takes→export); grid-from-drums;
chop mode; commits c17dd0d, de0cb11, cdf2f13, 0a2921a, 5ac5cd0.
- **Learnings:** bare PLP latches the eighth-note pulse → ~2× tempo (Loituma read 250 not 125);
pin tempo_min/max to one octave + min peak distance. Per-stem PLP grids are WEAK on
sparse-onset vocals → grid-from-drums (one grid from the rhythmic stem, reused for all)
lifted recall 0.27→0.34 (vocals 0.27→0.50). Chop mode (onset sub-bar) WORKS but recall
0.13 < loops 0.34 — PLN picks chops by TASTE from many onsets (recall is a harsh metric;
onsets over-segment, floored chops at 0.25s). Loops=default, chops=opt-in.
## #7 — Finder recall harness, build_finder_eval.py
- **Done:** recall vs provenance GT (distinct-window, uncapped N + precision); commit 09bace6.
- **Learnings:** honest 0.27 recall / 0.24 precision on the 8 most-cut stems — BELOW the 0.70
target, and that's diagnostic not failure: those are chop-heavy sources (14-42 sub-bar cuts
/stem); the bar-finder can't reproduce sub-bar chops, and the finder is a SUGGESTER anyway.
## #9 — Merge-of-stems multimodel, engine/separate.py
- **Done:** MultiModelBackend cascade (Roformer vocals → demucs on the instrumental for
drums/bass/other → merged 4-stem) + wired RoformerBackend + demucs model selector; commits
853eeaf, 14e69fe.
- **Learnings:** there is NO 4-stem Roformer (all are 2-stem) — the win is an ENSEMBLE.
htdemucs_ft is a free drop-in 4-stem A/B (vocals SDR 10.8 vs 9.9). Refactored backends to
declare `produces` + `run_composite`. Verified on Loituma: 4 clean PCM_16 stems.
## #13/#16/#17 + audio fix — supporting wins
- **#13 naming** (engine/naming.py, 146070b): NN_role[_character] derived from the corpus
(46% indexed, 74% underscore, kit-name not repeated).
- **#16 live MIDI panel** (c0fd5d4): SSE fan-out into the Bridge, colour-by-event.
- **#17 self-updating corpus essay** (24606d4): templated Story 02 from EDA + freshness badge;
honesty fix — 4→14 gigs is "grew 3.5×", not the hand-copied "tripled".
- **AUDIO STREAMING fix** (7c3154a): stdlib http.server defaults to HTTP/1.0 → `<audio>`
seeking (many small Range requests) is flaky in real browsers. Set
`protocol_version="HTTP/1.1"` on the Foundry Handler AND armada RangeHandler (safe: every
response sets Content-Length). Also preload="metadata" so durations show (0:00/0:00 read as
"broken"), and offer the ORIGINAL alongside stems. A fleet-wide gotcha for any audio server.
- **Deps:** the chain feeds #19 (auto-tune settings against the grader) and #20 (batch-explore
many sources). Engine registry now seeds the product/API/service direction PLN wants.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment