Sunday, August 1, 2010

Evolutionary Kernel

In the past, I mentioned genetic algorithms as a way of producing powerful code that not even the programmer thought of. Here's what I wrote, as a refresher:
Evolution is an important principle in modern biology, and the subject is frankly impossible to understand without it. Evolutionary biology states that genes drift over time, and successful ones predominate over unsuccessful. Therefore, life adjusts to current conditions, whatever they may be.
Genetic algorithms adjust computer code, or abstract computerized representations, according to a fitness function. When the genetic algorithm is trying to design something, the fitness function works according to the qualities of the thing trying to be designed. When the genetic algorithm is designing an algorithm, the fitness function determines how efficiently the target runs.
So, I realized that genetic programming works best when we know what the correct result is, but aren't entirely sure of how to get there. So we have genetic algorithms evolve to produce the most efficient solution. (This solution can then be generalized for more abstract problems. And because of this, I think we should try to evolve an operating systems kernel.
The kernel is the central part of the OS that must run all the time, never leaving memory. It handles the computer's resources, determines which program is allowed to run (is "database" more important than "solitare?"), and prevents errors in one program from taking down the rest of the system.
Various kernels would be run through an obstacle course of tasks, like starting a certain set of programs, one of which has a pointer-arithmatic error and will "crash" it unless the kernel intervenes. There should be memory access, disk access, scheduling, and conflict management issues. Afterwards, the run time of all these is recorded. The program with the most application run time and the least kernel run time (it efficiently ran as many programs for as long as possible) "wins," and is bred into the next generation. The one with most crashes "loses" and is killed, as is the one that ran the least efficiently. After many many generations, we would have the best possible kernel.
The next step would be to reverse engineer it...


Alex Waller said...

People are doing exactly what you describe:

themadengineer said...

Your article was mostly about applying genetic programming to robotics. I'm talking about applying genetic programming to operating systems.

Related Posts Plugin for WordPress, Blogger...