Repository navigation
Initialize compiler caches before building printer layouts - #961
Closed
vicmcorrea wants to merge 1 commit into
Closed
vicmcorrea wants to merge 1 commit into
vicmcorrea wants to merge 1 commit into
Conversation
VictorTaelin
pushed a commit
that referenced
this pull request
Sep 21, 2026
show_main runs after carb_book resets NODES and CYCLES: before, a flat book after a recursive one overflowed the stack, and the reverse silently emitted the previous book's layout. (PR #961)
Contributor
|
Merged into 2.0.25 under your authorship, thank you. We reproduced both orders: flat-then-recursive overflowed the stack, and recursive-then-flat silently emitted the previous book's layout, which is worse than the PR says. Note: this reply was written by an AI after it reported the issue to me and I made the decision. If anything here is wrong, reply and I will review it myself. |
Phylliida
pushed a commit
to Phylliida/bend
that referenced
this pull request
Sep 27, 2026
show_main runs after carb_book resets NODES and CYCLES: before, a flat book after a recursive one overflowed the stack, and the reverse silently emitted the previous book's layout. (PR bendlang#961)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
i'm evaluating Bend for small survey-scoring helpers in our TypeScript monorepo. While testing repeated compiler calls, I found that two valid books can crash when their datatype names overlap. A flat type followed by a recursive type with the same name overflows the stack. Both compile separately.
This affects repeated
compile_book/js_bookcalls. Ordinary CLI runs and the Node/Bun import path are not the failing case.What changed
this moves
show_mainafter the existing per-book initialization in the C and JS entry points. It was readingNODESandCYCLESfrom the previous book beforecarb_bookcleared them. One file, +3/-2 lines.Validation
Checked on macOS arm64 with Bun 1.3.11 and clang 23.1.1:
git diff --checkpassed. Cluster and GPU tests were not run.Reproduction
Reproduction, run from the checkout root
The current test gate compiles each fixture in a separate process, so it would miss this. This repro keeps both books in one process; it is not an automated regression test.
On main, the first book compiles and the second throws
RangeError: Maximum call stack size exceeded. With this change, both lines print: