Unity+ Posted October 6, 2015 Posted October 6, 2015 So, the hypothetical here is let's say you have a physical computer that has the possibility of emulating the exact way that the physical computer works digitally. Considering that possibility, let's say that virtual computer can emulate another virtual machine. The question is if you were only given the data about the schematics of the physical machine and it's sequences of states within the circuitry, would you be able to tell that there is a virtual computer within a computer?
Strange Posted October 6, 2015 Posted October 6, 2015 We do exactly this all the time when designing new processors. And when you run a virtual machine, such as VirtualBox. The main way you can tell that it is an emulated processor is because it is slow! If you can see the sequence of states that the host computer is executing then you could, in principle, reverse engineer the code it is running and work out that it is running an emulator. (One clue might be that it is executing many more instructions than are in the program you give it to run.)
Unity+ Posted October 6, 2015 Author Posted October 6, 2015 We do exactly this all the time when designing new processors. And when you run a virtual machine, such as VirtualBox. The main way you can tell that it is an emulated processor is because it is slow! If you can see the sequence of states that the host computer is executing then you could, in principle, reverse engineer the code it is running and work out that it is running an emulator. (One clue might be that it is executing many more instructions than are in the program you give it to run.) I know we do it all the time, just a thought experiment. (One clue might be that it is executing many more instructions than are in the program you give it to run.) That isn't completely useful since there are other programs that could be executing way more functions.
Strange Posted October 6, 2015 Posted October 6, 2015 That isn't completely useful since there are other programs that could be executing way more functions. True. You would have to try and separate out the threads of different things being run. It would not be easy! But it is, in principle, always possible to find out what code a processor is executing.
Sensei Posted October 6, 2015 Posted October 6, 2015 Do you want to emulate exactly the same CPU within the same CPU? Like emulate Intel on Intel machine? Or without such restrictions? Because 15 years old x86 CPU (Duron 1300 MHz) was emulating mine Amiga at speed it never had, literally hundred time faster. Amiga 500 has 7.14 MHz. 1300/7.14=182 times faster by frequency. But old CPUs had much slower instructions, f.e. division was the slowest instruction on Motorola 680x0, 140-158 cycles per div, 70 cycles per multiply, http://oldwww.nvg.ntnu.no/amiga/MC680x0_Sections/timstandard.HTML http://oldwww.nvg.ntnu.no/amiga/MC680x0_Sections/mc68000timing.HTML Current CPUs have it much more optimized, or even do couple instructions in single CPU cycle.
Acme Posted October 6, 2015 Posted October 6, 2015 ... The question is if you were only given the data about the schematics of the physical machine and it's sequences of states within the circuitry, would you be able to tell that there is a virtual computer within a computer? My first thought on reading the title was Conway's game-of-life. Since the game has the capacity of a universal Turing machine it seems to me it would be rather difficult to tell the difference between a game running as a virtual computer and a game running otherwise. 1
Unity+ Posted October 6, 2015 Author Posted October 6, 2015 My first thought on reading the title was Conway's game-of-life. Since the game has the capacity of a universal Turing machine it seems to me it would be rather difficult to tell the difference between a game running as a virtual computer and a game running otherwise. That is the best way, as far as I know, to think of it.
Strange Posted October 6, 2015 Posted October 6, 2015 But your original questions implied you had access to the internal states of the "outer" (host) machine, in which case one could tell it was running an emulation of another machine. If I have misunderstood, and you only have access to the states of the inner (emulated) machine then it is, of course, impossible to tell.
Unity+ Posted October 6, 2015 Author Posted October 6, 2015 But your original questions implied you had access to the internal states of the "outer" (host) machine, in which case one could tell it was running an emulation of another machine. If I have misunderstood, and you only have access to the states of the inner (emulated) machine then it is, of course, impossible to tell. Yes, that is what I mean. In this case, would it be wrong to say that one could never determine whether any computer, given that data, was running an emulated version of itself?
Strange Posted October 6, 2015 Posted October 6, 2015 In this case, would it be wrong to say that one could never determine whether any computer, given that data, was running an emulated version of itself? If you have access to the states of the machine, surely you can work out what program it is running. Either it is running an emulator or it is running something else (Life, accounting program, web browser, whatever). Maybe I am missing something, but I fail to see the problem. (Well, the problem is that it would be nearly impossible in practice, but ...) Imagine someone gave you an assembly code listing of a program and asked you what it was. It would be extremely difficult but you could, in principle, work out what it did. That is the same problem. Except that first, you would have to piece together the assembly program by tracing the instructions executed.
Unity+ Posted October 7, 2015 Author Posted October 7, 2015 If you have access to the states of the machine, surely you can work out what program it is running. Either it is running an emulator or it is running something else (Life, accounting program, web browser, whatever). Maybe I am missing something, but I fail to see the problem. (Well, the problem is that it would be nearly impossible in practice, but ...) Imagine someone gave you an assembly code listing of a program and asked you what it was. It would be extremely difficult but you could, in principle, work out what it did. That is the same problem. Except that first, you would have to piece together the assembly program by tracing the instructions executed. But deciphering assembly code is different from obtaining the state of each transistor in the machine, I would think.
Strange Posted October 7, 2015 Posted October 7, 2015 But deciphering assembly code is different from obtaining the state of each transistor in the machine, I would think. It is orders of magnitude simpler to decipher assembly code (even though it is almost impossible, in the general case) but I can't see that you are doing anything other than making the problem more difficult, rather than impossible. By looking at the state of every transistor, you can identify the logic gates, latches, etc. From that you can work out the datapaths and control logic, from that you can work out the instructions executed and the data operated on, from that you can piece together the assembly listing. 1
Unity+ Posted October 7, 2015 Author Posted October 7, 2015 It is orders of magnitude simpler to decipher assembly code (even though it is almost impossible, in the general case) but I can't see that you are doing anything other than making the problem more difficult, rather than impossible. By looking at the state of every transistor, you can identify the logic gates, latches, etc. From that you can work out the datapaths and control logic, from that you can work out the instructions executed and the data operated on, from that you can piece together the assembly listing. That makes sense. I wonder what would happen, though, if you had a virtual machine within a virtual machine and you had the same restrictions. Would having an infinite amount of them inside each other make it harder to discern the virtual machines?
Sato Posted October 8, 2015 Posted October 8, 2015 I wonder what would happen, though, if you had a virtual machine within a virtual machine and you had the same restrictions. Would having an infinite amount of them inside each other make it harder to discern the virtual machines? If you specify an infinitely deep nest of machines, then your input to your top-level, universal machine is just some encoding of that infinite nest. Because each machine, when read and run by its parent, will do the same thing for its input (its child machine) and so on, by the definition of a simulation, the program will never halt. What's interesting is that if we consider this in practice, without concern for infinite resources, a typical VM runs simultaneously with the computer running it, where the parent system is running some daemons, the windowing system, maybe browsing SFN, and so the processes of both machines have to be interleaved by some multithreading mechanism. There are established schemes for this, but if we require that any given child-VM eventually begins its simulation as per the point of this hypothetical, it might be impossible, namely if we allow them to run other such simulations, which you do naturally by allotting unlimited resources to the universal machine. I'm not sure, there might be a way around it, or there might be some special implied condition for which there's no way around, but this piques the problem—we might never be able to discern all of the VM's, precisely because they're infinite and can be nested. 1
Strange Posted October 8, 2015 Posted October 8, 2015 It does raise some interesting questions. I don't know if anyone has done any theoretical work on this (some sort of formal analysis of what is possible or not). Could be an interesting PhD project for someone ...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now