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

dialects: (hw) Fix printing of module visibility #2512

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

Moxinilian
Copy link
Contributor

While the visibility test was working, the practical roundtripping of private modules did not work properly. The reason for this is that there was a typo in the definition of the visibility attribute, which was cancelled out by the fact that roundtriping goes through generic format!

This seems to be a more fundamental issue of the testing infrastructure, so I am not sure how to add more tests that would cover this. @math-fehr @superlopuh

@Moxinilian Moxinilian added bug Something isn't working dialects Changes on the dialects labels Apr 29, 2024
@Moxinilian Moxinilian self-assigned this Apr 29, 2024
Copy link

codecov bot commented Apr 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.84%. Comparing base (ba1bdd4) to head (0b9490a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2512   +/-   ##
=======================================
  Coverage   89.84%   89.84%           
=======================================
  Files         351      351           
  Lines       43769    43769           
  Branches     6529     6529           
=======================================
  Hits        39323    39323           
  Misses       3486     3486           
  Partials      960      960           

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

@PapyChacal
Copy link
Collaborator

PapyChacal commented Apr 29, 2024

Nice catch!
The only way to test generic syntax is to test it explicitly IMO.
I see those filechecks are using // RUN: XDSL_ROUNDTRIP and // CHECK:.
There are complementary helpers; you can just add a // RUN: XDSL_GENERIC_ROUNDTRIP and use // CHECK-GENERIC: wherever in the same file to test the generic syntax output specifically 🙂

So I don't see anything fundamental about the testing infrastructure rather than the test itself here; if you do, could you expand? I'm always curious about ways to improve it

@Moxinilian
Copy link
Contributor Author

Moxinilian commented Apr 29, 2024

No I think you misunderstood the problem.

XDSL_ROUNDTRIP does xdsl-opt %s --print-op-generic --split-input-file | xdsl-opt --split-input-file. While xdsl-opt %s | xdsl-opt would have spotted the problem, this specific problem is such that doing xdsl-opt --print-op-generic | xdsl-opt hides it, because xDSL internals happen to not trigger the bug when the operation is newly parsed, and the generic format does not run the buggy printer.

For what it's worth, the hw tests already run XDSL_GENERIC_ROUNDTRIP as well.

@superlopuh
Copy link
Member

I'm confused, which tests are broken, and what do they miss?

@superlopuh
Copy link
Member

Ah, indeed, I'd expect it to not print the generic syntax. When I change the macro locally one test fails, but I assume it's for a different reason. Maybe we can change the macro?

@Moxinilian Moxinilian merged commit e43f913 into xdslproject:main Apr 29, 2024
10 checks passed
@Moxinilian Moxinilian deleted the fix-module-print branch April 29, 2024 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dialects Changes on the dialects
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants