From 9c8a44a4613d6cc71ac05459d2b30e632469d5e5 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Fri, 5 Apr 2024 17:07:36 -0500 Subject: [PATCH] rbyd-rr: Enabled color preservation on diverging-lower alt It's a great sign that this just worked. Now, the only case where coloring is not preserved is the diverging-upper alt, and only when encountering a yellow node. A rather complicated corner case: .-> .-> .-> h=4 -. .-----b-> .-b-> .-b-> | | .-> | .-> | .-> | | .---b-> .-y-b-> .-y-b-> | | | .-> | .-> | .-> | | | .-b-> | .-b-> | .-b-> | | | | .-> y-r-b-b-b-> .-b-b-b-> | .-y-r-b-b-> rm me => | | => | +- unbal :( | .-> rm me | | .-> | | | .-b-> | | .-b-> r-b---b-b-> | | | .-> | | | .-> | | .-> | | .---b-b-> | '---b-b-> | '-b-> | | | .-> | .-> | .-> | | | .-b-> | .-b-> | .-b-> | | | | .-> | | .-> | | .-> | r-b---b-b-> '-----b-b-> '-----b-b-> h=3 -' ^ ^ diverging diverging/stitching In theory it _is_ possible to preserve coloring on yellow nodes, but right now this only seems possible by duplicating most of the yellow-split logic, which doesn't seem worth it... --- lfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lfs.c b/lfs.c index 8d8dfc03..90461f23 100644 --- a/lfs.c +++ b/lfs.c @@ -3289,7 +3289,7 @@ again:; goto push; } else { - alt &= ~LFSR_TAG_R; + //alt &= ~LFSR_TAG_R; //d_will_diverge = true; diverged = true; }