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

Fixes for LogicValue operation bugs related to size, sign, math, and comparison #319

Merged
merged 13 commits into from
Sep 18, 2023

Conversation

ganewto
Copy link
Contributor

@ganewto ganewto commented Mar 17, 2023

Description & Motivation

Adds two tests for wide bitvector comparisons. Adds a fix for one of them.
The remaining problem is that shifting a 1 into the signed position and then converting to bigint results in a negative number regardless.

Related Issue(s)

Fix #299

Testing

Created two tests that do comparisons. One just breaks the length check. The other puts a 1 in the sign location just before conversion to BigInt (the fix for the first).

Backwards-compatibility

Is this a breaking change that will not be backwards-compatible? If yes, how so?

The change is in the core logic comparison operation so more tests may be needed.

Documentation

Does the change require any updates to documentation? If so, where? Are they included?

No

@quekyj
Copy link
Contributor

quekyj commented Mar 20, 2023

Maybe update your Related Issue to verb Fix to allow auto close of issue 299 once the pull request being merged.

E.g.

Related issue(s)

Fix #299

Copy link
Contributor

@mkorbel1 mkorbel1 left a comment

Choose a reason for hiding this comment

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

Thank you for the contributions and tests!

lib/src/values/logic_value.dart Outdated Show resolved Hide resolved
test/bigint_test.dart Outdated Show resolved Hide resolved
test/bigint_test.dart Outdated Show resolved Hide resolved
test/bigint_test.dart Outdated Show resolved Hide resolved
test/bigint_test.dart Outdated Show resolved Hide resolved
lib/src/values/logic_value.dart Outdated Show resolved Hide resolved
@ganewto
Copy link
Contributor Author

ganewto commented Jul 25, 2023

I made a one-line change that fixes the original test. I haven't made tests for the other observations on the 64-bit boundary,

Copy link
Contributor

@mkorbel1 mkorbel1 left a comment

Choose a reason for hiding this comment

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

thank you this is looking great so far!

test/big_logic_value_test.dart Outdated Show resolved Hide resolved
test/big_logic_value_test.dart Outdated Show resolved Hide resolved
@mkorbel1 mkorbel1 changed the title two tests, one fix for wide bitvector comparison Fixes for LogicValue operation bugs related to size, sign, math, and comparison Sep 13, 2023
lib/src/values/logic_value.dart Outdated Show resolved Hide resolved
test/big_logic_value_test.dart Outdated Show resolved Hide resolved
Copy link
Contributor

@mkorbel1 mkorbel1 left a comment

Choose a reason for hiding this comment

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

I think this all looks great to me, thank you so much!

Just a handful of minor cosmetic/comment changes before merging it in

lib/src/values/logic_value.dart Outdated Show resolved Hide resolved
test/big_logic_value_test.dart Outdated Show resolved Hide resolved
test/big_logic_value_test.dart Outdated Show resolved Hide resolved
test/big_logic_value_test.dart Outdated Show resolved Hide resolved
lib/src/values/logic_value.dart Show resolved Hide resolved
Copy link
Contributor

@mkorbel1 mkorbel1 left a comment

Choose a reason for hiding this comment

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

Looks great, thank you!

@mkorbel1 mkorbel1 merged commit 2ef187e into intel:main Sep 18, 2023
2 checks passed
@mkorbel1 mkorbel1 linked an issue Sep 18, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants