Skip to content

[Transcribe] Graceful interruption support#2019

Merged
stakira merged 4 commits intostakira:masterfrom
yqzhishen:transcribe-graceful-exit
Mar 22, 2026
Merged

[Transcribe] Graceful interruption support#2019
stakira merged 4 commits intostakira:masterfrom
yqzhishen:transcribe-graceful-exit

Conversation

@yqzhishen
Copy link
Copy Markdown
Collaborator

@yqzhishen yqzhishen commented Mar 21, 2026

Behavior before this PR

  • Even if the user closes the progress dialog manually, the MIDI and pitch extraction tasks continue and generate a voice part.
  • If any task raises an error, the modal dialog doesn't close.

Bahavior after this PR

  • Once the progress dialog is closed, the running inference session terminates gracefully, the task returns null, the memory is released, and nothing will be generated.
  • UI cleanup happens in both sucess and failure paths.

Copilot AI review requested due to automatic review settings March 21, 2026 09:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds cooperative cancellation for the Transcribe workflow so that closing the progress dialog attempts to terminate ONNX inference and prevents generating a new voice part.

Changes:

  • Hook progress dialog close to trigger interruption of SOME/GAME/RMVPE inference and skip part creation.
  • Add RunOptions-based termination + Interrupt() implementations to SOME/GAME/RMVPE transcribers.
  • Update MidiExtractor.Transcribe() to treat OperationCanceledException as a graceful cancel (return null) and expose a base Interrupt() hook.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
OpenUtau/Views/MainWindow.axaml.cs Wires dialog-close cancellation into transcribe + pitch inference pipeline and guards part creation.
OpenUtau.Core/Analysis/MidiExtractor.cs Catches cancellation and adds virtual Interrupt() for derived extractors.
OpenUtau.Core/Analysis/Some.cs Uses RunOptions termination + maps ORT termination to OperationCanceledException.
OpenUtau.Core/Analysis/Game.cs Adds RunOptions termination across pipeline sessions + Interrupt().
OpenUtau.Core/Analysis/Rmvpe.cs Adds RunOptions termination + Interrupt() and makes Infer return nullable on termination.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread OpenUtau/Views/MainWindow.axaml.cs Outdated
Comment thread OpenUtau/Views/MainWindow.axaml.cs Outdated
Comment thread OpenUtau.Core/Analysis/Game.cs
@stakira stakira merged commit ba259ed into stakira:master Mar 22, 2026
6 checks passed
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.

3 participants