def METHOD_NAME(variant_scalar_rgb):
    weight = 0.2
    bsdf = mi.load_dict({
        'type': 'blendbsdf',
        'nested1': {
            'type': 'diffuse',
            'reflectance': {'type': 'rgb', 'value': 0.0}
        },
        'nested2': {
            'type': 'diffuse',
            'reflectance': {'type': 'rgb', 'value': 1.0}
        },
        'weight': weight,
    })
    si = mi.SurfaceInteraction3f()
    si.t = 0.1
    si.p = [0, 0, 0]
    si.n = [0, 0, 1]
    si.sh_frame = mi.Frame3f(si.n)
    si.wi = [0, 0, 1]
    ctx = mi.BSDFContext()
    # Sample using two different values of 'sample1' and make sure correct
    # components are chosen.
    expected_a = 1.0    # InvPi & weight will cancel out with sampling pdf
    bs_a, weight_a = bsdf.sample(ctx, si, 0.1, [0.5, 0.5])
    assert dr.allclose(weight_a, expected_a)
    expected_b = 0.0    # InvPi & weight will cancel out with sampling pdf
    bs_b, weight_b = bsdf.sample(ctx, si, 0.3, [0.5, 0.5])
    assert dr.allclose(weight_b, expected_b)