Is the "genetic testing" for the presence of a Y chromosome or the presence of the SRY gene? And what about people with AIS?

If it's just karyotype, are men with XX male syndrome (SRY gene without an Y chromosome) then allowed to participate in women's sports?

It's very confusing topic. I rendered this visual map to show how SRY gene is the 'trigger' for development, not just having the Y chromosome. It helps see the signaling steps where things like AIS or XX syndrome happen: https://vectree.io/c/y-chromosome-genomic-signaling

The question comes down if the presence of the SRY gene impact athletic ability. From my reading, it seems very much like an ongoing research topic.

I recall a study looking at genetics in general and how much of professional sport abilities that can be attributed to it, and the number were fairly high for most sports, especially those involving strength and endurance. Genetic disorders like AIS could however also be a hindrance.

I do recall that in some endurance sports, certain genetic disorders involving oxygen delivery were much more common in top elites than in the average population, meaning that people without that disorder is at severe disadvantage compared to general population. It is an ongoing discussion if people with those kind of disorders should be allowed to compete in for example long distance skiing, as the disorder becomes natural doping and would be cheating if a person without the disorder was competing with that kind of blood in their system.

Genetic testing, outside of the culture war about what defines a man or a woman, really comes down to what is fair competition. Personally I can't really say. Does knowing that maybe half of the top skiers has a rare blood disorder make it less fun for people?