...So how does that work? Does primate DNA come with a gene that has both a determinism allele and a nondeterminism allele? ...
This is a question for science, not philosophy. Philosophy only notes that we do have free will, and it is for science to explain how that works on the level of genes and chemistry. I'd speculate that it was a gradual process rather than one entity with no free will giving birth to one that suddenly had it, though. Free will is associated with the ability to reason, which we know evolved gradually.
Earlier you wrote:
"Contingent" means "could have been otherwise." As far as we know, the only phenomenon that this genuinely applies to is human free will. A human choice can genuinely turn out more than one way, even if everything else is the same. Apart from human choice, everything results from the deterministic actions of physical matter, which has no capacity of choice and is therefore "necessary."
So you are evidently equating free will with nondeterminism. But nondeterminism is not the sort of thing that can evolve gradually. "A little bit nondeterministic" is like "a little bit pregnant" -- the concept is incoherent.
[If you disagree, here's proof: Suppose whether the coin will land heads or tails follows with 100% certainty from its initial conditions and the laws of physics -- that's determinism. Contrariwise, suppose whether the coin will land heads or tails doesn't follow at all from its initial conditions and the laws of physics, and it's a 50-50 chance -- that's nondeterminism. But in order to go from one situation to the other
gradually, that would mean that given certain conditions that originally led to heads with 100% certainty, subsequently the chance of heads changes from 100% to 99%, to 98%, ... to 51%, to 50%. But in that scenario, although
the probability of heads falls gradually,
determinism goes away
instantly. When the initial conditions and the laws of physics imply the coin will come up heads 99 times out of 100, that's not 1% nondeterminism. That's already full-blown, 100% nondeterminism. 99 times out of 100 is not "always act the same way in exactly the same environment". There's no such thing as "a little bit nondeterministic", because there's no such thing as "a little bit not always". Failing once in a hundred means not always. Failing once in a million means not always. QED.]
So, assuming you're right that humans or some unknown set of other animals acquired free will by a gradual process, connected with the ability to reason which we know evolved gradually, it follows that free will
is not the same thing as not resulting from the deterministic actions of physical matter. Which, curiously enough, is exactly what Hume said back in the 1700s.
The belief that "Apart from human choice, everything results from the deterministic actions of physical matter" appears to be an intellectual relic left over from Cartesian dualism, and it appears to maintain itself in the meme pool due to an equivocation fallacy on the phrase "could have".
Notice that you could ask the same question about consciousness: When did consciousness arise? Did one organism without consciousness give birth to one with it? These are fair (scientific) questions, but they do not at all cast doubt on the knowledge that consciousness exists in the first place.
Indeed so -- in fact it seems likely to me that free will and consciousness are actually one and the same thing. But whether an object is conscious is a question
orthogonal to the question of whether the object "has a nature which causes it to operate in one particular way and no other under the circumstances."
When we learn to build a computer that emulates a human brain, using a hundred billion accurate simulations of a hundred billion neurons, then, as you say, there will be no other way that the computer could have acted without a contradiction ensuing. But there is no justifiable reason to think the computer won't be conscious. And when we build it, it will know it has free will the same way you know you have free will: immediate introspection.