Skip to content

gh-136438: Make sure test_generated_cases pass with all optimization levels #136594

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

Merged
merged 2 commits into from
Jul 21, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Tools/cases_generator/optimizer_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,9 @@ def generate_abstract_interpreter(
out.emit("\n")
base_uop_names = set([uop.name for uop in base.uops.values()])
for abstract_uop_name in abstract.uops:
assert (
abstract_uop_name in base_uop_names
), f"All abstract uops should override base uops, but {abstract_uop_name} is not."
if abstract_uop_name not in base_uop_names:
raise AssertionError(f"All abstract uops should override base uops, "
Copy link
Member

@Eclips4 Eclips4 Jul 19, 2025

Choose a reason for hiding this comment

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

Though I'm not sure, from an architectural point of view, that raising AssertionError manually is appropriate. I think we should change it to ValueError and handle it in the tests. WDYM?

Copy link
Contributor Author

@efimov-mikhail efimov-mikhail Jul 19, 2025

Choose a reason for hiding this comment

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

I'm agree that raising ValueError would be better. My first attempt was just to make as few changes to code as possible.

Copy link
Member

Choose a reason for hiding this comment

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

I guess it's ok to change it in this PR. Catching an AssertionError is semantically incorrect :)

"but {abstract_uop_name} is not.")

for uop in base.uops.values():
override: Uop | None = None
Expand Down
Loading