Okay, thanks for the clarification. It seems, however, that I'm dealing
with a hardware issue (as Dan Ritter suggested): I did some more
testing, and after the latest crash, the system won't boot at all, and
the power LED blinks red six times, which according to the
manufacturer "indicates a pre-video graphic card error."
"To resolve the issue, complete the following steps:
1) Reseat the graphics card.
2) Replace the graphic card.
3) Replace the system board."
https://support.hp.com/gb-en/document/c03599666
I suppose I'll begin by trying the first and see if it helps ...