-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Developement/logic assertions #277
Comments
Perhaps these checks could be enabled if logging is enabled? I think there is a simple #ifdef that could be used. |
But I think logging at first glance might be separate from debugging unless For the IDE, the |
I worry that having this enabled only when the IDE is launched in debug mode makes it rather invisible. |
Maybe you could have a look at the C++ template for inspiration. There are two macros
The intuition here is that I wouldn't couple this kind of functionality to the logging levels. I think they are really separate things. |
Agreeing with @cmnrd that this probably should be independent of logging levels. |
During my latest hunt for a logic error in the distributed execution framework, I realized that some logic sanity checks might be really useful. For example, there is a function called
_lf_advance_logical_time(instant_t next_time)
that had the following basic logic:As it turned out, this function was being called incorrectly with a
next_time
value that was behindcurrent_time
, effectively moving logical time back. Moreover, there were situations where this function was being called correctly with anext_time
in the future. However, thisnext_time
had a value that was larger than the event tag that was at the head of the event queue. This is also incorrect logic but much more subtle.In pursuit of these bugs, I realized that if
_lf_advance_logical_time
had the following structure, it would have been much easier to detect and chase these bugs:This sanity check however, adds considerable overhead to the runtime (about 6msec to
TimeLimit.lf
). Therefore, I think we need a mechanism (a target property perhaps) to turn on these logic/sanity checks for development purposes but keep them out of end-user code.The text was updated successfully, but these errors were encountered: