Skip to content

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

@TobiasDuswald

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) {

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