def METHOD_NAME(variant_scalar_rgb):
    """
    Check if the sampling routine uses consistent incoming-outgoing orientation
    conventions.
    """
    tab = mi.load_dict({"type": "tabphase", "values": "0.0, 0.5, 1.0"})
    ctx = mi.PhaseFunctionContext(None)
    mei = mi.MediumInteraction3f()
    mei.t = 0.1
    mei.p = [0, 0, 0]
    mei.sh_frame = mi.Frame3f([0, 0, 1])
    mei.wi = [0, 0, 1]
    # The passed sample corresponds to forward scattering
    wo, w, pdf = tab.sample(ctx, mei, 0, (1, 0))
    # The sampled direction indicates forward scattering in the "graphics"
    # convention
    assert dr.allclose(wo, [0, 0, -1])
    # The expected value was derived manually from the PDF expression.
    # An incorrect convention (i.e. using -cos θ to fetch the PDF value) will
    # yield 0 thanks to the values used to initialize the distribution and will
    # make the test fail.
    assert dr.allclose(pdf, 0.5 / dr.pi)