E6021

E6021 — A violation of the async/synchronization discipline in a lowering body: a destination read while an async_copy into it is still outstanding, a body that ends with copies no async_wait covers, or a lowering for a synchronizing edge whose body does not end with raw::barrier() (the seam obligation of hir/seam.rs: a relaxed publication makes a stale read reachable).

What the compiler reports

E6021
no matching

The fragments the test suite holds the compiler to. An ellipsis marks text the test does not constrain; the emitted message also carries a source location.

A program that triggers it

// A copy with no wait: the engine may still be writing when the transfer
// returns. The barrier does not clear it -- only raw::async_wait() does.
Topology Dev {
  memory: Memory::L2,
  visible: [Memory::L2, Memory::SMEM],
  transfer Memory::CPU_DRAM -> Memory::L2 : 10 GB/s,
  transfer Memory::L2 -> Memory::SMEM copy_engine
}
impl Transfer<Memory::L2, Memory::SMEM> for Topology::Dev {
  fn move_tile(src: &Tensor<f32, [4]>, dst: &mut Tensor<f32, [4]>) -> i32 {
    raw::async_copy(dst, src, 0);
    raw::barrier();
    return 0;
  }
}
fn main() -> i32 {
  return 0;
}

From tests/middle_end/fail/raw_async_unwaited.vx, which asserts this diagnostic on every commit.

Related