rbyd: Trying to get separate r/b diverged trimming working

The conflicts between y-pruning and diverged-pruning are proving
difficult to resolve...

This is a step backwards but also a work in progress:

  test_rbyd+balance before: 156/385878 failed
  test_rbyd+balance after:  312/385878 failed (+100.0%)

Code changes:

           code          stack          ctx
  before: 38644           2624          640
  after:  38860 (+0.6%)   2624 (+0.0%)  640 (+0.0%)
This commit is contained in:
Christopher Haster
2025-01-25 14:09:43 -06:00
parent 3ba17cf2f9
commit 69adb1f033
+29 -29
View File
@@ -3866,32 +3866,32 @@ trunk:;
// .-'| .--' // .-'| .--'
// 3 4 3 4 x // 3 4 3 4 x
} else if (diverged) { } else if (diverged) {
// diverging = lfsr_tag_diverging2( diverging = lfsr_tag_diverging2(
// alt, weight, alt, weight,
// p[0].alt, p[0].weight, p[0].alt, p[0].weight,
// lower_rid, upper_rid, lower_rid, upper_rid,
// a_rid, a_tag, a_rid, a_tag,
// b_rid, b_tag); b_rid, b_tag);
// diverging_red = lfsr_tag_isred(p[0].alt) diverging_red = lfsr_tag_isred(p[0].alt)
// && lfsr_tag_diverging( && lfsr_tag_diverging(
// p[0].alt, p[0].weight, p[0].alt, p[0].weight,
// lower_rid, upper_rid, lower_rid, upper_rid,
// a_rid, a_tag, a_rid, a_tag,
// b_rid, b_tag); b_rid, b_tag);
// if (diverging_red) { if (diverging_red) {
// LFS_DEBUG("%04x->%04x: div r pruning", LFS_DEBUG("%04x->%04x: div r pruning",
// branch, lfsr_rbyd_eoff(rbyd)); branch, lfsr_rbyd_eoff(rbyd));
// // trim so alt is pruned // trim so alt is pruned
// lfsr_tag_trim( lfsr_tag_trim(
// p[0].alt, p[0].weight, p[0].alt, p[0].weight,
// &lower_rid, &upper_rid, &lower_rid, &upper_rid,
// &lower_tag, &upper_tag); &lower_tag, &upper_tag);
// p[0].weight = 0; p[0].weight = 0;
//
// lfsr_rbyd_p_pop(p); lfsr_rbyd_p_pop(p);
//
// // TODO prune? (trim?) // TODO prune? (trim?)
// } }
diverging = lfsr_tag_diverging2( diverging = lfsr_tag_diverging2(
alt, weight, alt, weight,
@@ -3899,9 +3899,9 @@ trunk:;
lower_rid, upper_rid, lower_rid, upper_rid,
a_rid, a_tag, a_rid, a_tag,
b_rid, b_tag); b_rid, b_tag);
if (diverging) { if (diverging
// && (!lfsr_tag_isred(alt) && (!lfsr_tag_isred(alt)
// || lfsr_tag_isred(p[0].alt))) { || lfsr_tag_isred(p[0].alt))) {
LFS_DEBUG("%04x->%04x: div trimming", LFS_DEBUG("%04x->%04x: div trimming",
branch, lfsr_rbyd_eoff(rbyd)); branch, lfsr_rbyd_eoff(rbyd));
// trim so alt is pruned // trim so alt is pruned