Skip to content

fix(coverage): increase rayon worker stack to 8 MB#22790

Merged
graphite-app[bot] merged 1 commit into
mainfrom
12-coverage-stack-size
May 28, 2026
Merged

fix(coverage): increase rayon worker stack to 8 MB#22790
graphite-app[bot] merged 1 commit into
mainfrom
12-coverage-stack-size

Conversation

@Boshen

@Boshen Boshen commented May 28, 2026

Copy link
Copy Markdown
Member

Summary

cargo coverage (a.k.a. just c) crashes locally on macOS with fatal runtime error: stack overflow while running semantic_typescript on typescript/tests/cases/compiler/binderBinaryExpressionStressJs.ts. That fixture builds a ~1500-deep left-leaning BinaryExpression chain (0 + 1 + 2 + ... + 1499).

macOS's std::thread default stack is 2 MB; Linux is 8 MB, which is why CI doesn't see this. The file used to fit because OxcDiagnostic was 8 bytes (Box<OxcDiagnosticInner>); after #22406 inlined the ~200-byte inner, every recursive frame holding a diagnostic grew, pushing past 2 MB on macOS.

This sets the rayon pool's stack_size to 8 MB to match Linux's default. Scope is limited to the dev coverage task — the perf win from #22406 is preserved, and no runtime consumers (parser, semantic, oxlint, oxfmt) are affected.

Verified just c runs end-to-end on macOS after the change.

@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label May 28, 2026

Boshen commented May 28, 2026

Copy link
Copy Markdown
Member Author

Merge activity

## Summary

`cargo coverage` (a.k.a. `just c`) crashes locally on macOS with `fatal runtime error: stack overflow` while running `semantic_typescript` on `typescript/tests/cases/compiler/binderBinaryExpressionStressJs.ts`. That fixture builds a ~1500-deep left-leaning `BinaryExpression` chain (`0 + 1 + 2 + ... + 1499`).

macOS's `std::thread` default stack is 2 MB; Linux is 8 MB, which is why CI doesn't see this. The file used to fit because `OxcDiagnostic` was 8 bytes (`Box<OxcDiagnosticInner>`); after #22406 inlined the ~200-byte inner, every recursive frame holding a diagnostic grew, pushing past 2 MB on macOS.

This sets the rayon pool's `stack_size` to 8 MB to match Linux's default. Scope is limited to the dev coverage task — the perf win from #22406 is preserved, and no runtime consumers (parser, semantic, oxlint, oxfmt) are affected.

Verified `just c` runs end-to-end on macOS after the change.
@graphite-app graphite-app Bot force-pushed the 12-coverage-stack-size branch from 05c667d to 18079db Compare May 28, 2026 09:48
@graphite-app graphite-app Bot merged commit 18079db into main May 28, 2026
27 checks passed
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label May 28, 2026
@graphite-app graphite-app Bot deleted the 12-coverage-stack-size branch May 28, 2026 09:52
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