Fixed diverged leaf coloring issue

Took some debugging to figure out what was going on, but this was just
a refactoring oversight, didn't update the diverged state used to decide
how to color the leaves.

I guess this would have actually been caught earlier if I cleaned up the
code before debugging the test failures. But I wanted to reach
proof-of-concept first...

Anyways, good news, all tests are passing, so the proof-of-concept
new range removal algorithm works.
This commit is contained in:
Christopher Haster
2024-03-11 04:38:02 -05:00
parent dd31f610b3
commit 03954a1ef9
+8 -2
View File
@@ -3268,6 +3268,7 @@ again:;
if (diverging && !d_upper) { if (diverging && !d_upper) {
// no diverging branch? guess we only need one trunk then // no diverging branch? guess we only need one trunk then
if (!diverged) { if (!diverged) {
printf("false diverge\n");
diverging = false; diverging = false;
// // TODO too many swaps // // TODO too many swaps
// lfs_swap16(&a_tag, &b_tag); // lfs_swap16(&a_tag, &b_tag);
@@ -3285,6 +3286,9 @@ again:;
return err; return err;
} }
// TODO can we avoid lingering unreachable tags when when d_tag=0?
// why does hiding this behind if d_tag=0 not work?
//
// terminate diverged branch with an unreachable tag // terminate diverged branch with an unreachable tag
err = lfsr_rbyd_appendattr_(lfs, rbyd, err = lfsr_rbyd_appendattr_(lfs, rbyd,
(lfsr_rbyd_isshrub(rbyd) ? LFSR_TAG_SHRUB : 0) (lfsr_rbyd_isshrub(rbyd) ? LFSR_TAG_SHRUB : 0)
@@ -3353,7 +3357,8 @@ again:;
// split less than // split less than
a_alt = LFSR_TAG_ALT( a_alt = LFSR_TAG_ALT(
LFSR_TAG_LE, LFSR_TAG_LE,
(!lfsr_tag_hasdiverged(a_tag)) //(!lfsr_tag_hasdiverged(a_tag)) TODO
(!diverged)
? LFSR_TAG_R ? LFSR_TAG_R
: LFSR_TAG_B, : LFSR_TAG_B,
a_tag); a_tag);
@@ -3379,7 +3384,8 @@ again:;
// split greater than // split greater than
a_alt = LFSR_TAG_ALT( a_alt = LFSR_TAG_ALT(
LFSR_TAG_GT, LFSR_TAG_GT,
(!lfsr_tag_hasdiverged(a_tag)) // (!lfsr_tag_hasdiverged(a_tag)) TODO
(!diverged)
? LFSR_TAG_R ? LFSR_TAG_R
: LFSR_TAG_B, : LFSR_TAG_B,
tag); tag);