-
-
Notifications
You must be signed in to change notification settings - Fork 17
LT-22190 Use BitArray for large symbolic feature value sets #330
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
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #330 +/- ##
==========================================
+ Coverage 72.22% 72.28% +0.06%
==========================================
Files 414 416 +2
Lines 35169 35388 +219
Branches 4871 4894 +23
==========================================
+ Hits 25401 25581 +180
- Misses 8676 8705 +29
- Partials 1092 1102 +10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ddaspit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good. I just have a couple of comments. We should also see if we can optimize some of the methods that create create a lot of BitArray instances, such as ExceptWith. I think we can remove some of the extra instances creations.
@ddaspit reviewed 2 of 6 files at r1, all commit messages.
Reviewable status: 2 of 6 files reviewed, 2 unresolved discussions
src/SIL.Machine/FeatureModel/ISymbolicFeatureValue.cs line 5 at r1 (raw file):
namespace SIL.Machine.FeatureModel { internal interface ISymbolicFeatureValue
Can we rename this to make it more clear how this is different than the SymbolicFeatureValue class? Maybe ISymbolicFeatureValueState. We should rename all of the associated classes as well.
src/SIL.Machine/FeatureModel/SymbolicFeature.cs line 52 at r1 (raw file):
} internal ulong MaskUlong
We should pass the mask into the constructor of the ISymbolicFeatureValue implementation. It would also be nice to add an internal method to SymbolicFeature that creates the ISymbolicFeatureValue class. SymbolicFeatureValue would call it. That way you don't need to expose the mask properties.
Please make some suggestions of what this might be. I had problems getting some tests to pass until I made copies of these.
The classes that implement this interface are two different ways of handling the original _flags property, with one exception: SetFirst() that uses _flags to set the First property. What do you think of changing the name to ISymbolicFeatueValueFlags or ISymbolicFeatueValueFlagsImpl?
I'm not following this yet. Maybe it will be clearer tomorrow... |
ddaspit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make some suggestions of what this might be. I had problems getting some tests to pass until I made copies of these.
I will take a look and see if I can make more specific suggestions.
What do you think of changing the name to ISymbolicFeatueValueFlags or ISymbolicFeatueValueFlagsImpl?
I'm good with either of your name suggestions.
Reviewable status: 2 of 6 files reviewed, 2 unresolved discussions (waiting on @AndyBlack)
|
Is this a duplicate/updated version of this PR? |
ddaspit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't done a good job of communicating my suggestions, so I will try making some of the changes and let you finish it up.
Reviewable status: 2 of 6 files reviewed, 2 unresolved discussions (waiting on @AndyBlack)
Sounds good. Thanks. |
|
@ddaspit Your changes are instructive and all look good to me. What is the proper etiquette here as far as approving the changes goes? Should I review them now? Or you? Or someone else? |
ddaspit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Enkidu93 Can you review my changes?
@ddaspit reviewed all commit messages.
Reviewable status: 0 of 10 files reviewed, 1 unresolved discussion (waiting on @AndyBlack)
Enkidu93
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep! Sorry - I was out of town for a few days.
@Enkidu93 reviewed 10 of 10 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @AndyBlack)
AndyBlack
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @AndyBlack)
|
@ddaspit Eli approved your changes. I'm new to how this review system works. It looks like someone like you still needs to approve something. Is that right? If not, what is needed? Thanks. |
AndyBlack
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @AndyBlack)
ddaspit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ddaspit reviewed 10 of 10 files at r2.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @AndyBlack)
- rename interfaces and classes
ddaspit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ddaspit reviewed all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @AndyBlack)
This is a fix related to "L[T-22190 Hermit Crab adds wrong POSes to compound rules when there are more than 64 POSes"
The problem is that Machine uses a ulong to represent the possible values of a feature. This solution uses a BitArray instead of a ulong whenever there are more than sizeof(ulong) * 8 (=64) values.
The solution attempts to use composition instead of inheritance
.
This change is