It's becoming something of a trope in contemporary science fiction: the character who believes himself to be in the real world finds out, through a series of enlightenment-style experiences, that what he inhabits is not "ground level" reality but a virtual world of one sort or another. After the runaway success of The Matrix (despite its horrifically bad sequels) virtual realities have made their way from hard sci-fi and introductory philosophy courses into the standard guns-and-leather plots of the silver screen. This suspicion of reality goes back at least as far as Plato, though as a basic idea it is straightforward enough. Whether the technology of any given movie world is plausible or not, as a narrative, we get it: things ain't what they seem.

image: Pathfinder Linden
A question, though, is raised by all this consciousness-raising: what constitutes ground level reality? Or, in a more positivist vein: what could, even in principle, determine whether any given level were ground?
An interesting recognition of the complexities appears in the 1999 movie The 13th Floor. The movie is a throw-away; I don't mean to recommend it as fine cinema. But the script contains the seed of a relevant epistemological knot. (BEWARE: SPOILERS FOLLOW)
In it, the creators of a virtual Los Angeles, indistinguishable to its cyber-based observers from the real world, find through a long series of adventures that they, themselves, are likewise living in a virtual city. Their lives, which they took to be at level A, were in fact always at A', while the virtual city they built and believed to be at A' was in fact at A''. When the hero emerges -- that enlightenment experience again -- into the actual A-level world, he finds it to be Los Angeles in the future.

image: cogdogblog
Nice surprise. However, the script touches more or less accidentally on a profound problem. To stay within this scenario, how do observers in A know that they are at ground--that their level is, indeed, A? After all, observers in A' mistook themselves for A, as did observers in A''.
On cursory inspection one is tempted to conclude that there is no way to know, at any level, whether you are at A. All levels must make this pragmatic assumption, but any level could be wrong -- indeed, all could be wrong, if there is an infinite number of foundations. But is this so?
(Note also that this situation of ontological undecidability did not exist until the invention of the virtual city, the first Los Angeles A'. Until any version of A' is fabricated, the currently experienced reality has to be A; there are no other options. However, how can a stable A turn into an uncertain A merely by being the location of some new technology?)
Question, then: is it possible in principle to devise a test -- scientific, quantifiable -- to determine whether the given reality in which the test is run is foundational?