Repository navigation
Lay out the IP Intelligence collection item as the C structure is - #199
Merged
Merged
Conversation
CollectionItem was declared with no fields, so ProfilePercentage, which holds one ahead of its weighting, read raw_weighting from the first bytes of the item's data pointer rather than 32 bytes in on a 64 bit target. It now holds the data, handle and collection pointer the C structure holds, so the weighting fiftyoneDegreesResultsIpiGetValues returns reads correctly. A test compares that weighting with the weighted value collection's for every property. Closes #156.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #156.
Problem
ProfilePercentageinfiftyone-ip-intelligence-sysholds aCollectionItemahead ofraw_weighting, andCollectionItemwas declared with no fields, where the C structure holds a data buffer, a handle and a collection pointer, 32 bytes on a 64 bit target. So a caller offiftyoneDegreesResultsIpiGetValuesread the weighting from the first bytes of the item's data pointer. #156 has the measurements and the lines involved. The engines read weightings through the weighted value collection and are not affected.Change
CollectionItemnow holds the data, handle and collection pointer the C structure holds, so the weightingfiftyoneDegreesResultsIpiGetValuesreturns reads correctly. A new test compares that weighting with the weighted value collection's for every property of the ASN data file.How it was verified
Locally on Windows, on the five native fixes merged together (this change, #193 and the other three native pull requests, at d94fa6a),
cargo fmt --all -- --checkandcargo clippy -p fiftyone-native -p fiftyone-ip-intelligence-sys -p fiftyone-device-detection-sys -p fiftyone-common-sys --all-targets -- -D warningspass, andcargo test -p fiftyone-native --no-fail-fastwith the Lite Hash and ASN data files gives 58 passed, 0 failed and 0 ignored across 9 test binaries.Behaviour that changes
The
-syscrate'sCollectionItemhas the C structure's fields, soProfilePercentagehas the C size.What remains