Randomly assign a race (marked by a corresponding trait - e.g., Elf) to the apical ancestor, weighting for the rarity of each race (set in game rules) and the biome (e.g., forest, mountain, desert) of the province in which the living descendant resides.If the living character himself has no attested parents, he becomes the apical ancestor of his lineage.
I worked out a pedigree system for tracking a character's genotype using variables that consistently yielded accurate racial assignments. (I plan to eventually port it to CK3, but that'll have to wait.) The idea was to allow the player to set up a customized fantasy scenario using game rules to toggle things like nonhuman races, magic, deities, monsters, etc. I was working on a fantasy converter mod for CK2 that I put on hold when CK3 was announced.