Repository navigation
Fix base probability calculation in generate_sequence to handle zero … - #1631
AgustinPardo wants to merge 1 commit into
Conversation
…total probabilities
|
Hi @AgustinPardo, Thanks for your contribution. Have you raised this because you've had an issue caused by this code (I don't see an open ticket)? I ask because this change introduces additional branching into a critical loop, which could have a deleterious effect on performance. As far as I can see it's not possible for the most probable base to have a If you're experiencing something different, we'd like to take a look and solve the issue at source rather than masking it with this change. |
|
Hi @malton-ont Thanks for the quick review and the detailed explanation. You're right , I raised this as a precautionary fix based on static code analysis rather than an observed failure in practice. I didn't have a concrete reproduction case, and I should have opened a ticket first to discuss whether the scenario is actually reachable before submitting the PR. Your explanation makes sense: if totalProbs always sums to 1 by construction, then the guard is indeed redundant and the added branching in a hot loop is a valid concern. |
Handle positions with zero accumulated probability when generating the decoded sequence and quality string
totalProbs[i]is zerolog10(0)by clamping the error probability to the smallest positive float