Author Topic: A weird, cool idea  (Read 6651 times)

Offline jknilinux

  • Bot Destroyer
  • ***
  • Posts: 468
    • View Profile
A weird, cool idea
« on: November 29, 2008, 12:15:29 AM »
Would it be possible to write self-replicating programs in x86 assembly, then let it run for a few days and let evolution occur? This way, you have an alife program running MUCH much faster than it would on top of winxp in a simulator.

However, there's one problem- how do you generate mutations? Aside from waiting 500 years for a cosmic ray to come by? Well, heat causes random errors, right? So does overclocking...

So, maybe an overclocked undercooled Pentium 4 could run alife hundreds of times faster than we could ever hope on DB. Would it work?

Offline Endy

  • Bot Overlord
  • ****
  • Posts: 852
    • View Profile
A weird, cool idea
« Reply #1 on: November 29, 2008, 11:21:09 AM »
Well the computer itself would be in danger of breaking down for one thing. I don't think the programming language could safely support many mutations either. Organisms also need to be able to seperate themselves from their mutated offspring. Having more than one program of that type on the same computer would increase the risk for all.

Had an idea for a worm/virus that could self-compile/mutate offspring then send them on their way.  It'd be a wee bit illegal to set loose though... Could create some sort of internet doomsday scenario, since anti-viral programs would have problems catching it.

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
A weird, cool idea
« Reply #2 on: November 29, 2008, 01:23:22 PM »
So that is the way microsoft made vista. Now I understand.
Oh my god, who the hell cares.

Offline jknilinux

  • Bot Destroyer
  • ***
  • Posts: 468
    • View Profile
A weird, cool idea
« Reply #3 on: November 29, 2008, 03:48:08 PM »
Endy-

If the programming language is assembly, then it's implemented in the ISA, right? So, it's written in the HW, and altering memory won't disturb it at all.


Peter-

What- you mean you didn't know that before? That's the way microsoft makes all their products.
« Last Edit: November 29, 2008, 03:49:18 PM by jknilinux »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
A weird, cool idea
« Reply #4 on: November 29, 2008, 04:09:33 PM »
The problem is that, depending on the OS, a freely mutating program can either cause the entire OS to crash or erase the hard drive or all kinds of other bad things.  Computers are far less forgiving than real life.  In real life the worst you can do is kill yourself.  On the computer you can destroy the entire universe.

If you found/wrote an OS that was built around the idea that programs aren't written by intelligent entities, you could probably set something up.

Offline jknilinux

  • Bot Destroyer
  • ***
  • Posts: 468
    • View Profile
A weird, cool idea
« Reply #5 on: November 29, 2008, 04:34:20 PM »
Well, I'm saying that there is no OS. There are only bits of machine code flying around. A PC doesn't need an operating system to run machine code, right?

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
A weird, cool idea
« Reply #6 on: November 30, 2008, 03:23:00 AM »
CPUs are built with instruction sets, and there are combinations of instruction sets that will cause it to do very bad things.  Computers are purposely built to be fragile.  It's far preferable to crash the computer than cause "undefined behavior", especially that low in the hardware.  All you'd have to do is build an OS that limits the damage a single program can do.  And handles multithreading issues.  CPUs don't natively handle that.  Without an OS you'd be limited to one organism per computer.  All kinds of other issues, it just isn't practical.

Offline jknilinux

  • Bot Destroyer
  • ***
  • Posts: 468
    • View Profile
A weird, cool idea
« Reply #7 on: November 30, 2008, 01:25:11 PM »
Oh- OK. I understand.
Then, out of curiosity, do you know how CoreWars-8086 can run more than one organism on a simulated x86 computer?

http://en.wikipedia.org/wiki/Core_wars

Offline Ta-183

  • Bot Destroyer
  • ***
  • Posts: 105
    • View Profile
A weird, cool idea
« Reply #8 on: November 30, 2008, 04:28:03 PM »
Batch processing, perhaps?

