[Sony Xperia XZ Premium ROMs, Kernels, Recoveries, ] LSS4181:
I just built an AOSP image (userdebug flavor). The ROM boots normally the first time. After that I went to your TWRP and flashed Magisk Canary, it was able to boot to system, but it rebooted to recovery on its own a few seconds later (followed by bluetooth and media crashes). It's possible the userdebug flavor isn't perfect so I'll do a cleanup and try with eng flavor. (During build of either flavor, a lot of warnings show up, but at least I am able to complete the build right now). (EDIT: userdebug and eng flavors exhibit the same behaviors. The build isn't really usable but it's bootable enough to confirm about things. The code base is that of today (Feb 4, 2019).

At least system, boot, userdata are needed to be flashed in order to be able to boot to AOSP properly (I've internal storage stuffs backed up). Leaving any out would result in a boot-looping system that can only be solved by re-flashing all the images at once before booting.

(Off-topic) Flashing GApps after you've booted at least once would result in the system non-bootable as well, and it holds true for all current ROMs (including CarbonROM). However, I'm yet to flash GApps here, and that I don't think I should flash GApps directly once I actually started using GSI.

EDIT: While this might possibly rule out AVB 1.0 being the issue with Magisk bootlooping, it does rule out January 2019 patch being the culprit. The issue was never reported to Magisk as it wasn't widespread (there were few threads mentioning about it, and they aren't entirely related to our cases so they weren't helpful), it's possible the issue was never on Magisk's side to begin with.

EDIT 2: It seems the "rebooting itself to recovery" issue is not related to Magisk (after first boot, it seems to be asking something to the recovery that was built alongside which I didn't flash, something TWRP doesn't seem to be able to understand), but at least I know now that AOSP does boot after flashing Magisk. On the other hand, AOSP by itself appears to not support exFAT and it asks me to format SD card, so it's not really that useful (not to mention I can't even enter Developer Options and such). There's an additional phenomenon: The "prompt to install TWRP app" keeps showing up even though I have told it not to install and not to prompt me again.

EDIT 3: Flashed an unofficial AEX 6.2 (without Magisk, and appears to have a setup wizard that I need to skip as I cannot connect my phone at the moment) and now I couldn't even get to recovery. The recovery.log is flooded with the following garbled text (and it keeps outputting those text nonstop).

E:Error parsing XML file.
Parser error: expected <
Start of string: ��g%�h�۩N�8nZ�cWk�خ{
��Q��F!��)��5J�H�Vd�ytt�/���9D���*W����r���1�?��ǔ/"����]6e�%0E40�u�et�H�O|�Z�OH7$�k��Q�>����>����̙ʽ
E:Error parsing XML file.
Parser error: expected <
Start of string: ��g%�h�۩N�8nZ�cWk�خ{
��Q��F!��)��5J�H�Vd�ytt�/���9D���*W����r���1�?��ǔ/"����]6e�%0E40�u�et�H�O|�Z�OH7$�k��Q�>����>����̙ʽ
E:Error parsing XML file.
Parser error: expected <
Start of string: ��g%�h�۩N�8nZ�cWk�خ{
��Q��F!��)��5J�H�Vd�ytt�/���9D���*W����r���1�?��ǔ/"����]6e�%0E40�u�et�H�O|�Z�OH7$�k��Q�>����>����̙ʽ
E:Error parsing XML file.
Parser error: expected <
Start of string: ��g%�h�۩N�8nZ�cWk�خ{
��Q��F!��)��5J�H�Vd�ytt�/���9D���*W����r���1�?��ǔ/"����]6e�%0E40�u�et�H�O|�Z�OH7$�k��Q�>����>����̙ʽ
E:Error parsing XML file.
Parser error: expected <
Start of string: ��g%�h�۩N�8nZ�cWk�خ{
��Q��F!��)��5J�H�Vd�ytt�/���9D���*W����r���1�?��ǔ/"����]6e�%0E40�u�et�H�O|�Z�OH7$�k��Q�>����>����̙ʽ
E:Error parsing XML file.
Parser error: expected <
Start of string: ��g%�h�۩N�8nZ�cWk�خ{
��Q��F!��)��5J�H�Vd�ytt�/���9D���*W����r���1�?��ǔ/"����]6e�%0E40�u�et�H�O|�Z�OH7$�k��Q�>����>����̙ʽ
E:Error parsing XML file.
Parser error: expected <
Start of string: ��g%�h�۩N�8nZ�cWk�خ{
��Q��F!��)��5J�H�Vd�ytt�/���9D���*W����r���1�?��ǔ/"����]6e�%0E40�u�et�H�O|�Z�OH7$�k��Q�>����>����̙ʽ

Guess I'll have to start over. It seems the GSI produced some XML that is apparently garbled (encrypted), that broke TWRP's functionality. Is your TWRP (the newest build) capable of accessing an encrypted data partition? I know the official TWRP can (and is able to prompt me to enter the necessary credentials such as PIN). If the problem is not on TWRP's side then it's the GSI, although that GSI build does have working Bluetooth/Wifi. The only way to access TWRP again is through formatting the entire userdata. (EDIT: Okay, it seems the problem is indeed caused by the GSI so I'll post further related stuffs on their respective thread)

EDIT 4: Nope I was wrong (tested with the AEX 6.1 build which had broken Bluetooth). It seems as soon as I set a security option (PIN for example), the TWRP would end up stuck on the splash logo with those garbled errors in the recovery.log as it got stuck in an endless loop failing to read some encrypted information. It seems that, while it can decrypt the data partition with default credentials, it can't decrypt the data partition whose credentials has been changed. (Official TWRP doesn't have the issue, with CarbonROM)

Is it possible to build a kernel image with forceencrypt turned off to avoid the issue for now? I'd love to have encryption, but since it doesn't seem to cope well with TWRP, I cannot really use it as it could lead to problems.