For the case of a perfectly reflective and refractive glass material, the BSDF is a weighted sum of 2 delta distributions, where the weight is
In a path tracer you typically want to only continue one path when you sample a BSDF consisting of multiple parts. You can sample such a BSDF by randomly choosing between reflection and refraction, effectively splitting the integral into 2 addends, and dividing the samples contribution by the probability of picking it to eliminate the added bias when doing monte carlo.
I was confused why I my implementation which did not counteract the bias was giving seemingly unbiased results, but it turns out I was sort of accidentally importance sampling, and some terms cancel out.
For both reflection and refraction your estimator essentially looks like
The way I was picking between reflection and refraction was by generating a random number [0;1]
and picking reflection if it was lower than the fresnel value. This makes