https://github.com/mmp/pbrt-v2
https://github.com/mmp/pbrt-v3
https://github.com/mmp/pbrt-v4
Have you read these books and modified the source to pbrt? The books contain small fragments of source code and aren't close to a full program.
I guess that including those lines would have been problematic in terms of book length/page count?