Haven't tested it myself, but my assumption is that spouse_id used only for relationships and legends, race of a future child is probably taken from mother without checking father at all, and genes used for appearance and colors (maybe with some sort of recombination with mother's genes). So if some random creature is used for spose_id, but for genes used normal genes suitable for mother's race, then child would be just a normal dwarf (or whatever mother's race is), but with some demon/deity/forgotten beast/whatever-else-race father listed in legends mode and relations screen. Again, that's just my assumption, so I would like to see some testing, maybe would do it later myself.
Exactly, yes. spouse_id appears to be used for legends/relationships screen only. At the start of the thread I plugged in random hist fig ids into that field, and it seems literally anything works. (Hm, actually, I didn't check what would happen if you plugged in a deity ID. Since deities are not like other creatures (don't actually exist) it's possible this would cause a crash).
The mother's genes are not recorded anywhere, probably because she is
guaranteed to be present when the baby is born. Eggs, on the other hand, have fields for
both the mother and the father's genes.
So how does a unit with a father with a different species behave? Do they just take the mothers information?
When inducing a pregnancy, you have to
provide something to use as the father's genes, it's not automatic. In my tests, this has been a second copy of the mother's genes (which results in the child being a clone of the mother).
Based on what I now understand about the actual fields involved, attempting to use a different-species-father's actual genes would be a potential crash and overall wouldn't work right (possibly two races could be set up to have compatible appearance modifier lists, in which case perhaps the father's genes
could be used directly without issue). If you want the father's appearance to be reflected in the child's appearance, I think you have to manually translate the father's genes into a valid set of genes for the mother's species.
...
How much of a unit's appearance is heritable in DF? Color is, but is stuff like height and earlobes and what-have-you heritable? The genes structure certainly has fields for those aspects of appearance, but is it known whether they actually get used?