Open and answer this issue on GitHub.
compiler, ready · opened 2026-10-12 · updated 2026-10-29 · 1 comment
By the self-hosting sessions of 2026-10-11 (emit U1a, and the check-core planning). Not measured with callgrind yet (counts, never time, per CLAUDE.md); the figures below are observations.
ifs and blocks are exponential: 16 levels took 0.6-1.7 s, 60 nested parentheses did not finish in 60 s, and 16 blocks with a missing } ran past 20 s..abs() chain overflows after parsing between 1,600 and 1,800 (default 8 MB stack).emit_deep_nesting.rs and check_deep_nesting.rs therefore chain (calls 500, lists 500, ?? 500, a chain of 1,000) and never nest parentheses, ifs or blocks.if expressions and blocks 64 deep and finishes (today it does not); a missing-} case that reports the error without backtracking blow-up. Measure with callgrind (instructions) at 8, 12 and 16 levels to show the growth.callgrind_annotate) and remove the re-parse (parse once and decide, or memoise by position).Fixes #<this issue> on the last commit.Related: #125, the checker core plan (docs/selfhosting-plan.md, “C-6 in units”: a 2,953-line match is one large frame).
Triage (#982), class B: waits for the parser R rows (after #903 and #557). The fix lands in parser/mod.rs’s grammar!.
Generated by Claude Code