Repository navigation
fix(code): prevent native parser startup failure on macOS - #1818
Merged
Teingi merged 3 commits intoOct 2, 2026
Merged
Conversation
beatenevo
requested review from
AlexStocks,
PsiACE,
Teingi,
frostming and
zhanghuidinah
as code owners
October 1, 2026 03:54
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.
Which issue or RFC does this PR close?
Closes #1817.
Discovered while implementing and validating #1789. This fix is independent of the continuity-hint feature.
Rationale for this change
On macOS, the native parser worker fails to initialize
RLIMIT_AS, exiting before parsing begins. Index builds that need the worker then fail withcode_parser_failed.What changes are included in this PR?
RLIMIT_ASlimit; enforce a sampled RSS memory budget from the parent process on macOS.psutildependency, regression tests, and English/Chinese documentation.Are there any user-facing changes?
Native parser workers can start successfully on macOS.
Linux limits virtual address space; macOS monitors resident memory. These mechanisms are not equivalent. RSS sampling runs approximately every 100 ms under normal scheduling and may permit temporary overshoot.
No public API or persisted format changes.
How was this change tested?
uv run pytest tests/builtin/test_native_code.py -q: 62 passed on macOS / Apple Silicon, Python 3.12.14.uv run prek run -a: passed, including Ruff and type checks.git diff --cached --check: passed before committing.Memory-budget tests use real child processes with substituted worker commands to verify monitoring, termination, and index preservation. Ordinary indexing tests exercise the actual parser worker. Linux behavior was not executed locally.
AI usage statement
OpenAI Codex assisted with investigation, implementation, regression tests, documentation, and PR preparation. Validation commands were executed locally.