E6027

E6027 — A working set that overflows a space only across call boundaries: the peak along some call path — what each caller still holds when it calls, plus the deepest callee's own peak — exceeds the space's declared capacity, while every function on the path fits by itself (that case is E6010's). Computed by folding per-function capacity summaries over the call graph, after the per-function checks. Downgraded to W1028 when the space is declared overcommit.

What the compiler reports

E6027 … call path 'main -> stage$i32' … peaks at 6291456 bytes, over its 4194304 byte capacity

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

//
// Part of the Vx Project, under the Apache License v2.0 with LLVM Exceptions.
// See LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// The cross-call fold runs over the *monomorphized* call graph: the call site
// names the template, the summary belongs to the instance, and the path in
// the refusal names the instance. Same shape as the direct-call case -- the
// caller holds its tile across the call, the callee places its own, and only
// their sum overflows.
//

Memory CPU_DRAM {}
Memory W {
  within: Memory::CPU_DRAM, capacity: 4 MiB, managed: explicit
}
Topology Dev {
  arch: nvptx64,
  memory: Memory::W,
  visible: [Memory::W],
  transfer Memory::CPU_DRAM -> Memory::W : 10
  transfer Memory::W -> Memory::CPU_DRAM : 10
}

fn stage<T>(_t: T) -> i32 {
  let y = Tensor<f32, [1024, 768]>::uninit();
  let _sy = transfer(y, Memory::W);
  return 1;
}

fn main() -> i32 {
  let x = Tensor<f32, [1024, 768]>::uninit();
  let sx = transfer(x, Memory::W);
  let r = stage(7);
  let _back = transfer(sx, Memory::CPU_DRAM);
  return r;
}

From tests/frontend/fail/generic_callee_joins_the_working_set.vx, which asserts this diagnostic on every commit.

Related