Skip to content

Metal: a ! call reaching F32.show fail-stops with "a function the device does not hold" #1128

Open

Description

@nicolas-abril

What you did

bend show_bang.bend -o show_bang   # built with Metal
./show_bang --gpu off
./show_bang --gpu on

What happened

--gpu off: 1.5
--gpu on:  bend: a function the device does not hold

A ! call that reaches F32.show fail-stops on the device, while the CPU lanes print 1.5. The fuzzer saw F32.read do the same: the device stubs hold neither. The fuzzer skips these programs as a known limit (metal-host-only).

The file

import Base

def sh(x: F32) -> String:
  F32.show(x)

def main() -> IO(Unit):
  IO.print(sh!(1.5))

bend --version

Bend 2.0.32 (main d2066a52); also on 2.0.31 (af569d48)

uname -sm

Darwin arm64

clang --version (the first line)

Apple clang version 17.0.0 (clang-1700.6.4.2)

Found by the bend2 differential fuzzer.

Activity

  1. added
    bug
    on Sep 27, 2026
  2. changed the title [-]A 24 KB string literal overflows the stack in both emitters, while the check and the interpreter pass[/-] [+]Metal: a `!` call reaching F32.show fail-stops with "a function the device does not hold"[/+] on Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions