-
Notifications
You must be signed in to change notification settings - Fork 14
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
Bug/527 #530
Bug/527 #530
Conversation
Within TPIE's data structures, e.g. tpie::array<T>, there is the memory_usage(size) function to derive the amount of memory to use for a certain number of elements. Yet if one calls this function with size derived from memory_fits(64UINT_MAX) then you end up with undefined behaviour. Specifically, Clang 15 has (an intermediate?) result cast to a 32 bit unsigned integer (unsigned long) rather than a 64 bit one (unsigned long long). The proper solution is to change the specific piece of code, such that there is no unexpected downcasting. The quickfix is to just change Adiar's code to just assert whether we are outside TPIE's safe territory of 4 PiB of RAM (which is very realistic anyway).
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #530 +/- ##
=============================================
+ Coverage 97.094% 97.124% +0.029%
=============================================
Files 82 82
Lines 5644 5632 -12
=============================================
- Hits 5480 5470 -10
+ Misses 164 162 -2
☔ View full report in Codecov by Sentry. |
This sanity check probably has unintended consequences. Let us just trust TPIE instead and know that we never are going to call these functions with so large values that we will see the undefined behaviour of Clang.
Benchmark Report 🟢
Minimum running time (s) for 9-Queens:
|
Benchmark Report 🟢
Minimum running time (s) for 12-Queens:
|
Benchmark Report 🟡
Minimum running time (s) for 14-Queens:
|
Hotfix to close #527 .
Essentially we remove the faulty computation that was trying to safe-guard against TPIE overflowing. This call to TPIE's
memory_usage
called it with such a large value that we ran into undefined behaviour (see the discussion in #527).While I was thinking to add a safe-guard for TPIE's max memory, it just seems best to trust this piece of code and know, that we never call it with so large values that Clang introduces undefined behaviour.