def METHOD_NAME(variant_scalar_rgb):
    si = mi.SurfaceInteraction3f()
    si.wi = [0, 0, 1]
    bsdf = example_bsdf()
    for i in range(2):
        for sample in [0.0, 0.5, 1.0]:
            for sel_type in range(2):
                ctx = mi.BSDFContext(mi.TransportMode.Importance if i == 0
                                     else mi.TransportMode.Radiance)
                # Sample reflection
                if sel_type == 0:
                    ctx.type_mask = mi.BSDFFlags.DeltaReflection
                else:
                    ctx.component = 0
                bs, spec = bsdf.sample(ctx, si, sample, [0, 0])
                assert dr.allclose(spec, [0.3 * 0.04] * 3)
                assert dr.allclose(bs.pdf, 1.0)
                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
                if sel_type == 0:
                    ctx.type_mask = mi.BSDFFlags.DeltaTransmission
                else:
                    ctx.component = 1
                bs, spec = bsdf.sample(ctx, si, sample, [0, 0])
                if i == 0:
                    assert dr.allclose(spec, [0.6 * (1 - 0.04)] * 3)
                else:
                    assert dr.allclose(spec, [0.6 * (1 - 0.04) / 1.5**2] * 3)
                assert dr.allclose(bs.pdf, 1.0)
                assert dr.allclose(bs.eta, 1.5)
                assert dr.allclose(bs.wo, [0, 0, -1])
                assert bs.sampled_component == 1
                assert bs.sampled_type == +mi.BSDFFlags.DeltaTransmission
    ctx = mi.BSDFContext()
    ctx.component = 3
    bs, spec = bsdf.sample(ctx, si, 0, [0, 0])
    assert dr.all(spec == [0] * 3)