You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
--verdict: runs that build the kernel at the same time can break each other's build #1948
--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
fix(safe): each kernel build goes in a dir of its own, renamed into p…