PS: when comparing with gbt_num_picksplit, I noticed that that one does not update v->spl_ldatum and spl_rdatum to the union datums, but initializes these to 0 at the beginning and never seems to update them. Not sure if this is a problem since the num_picksplit stuff seems to work well.
Actually gbt_num_picksplit updates v->spl_ldatum and spl_rdatum inside gbt_num_bin_union function.