Skip to content

Command-line render exits 0 once its file is written - #474

Open
ItsAlphaNeon wants to merge 3 commits into
sampler-reload-samplesfrom
render-exit-sweep
Open

ItsAlphaNeon wants to merge 3 commits into
sampler-reload-samplesfrom
render-exit-sweep

Conversation

@ItsAlphaNeon

Copy link
Copy Markdown
Owner

Summary

  • lemonstudio --render wrote its WAV, then aborted at exit with code 127 whenever the project hosted a plugin that joins a thread of its own in its destructor (Citrus, through nih_plug's background worker). Scripts that check the exit code saw a failed render.
  • Cause: the render left its instances on the session's retired list, a thread-local that the window empties every tick and at exit. Their destruction was left to the process's exit, after Windows had already ended their threads, so the worker's join panicked inside a thread-local destructor, which aborts.
  • The render now drops its session and sweeps the retired list on its own thread before it returns.
  • Also: dropout_log::tests::a_hold_tells_running_from_waiting (unix) now works until the thread has run 10 ms rather than for a fixed 20 ms. On a loaded CI runner, 20 ms of work ran 9.9 ms of CPU and failed Activate hosted plugins before restoring their saved state #472's Linux job.

Found while checking #305's Citrus centre-level report against FL tonight. That item, like the other nine in #305, is already fixed on main: FL's and Lemon's renders of FL's own Sytrus render test null at -87 dB, with 0.00 dB level difference.

Stacked on #473 (that branch is merged in).

Test plan

  • render::tests::a_looping_sample_stops_at_its_notes_end now also asserts nothing is left retired after a render. It fails without the sweep (left: 1).
  • Release build on Windows: rendering FL's Render tests/Sytrus.flp (a Citrus channel) exits 0, where it exited 127 before, and the audio is unchanged.
  • cargo test --workspace --locked on Windows: 2713 passed, 0 failed.
  • The unix-only timing test runs on CI's Linux and macOS jobs.

🤖 Generated with Claude Code

ItsAlphaNeon and others added 3 commits December 3, 2026 02:27
…shed render exits 0

lemonstudio --render left the instances it hosted on the retired list, and they were destroyed in the
process's exit, after Windows had ended their threads. Citrus joins a thread of its own in its
destructor, so a render that had written its WAV aborted with exit code 127. The render now drops its
session and sweeps the retired list on its own thread, as the window does at exit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d 20 ms

On a loaded CI runner 20 ms of busy work ran 9.9 ms of CPU and failed a_hold_tells_running_from_waiting
(Linux, PR #472). The loop now works until its running time reaches 10 ms, failing only if it never does
within 2 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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