E6021
E6021 — A violation of the async/synchronization discipline in a lowering body: a destination read while anasync_copyinto it is still outstanding, a body that ends with copies noasync_waitcovers, or a lowering for a synchronizing edge whose body does not end withraw::barrier()(the seam obligation ofhir/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
Topologies and memoryThe chapter covering the rule this code enforces.
All diagnosticsEvery code the compiler can emit, grouped by stage.
E6020
raw::async_copy in a lowering for an edge no declared topology equips with a copy engine. The capability lives in the machine file (transfer A -> B copy_engine); using an absent primitive is a compile error, not a fallback.
E6022An impl transfer lowering whose edge endpoints are not visible to a topology that declares the edge — the lowering would execute on a part that cannot address the spaces it moves bytes between, which the transfer contract's space-visibility constraint forbids.