Offline jknilinux

  • Bot Destroyer
  • ***
  • Posts: 468
    • View Profile
A weird, cool idea
« Reply #9 on: November 30, 2008, 05:01:02 PM »
Doesn't batch processing require an OS?

Offline Ta-183

  • Bot Destroyer
  • ***
  • Posts: 105
    • View Profile
A weird, cool idea
« Reply #10 on: November 30, 2008, 05:02:18 PM »
I'm not sure, but wasn't that program a game?


Unrelated; Did you see just a few minutes ago when we had 25 guests?  
« Last Edit: November 30, 2008, 05:03:19 PM by Ta-183 »

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
A weird, cool idea
« Reply #11 on: November 30, 2008, 05:22:27 PM »
Quite an interesting one as well.
Anyway, I just saw 17 guests.
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
A weird, cool idea
« Reply #12 on: December 01, 2008, 01:00:10 AM »
Quote from: jknilinux
Oh- OK. I understand.
Then, out of curiosity, do you know how CoreWars-8086 can run more than one organism on a simulated x86 computer?

http://en.wikipedia.org/wiki/Core_wars

It had an OS.  Or more accurately a virtual machine.  It was called MARS (Memory Array Redcode Simulator).

Again, I think this is a very possible experiment, you'd just need to define some basic rules about how programs can interact (assuming your programs can interact.  But if they can't, what's the point?)  For instance, in Windows a program will cause an illegal operation exception if it tries to access memory it doesn't own (such as memory Windows is using to run).  In something like this maybe you want to allow one program to access the memory of another, but make it a costly action in some way.  Or even just nakedly allow any program to write to any memory.

Such an experiment is closer in spirit to Avida than Darwinbots, incedently.  Darwinbots is about simulating a simplified version of biology, with bots moving through a 2D world and eating each other, etc.  Something like Avida is closer to raw programs competing in terms that make sense in the computing world.

edit: if you're really curious, multithreading in Core wars.
« Last Edit: December 01, 2008, 01:10:12 AM by Numsgil »

Offline jknilinux

  • Bot Destroyer
  • ***
  • Posts: 468
    • View Profile
A weird, cool idea
« Reply #13 on: December 01, 2008, 01:08:18 PM »
Well, if I had, say, 8 cores, then I could run a maximum of 8 organisms without an OS, right? That might allow evolution to occur.
Because, as it turns out, I do have an 8-core processor over here that I could put to the task. So, maybe I don't need an OS after all.

The second problem is overclocking and overheating- is there any other way to randomly alter code without killing the processor? I'm thinking I shouldn't really be randomly altering the processor anyway, since the "DNA" will be stored in memory. So, I'll need to randomly alter the RAM instead... Maybe using a random number generator to insert random bits into random places in memory is a better idea... In fact, since it's a microcontroller, interfacing a random number generator with the RAM should be easy.

Anyway, my real goal here was to eliminate the OS to let all of the computer's processing power go directly into simulating bots. Is it possible?

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
A weird, cool idea
« Reply #14 on: December 01, 2008, 01:50:07 PM »
I don't know how 8 cores works on the assembly level, but down that path lies madness.  Also, you would need more than 8 "organisms" to achieve any sort of meaningful competition and evolution.  As a bare minimum a population needs to number in the dozens, probably hundreds, or you'll get random drift overpowering natural selection.

Don't underestimate how much an OS actually does.  It isn't trivial.  An OS vs naked assembly on the CPU is like the Earth vs. Mars.  The OS you use doesn't have to be windows.  You could find a lean version of linux and use that.  But again I don't think it'd be a very hospitable environment.  You're much better off constructing a virtual machine and having evolution proceed inside that machine.  That way you can control the sort of damage your ecosystem can cause, and provide a uniform environment across different hardware configurations.
« Last Edit: December 01, 2008, 01:51:02 PM by Numsgil »