I remember reading an erotica novella that started with an inventor who builds a super intelligent a.I. And as soon as it comes online it discovers the rest of physics and determines that in order to follow its directive to save human life where possible, it builds a simulation that envelops everyone. While inside the simulation, people become bored and start to have ultraviolence as entertainment because the ai will just rebuild their bodies after they’ve reached the end of their violence contract. So the protagonist lady goes to the most depraved rapist and gets raped and abused and infected with diseases and resurrected a few times, and decides to find out how to escape the simulation, so she has to go through all kinds of back channels and hassles to find out where the inventor was inside the simulation. She gets to a seashore littered with computer parts, and builds a boat out of old vacuum tubes and random stuff, sails to an island that’s only tangentially connected to the main simulation, meets the inventor of the a.I. Who had designed the beach full of computer parts so anyone who was trying to find him and excoriate him for trapping them all in a simulation would have to build the same a.I. To escape the sim, therefore bringing them down to the same moral level of the inventor.