Armor Piercing and Damage Conversion

So I was under the impression that the order of “conversions” goes something like this:

Base damage -> flat damage (from weapon and from skills) -> armor piercing -> damage conversion

But I saw something today that seemed to suggest that the last two nodes were flipped. So, which is it? Does armor piercing happen before damage conversion, or does armor piercing happen after damage conversion? (Also, what happens if you have a conversion to physical damage?)

More concretely: If I had a 100% armor piercing weapon with 100 damage, and I added a haunted steel to it, would I be dealing 100 piercing + the flat damage from haunted steel, or would I be dealing 90 piercing + 10 vitality + the flat damage from haunted steel?

Physical damage on the weapon gets converted first and then the remaining part will go through armor piercing.

As for tricky stuff like what happens if you have a weapon that converts elemental to phys or what happens if you convert pierce to cold or acid - sorry, I don’t know.