OSL backfacing faces render black

I’ve never noticed this before so I hope it’s not some setting I’ve overlooked, but when rendering an object with an OSL material the flipped/backfacing faces will render black in the diffuse, even if you assign a colour to them specifically with backfacing() or when overriding the normal with (0.5, 0.5, 1) in the shader.
It won’t render the default colour, it will always just render black. In both 3.2 & 3.3.
A VRay mat renders fine, it’s not a backface culling then.

Have a look at the following shader. If you assign it to two planes, one rotated 180 degrees, one will show up green and the other black. Ideally the other one would render red.


surface
normTest
(
)
{
	color c_diff = color(0.5);
	if (backfacing())
	{
		c_diff = color(1,0,0);
	}
	else
	{
		c_diff = color(0,1,0);
	}
	Ci = diffuse(N) * c_diff;
}

Is there a fix/workaround for this? Thanks!

To clarify, this happens with all diffuse outputs from an OSL material. Like the plastic example in the docs, which shows up black on the back facing side as well:

As a workaround I tried a VRay2Sided mat with the OSL in the front and a VRayMat in the back, though this seems to mess up UDIM lookup and every bucket will have a different colour.
Thanks! : )

Hi, did someone have a chance to confirm this is an issue? Thanks!