Skip to content

fix: raise C stack for INTERP tail-recursion benchmarks - #16

Merged
esrrhs merged 3 commits into
masterfrom
fix/ci-bench-stack
Sep 18, 2026
Merged

esrrhs merged 3 commits into
masterfrom
fix/ci-bench-stack

Conversation

@esrrhs

@esrrhs esrrhs commented Sep 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Master Windows/macOS CI crashed in Run benchmarks on BM_FakeLua_TailRecursion_INTERP (Windows exit 127 after n=100, macOS SIGSEGV at n=5000). The interpreter does not turn tail calls into loops, so n=5000 is a 5000-deep C++ call chain.
  • Windows: set bench_mark PE stack to 128 MiB (-Wl,--stack) because the default 1–2 MiB is too small, especially with -O0.
  • Linux/macOS: ulimit -s unlimited (fallback 65532) before running benchmarks.

Test plan

  • After merge, confirm BuildWithWindows and BuildWithMacOS Run benchmarks steps pass (this step is skipped on PRs).
  • Confirm Linux Build (release) benchmarks still pass.

Made with Cursor

esrrhs and others added 3 commits September 18, 2026 13:05
Windows and macOS CI crashed in BM_FakeLua_TailRecursion_INTERP because
the interpreter does not TCO and the default C stack is too small.

Co-authored-by: Cursor <cursoragent@cursor.com>
INTERP has no TCO, so the n=1000/5000 benches overflowed Windows/macOS
C stacks. Cover tail calls with unit tests at INTERP-safe depth instead,
and run bench_mark on pull requests so the suite fails before merge.

Co-authored-by: Cursor <cursoragent@cursor.com>
Codegen rejects fewer/extra arguments to a fixed-arity function, so
tail-call into 1-arg and 3-arg callees with matching args instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
@esrrhs
esrrhs merged commit 8fad73e into master Sep 18, 2026
9 checks passed
@esrrhs
esrrhs deleted the fix/ci-bench-stack branch September 18, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant