DescentEngine pointer and initialization fixes#6044
Conversation
|
Noting initial CI failures for Clang16-NoMPI-Offload-Complex These are unrelated to the changed made here. Earlier we had a CI failure for GCC12-NoMPI-Werror-Complex-Mixed in #6042 with similar symptoms that went away on rerun: => it is likely than a recent PR removed the initialization of a variable, or similar. |
|
Based on the added error trap, nullptr is never intended to be a legit case. Then it should not be allowed in the first place and we should fix the bug if there is one. In general, changing reference to pointer is a step backward and harmful unless nullptr is a legit use case and then we need to protect every use of the pointer. So point 2 changes won't make our code safer. |
|
Point 1 seem to be an fix to #5913 |
|
Super. How about I make a fresh PR with just the constructor fix and we can decide on a proper solution to the other problem? It does appear that we have some unreliability introduced into the CI by a recent PR => it is worth understanding the origins of that first since it is more general and is now breaking CI on develop. |
please do so. thanks |
Proposed changes
Closes #6040
Fix two minor bugs that were tripping debug builds. Our non-debug sanitizer builds did not catch them
Ensure _le_list, _vg, and _weight are created/initialized before first use. Set to length (1) in initializer list. They are subsequently resized to the correct thread count.
Avoid deferencing of a null descentEngineObj by changing the API. It was deferenced in e.g. the adaptive optimizer even when no descentEngineObj would be available or needed. Updating the API seemed the cleanest way to handle this.
All the short-H4 tests were verified as working under debug builds after this change.
What type(s) of changes does this code introduce?
Does this introduce a breaking change?
What systems has this change been tested on?
macos, macports gcc 13.2.
Checklist