Skip to content

Unexpected failure when adding assert to AgentHandle::Next() #340

Description

@TobiasDuswald

Adding the following assert to AgentHandle::Next() breaks some unit tests.

AgentHandle Next() override {
    while (box_it.IsAtEnd()) {
      box_index++;
      assert(box_index < sorted_boxes.size() &&
             "box_index out of bounds. This should not happen.");
      box_it = sorted_boxes[box_index]->begin(grid_);
    }
    auto ret = *box_it;
    start++;
    ++box_it;
    return ret;
  }
};

Affects the following tests:

-TEST(DiffusionTest, GradientComputation) {
-TEST(DiffusionTest, LazyGradientComputation) {
-TEST(OperationTest, ReductionOp) {
-TEST(OperationTest, ReductionOpMultiThreading) {
-TEST(ResourceManagerTest, SortAndForEachAgentParallel) {
-TEST(ResourceManagerTest, SortAndForEachAgentParallelDynamic) {
-TEST(ResourceManagerTest, ParallelAgentRemoval_SmallScale1) {
-TEST(ResourceManagerTest, ParallelAgentRemoval_LargeScale25) {
-TEST(ResourceManagerTest, ParallelAgentRemoval_LargeScale50) {
-TEST(ResourceManagerTest, ParallelAgentRemoval_LargeScale75) {

Activity

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions