                                                                               scale,
                                                                               threshold);
         }
-        uint32_t index_count_clamped = min(index_capacity, index_pyramid[8].x);
+        uint32_t index_count_clamped = min(index_capacity, index_pyramid[4].x);
         if(index_count_clamped) {
           extractIndices<<<(index_count_clamped + 255) / 256, 256>>>(index_output,
                                                                      vertex_pyramid,

        }
      }
      else {
        uint32_t vertex_count_clamped = min(vertex_capacity, index_pyramid[8].x);
        if (vertex_count_clamped) {
          extractVertexPN<<<(vertex_count_clamped + 255) / 256, 256>>>(vertex_output,
                                                                       index_pyramid,

  }
  assert(25 < ctx->level_offsets[ctx->levels - 4]);
  assert(ctx->level_offsets[ctx->levels - 3] <= 25);
  ctx->level_offsets[ctx->levels - 3] = 4 + 7; // up to 25 uvec4's
  ctx->level_offsets[ctx->levels - 2] = 4 + 2; // up to 5 uvec4's
  ctx->level_offsets[ctx->levels - 1] = 4 + 1; // one uvec4
  ctx->level_offsets[15] = ctx->levels;         // Store # levels in top entry.

  size_t sideband0_size = sizeof(uint32_t) * ctx->level_sizes[0];
