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

dialect: Fix riscv verify #1271

Merged
merged 8 commits into from Jul 17, 2023
Merged

dialect: Fix riscv verify #1271

merged 8 commits into from Jul 17, 2023

Conversation

kingiler
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@math-fehr math-fehr 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 fine for the irdl.py part, but I think you should split the changes, so we have a PR with the irdl.py changes, and one with the riscv changes, which are not that related?

@kingiler
Copy link
Collaborator Author

riscv are the proof that previous implementation has some bug. I'm adding them as a test case.

compor
compor previously requested changes Jul 13, 2023
tests/dialects/test_riscv.py Show resolved Hide resolved
tests/dialects/test_riscv.py Show resolved Hide resolved
xdsl/dialects/riscv.py Outdated Show resolved Hide resolved
@compor
Copy link
Collaborator

compor commented Jul 13, 2023

riscv are the proof that previous implementation has some bug. I'm adding them as a test case.

It was not a bug per se, just an assert. Please split up the PRs.

@codecov
Copy link

codecov bot commented Jul 13, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.04 🎉

Comparison is base (d8f78bc) 89.34% compared to head (f7387e3) 89.39%.

❗ Current head f7387e3 differs from pull request most recent head 41bb9cb. Consider uploading reports for the commit 41bb9cb to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1271      +/-   ##
==========================================
+ Coverage   89.34%   89.39%   +0.04%     
==========================================
  Files         181      181              
  Lines       24080    24084       +4     
  Branches     3663     3665       +2     
==========================================
+ Hits        21515    21530      +15     
+ Misses       1991     1980      -11     
  Partials      574      574              
Impacted Files Coverage Δ
tests/dialects/test_riscv.py 100.00% <100.00%> (+7.53%) ⬆️
xdsl/dialects/riscv.py 83.83% <100.00%> (+0.07%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@kingiler
Copy link
Collaborator Author

I think it is a bug. SomeOperation.verify() does not raise VerificationException but DiagnosticException. Because of this, the check_float_register is not named test_float_register in order bypass pytests in previous PR by others.

@kingiler
Copy link
Collaborator Author

@math-fehr
Copy link
Collaborator

There are two bugs in my opinion.
One that we were returning a DiagnosticException, and the other that a test was not properly named, and thus was never tested (it could have just checked for DiagnosticException instead).

If we want to have a test for the irdl.py file, we should do so in test_irdl.py, and write a test for exactly that. Otherwise, the testing infrastructure of irdl.py depends on riscv tests, which might change in the future without a change in irdl.

So I would write a test in test_irdl.py, and have the riscv changes in another PR.

@kingiler
Copy link
Collaborator Author

Let me make separate PR.

@kingiler kingiler changed the title core: Provide better error message dialect: Fix riscv verify Jul 14, 2023
@kingiler kingiler added dialects Changes on the dialects testing PRs that modify tests minor For minor PRs, easy and quick to review, quickly mergeable labels Jul 14, 2023
@kingiler
Copy link
Collaborator Author

@math-fehr @compor I think it is ready for review.

@kingiler kingiler requested a review from adutilleul July 14, 2023 13:31
@kingiler kingiler merged commit dd95f31 into xdslproject:main Jul 17, 2023
9 checks passed
@kingiler kingiler deleted the better_error branch July 17, 2023 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dialects Changes on the dialects minor For minor PRs, easy and quick to review, quickly mergeable testing PRs that modify tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants