Could you provide the material source directly (shouldn’t be that big). pastebin[.]com seems not to work for me.
Without looking in the material source I can still try to guess. The generated code separates diffuse and glossy contribution. In your case, it is expected that the part of the bsdf generated by the diffuse_reflection_bsdf will be returned through Bsdf_evaluate_data.bsdf_diffuse. The part generated by the simple_glossy_bsdf will be returned through Bsdf_evaluate_data.bsdf_glossy.
If you don’t care about this separation, you can simply add them together. basically (bsdf_diffuse+bsdf_glossy)*light.
I was able to identify what caused the specular highlight to appear.
It comes from Phong distribution evaluation in
Specular highlight is caused by the returned value when nh > 0.99999f.
I was testing with instance compilation and the returned value was translated to a really large number (i.e. 300k+)
When I dialled the number to be much smaller (i.e. <=1000), the specular highlight disappeared. (while retaining same behaviour for other lighting & material parameter scenarios i tested)
Also, I was using Point Light here in Cycles which is implemented as a sphere with a radius that emits light.
If I increase the radius of the sphere, the Blender Cycles Material also showed specular highlight which looked the same as MDL counterpart.
It was only when I dialled the sphere radius to be <= 0.001 that this discrepancy in behaviour happened.
Another thing, I was testing with instance compilation, so I will test with class compilation and see whether I get the same behavior.
And if I do, I will see what change could be suggested for the MDL compiler.
Are you generating code using the MDL backends or are you implementing the nodes yourself? In the MDL source, you are usually not able to set exponents directly. Instead, you set a roughness between 0 and 1.
I am implementing the node myself. I initially was going to integrate MDL SDK API into Cycles codebase. But realised it would require too many refactoring and generally make the code much harder to maintain than simply following the existing design.
Also I referenced VisRTX codebase from Github which implements simple_glossy_bsdf to understand and troubleshoot.