Skip to content

--verdict: runs that build the kernel at the same time can break each other's build #1948

Closed

Description

@nicolas-abril

--verdict builds the BendTT kernel the first time it runs (kernel_bin in bend2/safe.ts), into ~/.bend/bendtt/<hash>/. Every run builds in that same directory, writing bendtt.lean, bendtt.c and bendtt there. So runs that start together on an empty cache write over each other's files, and one of them can fail to build.

Reproduce

With $BENDTT unset and HOME pointed at an empty directory that links to the real ~/.elan (so the cache is empty), start four bend tests/check/alpha_equivalence.bend --verdict runs at once. On main, 3 of 5 tries had one run fail:

Error: BendTT infrastructure: the kernel did not build (…/leanc: ld64.lld: error: undefined symbol: main | >>> referenced by the entry point | clang: error: linker command failed with exit code 1 (use -v to see invocation) | ); --verdict needs Lean v4.34.0 (elan toolchain leanprover/lean4:v4.34.0), or $BENDTT set to a built kernel

That run's leanc read a bendtt.c that another run's lean -c was rewriting.

The cache also takes bendtt's existence as "built", and leanc writes bendtt in place. So a run could also pick up a half-written kernel, or a build cut short could leave one. I could not catch either on macOS, where bendtt appears at full size at once, but nothing guarantees that.

Scope

It only happens on the first build for a given bendtt.lean and Lean version. gates/safe.ts passes a prebuilt kernel, so the gates do not go through this path.

Activity

  1. added a commit that references this issue on Oct 29, 2026
    2230009
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions