Added a comment after mistakenly trying to use altas during rbyd compaction
Spent an embarrassingly long time debugging rbyd over this. It's tempting to terminate inner binary nodes with altas during compaction, since the last alt should always be taken. But it's easy to miss that our compaction algorithm actually relies on copying the tag forward each layer to avoid recursively finding the largest tag. Adding a comment will hopefully prevent the headache for someone else in the future.
This commit is contained in:
@@ -3768,6 +3768,10 @@ static int lfsr_rbyd_appendcompaction(lfs_t *lfs, lfsr_rbyd_t *rbyd,
|
||||
}
|
||||
|
||||
// connect with an altle
|
||||
//
|
||||
// note we can't use an altas here, we need to encode the
|
||||
// exact tag so we know the largest tag when building the
|
||||
// next layer
|
||||
err = lfsr_rbyd_appendtag(lfs, rbyd,
|
||||
LFSR_TAG_ALT(
|
||||
(i == 0 && off < layer_)
|
||||
|
||||
Reference in New Issue
Block a user