Heads up in case anyone else hits this on main: the 6.5-dev compiler crashes with a SIL verification error (debug_value undef in the OwnershipModelEliminator pass) when an async throws function spawns a Task capturing both a loop variable and an enclosing Mutex inside a task group. It compiles fine on 6.4, so it looks like a recent regression.
Minimal repro and crash backtrace are in the issue: Compiler crash on main (6.5-dev): SIL verification error (debug_value undef) on Mutex captured in nested Task inside task group · Issue #90211 · swiftlang/swift · GitHub
Caught it in CI on a real test, then reduced it to about 20 lines. Posting here in case it rings a bell for anyone working on the ownership SIL passes.