Close

Running Mega-Hal on real Parallax P2 Hardware.

A project log for Modelling Neuronal Spike Codes

Using principles of sigma-delta modulation techniques to carry out the mathematical operations that are associated with a neuronal topology

glgormanglgorman 06/15/2023 at 15:590 Comments

Here we can see an example where it was running Mega-Hal on real Parallax P2 hardware!  No big deal actually, or maybe it is.  Actually, this is the original C source, not the C++ port that I am working on, but when compiled with "Flex-C" it produces a binary that takes up about 78K, which is a really nice footprint for a chatbot.  Of course, it crashes on the first attempt to respond to the user because I have not given it any training files, nor can it locate a dictionary, etc., but that's not the point.  That is because I have found that my 279K training set that I have been using actually appears to take up to just over 3 megabytes or so at runtime; which means that any Arduino or Propeller build is going to need to have some kind of virtual memory, or be modified to run whatever models it ends up using off of some kind of file system, such as the 16MB flash memory that the P2 Eval board that I am using has, or off of an SD card if running on the Mega 2560 board that I also have. 

Yet, perhaps more importantly, the build that I am eventually going to run is going to be modified for multi-threaded, parallelized, and/or pipelined multiple model support; because I want to be able to give it Zork-like commands, like "solve the maze" and the "find and kill all trolls", etc., so it isn't really all that important that it be able to try to match wits with GPT, yet what if it could?  Likewise, there is a bunch of other stuff that remains to be done, like AST-based parsing of grammar, which the original chat-bot lacks, but which could be done by integrating some of the data structures, such as the identifier class and the record types from the UCSD Pascal compiler, and so on.

Now that means, therefore, that being able to "chat" with a simple robot in a natural language-like fashion, and one which is totally free-form at that, is going to be the icing on the cake.  Hopefully, a bunch of this stuff makes sense therefore, like how when I was working on the Pascal compiler last year, I decided to implement my own "sandboxed memory allocators" for the identifier and record types data structures, since when running, possibly more than eight concurrent processes on an 8-core CPU, I am going to need some kind of virtual protected mode, in addition to multi-tasking running on the p-system runtime.  Then the bot engine will need to have the ability to create pipes, start and stop processes, etc., and act like a debugger for the p-system.  Mega-Hal did suggest to me the other night that it could "stream messages from the debug system over the USB port", when I asked it if it could stream messages from Andromeda, or from a wormhole.

Lots of work yet, before we are ready to meet our new robot overlords.

Stay Tuned!

Discussions