Skip to content

Concurrent analysis pipeline + immediate set-page redirect (and SoundCloud) - #1

Merged
robrien20 merged 2 commits into
mainfrom
parallel-pipeline-and-redirect
May 5, 2026
Merged

robrien20 merged 2 commits into
mainfrom
parallel-pipeline-and-redirect

Conversation

@robrien20

Copy link
Copy Markdown
Owner

Summary

  • Concurrent orchestrator: peaks/bpm/key/fingerprint now fan out across a ThreadPoolExecutor instead of running serially. Real-world win comes from overlapping network-bound fingerprint and subprocess-bound peaks with CPU-bound bpm/key — typically ~1.5–2× on an hour-long set.
  • Immediate redirect: the library form navigates to /set.html?id=… as soon as ingest finishes (set_id known), rather than blocking on the full pipeline. The set page already polled status.json and reloaded artifacts on-the-fly; added a peaks case to reloadStep so wavesurfer rebuilds with real peaks the moment that step lands.
  • SoundCloud (and other audio-only yt-dlp sources): extended URL_FORMAT with /ba/b fallbacks so URLs without a video track (SoundCloud shortlinks, Bandcamp, etc.) ingest successfully.

Concurrency safety

status.json is the only shared mutable state. store.update_step does a read-modify-write of the file, so concurrent calls from worker threads are serialised behind a single lock. bus.publish is already thread-safe so event emission needs no locking. Per-step failure isolation is preserved — a fingerprint failure (e.g. ACR creds missing) still doesn't tank bpm/key data.

Test plan

  • Full pytest (78 passed)
  • Local smoke test on clip30.mp3 — three steps started simultaneously on setplot-step_{0,1,2} threads, peaks completed in 0.04s while bpm/key continued to 1.78s
  • Verified yt-dlp resolves an on.soundcloud.com shortlink and the new format selector picks audio-only formats (BRUX Boiler Room set ingested as source.m4a)
  • Manual UI smoke: paste a URL into the library page, confirm redirect to set page, confirm progress pill ticks through running → done as steps complete

Robert O'Brien and others added 2 commits May 4, 2026 13:20
The previous selector required a video track, so audio-only URLs (SoundCloud,
Bandcamp, etc.) silently failed. Adds /ba/b fallbacks so yt-dlp picks the
best audio when no video stream exists.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…gest

Steps after ingest (peaks, bpm, key, fingerprint) had no data dependency on
each other but ran serially. Fan them out across a ThreadPoolExecutor; the
status.json read-modify-write is the only shared mutable state, so a single
lock around update_step is sufficient. Real-world wins come from overlapping
the network-bound fingerprint scan and subprocess-bound peaks step with the
CPU-bound bpm/key passes.

On the viewer side, the library form now navigates to /set.html as soon as
the SSE stream emits a set_id (immediately after ingest), rather than blocking
on the full pipeline. The set page already polled status.json and reloaded
artifacts as they appeared; added a peaks case so wavesurfer rebuilds with
real peaks once that step finishes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@robrien20
robrien20 merged commit db12e40 into main May 5, 2026
1 check failed
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