Skip to content

3.14 support#97

Merged
15r10nk merged 22 commits intomasterfrom
3.14
Aug 28, 2025
Merged

3.14 support#97
15r10nk merged 22 commits intomasterfrom
3.14

Conversation

@15r10nk
Copy link
Collaborator

@15r10nk 15r10nk commented Mar 4, 2025

No description provided.

@frenzymadness
Copy link
Contributor

With this patch we are down to 31 failed tests. It'd be great to merge the 3.14 into the CI as a separate PR so we can see the results here.

@15r10nk 15r10nk force-pushed the 3.14 branch 3 times, most recently from cc340e5 to 71e11cf Compare March 5, 2025 07:47
@frenzymadness
Copy link
Contributor

I'd be nice to move this forward. Python 3.14 is beta 3 now so no breaking changes are expected anymore.

@15r10nk 15r10nk force-pushed the 3.14 branch 2 times, most recently from e1a9923 to 2b43bfa Compare June 18, 2025 21:56
@15r10nk
Copy link
Collaborator Author

15r10nk commented Jun 19, 2025

@frenzymadness, thank you for reminding me. I fixed some issues (mostly part of the verification and not in the algo). I also found a cpython issue python/cpython#135700 and hope that it can be fixed because it hard to work around it in executing.

@alexmojaki
Copy link
Owner

Python 3.14.0 release candidate 2 was released yesterday. The final release will be on 7 October.

@15r10nk 15r10nk force-pushed the 3.14 branch 2 times, most recently from 18b953f to 90b6317 Compare August 17, 2025 13:36
@15r10nk
Copy link
Collaborator Author

15r10nk commented Aug 17, 2025

hi @alexmojaki, This one is almost ready. The open problem with 3.9 is caused by one new small sample which are part of this pr. This problem can be fixed with #95. Can we merge it before this one?

@15r10nk 15r10nk marked this pull request as ready for review August 21, 2025 22:09
@15r10nk
Copy link
Collaborator Author

15r10nk commented Aug 21, 2025

@alexmojaki I think you can review this.
I have to say that the logic here gets harder with every release. Especially the tests/verification could be simplified. I hope I find some time in the future to refactor parts of it.

# https://github.com/python/cpython/issues/135700
raise KnownIssue("synthetic opcodes in annotations are just bound to the first node")

if self.frame.f_code.co_name=="__annotate__" and instruction.opname=="STORE_SUBSCR":
Copy link
Owner

Choose a reason for hiding this comment

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

does this mean executing won't work inside a function called __annotate__?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You are right, this is what it currently does. What it should do is handle some instructions in annotations, and only those. Will fix it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it is not possible to make this more precise.

This is one example which fails when I remove this code:

[0]                                                                                                 
unique_name_0: 0                                                                                    
unique_name_1: 0                                                                                    

The problem here is that the unique_name_0: 0 creates a STORE_SUBSCR in the middle of the annotate bytecode.

     50  1:0    1:3   STORE_SUBSCR()                           VerifierFailure: ast.List is not created 
                                                               from STORE_SUBSCR                        

And this bytecode is mapped to [0] which is completely unrelated to the annotation (it happens to be the first statement in the file).

It is general possible to map instructions in annotations to ast-nodes, but the problem is that the synthetic generated instructions are mapped to an unrelated ast-node (the first in the file). This issue describes the problem.

I have currently no better idea to work around this problem.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think I have found a way.

Copy link
Owner

Choose a reason for hiding this comment

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

so is it ready for re-review?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes

Copy link
Owner

@alexmojaki alexmojaki left a comment

Choose a reason for hiding this comment

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

Thanks! It all looks a bit crazy but oh well, doesn't seem to hurt the common use cases.

@15r10nk
Copy link
Collaborator Author

15r10nk commented Aug 27, 2025

Yes, it is a bit crazy how these annotations are implemented. This causes several exceptions for our current tests. I hope I can simplify it in the future.

@alexmojaki
Copy link
Owner

Merge if you're happy

@15r10nk 15r10nk merged commit 5ed2ba3 into master Aug 28, 2025
8 checks passed
@15r10nk 15r10nk deleted the 3.14 branch August 28, 2025 14:58
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.

3 participants