perjantai 26. lokakuuta 2018

Cyberpunk eyes


Everything cyberpunk has taught us is that it will make us better through implants - or augmentations, or whatever term you prefer. There is cost of course - monetary at least, and very likely social too (see: deus ex games). However..

Our visual cortex and eyes have been honed by millions of years of evolution, and even still it isn't even good, nevermind perfect - I do have to wear glasses after all. That being said, I don't really expect much more of it; after all, evolution is always looking for better overall result and not for singular results.

That makes me think.

Let's say we could replace my eyes with a perfect camera (not an option I'd pick first from a list of possible improvements, but for argument's sake) .. would my brain - or specifically, my visual cortex - keep up with it?

I think that overtime, our eyes and brain have evolved together, to offer just enough data at our focus to give sufficient resolution, but also process incoming data in most effective matter. This is the reason so many of the visual tricks work. "Focus on the jugglers .. now, did you notice the gorilla walking past?" just to name one example.

Our senses - eyes in this case - feed our brain massive amount of information, so before anything else happens, this wealth of data must be processed and filtered. Almost from birth our brain can detect movement very efficiently, as well as shapes - human faces specifically seem to take a lot of processing for identification - and some other very specific but very important things that helped our survival in the past.

If I were to feed my brain with that camera footage instead of what my natural eyes feed them, could my brain make any sense of it? I guess the answer for that would be yes - but only after long period of my brain getting used to it. That might take a long time, months or years even.

But the better question is, would that actually make me perform better? Replacing just the eyes that is. I do have a feeling that answer to this is no. The same processing would need to be applied to incoming data. I just changed the source, but processing did not change. For optimal results the brain needs an upgrade there too.

For example, some predatory birds the live in forests have essentially two visual processors. One keeps track of surroundings - essentially making sure they don't hit a trees or other such things. Other tracks their prey as they flee, to keep it from escaping. We don't have that capacity to focus on two very different (visual) things at once, although some people appear to thing they do, especially when driving.

Some frogs apparently have processing in their brain that only fires then small, round-ish item (like a bug) is moving on their vision (disclaimer: or so I've recently read from somewhere). What a perfect way to conserve energy by idling when there's nothing to do... (I think I wrote a post where I talked about this "do nothing/sleep until you need to do something" in context of MCUs but can't find it right now so no link, sorry).

So in the end, without some brain processing upgrades, upgraded eyes might not actually be that great. Granted, you could put processing in the the new eyes too, to provide a HUD or something like that to make them more useful, but even then, there is that "one focus thing only" limitation. Context switching is expensive in processors, and in our our brain, even more so (say, switch between focus points in vision.)

That eye upgrade - or at least versions 1 through 5 of them - might be quite disappointing. But even then, for someone with no (properly) functioning eyes, they still might be almost a miracle and absolutely worth the cost. I'll just wait upgraded version of eyes - and other things too -  for a bit longer, thank you.





keskiviikko 17. lokakuuta 2018

Life of an NPC

Lately I've been way too busy to write (or even think up, really) new posts, nevermind ones that would be even close of being on-topic. So unfortunately you may need to just accept wildly off-topic posts like this.


In computer games, NPC refers to roughly "non-player character". Essentially, a character controlled by computer.

I've been playing WoW (that is, World of Warcraft) on and off for .. well, long time. After new expansion came out, I picked up again, for some time at least. And running around in Boralus harbor I saw some guards standing there in attention, and suddenly my imagination formed idea on what's going on "in their mind"...

"..So, my job is to stand here, in attention, for the length of this expansion? ..Well, could be worse, I could have been put to next hamlet over, to be eaten alive by huge monster whenever here comes to town, so once every hour or so I reckon..."


So, at this point you may be asking, I'm too busy to write not still have time for games? Well, like I said before, you need to relax in order to retain your productivity, and do know that unless I take a proper time out at some time, my productivity just plummets. So, at the moment, this is one of the ways I relax a bit when off from work.




maanantai 8. lokakuuta 2018

Compiler bugs?


I've been writing code, in one form or other, for some 30 years now. And over all that time, I've found exactly two compiler bugs, and one of those is kinda grey area anyway.

First one was a C compiler for C51 processors. The bug was that when a did something like this;

int var;
 
void func()
{ var = var*2; }
...

var = 3;
func();
printf("var=%i\n", var);
 
It would print out 3. Whether this actually counts as bug (variable wasn't volatile, after all) is another issue, but this did take a few moments of head scratching to figure out.

Another one was with Microsoft Visual Studio 6 (or might been few versions newer MSVC too) or so. I don't remember the exact details here, but somehow, when #including things is a very specific order, compiler (well, pre-processor) decided to completely drop one of the included files from compilation, resulting a very, very strange error complaining about undeclared classes/namespaces/whatever (again, exact details escape me).

This one took again few hours to figure out (I had to actually make compiler to print out pre-processed intermediate output to find out what exactly happened), and just switching include order of two files (one that was dropped and another) fixed the issue.

Unfortunately, this was part of very complex project, so making simplified case of this to report the issue wasn't possibly, so I never submitted a bug report.

What am I trying to say here?

Do you suspect that error is a compiler bug? I am willing to bet that it isn't - it's your bug.

Yet, even then, I am a bit... shall we say, reluctant, to upgrade the compiler I'm using for my ARM builds. Although the possibility of finding an actual compiler bug is nearly zero, possibility of triggering some obscure bug in some part of (my!) old code because some detail somewhere changed doesn't make a fun possibility...