Skip to content

inconsistent results from repeated calls to union!(s::BitSet, r::UnitRange{Int}) #45574

@dmbates

Description

@dmbates

As part of a larger task I need to count the number of elements in the union of a set of intervals. A sample set of intervals from genomic sequences and a function to evaluate the overlap size is in
bugreport.txt

I get inconsistent results

ulia> overlapsz(rngs)
8833

julia> overlapsz(rngs)
10413

julia> overlapsz(rngs)
8663

julia> versioninfo()
Julia Version 1.8.0-rc1
Commit 6368fdc656 (2022-05-27 18:33 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: 8 × 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, tigerlake)
  Threads: 8 on 8 virtual cores

I suspect that somewhere in the union!(s::BitSet, r::AbstractUnitRange{<:Integer}) method starting at line 126 of bitset.jl the bits vector of s is being extended without zeroing the extending part.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions