If the constrained-space density is continuous and finite at 1 then rounding makes little difference; the sampler behaves approximately correctly. If the density goes to zero or infinity at the boundary any rounded sample is rejected anyway.
Don’t worry, it’s just me.
I’d like someone to explain it to me! I’m pretty sure the infinite looping I saw is literally impossible. I didn’t find any loops in the code at the point where I think it’s happening.
Honestly I think we should return the nominal output (without that 1e-15 correction). If 1 is the closest floating point approximation to the logistic output then that’s the best number to report so long as constraints are inclusive. It’s up to the density to handle that boundary value gracefully.
The behavior here is even trickier as it a component of the gradient at the boundary that is causing the problem. Gradient behavior isn’t checked in most of the densities. Then again it’s tricky because bad behavior in the density can sometimes be ameliorated by opposing behavior in the constraint Jacobian, but there’s no way to access both pieces of info at the same time.