Skip to content

Disable compiler stack switching in Python 3.14#9168

Merged
alexreinking merged 1 commit into
mainfrom
alexreinking/fix-python-stack
Jun 2, 2026
Merged

Disable compiler stack switching in Python 3.14#9168
alexreinking merged 1 commit into
mainfrom
alexreinking/fix-python-stack

Conversation

@alexreinking
Copy link
Copy Markdown
Member

@alexreinking alexreinking commented May 31, 2026

Python 3.14 caches C stack limits in the thread state, which does not interact well with Halide's user-space compiler stack when warnings call back into Python. Stay on Python's stack by default for Python 3.14+, while preserving the existing Halide behavior when HL_COMPILER_STACK_SIZE is explicitly set.

Fixes #9167

Tested:

cmake --build build/macOS --target Halide_Python -j8
uv run --no-sync ctest --test-dir build/macOS -R python_correctness_realize_warnings -V
uv run --no-sync ctest --test-dir build/macOS -L python --output-on-failure

@alexreinking alexreinking added release_notes For changes that may warrant a note in README for official releases. python Issues related to Halide/Python interop labels May 31, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@7e2ecf2). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9168   +/-   ##
=======================================
  Coverage        ?   69.35%           
=======================================
  Files           ?      254           
  Lines           ?    78216           
  Branches        ?    18712           
=======================================
  Hits            ?    54247           
  Misses          ?    18480           
  Partials        ?     5489           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@alexreinking
Copy link
Copy Markdown
Member Author

Failure appears intermittent / obviously unrelated (OpenCL, not in Python).

@alexreinking alexreinking merged commit 2033ff5 into main Jun 2, 2026
24 of 25 checks passed
@alexreinking alexreinking deleted the alexreinking/fix-python-stack branch June 2, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Issues related to Halide/Python interop release_notes For changes that may warrant a note in README for official releases.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Halide warnings trigger "recursion" errors on Python 3.14+

2 participants