Skip to content

Make stacker an opt-in feature - #29505

Merged
MichaReiser merged 2 commits into
mainfrom
micha/optional-parser-stacker
Oct 20, 2026
Merged

MichaReiser merged 2 commits into
mainfrom
micha/optional-parser-stacker

Conversation

@MichaReiser

@MichaReiser MichaReiser commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Summary

Make stacker an off-by-default parser feature so embedders such as Monty can avoid stack allocations that bypass their custom allocator (and have ty crash instead).

It's an off-by-default feature because of feature unification: Monty depending on ruff_db (transitively through ty_python_semantic) would enable the stacker feature even if monty disables the parser's default features. Instead, explicitly enable stacker for the targets where it is needed (CLI, wasm) and have feature unification propagate it to all crates that ruff/ty depend on.

As discussed with @samuelcolvin in #29181

Review

The first commit groups the stacker related tests and code. It only moves code around. It's the second commit that changes the feature gating. I suggest skipping over commit 1, but have a look if you're curious.

Test Plan

Parser tests and Clippy pass with and without the feature, and repository hooks pass.

@astral-sh-bot

astral-sh-bot Bot commented Oct 19, 2026

Copy link
Copy Markdown

Typing conformance results

No changes detected ✅

Current numbers
The percentage of diagnostics emitted that were expected errors held steady at 98.24%. The percentage of expected errors that received a diagnostic held steady at 98.24%. The number of fully passing files held steady at 134/146.

@astral-sh-bot

astral-sh-bot Bot commented Oct 19, 2026

Copy link
Copy Markdown

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot

astral-sh-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

ecosystem-analyzer results

No diagnostic changes detected ✅

Flaky changes detected. This PR summary excludes flaky changes; see the HTML report for details.

Full report with detailed diff (timing results)

@astral-sh-bot

astral-sh-bot Bot commented Oct 19, 2026

Copy link
Copy Markdown

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@MichaReiser
MichaReiser force-pushed the micha/optional-parser-stacker branch from 40ad1a8 to 621e6eb Compare October 19, 2026 23:56
@MichaReiser
MichaReiser force-pushed the micha/optional-parser-stacker branch from 621e6eb to 6e3f103 Compare October 20, 2026 00:00
@MichaReiser MichaReiser changed the title [parser] Make stacker an opt-in feature [parser] Make stacker an opt-in feature Oct 20, 2026
@MichaReiser MichaReiser changed the title [parser] Make stacker an opt-in feature Make stacker an opt-in feature Oct 20, 2026
@MichaReiser MichaReiser added internal An internal refactor or improvement (not for changelogs) parser Related to the parser labels Oct 20, 2026
@MichaReiser
MichaReiser force-pushed the micha/optional-parser-stacker branch from 6e3f103 to 68524ac Compare October 20, 2026 00:02
@MichaReiser
MichaReiser marked this pull request as ready for review October 20, 2026 00:05
@MichaReiser
MichaReiser requested review from charliermarsh and removed request for dhruvmanila October 20, 2026 00:07
Comment thread .github/workflows/ci.yaml Outdated
run: cargo test --doc --all-features
# A workspace build enables stacker through the CLI crates' dependencies.
- name: "Run parser tests without stacker"
run: uv run --locked --only-dev cargo nextest run --locked -p ruff_python_parser

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just do a cargo check here?

@MichaReiser
MichaReiser force-pushed the micha/optional-parser-stacker branch from 68524ac to 1f0669e Compare October 20, 2026 00:54
@MichaReiser
MichaReiser merged commit 3e3f22d into main Oct 20, 2026
75 checks passed
@MichaReiser
MichaReiser deleted the micha/optional-parser-stacker branch October 20, 2026 01:02

This branch was previously deployed

1 inactive deployment
automations — 1f0669ec Deployed Oct 20, 2026 by MichaReiser via security-review / security review #92293
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal An internal refactor or improvement (not for changelogs) parser Related to the parser

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants