Well done and very educational indeed.
hmm, very interesting, the Pmos is placed in the reverse pinout of a normal Pmos highside switch, but it still works cause DS orientation doesn't matter to a FET ,and it works because the internal parasitic diode is polarized the right way around :) instead of in a normal high side switch topology the diode you conduct reverse current..
just remember you cant high side switch with this topology cause the parasitic diode is forward polarized even if you bring 12V to the gate