Fixed coloring conflicts in rbyd tree renderers

A bit of a hack, but rather than handling conditional alt branches, our
dbg rbyd tree renderers just represent single-pointer alts as an alt
with both branches pointing to the place.

Unfortunately, the two branches technically have different colors. This
resulted in a bit of contention when chosing how to color the tree.
Basically Python's dict ordering would determine which color won.

Which was a bit confusing when dbgrbyd.py displayed different tree
colorings for the same rbyd. dbgrbyd.py should be idempotent!

This is solved by adding another hack to check explicitly for
same-destination branches.
This commit is contained in:
Christopher Haster
2024-04-03 20:19:41 -05:00
parent c3dc7cca10
commit 37c45e1afc
4 changed files with 28 additions and 24 deletions
+1
View File
@@ -548,6 +548,7 @@ class Rbyd:
d=t_depth-1 - alt['h'], d=t_depth-1 - alt['h'],
c=alt['c'], c=alt['c'],
)) ))
if alt['ft'] != alt['nft']:
tree.add(TBranch( tree.add(TBranch(
a=alt['nft'], a=alt['nft'],
b=alt['ft'], b=alt['ft'],
+1
View File
@@ -579,6 +579,7 @@ class Rbyd:
d=t_depth-1 - alt['h'], d=t_depth-1 - alt['h'],
c=alt['c'], c=alt['c'],
)) ))
if alt['ft'] != alt['nft']:
tree.add(TBranch( tree.add(TBranch(
a=alt['nft'], a=alt['nft'],
b=alt['ft'], b=alt['ft'],
+1
View File
@@ -563,6 +563,7 @@ class Rbyd:
d=t_depth-1 - alt['h'], d=t_depth-1 - alt['h'],
c=alt['c'], c=alt['c'],
)) ))
if alt['ft'] != alt['nft']:
tree.add(TBranch( tree.add(TBranch(
a=alt['nft'], a=alt['nft'],
b=alt['ft'], b=alt['ft'],
+1
View File
@@ -768,6 +768,7 @@ def dbg_tree(data, block_size, rev, trunk, weight, *,
d=t_depth-1 - alt['h'], d=t_depth-1 - alt['h'],
c=alt['c'], c=alt['c'],
)) ))
if alt['ft'] != alt['nft']:
tree.add(TBranch( tree.add(TBranch(
a=alt['nft'], a=alt['nft'],
b=alt['ft'], b=alt['ft'],