Skip to content

fix: lossless candidate matching, compiler JVM monitor overflow, and test regressions - #268

Merged
ajisth69 merged 6 commits into
mainfrom
fix/inline-download-transfer-ir-crash
Oct 5, 2026
Merged

ajisth69 merged 6 commits into
mainfrom
fix/inline-download-transfer-ir-crash

Conversation

@ajisth69

@ajisth69 ajisth69 commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes the Kotlin compiler backend crash, test suite regressions, and resolves the issue where global collaborative tracks (such as Timeless by The Weeknd) falsely dropped to Opus 147 kbps instead of playing in lossless FLAC.

1. Lossless Stream Candidate Matching Fixes

  • Collaborator Splitting: Passed raw candidate artist credit fields directly to artistNames before punctuation normalization so ,, &, feat, and with split collaborative/featured artists into distinct identities instead of collapsing them into a single unmatchable 3-word string.
  • Symmetric Noise Word Filtering: Updated artistNames to filter ARTIST_NOISE_WORDS ("the", "and", etc.) so targetArtists and candidateArtists tokens match symmetrically (e.g. "The Weeknd" -> ["weeknd"]).
  • Single-Token Artist Fallback: Allowed single-token clean artists to match credited performer tokens (targetTokens.isNotEmpty()).
  • Title-First Dash Packaging (<Title> - <Artist, Collaborator>): Updated isArtistOrAlbumName with bidirectional matching and split-artist checks so multi-artist tails in dash-separated titles are recognized as artist credits instead of replacing the track title core.
  • Featuring Clauses & Record Labels: Added with to FEATURING_CLAUSE for unbracketed featuring phrases, and allowed major record label stem matching in isRecordLabel for regional YouTube upload channels (e.g. "T-Series Regional", "Sony Music South").

2. Compiler Crash Fix (StackOverflowError in JVM Coroutine Transformer)

  • In TrackDownloadManager.kt, nested local suspend functions and duplicate transfer invocations inside the massive runDownloadJob coroutine caused Kotlin's CoroutineTransformerMethodVisitor monitor depth analysis to overflow the JVM compiler stack.
  • Extracted isOpusStream to a class-level helper method, simplified track filter predicates to lightweight lambdas, and reverted the transfer call to a single compact downloadToTempFile invocation (which internally handles reconnectable network failures with exponential backoff and retry bounds).

3. Unit Test Regression Fixes

  • TextMatch.tokens: Restored MATCH_NOISE_WORDS filtering to preserve expected Latin tokenization behavior (TextMatchTest.latinBehaviorIsUnchanged).
  • CsvPlaylistImporter.sameArtist: Removed loose bidirectional substring matching that caused "Artist Tribute" to match "Artist" (CsvPlaylistImporterTest.rejectsDifferentArtistsVersionsAndMissingMetadata).
  • CsvPlaylistImporter.queryVariants: Restored full query shape permutations (including inverted artist/title and base title variants) so empty search passes retry across all candidate forms (CsvPlaylistImporterTest.retriesEmptySearchesBeforeGivingUpOnARow).
  • CsvPlaylistImporter.parseTracks: Updated hasHeader detection to verify that the first row does not contain purely numeric track/index cells, ensuring headerless numeric CSV files (e.g. 1,Song,Artist) are not discarded as headers (CsvPlaylistImporterTest.skipsIndexAndTrackNumberColumnsCorrectly).

…kend crash

Local suspend functions capturing outer coroutine scope can trigger internal compiler errors in Kotlin's IR backend.
@ajisth69 ajisth69 changed the title fix(build): inline downloadToTempFile to fix Kotlin compiler crash fix(build): eliminate JVM monitor overflow and resolve test regressions Oct 5, 2026
@ajisth69 ajisth69 changed the title fix(build): eliminate JVM monitor overflow and resolve test regressions fix: lossless candidate matching, compiler JVM monitor overflow, and test regressions Oct 5, 2026
@ajisth69
ajisth69 merged commit 613ddbf into main Oct 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