def METHOD_NAME(variant_scalar_rgb):
    si = mi.SurfaceInteraction3f()
    si.wi = [0, 0, -1]
    bsdf = example_bsdf()
    for i in range(2):
        ctx = mi.BSDFContext(mi.TransportMode.Importance if i == 0
                          else mi.TransportMode.Radiance)
        # Sample reflection
        bs, spec = bsdf.sample(ctx, si, 0, [0, 0])
        assert dr.allclose(spec, [0.3] * 3)
        assert dr.allclose(bs.pdf, 0.04)
        assert dr.allclose(bs.eta, 1.0)
        assert dr.allclose(bs.wo, [0, 0, -1])
        assert bs.sampled_component == 0
        assert bs.sampled_type == +mi.BSDFFlags.DeltaReflection
        # Sample refraction
        bs, spec = bsdf.sample(ctx, si, 0.05, [0, 0])
        if i == 0:
            assert dr.allclose(spec, [0.6] * 3)
        else:
            assert dr.allclose(spec, [0.6 * 1.5**2] * 3)
        assert dr.allclose(bs.pdf, 1 - 0.04)
        assert dr.allclose(bs.eta, 1 / 1.5)
        assert dr.allclose(bs.wo, [0, 0, 1])
        assert bs.sampled_component == 1
        assert bs.sampled_type == +mi.BSDFFlags.DeltaTransmission