Author Topic: Looking into memory snapshots  (Read 3139 times)

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2554
    • View Profile
    • http://kuro-tejina.com
Looking into memory snapshots
« on: May 16, 2005, 03:47:40 PM »
I have just started looking into the best way to implement memory snapshots.

There are three main approaches that I can see.

1) save the memory of the robots into the snapshot save file for offline use. This can either be added as part of the main snapshot file or added as a second complimentary file with just memories.

2) Online memory monitoring as an extension of the robot information panel. While it is already possible to see each of the robot's memory locations from the console, it takes a long time to check through them. A display could be set up to monitor all or a select few memory locations at each cycle of the sim.

3) A third approach could be to save the memory locations of one specific robot (as selected in the robot information panel) as a special kind of snapshot file. This will track ALL of the memory locations for the selected robot for as long as you like.

Personally I think 2 and/or 3 would work the best. I don't think 1 would be all that useful.

Thoughts please people?
There are 10 kinds of people in the world

Those who understand binary.

and those who don't

:D PY :D

Offline Endy

  • Bot Overlord
  • ****
  • Posts: 852
    • View Profile
Looking into memory snapshots
« Reply #1 on: May 17, 2005, 05:47:06 PM »
I think #2 mainly since I normally monitor the numbers cycle by cycle when testing complex code for stuff like MB repro or when a series of actions are required. A way to monitor the top numbers in the stack would also be helpful(it's possible to rig something up but I'd rather not have to).

Endy :)
« Last Edit: May 17, 2005, 05:48:02 PM by Endy »

Offline Greven

  • Bot Destroyer
  • ***
  • Posts: 345
    • View Profile
Looking into memory snapshots
« Reply #2 on: May 18, 2005, 10:22:45 AM »
2 and 3 sounds good to me.

But what about the option to save only specific memory locations for all robots? Or was it abandoned?

Example:

You only what to look into memory location 201-207 and 509-512 (just picked out of the blue) over an entire run (x cycles)?
10010011000001110111110100111011001101100100000110110111000011101011110010110000
011000011000001100010110010111101001110100110010111100101000001000001111001011101
001101001110011011010011100011110100111000011101100100000100110011010011100110110
010110000011100111101001110110111101011101100110000111101001101001110111111011101
01100100000111010011010001100001110111010000010001001000010100001

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2554
    • View Profile
    • http://kuro-tejina.com
Looking into memory snapshots
« Reply #3 on: May 18, 2005, 10:44:19 AM »
Quote
You only what to look into memory location 201-207 and 509-512 (just picked out of the blue) over an entire run (x cycles)?

 :blink:

That would be one [span style=\'font-size:14pt;line-height:100%\']HUGE[/span] file.

Even 10 memory locations saved for ALL bots (average of about 500) over 1,000,000 cycles would be a 5 GIGABYTE file.

That is why this option gives me headaches even thinking about it.

What I am thinking about is to have a recording function built into the console. It would allow for maybe 20-50 user definable memory locations to be constantly monitored, updated and displayed for each cycle for the selected robot.
A control could be set up to initialize a save file for this specific robot, then it could be saved to a file as well as monitored in the console for as long as you like. I would automatically include informational inputs like the eyes, shots hitting it and such like so that you can examine the file online and again offline afterward.
There are 10 kinds of people in the world

Those who understand binary.

and those who don't

:D PY :D

Offline Greven

  • Bot Destroyer
  • ***
  • Posts: 345
    • View Profile
Looking into memory snapshots
« Reply #4 on: May 18, 2005, 10:48:04 AM »
Okay 5 GByte is a little to much, my brain is running low on nrg at the moment.  ;)

But still you should have the option. Make so you can choose at which rate it would save. At 1000 cycles/save is only 5 MegaByte!
« Last Edit: May 18, 2005, 10:49:46 AM by Greven »
10010011000001110111110100111011001101100100000110110111000011101011110010110000
011000011000001100010110010111101001110100110010111100101000001000001111001011101
001101001110011011010011100011110100111000011101100100000100110011010011100110110
010110000011100111101001110110111101011101100110000111101001101001110111111011101
01100100000111010011010001100001110111010000010001001000010100001

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2554
    • View Profile
    • http://kuro-tejina.com
