Source code for pbrt, the renderer described in the third edition of "Physically Based Rendering: From Theory To Implementation", by Matt Pharr, Wenzel Jakob, and Greg Humphreys.
The code is indeed wrong. :-(. I'm going to defer fixing this until pbrt-v4, however, since doing so can cause rendered images to change significantly.
According to the formula, dpdu is not a normalized vector, but si->shading.dpdu is normalized.
This is a part of code in "Triangle::Intersect", ts and ss are normalized, the values are assigned to shading.dpdu and shading.dpdv.
Is the code wrong?