def METHOD_NAME(variant_scalar_rgb, warp, normalize):
    # Check that forward + inverse give the identity. Test for
    # all supported variants of N-dimensional warps (N = 0..3)
    cls = getattr(mi, warp)
    ndim = int(warp[-1]) + 2
    rng = np.random.default_rng(seed=all_warps.index(warp))
    for i in range(10):
        shape = rng.integers(2, 8, ndim)
        param_res = [
            sorted(rng.random(s)) for s in shape[:-2]
        ]
        values = rng.random(shape) * 10
        if i == 9:
            values = np.ones(shape)
        instance = cls(values, param_res, normalize=normalize)
        for j in range(10):
            p_i = mi.Vector2f(rng.random(2))
            p_o, pdf = instance.sample(p_i)
            assert dr.allclose(pdf, instance.eval(p_o), atol=1e-4)
            p_i_2, pdf2 = instance.invert(p_o)
            assert dr.allclose(pdf, pdf2, atol=1e-4)
            assert dr.allclose(p_i_2, p_i, atol=1e-4)