Skip to content

--check-only hangs on a four-line self-application during eager beta reduction #973

Description

@jasisz

What you did

Run bun bend2/main.ts omega.bend --check-only on the file below.

What happened

The command consumes a CPU core indefinitely and produces no output. I confirmed that it was still running after 20 seconds and had to interrupt it. The same command on ordinary invalid files returns immediately with a diagnostic.

The term is invalid and should be rejected quickly: the lambda parameter is self-applied and used twice. This is therefore a frontend/checker denial of service from a four-line source file, rather than accepted nontermination.

The file

type Empty is Data:

def boom() -> Empty:
  (x => x(x))(x => x(x))

Cause

term_higher eagerly beta-reduces an App whenever its elaborated function is a Lam: bend.ts:781-787. For Ω, substituting the right lambda into x(x) reconstructs the same application, so term_higher recurses forever before term_check can reject the non-inferrable or affine-invalid lambda.

I have not derived a checked nonterminating term or an inhabitant of Empty; the observed issue is nontermination while processing invalid input.

Version / system

Bend 2.0.25 (a49524265bdf), Bun 1.4.2, Darwin arm64 27.0.

Activity

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

    wontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions