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

core: Fix parsing for hex denseAttrs #3239

Merged
merged 2 commits into from
Oct 3, 2024

Conversation

vinayakdsci
Copy link
Contributor

Fixes #2876.

The original parsing implementation for hex denseAttrs uses format strings in struct.unpack_from(), but the format strings actually do not include the count of the chunks contained in the bytes list.

This patch fixes this behavior by embedding the number of chunks in the respective format string.

@vinayakdsci
Copy link
Contributor Author

Copy link

codecov bot commented Oct 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.90%. Comparing base (6a3446a) to head (bac9be6).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3239      +/-   ##
==========================================
- Coverage   89.91%   89.90%   -0.02%     
==========================================
  Files         440      440              
  Lines       55290    55347      +57     
  Branches     8627     8635       +8     
==========================================
+ Hits        49716    49761      +45     
- Misses       4149     4159      +10     
- Partials     1425     1427       +2     

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

@superlopuh
Copy link
Member

Could you please add a unit test that fails before your patch, and works after?

@JosseVanDelm JosseVanDelm self-requested a review October 3, 2024 11:49
@vinayakdsci
Copy link
Contributor Author

@superlopuh Added.

Copy link
Member

@superlopuh superlopuh left a comment

Choose a reason for hiding this comment

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

Very nice, thank you!

@superlopuh superlopuh added the core xDSL core (ir, textual format, ...) label Oct 3, 2024
@superlopuh superlopuh merged commit 2ae41dd into xdslproject:main Oct 3, 2024
14 checks passed
@JosseVanDelm
Copy link
Collaborator

JosseVanDelm commented Oct 3, 2024

Thanks @vinayakdsci @superlopuh !

emmau678 pushed a commit that referenced this pull request Oct 8, 2024
Fixes #2876.

The original parsing implementation for hex denseAttrs uses format
strings in `struct.unpack_from()`, but the format strings actually do
not include the count of the chunks contained in the bytes list.

This patch fixes this behavior by embedding the number of chunks in the
respective format string.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core xDSL core (ir, textual format, ...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong values on large dense arrays after xdsl-opt
3 participants