Skip to content

gh-126910: Verify that JIT stencils preserve frame pointer#146524

Merged
Fidget-Spinner merged 11 commits intopython:mainfrom
Fidget-Spinner:fp_verifier
Mar 27, 2026
Merged

gh-126910: Verify that JIT stencils preserve frame pointer#146524
Fidget-Spinner merged 11 commits intopython:mainfrom
Fidget-Spinner:fp_verifier

Conversation

@Fidget-Spinner
Copy link
Copy Markdown
Member

@Fidget-Spinner Fidget-Spinner commented Mar 27, 2026

This PR introduces a lightweight assembly verifier that the JIT does not clobber the frame pointer.

I verified that without #146521 , this will fail JIT compilation on x86-64. Will use CI to test AArch64.

This is expected to fail JIT CI until that PR lands.

Copy link
Copy Markdown
Contributor

@diegorusso diegorusso left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@Fidget-Spinner
Copy link
Copy Markdown
Member Author

Fidget-Spinner commented Mar 27, 2026

Alright! Confirmed all platforms that currently support frame pointers (x64 and AArch64) fail, so this means it does work!

@Fidget-Spinner
Copy link
Copy Markdown
Member Author

Just an FYI: discussed with Mark on 26 Mar UK time that we should just remove the clever tricks to get the frame address and use a simple approximate one.

@Fidget-Spinner
Copy link
Copy Markdown
Member Author

Fidget-Spinner commented Mar 27, 2026

Had to partially revert some of #146521 because the current recursion limit/stack overflow detection is working strangely after that with the JIT. Brandt's suggestion to just whack a Py_NO_INLINE on the function work. Good thing we have the verifier now so that we don't use one of the other recursion check functions and inadvertently introduce this again into the JIT.

@Fidget-Spinner Fidget-Spinner merged commit 1384f02 into python:main Mar 27, 2026
83 checks passed
@Fidget-Spinner Fidget-Spinner deleted the fp_verifier branch March 27, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants