This job must be good (job stuff)
James has reverted to not wanting to believe that I know what I'm talking about, but he doesn't seem to understand the difference between cycle-accurate and high-level speed-accurate emulation, and that the developer kit uses a cycle-accurate emulator, and that the reason that the samples in the kit run at 40-60fps is because they're not using the emulated CPU much, and that if the code weren't fast enough to run at 60fps then the display would be totally garbled because, unlike PC-based platforms, the DS is not double-buffered, and no, adding in our own double-buffering is not an option. (Well, technically it is, but it's a waste of memory.)
Anyway, I told him that I bet him that my code will run at full-speed on the real hardware, and he said, "Would you put money on that?" and I said I would, and he said, "how much?" and I said "as high as you'll go."
That shut him up. For five minutes, anyway.
But yeah, like, one of the many quirks of how the DS graphics chip is laid out makes it so that if you don't keep your rendering at 30fps per screen (meaning 60fps total) and, further, if you don't keep all screen updates ahead of the screen retrace, you will get MAJOR shearing artifacts, i.e. the two screens will mix together in very stupid-looking ways.
The reason he thinks my code will run slowly is because the emulator runs at only 5fps per screen while basic blitting runs way faster, but he just doesn't understand that basic blitting is a system call which can be emulated at a high level and still remain cycle-accurate, while cycle-accurate emulation of low-level ARM9 code is relatively quite slow.
The anecdote I keep on telling him is that the 1MHz Commodore 64 required a 100MHz 486 to be emulated at full speed in a cycle-accurate manner with a VERY well-optimized emulator (which I know the Nintendo devkit one isn't), and that didn't even cover the I/O subsystem. By that rule of thumb, the DS would need about a 20GHz P4. It runs like shit on my 3.8GHz dual P4 because a 3.8GHz dual P4 simply can't emulate it fast enough.
He's hung up on the notion that an emulator is "supposed to emulate the time correctly." He has no fucking clue how emulators work.
Also, even the CPU-lightest high-level code in the examples only runs at around 45fps on the emulator, but he just thinks that means that the code will run at 45fps on the real thing. I'm getting pretty sick of explaining this particular facet.
On the other hand, the thing which I had the huge debate with Antoine about has beared quite a bit of fruit, and Antoine was suitably impressed. I think now he realizes that just because he doesn't understand something doesn't mean it's bad.
On the emulator speed front, Antoine seems to just be staying out of the debate. He had me try a couple of things based on his experience with a gimpy Nokia emulator (which is orders of magnitude simpler) but it didn't make any difference, and I think that my C64 analogy has at least sunk in with him. I think Antoine has also finally realized that I really do know what I'm doing. :)
Anyway, I'm positive that my decompression/blitting code will run exceedingly well, since a similar (and less architecture-tuned) algorithm ran extremely well on a 486/33, which is WAY slower than a 66MHz ARM9.
All of the graphics programming James has done has been on double-buffered DirectX displays. I don't think he even understands what retrace shear is. But I know how to show him that the GPU emulation is cycle-accurate: I will turn off the retrace checking code, which will make the code blit to the screen as fast as possible, which will introduce a hell of a lot of shearing artifacts. It will hopefully show him the difference between raster-scanned and double-buffered hardware, and show him that on this emulator, one frame is one frame, not one fifth of a second. And by counting the number of shear transitions which happen in a frame I can hopefully show him how many more layers of software compositing I can do before CPU load will be an issue. (My guess: 10, at least.)
In other news, it's 11PM and I still haven't eaten any dinner. I'm sick of cooking in the toaster oven. Fortunately, I finally established an account with Keyspan Energy (I went to their Brooklyn office before work this morning) and I should have gas service tomorrow.
I wonder if anything is open this late, and if they take credit cards.
Comments
I'm very jealous that you have a job where knowing stuff is actually important.
But it'd shut James up, at least.
Manhattan is the city that never sleeps, though most restaurants still close around midnight (as I found out when I was jonesing for some food after that concert last week). Downtown Brooklyn is severely sleep-deprived, but it seems to also shut down eventually, and anyway Brooklyn scares me and I haven't felt like going there to explore just yet.
Ridgewood (where I am) seems to shut down at around 10PM, except for McDonald's and a few other restaurants, and none of them take credit cards (they say, "there's an ATM down the street," I say, "That'd be helpful if I had money on my debit card"), so with my $4 I got a Quarter Pounder, breaking my five-year run of not eating at McDonald's. Oh well.
From now on I'm always keeping at least $100 in my Paypal account. At least ATM fees aren't too bad around here.
I'd post pictures but I don't have a workable camera and I'd like to keep my job.
Also, in terms of office politics, I think you really need to try stay out of the "I-am-right-you-are-wrong" mode if possible, especially when you're in the right. Being wrong and humbly apologising makes you a team player. Being right and showing it makes you a prima donna.
Any new hire is assumed an idiot until proven otherwise, since quite a lot of new guys do turn up, do a huge amount of damage, then leave. It's to be expected that people check up on you: no-one in their right mind would just trust someone new, if what's up on screen appears crap.
Instead of "you're wrong", try "Well spotted, that's a very good point. But in this particular case it doesn't apply because of..."
I also don't think that I've said anything which gets too personal; I have been paying attention to what I say, since I know rather well at this point how easy it is for web-based stuff to turn sour.
I wish they'd stop doing that, though - remember when stock Pentium classics, all the way through Pentium3s were SMPable? AMD is guilty of the same damn thing (and nobody makes a good workstation-type dual Opteron board - hell, I can't even find one with AGP and SATA. One or the other, yes, but not both. Maybe I'm not looking hard enough.)
On the other hand, I don't really see the need for 64-bit consumer computing at this point (I mean, are you going to run a petabyte database on an iMac or a laptop?) and it's not like most people even use the maximum capability of a G4/800 or anything. (I mean, unless you're running Safari and it's pointing at a page with lots of animated .gifs or something, but that's just because WebKit seems to have some gimpiness in its animated .gif handling).
And my reason for wanting a 64-bit box has less to do with the 64-bitness and much more to do with architectural improvements within the chip itself, which improve IPC (this seems true of both PPC 970 and AMD64). And you can never have too much CPU power, after all. If I can have a 2GHz G5 for the same price as the 1.5GHz G4, I'd just as soon have the extra oomph. I can always find some amusing misuse of resources to suck it up (or just multitask myself to the moon - though I'd rather have SMP for this.)