E6028

E6028 — A recursive cycle that places tiles in a space with a declared capacity. The recursion depth is not known at compile time, so the true peak is unbounded and the placement is refused conservatively. Downgraded to W1028 when the space is declared overcommit.

What the compiler reports

E6028 … 'deep' calls itself and places up to 3145728 bytes in memory space 'W' per activation … unbounded

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
//
// One 3 MiB tile per activation, and the depth is a runtime value: the peak is
// depth * 3 MiB against a 4 MiB space, with nothing at compile time to bound
// it. The fold refuses the cycle conservatively. A future `requires` capacity
// contract on the recursive function is the principled lift: the body would
// check as own footprint + recursive requires within the declared bound.
//

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
}

fn deep(n: i32) -> i32 {
  let x = Tensor<f32, [1024, 768]>::uninit();
  let _sx = transfer(x, Memory::W);
  if n <= 0 {
    return 0;
  }
  return deep(n - 1);
}

fn main() -> i32 {
  return deep(64);
}

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

Related