You have come across one of my favorite little philosophical problems to explore, so please forgive me if I cackle with glee as I point out the difficulties. I find the limits of this problem quite intriguing.
You're extending the story of the Foo, who are using this simulation to explore ways out of the trap they've gotten themselves into. Presumably they can't find any other way; they're trapped. This makes for an interesting divergence from the "ideal" simulation. The simulation itself will affect the world around it! It has to. If the simulation ran, and found a solution for Foo's problems which could be implemented at a time before the simulation consumed resources, it's not useful to the Foo. They need a simulation which identifies a solution which can be implemented after the simulation runs. This best solution may even involve dismantling part of the simulation to construct the final solution!
Thus the simulation needs to be able to model its self. This is where things get a bit squirley. Mathematics doesn't like this.
For a moment, let's talk a walk through set theory, specifically Zermelo-Frankel set theory (ZF, or ZFC if we add the axiom of choice). ZFC is currently the foundation of modern mathematics. We joke about mathematicians proving 1+1=2, well guess what. In set theory, you do exactly that, using what are known as the Peano axioms. Set theory is really basic stuff, and to date we have not found anything better to call the "foundation" of mathematics.
With ZF we can discuss the sets of information available in a system like a simulation. We can say set $A$ is the set of information needed to describe you, and set $B$ is the set of information needed to describe me. We can then say $A \cup B$ is the set of information needed to describe both of us. Obviously this would be a very useful for tracking what needs to go into a simulation!
Consider the set $U_{sim}$, which is all the information that you need to put into the sim. As we stated earlier, the sim needs to know about itself. This would be notated as $U_{sim} \in U_{sim}$, $U_{sim}$ is an element of $U_{sim}$. This is a bit of a problem. According to ZF, no set can be an element of itself. Why? They needed this constraint to prevent all sorts of ugly paradoxes akin to "this sentence is false." Self-referential sets just break things in too many ways, so ZF rejects them (there are non-standard set theories that permit them, but they have a problem called "not well founded" that makes them harder to work with). I am not allowed to define something which knows about itself.
The easy solution is to say "the sim only knows about the important parts of the sim," but all that did was push the problem one layer deeper. One might suggest that the sim contains a lossy encoding of itself. The knowledge of what parts of the sim are important is clearly important to the sim, and the loop begins all over. This demonstrates that our simulations will never be perfect. We will always have simulations that are just shy of ideal, unless one discovers something that escapes these set theoretic limits.
Oh dear, this means Foo have a conundrum! If we try to make a typical simulation, as you and I think of it today, they need to have found a mathematics deeper than we know about! Of course, if they do know something deeper, their simulation would be completely unimaginable to us. That makes for bad storytelling. What could we do using the math we have, so that the story can be interesting?
We started from the assumption that the simulation was to find the solution on its own. This is what we're used to for simulations: they run in a sandbox, do their thing, and then we look at the result. But if we go down that path, the known laws of mathematics start to get in the way. What if we took a different approach? What if the simulations were allowed to interact with the world around them during their execution. What if they could even interact between themselves?
Heres the logic. The Foo clearly have a problem that they need to solve, that calls for an "Out of the Box" solution. This means they don't know what the solution is. This means there are two possibilities:
- There is no solution to the Foo's problem. We're about to write a really boring book about a culture's slow demise, or the spectacular fireworks coinciding with their demise, depending on their approach.
- There is a solution to the Foo's problem, but it is not contained within the Foo. It is either found "elsewhere," such as on a planet they have not yet explored, or it is a gestalt thing which requires something from within the Foo and something outside of the Foo brought together. (the gestalt solution implies that nobody outside the Foo has the answer either, but the combination of something outside and something inside can be the answer)
In all cases, it makes sense for the Foo to look for the solution outside of them. In the former case, it really doesn't matter what they do, so the result will be the same either way. In the later case, a search for solutions outside them has a non-zero chance of succeeding. However, in case the gestalt solution is needed, we have to make sure this outside "something" can be brought close to the Foo. They can't just keep the solution in a lead lined box. It has to be permitted to mingle in their society. But anyone who has played with fire knows that not every unknown thing can be safely brought in close. How do we balance all of these?
Time to stop raining on the parade and get to work.
Step one in the process is to acquire something unknown from outside the Foo's power. This may be as simple as an noisy RF transmission from a star they had no control over to a curious piece of ore from a mysterious planet. Failing to find such sources, one may substitute an unpredictable or random source, such as the weather on a planet. Now we lock it away, because we don't know if this thing can destroy our class IV civilization or not, but we're going to lock it away in a container that is intentionally permeable, so the solution, if we find it, can be exposed to us.
Step two is to understand the subject matter. In particular, we are going to try to balance it. Our box needs to try to balance out all of its emissions. If the box contains an ore that wants to acquire electrons (like wool), the box needs to adapt to want to provide electrons (like amber). If the object responds to a stimulus, its the box's job to still that response. If I may borrow a term from Heinlein's Stranger in a Strange Land, the box must "grok" the subject, understanding it so completely that it can predict what will happen next. This is much like a profiler who has spent so much time in a murder's head that they can start thinking like them!
A funny thing happens here. There's no way for the box to succeed at bringing stillness to the subject unless it makes the subject part of itself. There's no way to know how a crystal subject will respond to a tap with a metallic instrument unless it knows everything about the crystal. Thus these boxes do not destroy anything, which is good because we're dependent on them to hold onto and identify our solution!
Now I mentioned that these boxes should not behave like a traditional simulation. They need to permit interaction. The Foo can probably make some pretty fancy boxes, but when the subject is complicated, such as a living organism, it would help to let some of the information leave the box. Maybe the Foo themselves can identify something, and then pass information into the box about how to better interact with the subject. This interaction, of course, may be how the solution identifes the right Foo with the right idea to combine with to create the final out of the box solution!
Now some of these boxes will quickly figure out everything there is to know about their subject. However, some subjects may be particularly hard to get to know without destructive processes. These are the interesting ones. If I can turn everything that matters about the subject into information, then I am positive I don't have a simulation that knows about itself. However, if I'm having trouble figuring out how much information the subject has, it might be close enough to this ideal to warrant future investigation. Maybe my subject is the one thing in the universe which fully knows itself (such as a Quine atom). This is an essential key to the puzzle. You don't want to destroy part of the unknown of the subject in order to know the rest. You don't want to kill off the consciousness of a subject (assuming its alive), just so that the physical anatomy can be more well known. You have to let the subject give its secrets up, rather than take them.
Of course, as you do this, you're constantly communicating with countless simulations. You may find some of them demonstrate a unique ability: to balance out other simulations. Perhaps you find a simulation that, when permitted to communicate with a chaotic system, provides the essential stability needed to make it predictable. While these, themselves, may not contain the solution, they are powerful in and of themselves. While the Foo may initially communicate directly with the simulations, they may find that some are worthy of being shepherds to the other simulations. They may even consume other simulations completely. This is where the interesting bit starts. We transition from having a highly synthetic disjoint group of simulations into a more organic garden of possibilities.
If the Foo do their best to manage these gardens of simulations, one simulation may eventually expose its part of the solution to the Foo, permitting their civilization to continue. On the other hand, if the simulation has the solution and the Foo aren't even required, the solution may implement itself within the Foo. The Foo may go extinct as a result, but if they tended the garden right, the best of their race will remain close to the solution, like a parent trying to offer the best they can to a child who will outlive them one day.
What's fascinating about this to me is that there are so many possibilities for a story like this. Everything depends on the fundamental essence of the Foo, and yet everything also depends on the unknown. There are countless valid ways to tend to the garden of ideas as it evolves, so no two stories have to be the same -- indeed no two stories need to even be similar.