SimpleMPS algorithm breaks due to integer overflow of cell coordinates · Issue #2 · sandialabs/DeterministicMPS · GitHub
Skip to content

SimpleMPS algorithm breaks due to integer overflow of cell coordinates #2

Open

Description

@drlight-code

The current SimpleMPS code creates points that lie out of the expected bounding box, i.e. outside the grid coordinates. Particularly if I check all generated points for x > 0 the assertion fails, but only very randomly. I didn't debug further, but if I switch to the commented code with pool updates as defined here https://github.com/sandialabs/DeterministicMPS/blob/main/source/SimpleMPS.cpp#L124-L143 the problem vanishes.

Activity

  1. changed the title [-]Version without pool updates generates erronous points[/-] [+]Algorithm generates points outside of domain[/+] on Nov 1, 2024
  2. drlight-code commented on Nov 1, 2024

    @drlight-code
    Author

    The problem also crops up when using the version with pool updates, so it seems not directly related after all.

  3. changed the title [-]Algorithm generates points outside of domain[/-] [+]Algorithm generates points outside of domain due to integer overflow[/+] on Nov 4, 2024
  4. changed the title [-]Algorithm generates points outside of domain due to integer overflow[/-] [+]SimpleMPS algorithm generates points outside of domain due to integer overflow[/+] on Nov 4, 2024
  5. drlight-code commented on Nov 4, 2024

    @drlight-code
    Author

    I did the debugging, the problem occurs due to an integer overflow of the cell coordinates. It happens only very rarely for certain choices of random seeds, where a high number of refinements is necessary. When the error occurs here, I'm at refinement level 19. The problem appears in the refine method step when the cell coordinates are doubled https://github.com/sandialabs/DeterministicMPS/blob/main/source/SimpleMPS.cpp#L353-L354

    Defining the cell coordinates as size_t instead of int fixes the issue for me https://github.com/sandialabs/DeterministicMPS/blob/main/source/SimpleMPS.hpp#L28

  6. changed the title [-]SimpleMPS algorithm generates points outside of domain due to integer overflow[/-] [+]SimpleMPS algorithm breaks due to integer overflow of cell coordinates[/+] on Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions