Skip to content
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

[ENHANCEMENT]: Device assertions in debug mode #563

Open
sleeepyjack opened this issue Jul 29, 2024 · 0 comments
Open

[ENHANCEMENT]: Device assertions in debug mode #563

sleeepyjack opened this issue Jul 29, 2024 · 0 comments
Labels
good first issue Good for newcomers P2: Nice to have Desired, but not necessary type: improvement Improvement / enhancement to an existing function

Comments

@sleeepyjack
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

Probing errors can be tedious to debug.
Some of these errors, such as inserting or probing for a sentinel, might even lead to silent failures.

Describe the solution you'd like

Add device-side assertions in debug mode for the following:

  • inserting or probing for a sentinel key or payload
  • probing took more than capacity-many slots (this will also detect overflow state, i.e., inserting more elements than there are slots in the map)
  • out-of-bounds access to storage

assert in device code will impact performance negatively. Thus, I propose we conditionally enable it only if DEBUG is defined.

Describe alternatives you've considered

Instead of using the global DEBUG flag to enable assertions, we could define a new flag CUCO_DEBUG to get finer-grained control.

Additional context

No response

@sleeepyjack sleeepyjack added good first issue Good for newcomers P2: Nice to have Desired, but not necessary type: improvement Improvement / enhancement to an existing function labels Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers P2: Nice to have Desired, but not necessary type: improvement Improvement / enhancement to an existing function
Projects
None yet
Development

No branches or pull requests

1 participant