def METHOD_NAME(variant_scalar_rgb, shape):
    trans = mi.ScalarVector3f([0, 1, 0])
    angle = 15
    for scale in [0.57, 2.7]:
        s, s_inst = example_scene(shape, scale, trans, angle)
        # grid size
        n = 11
        inv_n = 1.0 / n
        for x in range(n):
            for y in range(n):
                x_coord = scale * (2 * (x * inv_n) - 1)
                y_coord = scale * (2 * (y * inv_n) - 1)
                ray = mi.Ray3f(o=mi.ScalarVector3f([x_coord, y_coord, -12]) + trans,
                               d = [0.0, 0.0, 1.0],
                               time = 0.0, wavelengths = [])
                si_found = s.ray_test(ray)
                si_found_inst = s_inst.ray_test(ray)
                assert si_found == si_found_inst
                for dn_flags in [mi.RayFlags.dNGdUV, mi.RayFlags.dNSdUV]:
                    if si_found:
                        si = s.ray_intersect(ray, mi.RayFlags.All | dn_flags, coherent=True, active=True)
                        si_inst = s_inst.ray_intersect(ray, mi.RayFlags.All | dn_flags, coherent=True, active=True)
                        assert si.prim_index == si_inst.prim_index
                        assert si.instance is None
                        assert si_inst.instance is not None
                        assert dr.allclose(si.t, si_inst.t, atol=2e-2)
                        assert dr.allclose(si.time, si_inst.time, atol=2e-2)
                        assert dr.allclose(si.p, si_inst.p, atol=2e-2)
                        assert dr.allclose(si.dp_du, si_inst.dp_du, atol=2e-2)
                        assert dr.allclose(si.dp_dv, si_inst.dp_dv, atol=2e-2)
                        assert dr.allclose(si.uv, si_inst.uv, atol=2e-2)
                        assert dr.allclose(si.wi, si_inst.wi, atol=2e-2)
                        if dr.norm(si.dn_du) > 0.0 and dr.norm(si.dn_dv) > 0.0:
                            assert dr.allclose(si.dn_du, si_inst.dn_du, atol=2e-2)
                            assert dr.allclose(si.dn_dv, si_inst.dn_dv, atol=2e-2)