Open swfsql opened 3 months ago
Note: reviewing the fix code, I think the it's still not correct because ultimately every different index may have it's own index diff that precedent removals may have interfered with it. Currently, only the indexes above the "global minimal" get a index diff, but not all the would need to.
For example, if idx 10 is removed and then idx 3 is also removed, it would work OK. But if then idx 7 is removed, then only those above idx 7 should have a diff of -2, while then those like idx 5 (which is below 7) should have only a -1 diff. And that removal on idx 5 should also affect all diffs above idx 5, so then I think every index should have it's own idx diff.
Another note to add is that although the status quo (main
) code doesn't fail on the second test (test_add_grad_decreasing_idx_r2
), I think it removes the wrong dimension. This would happen because the vector still has enough items, but the wrong item would get removed.
Related to #68