Skip to content

Fixes eachoverlap(stream, collection) iterating forever - #52

Merged
CiaranOMara merged 2 commits into
masterfrom
hotfix/eachoverlap-stream
Oct 26, 2026
Merged

CiaranOMara merged 2 commits into
masterfrom
hotfix/eachoverlap-stream

Conversation

@CiaranOMara

Copy link
Copy Markdown
Member

Fixes eachoverlap(stream, collection) iterating forever, and releases 3.0.1.

iterate didn't always advance the stream: a query whose group the collection lacks was retried forever, and a query without overlaps restarted the search from that query. It now advances the stream with every query.
Results are unchanged.

collection = GenomicIntervalCollection([GenomicInterval("chr1", 100, 200)])
collect(eachoverlap([GenomicInterval("chr0", 1, 10)], collection))  # hangs in 3.0.0

New tests cover both cases, and cross-check stream–collection pairs against simple_intersection.
They hang without the fix and pass with it.

The "Run Benchmarks" failure is unrelated: it fails on every push, including 3.0.0's master.

The iteration took the next query from the stream at a state that it didn't advance: a query whose group the collection lacked was taken again forever, and after a query without overlaps, a recursive search to the end of the stream was followed by another from the query, so that the rest of the stream was searched again for every such query.
It now takes the queries in a loop that advances the stream's state with each one.

The tests check a query whose group the collection lacks and queries without overlaps, which never ended before, and the pairs of a stream and a collection against those of two streams.
@CiaranOMara
CiaranOMara merged commit 52e4516 into master Oct 26, 2026
31 of 37 checks passed
@CiaranOMara
CiaranOMara deleted the hotfix/eachoverlap-stream branch October 26, 2026 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant