The documentation page for the PDB Serialized Hash Table Format (https://github.com/llvm/llvm-project/blob/main/llvm/docs/PDB/HashTable.rst) indicates that the number of key/value pairs is "capacity" but based on my reading of the microsoft-pdb repo (and looking through some PDB files modified by pdbstr.exe), it's actually "size" that determines the length. Or more accurately, in the microsoft-pdb implementation it's actually determined by the number of bits set in the "present" bit map. Which I believe should match in a well-behaved PDB.
Reference source here: https://github.com/microsoft/microsoft-pdb/blob/805655a28bd8198004be2ac27e6e0290121a5e89/PDB/include/map.h#L584
Commit in a fork showing a potential revision to the docs: TimMisiak@9bd9756