Smarter task unskipping
This is just an idea, dropping it in an issue so I don't forget it.
Instead of traversing the entire cell tree to find cells with active tasks, we could actually just keep a list of cell pointers sorted by their time bin, e.g. struct cell **cells_by_time_bin
, and keep offsets for the first cell for each time_bin, e.g. int *cell_time_bin_offset
.
When running a step in the kth time bin, we just iterate over the cells up to cells_by_time_bin[cell_time_bin_offset[k + 1]]
.
Note that this is not just top-level cells, it's all cells, so we don't need to recurse when we activate things. This requires us to ensure that cell activation is completely thread-safe (it already is partially).