Skip to content

Test long-form pipeline panics, cancellation and memory bound on CPU #41

Open

Description

@praveenperera

The long-form pipeline's panic, cancellation and memory-bound behaviour is only tested on a GPU. Every relevant test is #[ignore]d, so CI never runs them:

  • gpu_cancellation_stops_workers (src/long_form.rs:1303)
  • gpu_workers_join_after_the_first_preprocessor_error (:1381)
  • gpu_batched_worker_panic_does_not_hang (:1418)

The bound in the run_batched_plan doc comment, "workers stay at most one batch ahead of the model", is not asserted anywhere. This is the code where review kept finding hangs: worker panic, then consumer panic, then the batched path. #9, #35 and #40 each fixed one of them.

Proposal

  • Let run_batched_plan and run_parallel_plan run with a fake CPU pipeline that can panic, return an error, or stall on any window index
  • Inject a panic, an error and a cancel at every window index, in each role:
    • preparing worker
    • model consumer
    • VAD scan thread
    • planner
  • Check every run:
    • it returns rather than hangs
    • it returns the injected error, not a different one
    • all threads are joined
    • a failed run does not cancel the caller's TranscriptionControl
    • the windows held in memory never exceed 2 * batch_size
  • Run Lookahead, StopOnPanic, StopRunOnPanic and ClosePlan under shuttle, or loom if the state space stays small, so lost wakeups between the Mutex/Condvar gate and the sync_channel are found by search instead of by luck
  • Do the same for the scheduler's StopOnExit path
  • Run all of it in the normal CI job

Code (master 230e027)

  • src/long_form/execute.rs:170-186: path choice
  • src/long_form/execute.rs:207-330: batched path; sync_channel(batch_size) at :228, allow at :303
  • src/long_form/execute.rs:333-399: parallel path and collector
  • src/long_form/execute.rs:450-515: Lookahead and StopOnPanic
  • src/long_form.rs:372-401, :683-706: planner thread, ClosePlan, StopRunOnPanic
  • src/long_form/vad.rs:94-161: scan threads with an unbounded channel
  • src/scheduler.rs:422-436, :788-815: StopOnExit

Activity

  1. added
    enhancement
    on Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions