Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc: store context as property on ParsingState #3997

Merged
merged 1 commit into from
Mar 2, 2025

Conversation

superlopuh
Copy link
Member

Makes it more explicit that the variable contains all the state necessary for inference.

@superlopuh superlopuh added the misc Miscellaneous label Mar 2, 2025
@superlopuh superlopuh self-assigned this Mar 2, 2025
Copy link

codecov bot commented Mar 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.16%. Comparing base (b6caa5f) to head (13cacf6).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3997   +/-   ##
=======================================
  Coverage   90.16%   90.16%           
=======================================
  Files         458      458           
  Lines       58291    58298    +7     
  Branches     5691     5691           
=======================================
+ Hits        52559    52566    +7     
  Misses       4340     4340           
  Partials     1392     1392           

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

Copy link
Collaborator

@alexarice alexarice left a comment

Choose a reason for hiding this comment

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

I'm unsure if this change is sound with InferenceContext being mutable. If it's only something we use internally then it's probably fine

@superlopuh
Copy link
Member Author

Aren't they both just as mutable as each other?

@alexarice
Copy link
Collaborator

True, I for some reason thought we were copying it when making the context but we obviously weren't

@alexarice
Copy link
Collaborator

Could you remind me of the reason for the InferenceContext. Do we expect other things to be in there?

@superlopuh
Copy link
Member Author

That's the next PR!

@superlopuh
Copy link
Member Author

I'm actually going towards using the ConstraintContext for inference again.

@@ -51,7 +50,7 @@ class ParsingState:
successors: list[Successor | None | Sequence[Successor]]
attributes: dict[str, Attribute]
properties: dict[str, Attribute]
variables: dict[str, ConstraintVariableType]
context: InferenceContext
Copy link
Collaborator

Choose a reason for hiding this comment

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

I feel context is a slightly ambiguous name but I'm getting the feeling that this is part of a bigger change that may make it make more sense

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah it's InferenceContext in this PR but will be a ConstraintContext in a future one.

@superlopuh superlopuh merged commit 3c227db into main Mar 2, 2025
17 checks passed
@superlopuh superlopuh deleted the sasha/irdl/context-property branch March 2, 2025 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
misc Miscellaneous
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants