OK, so I figured out what was wrong, but I don't know why. The For-Next loop in the middle of this part was not creating
bitstr
correctly, so non-unique entries were being made, and those were stripped in a subsequent operation in another, outer loop.
outG()
was correct, but this concatenation method to build the string did not work.
cc_str = Nothing
bitstr = bobinbitsl
For jl = 0 To en0
bitstr &= CStr(outG(jl, enl))
Next
bitstr &= eobinbitsl
bitcount = bitstr.Length
If bitcount Mod 6 <> 0 Then Stop
My solution to the problem was to streamline the creation of
bitstr
and make it at the same time it's creating
outG
(used for some analysis I didn't include).
I'm still mystified about why that loop fails. All of the variables are thread-local, and the code methods are clumsy but not unconventional. I even tried a SyncLock around the loop, and that didn't help, either. I'll go through this process with a fine-tooth comb and clean it up. I just hope I don't create another weird bug in the process!