[OnePlus 7 Pro Questions & Answers] Alpha_Geek1:
This is my first time starting a new thread, so here goes.

Since getting a new (to me) One Plus 7 Pro Android device which supports (also new to me) A/B partition slots, I have learned more than I ever expected to about A/B slots. However, the one area that is still quite confusing and unknown is Slot Switching. What follows is a list of questions for which I have found only sketchy answers, or no answers at all. I submit them here in the hopes that these are questions which others also struggle with and that there are some folks who actually know the definitive answers and can supply them here.

Device Selection/Switching of Active Slot on Reboot

When the device boots system (not recovery), does it attempt to switch slots each time?

Does it check the inactive slot to see if there is something newer there?

If so, what are all the flags it checks?

What are all the conditions and actions that set those flags?

Can these be manually manipulated, and if so how?

Can these flags be checked/read, and if so how?

When a new ROM update is applied, is it applied to the inactive slot? What causes (and when) the active slot to be changed? What exactly (flags?) governs/affects that change and how?

Restoring TWRP Backup

Assuming the active slot is A, when booting to recovery and restoring a TWRP backup, does the backup get restored to slot A (active slot), or slot B (inactive slot)?

After restoring, which slot does the device attempt to boot from? See questions under 'Device Selection/Switching of Active Slot on Reboot'.

If trying to fix a bootloop (stuck on boot animation), restoring a TWRP backup doesn't seem to work. It only seems to make matters worse, and sometimes it actually DOES work as expected. Why?

How can we use a backup to overwrite the slot that is causing the bootloop and thereby resolve the problem by restoring 'known working state' that was backed up? What's going on here? I think this goes back to the questions under 'Device Selection/Switching of Active Slot on Reboot'.

Installing .zip Files in TWRP

When installing a .zip file in TWRP, does this go to the active or inactive slot? Is this determined by the .zip file or is it a constant?

When using the Wipe options, is the active slot being wiped (or reformatted, etc.), or the inactive slot?

Do various .zip files, be they gapps, Magisk, or a custom ROM have within them directives that either do or do not cause the active slot to change?

If so, does this mean that the active slot may or may not be changed by a given .zip file installed with TWRP?

Again assuming the .zip files can and do dictate active slot switching, is there a way to tell whether a .zip file will switch the active slot or a rule of thumb that says which .zip files will or won't switch the active slot?

If a .zip install *does* switch active slots, when is the active slot actually switched? Immediately, so that the next action (e.g. next .zip file installed) would be destined for the new active slot, or after a subsequent reboot?

Thanks to anyone who can help with these questions. I truly believe that having a firm understanding of the answers here will help me and others avoid lengthy and problematic updates and installs.

- Alpha_Geek1