7 Commits
Author SHA1 Message Date
Joren 6b0460a646 Use 1 MiB reads and add scan --shuffle for multi-disk arrays
- raise symphonia's MediaSourceStream buffer from the 64 KiB default to
  1 MiB; direct I/O on the FUSE share measures ~45 MB/s at 4 KiB,
  ~90 MB/s at 64 KiB, and ~119 MB/s at 1 MiB
- add scan --shuffle: seeded randomization of analysis order so
  concurrent workers read from different library regions instead of
  seek-thrashing the disk that happens to hold the current walk-order
  range
- thread the flag through scan::run and the integration tests
- document both changes in the README
2026-11-25 21:13:06 +01:00
Joren 94a1e669c9 Add scan --exclude and improve long-scan progress reporting
- add repeatable scan --exclude <DIR>; relative paths resolve against
  MUSIC_DIR, excluded subtrees are skipped during the walk and pruned
  from SQLite so they disappear from the index and playlists too
- reduce scan batches from 4,096 to 128 tracks: a single long track
  (DJ mix, audiobook) can no longer delay commits and reporting for
  hours, and progress survives restarts at finer granularity
- emit a worker-level progress line every 50 processed tracks (rate,
  analysis elapsed, ETA) when stderr is not a terminal, independent of
  batch boundaries
- measure heartbeat elapsed/ETA from analysis start instead of scan
  start, so file discovery no longer inflates the estimate
- tests: excluded-directory skip/re-include, component-aware prefix
  matching
2026-11-25 17:16:02 +01:00
Joren 89d0118da7 Correct large-library sizing with measured throughput
A 17-track smoke test on a 32-core host scanned at 2.15 tracks/s with
2 workers (~1 CPU-second per track). The nice-19 reference run was
throttled, so its wall time was not representative of dedicated
hardware. 429k tracks are ~120 core-hours (~6 h at 20 workers); reading
18 TB dominates, for ~12-30 h end to end.
2026-11-25 15:54:09 +01:00
Joren f506a7f70d Raise LMDB map size and batch scan upserts for large libraries
- raise MAP_SIZE from 2 GiB to 16 GiB; LMDB reserves address space, not
  RAM, and the file grows on demand. The old cap would be exhausted
  around ~100k 1,280-d tracks
- analyze the library in 4,096-track batches and upsert after each batch
  so peak memory stays bounded instead of holding every embedding in
  memory; each batch is its own transaction, so interrupted scans keep
  completed batches
- add a multi-batch scan integration test
- document large-library sizing (~4 CPU-seconds/track; ~1.5-2 days at 20
  threads for 429k tracks) in the README
2026-11-23 18:22:24 +01:00
Joren 4df14c5297 Upgrade to discogs-effnet-bsdynamic-1 with style-aware clusters
- switch from msd-musicnn-1 (200-d, 50 tags, 187-frame patches) to
  Essentia's discogs-effnet-bsdynamic-1 (1,280-d embeddings, 400 Discogs
  styles, 128-frame patches)
- export script now downloads Essentia's official dynamic-batch ONNX and
  verifies the schema, tensor shapes, and a smoke inference; no
  TensorFlow or tf2onnx required
- cluster names strip the ParentGenre--- prefix and rank styles with
  sqrt(mean) * (mean / (global + 0.05)) so dominant sub-styles beat
  ultra-rare predictions; playlists dedupe normalized (artist, title)
  keeping the edition nearest the cluster centroid
- add scan --jobs/-j to cap rayon worker threads
- update tests, README, and benchmarks (48 tests; 2,411-track re-embed)
2026-11-23 15:29:45 +01:00
Joren 7ccccf2d31 Mean-center embeddings, dedup similar playlists, add rebuild-index
- center_and_normalize() removes the ReLU positive-orthant baseline before
  L2 normalization; used by the arroy rebuild and k-means so similar,
  adventure and cluster share one zero-mean hypersphere
- persist the library mean as meta.center_mean; nearest_by_vector centers
  raw queries with it; empty rebuilds clear it
- similar dedupes candidates by normalized (artist, title) with the seed
  key pre-inserted, removing duplicate rips and deluxe editions
- new rebuild-index subcommand re-indexes stored embeddings in ~60 ms
  for 2.4k tracks without re-scanning audio
- tests: zero-mean/unit-norm centering, angular separation, empty rebuild
  mean clearing, duplicate-edition filtering
2026-11-23 14:43:11 +01:00
Joren 0d54a52e84 Initial commit: sonic-rs local sonic analysis CLI 2026-11-23 14:21:35 +01:00