You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was using this library in a project and noticed a subtle potential bug: taking a Vec<Interval<()>> and creating both BasicCOITree and NeonCOITree objects, and then iterating over their intervals with .iter() produces different results. I have created a MRE (mre.rs)
use coitrees::{BasicCOITree,Interval,IntervalTree,NeonCOITree};fnmain(){letmut intervals:Vec<Interval<()>> = Vec::new();
intervals.push(Interval{first:0,last:10,metadata:()});
intervals.push(Interval{first:11,last:14,metadata:()});let basic_trees:BasicCOITree<(),usize> = BasicCOITree::new(&intervals);for interval in basic_trees.iter(){println!("basic tree interval: {:?}", interval);}let neon_trees:NeonCOITree<(),usize> = NeonCOITree::new(&intervals);for interval in neon_trees.iter(){println!("neon tree interval: {:?}", interval);}}
which can be placed in the examples/ directory and run with cargo run --example mre to see the behavior. The output I see is:
I believe the potential issue could be due to these lines (https://github.com/dcjones/coitrees/blob/main/src/neon.rs#L62-L81). Unfortunately, I do not know enough about targeting these specific architectures to know what is the right way to address this issue and create a pull request. Perhaps these lines are correct, but the iterator for NeonCOITree needs to be adapted to output offset intervals.
The text was updated successfully, but these errors were encountered:
cauliyang
added a commit
to cauliyang/coitrees
that referenced
this issue
Jan 27, 2024
@vsbuffalo, Great find! It appears we overlooked adding an offset when converting the coitree to an iterator. This issue is present in both aux and neon. I've taken care of it and fixed the bug with commit d4921e0. You can find this fix in one of my ongoing pull requests at #12.
I was using this library in a project and noticed a subtle potential bug: taking a
Vec<Interval<()>>
and creating bothBasicCOITree
andNeonCOITree
objects, and then iterating over their intervals with.iter()
produces different results. I have created a MRE (mre.rs
)which can be placed in the
examples/
directory and run withcargo run --example mre
to see the behavior. The output I see is:I believe the potential issue could be due to these lines (https://github.com/dcjones/coitrees/blob/main/src/neon.rs#L62-L81). Unfortunately, I do not know enough about targeting these specific architectures to know what is the right way to address this issue and create a pull request. Perhaps these lines are correct, but the iterator for
NeonCOITree
needs to be adapted to output offset intervals.The text was updated successfully, but these errors were encountered: