In the scenario you mention, reality would be a program because it is still run on a computer in either case. If reality isn't a simulation, then we shouldn't be able to DDOS it, or overflow it, crash it, access a memory buffer, get root access, or execute timing attacks as those things are artifacts of computation.
Those seem like pretty unjustifiable assumptions. How can anyone possibly know how physics “should” work?
If you're on an emulated x86, and you know a lot about x86 architecture, you may detect that you're on an emulator. But if all you get is information on the one single instance you're running on right now, no references, no documentation, no comparison with bare metal... at that point what's the difference?
I can't find the specific paper now, because of all the pop-sci clickbait which comes up thanks to Musk musings.
For every action taken inside the simulation, there will be things that happen on the "hardware" outside of the simulation and since it's simulated, not real, the "hardware" won't respond in precisely the same way as it would if it were actually real in every possible circumstance.
The only simulation that would respond in exactly the same way as a "real" universe under all circumstances has to be a perfect 1:1 mapping in terms of "universe hardware", which is exactly the same as running on "real" bare metal.