The shiny code that modifies IVs without changing TID/SID happens to turn pokemon into a traded pokemon once it evolves. I tried to "shinify" my starter Torchic at the beginning of the game (modified its IVs to 31 as well), but when it evolved to Combusken, it turned into a traded Combusken (with my TID but not SID). I noticed this because my Combusken received "boosted exp". I failed to turn it back to my own Combusken by "renaming male trainer code".
So, my question is how does this code actually modify my pokemon and how do IVs/natures relate to the PID? I know that people saying IVs have not been relevant since gen IV but how? If someone can explain to me how current PIDs and their IVs, natures, shiny value are related, i'd appreciate that.