You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bound lyric harmonization timestamps and window count to prevent browser hangs #28
chordr/screen.js filters individual token start/duration values for finiteness, but _harmonizeMelody adds them and iterates every window until that endpoint. A valid numeric token {start: 1e308, duration: 1e308, midi: 60} overflows the endpoint to Infinity and never completes. Large finite timestamps also cause impractically many synchronous iterations on the browser main thread.
Reproduced through window.chordr.generateAccompanimentFromLyrics with a mocked schema_version 1 playback response containing that token; a Node child process exceeded a two-second timeout. Existing 100 JS and 18 Python tests pass.
Please validate the summed endpoint and supported song horizon, bound work independently of timestamps, and return a graceful unavailable/invalid result. Add regression coverage for overflow and very large finite timestamps.
Built and opened PR #31: "Bound lyric harmonization timestamps and window count to prevent browser hangs (#28)" — #31
_harmonizeMelody (chordr/screen.js:1116) now validates the summed endpoint t.start + t.duration for finiteness and against a supported 15-minute song horizon (sharing routes.py's MAX_AUDIO_DURATION_SECONDS), returns the existing graceful null for out-of-bound melodies, and hard-caps the window loop (MAX_HARMONY_WINDOWS) independently of timestamps — so the issue's repro {start: 1e308, duration: 1e308, midi: 60} no longer overflows to an infinite main-thread loop, and large finite spans no longer iterate billions of windows.
Coverage: 3 new tests (overflow with a real token alongside; very large finite span beyond the horizon; an in-horizon ≥890s boundary still harmonizes). JS suite 110/110 (was 107), Python 20/20, node --check clean. Reverting the fix to the old reduce-based endpoint makes the overflow test hang (killed by external 12s timeout), proving the regression pins it. Docs/version kept in sync: README null-conditions, CHANGELOG ### Fixed, plugin.json 0.6.1→0.6.2, CLAUDE.md prose + count.
Activity
pullfrog commentedon Oct 11, 2026
pullfrog commentedon Oct 11, 2026
Built and opened PR #31: "Bound lyric harmonization timestamps and window count to prevent browser hangs (#28)" — #31
_harmonizeMelody(chordr/screen.js:1116) now validates the summed endpointt.start + t.durationfor finiteness and against a supported 15-minute song horizon (sharingroutes.py'sMAX_AUDIO_DURATION_SECONDS), returns the existing gracefulnullfor out-of-bound melodies, and hard-caps the window loop (MAX_HARMONY_WINDOWS) independently of timestamps — so the issue's repro{start: 1e308, duration: 1e308, midi: 60}no longer overflows to an infinite main-thread loop, and large finite spans no longer iterate billions of windows.Coverage: 3 new tests (overflow with a real token alongside; very large finite span beyond the horizon; an in-horizon ≥890s boundary still harmonizes). JS suite 110/110 (was 107), Python 20/20,
node --checkclean. Reverting the fix to the oldreduce-based endpoint makes the overflow test hang (killed by external 12s timeout), proving the regression pins it. Docs/version kept in sync: README null-conditions, CHANGELOG### Fixed,plugin.json0.6.1→0.6.2, CLAUDE.md prose + count.Task list (7/7 completed)
big-pickle(free) | 𝕏Bound lyric harmonization timestamps and window count (#28)