The following is based on decompiled code, using MCP naming.
The minimum heightmap value for a chunk is currently set when the heightmap is populated either by chunk generation on the server, or by a chunk data packet being received by the client. However, it is not set when a chunk is read from NBT (see AnvilChunkLoader#readChunkFromNBT()).
This means that server-side, any chunk not freshly generated will have a heightmap minimum of 0.
The main effect of this is that lighting checks performed by Chunk#recheckGaps() will call World#checkLightFor() for all y-values between 0 and the heightmap value for that column (+1), instead of a reduced range.
The heightMapMinimum field should be updated when the heightmap is set in Chunk#setHeightMap(). For example: