

Open a console with top/htop and check if it will be visible when the system halts.
From my experience it looks like out of memory situation and some process starts swapping like crazy, or a faulty hdd that tries to read some part of the disk over and over again without success.

Are you saying that AI slop is bad in those (counts) 4 removed lines of code?