https://github.com/mmp/pbrt-v4/blob/779d1a78b74aab393853544198189729434121b5/src/pbrt/util/hash.h#L81C33-L81C42
template <typename T>
PBRT_CPU_GPU inline uint64_t HashBuffer(const T *ptr, size_t size, uint64_t seed = 0) {
return MurmurHash64A((const unsigned char *)ptr, size, seed);
}
PBRT_CPU_GPU inline uint64_t MurmurHash64A(const unsigned char *key, size_t len,
uint64_t seed) {
const uint64_t m = 0xc6a4a7935bd1e995ull;
const int r = 47;
uint64_t h = seed ^ (len * m);
const unsigned char *end = key + 8 * (len / 8);
In the function HashBuffer(), the pointer ptr is converted to unsigned char * type, but the size is element size, not byte size. So in MurmurHash64A(), the end is not the real end of the data.
https://github.com/mmp/pbrt-v4/blob/779d1a78b74aab393853544198189729434121b5/src/pbrt/util/hash.h#L81C33-L81C42
In the function HashBuffer(), the pointer
ptris converted tounsigned char *type, but thesizeis element size, not byte size. So inMurmurHash64A(), theendis not the real end of the data.