Looking into memory snapshots
« Reply #5 on: May 18, 2005, 12:47:40 PM »
Maybe so but it would still take you a couple of years or so to make any sense out of the save file
There are 10 kinds of people in the world

Those who understand binary.

and those who don't

:D PY :D

Offline Greven

  • Bot Destroyer
  • ***
  • Posts: 345
    • View Profile
Looking into memory snapshots
« Reply #6 on: May 19, 2005, 10:14:36 AM »
No it would not! If the saved file has proper formatting, a program could make some beautifull statictics! But then again this could be done directly from DB...
10010011000001110111110100111011001101100100000110110111000011101011110010110000
011000011000001100010110010111101001110100110010111100101000001000001111001011101
001101001110011011010011100011110100111000011101100100000100110011010011100110110
010110000011100111101001110110111101011101100110000111101001101001110111111011101
01100100000111010011010001100001110111010000010001001000010100001

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2554
    • View Profile
    • http://kuro-tejina.com
Looking into memory snapshots
« Reply #7 on: May 19, 2005, 01:13:01 PM »
I guess graphing it would be pretty easy but I'm not sure what that would really acheive.

The point of saving memory locations and/or stacks is that you can follow a specific organism through the cycles of its life and see exactly what external stimuli effect it and in what way.
Critically examining all the inputs and outputs for one robot over 1000 cycles is still a pretty tall order. I have spent hours just looking at a single robot in a given situation while attempting to analyze exactly what, where, when, why everything is happening.
A bunch of pretty graphs wouldn't tell me diddly squat about what I really want to know. Stuff like exactly how much is stored into .aimsx when I have a variety of different eye inputs.
Try running HDV4 for a few cycles to see what I mean.
He doesn't use simple turning with stuff like "If eye3 > eye5 then store 23 in aimsx"
He uses a complex and infinitely variable formula based on several eye inputs.

1000 cycles of memory information from a single HDV4 would take me a couple of days to really sort out.
There are 10 kinds of people in the world

Those who understand binary.

and those who don't

:D PY :D

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7714
    • View Profile
Looking into memory snapshots
« Reply #8 on: May 19, 2005, 09:33:21 PM »
The problem is just figuring out what it is you want to record in the bots memory.  Probably, the only useful things to record are memory locations that are set more or less at birth, or locations that directly relate to a bots success, like *.kills or *.body.

So you don't need to record 1000 memory locations.  You're probably only really interested in maybe 10.  Let the user create a small list of memory locations he wants to record.  Then record only when those memory locations change, and list how they changed.

Something like this:

robot 6985
born on 102540
died on 107654
*50
cycle# | value | changed by
102541 | 214 | self
103251 | 52 | positive shot
105315 | 314 | positive shot
107600 | 322 | self

In the end you really just want one snapshot tool.  Have it be able to record DNA, specified memory locations, and/or anything else you can come up with.

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2554
    • View Profile
    • http://kuro-tejina.com
Looking into memory snapshots
« Reply #9 on: May 20, 2005, 09:35:46 AM »
Agreed Num.
You certainly need a lot more than 10 memlocs saved though.
Maybe 10 user definable memlocs in addition to most of the senses.
We certainly need all the eyes, the refvars, the myrefvars (in case you want to see anyone messing with them) and a few others recorded all the time.
Possibly about 100 memlocs per cycle. That wouldn't bee too bad for a single robot but it would make a pretty big snapshot file.
There are 10 kinds of people in the world

Those who understand binary.

and those who don't

:D PY :D

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7714
    • View Profile
Looking into memory snapshots
« Reply #10 on: May 20, 2005, 05:49:01 PM »
Again, it depends exactly what it is you want to find.

AZPaul wanted to figure out how is sex selection memory locations were mutating.  So likely he'd only be interested in them.

As you want more and more data, you'll want fewer and fewer bots to be recorded (no use gathering 10MB of data.  It'll blow your mind).  Maybe a 'only record X% of bots' check could be included, or a simple 'snapshot' of all bots currently on the screen at this instant.

Point is if you create enough tool pieces the user can mix and match to creat the perfect recording tool for his present needs.