Closed grovesNL closed 6 days ago
I haven't dug into this much yet but certain intersections can be missed:
let mut t = SieveTree::<2, 2, Bounds<2>>::new(); let b1 = Bounds { min: [30., 30.,], max: [31., 31.], }; let b2 = Bounds { min: [50., 50.,], max: [51., 51.], }; t.insert(b1, b1); t.insert(b2, b2); assert_eq!( t.intersections(Bounds { min: [0.0, 0.0], max: [100., 100.] }) .count(), 2 );
fails with a count of 0 instead of the expected 2.
0
2
I guess it depends on where the inserted bounds end up in the tree, because I didn't notice any clear pattern with the values. Changing b2's max like this:
b2
max
let b2 = Bounds { min: [50., 50.,], max: [61., 61.], };
results in a count of 1 instead of 0.
1
Changing both b1 and b2 to some other values:
b1
let b1 = Bounds { min: [30., 30.,], max: [41., 41.], }; let b2 = Bounds { min: [50., 50.,], max: [61., 61.], };
results in the expected count of 2.
Changing b2 to be an even bigger range makes it fail again though (count of 1 again):
let b1 = Bounds { min: [30., 30.,], max: [41., 41.], }; let b2 = Bounds { min: [50., 50.,], max: [71., 71.], };
This was a really dumb bug. Fixed in 7e5d64979ea5964fcfd7b3fa1629ec2f5ee6c736.
I haven't dug into this much yet but certain intersections can be missed:
fails with a count of
0
instead of the expected2
.I guess it depends on where the inserted bounds end up in the tree, because I didn't notice any clear pattern with the values. Changing
b2
'smax
like this:results in a count of
1
instead of0
.Changing both
b1
andb2
to some other values:results in the expected count of
2
.Changing
b2
to be an even bigger range makes it fail again though (count of1
again):