-
Notifications
You must be signed in to change notification settings - Fork 72
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
Use libstdc++ implementation of std::bitset if other standard library is used #517
base: main
Are you sure you want to change the base?
Conversation
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.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 25 out of 32. Check the log or trigger a new build to see more.
98340f7
to
ac5c062
Compare
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.
clang-tidy made some suggestions
40394c1
to
269a744
Compare
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.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 25 out of 32. Check the log or trigger a new build to see more.
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.
clang-tidy made some suggestions
691dea7
to
cc31c8f
Compare
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.
clang-tidy made some suggestions
cc31c8f
to
8bfd025
Compare
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.
clang-tidy made some suggestions
7bb52ce
to
a02c213
Compare
Implement bitset and bitset tests
Use implemented bitset instead of std::bitset in: - fdep::FDTreeElemend - ::FDep - od::AttributeSet - dc::Predicate - ::CommonClueSetBuilder
Remove src/core/bitset_extensions, because now it's not needed
a02c213
to
f36377b
Compare
Specialize std::hash instead of hash inside of namespace std to avoid UB
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.
Looks ok to me, but I can't say with much certainty that using Apache and GPL-3 with our AGPL is fully compatible, as I'm not a lawyer. But if you trust the information on the Internet, then everything seems ok. For example:
https://opensource.stackexchange.com/a/8271
P.S. I didn't look a lot at the code in the added bitset.h
as I trust that it was copied from gcc and doesn't need review :)
FlipAll, Flip, FlipInvalidIndex, ToString, ToStringCustomChars, ToULong, | ||
ToULLong, And, Or, Xor, ToStream, FromStream, FindFirst, FindNext); | ||
|
||
using BitsetSizes = ::testing::Types<BitsetSizeParam<8>, BitsetSizeParam<128>>; |
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.
Why exactly these values? Are they used in our algorithms? Is 64 also used? Maybe we should put all our values from all used bitsets there?
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.
These are just convenient values for testing. 8-bit is a single-word bitset (with most zeros), 128-bit contains at least 2 words on any system. I believe that 64-bit will work fine too, considering these two work.
Copy
libstdc++
implementation ofstd::bitset
to use it when project is compiled withlibc++
(and possibly other STL implementations). Fixes #516.Here are macOS Apple Clang run times after this fix:
![Снимок экрана_20250201_214626](https://private-user-images.githubusercontent.com/70594847/408819639-b2eeb80e-6f60-44d6-b803-8e6640b08235.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MTk2NzcsIm5iZiI6MTczOTYxOTM3NywicGF0aCI6Ii83MDU5NDg0Ny80MDg4MTk2MzktYjJlZWI4MGUtNmY2MC00NGQ2LWI4MDMtOGU2NjQwYjA4MjM1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDExMzYxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQwMGIwZmZhMjgzNzIxMmY5NjEwOWFlZWY0ODRlMGE0MDUzNTJkYzJlODc1YWU4ZmU2MDgxZTY3YjY5NWIxMjMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.mZIY4_WATUwupJaRmaHnQVb8Jj--aQ4P5YOrRk6kcXo)
![Снимок экрана_20250201_214756](https://private-user-images.githubusercontent.com/70594847/408819647-5bb393c6-2495-4a78-9e37-e429ad25da58.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MTk2NzcsIm5iZiI6MTczOTYxOTM3NywicGF0aCI6Ii83MDU5NDg0Ny80MDg4MTk2NDctNWJiMzkzYzYtMjQ5NS00YTc4LTllMzctZTQyOWFkMjVkYTU4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDExMzYxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU5NTI3NmQ5ZThjZWM3ZTQwMDYyNGVhY2IwM2M3MDAwYTg5MGUxMjJkMmFmODIyZTEzOGFhOTNjMTY4YTg4ZTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.uqjv_rr7v6Mo0ro0o9OkdfBzjLNCvr2caG4fhN3YSdo)