RSS LJ

August 2, 2004

This job must be good ()

by fluffy at 10:52 PM
This is the first job I've ever had where I haven't kept my eye on the clock all day long, and have actually ended up going home at, like, 8:30 PM without realizing it.

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

#3242 08/02/2004 08:21 pm Wait...
Isn't New York the city that never sleeps?

I'm very jealous that you have a job where knowing stuff is actually important.
#3243 Conspyre (unregistered) 08/02/2004 08:23 pm
At some point are you going to get access to some sort of demo hardware? Seems like it would make it a lot easier to test, especially if there's a way to put data on the new memcard format without some kind of crazy machine.
#3244 08/02/2004 08:33 pm
I have demo hardware, but it's some funky/finicky SCSI weirdness and I can't get the device driver to load (Windows says the driver is "missing an entry" WeverTF that means), and its usefulness is limited because it only has one screen. It'll still be sufficient for seeing how fast the code actually runs, but it won't be very playable. Smile

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.
#3245 Anonymous 08/02/2004 09:27 pm
What's the SCSI demo thingy? Some sort of borked GBA, or a breadboard/prototypey thing of some sort?
#3246 08/02/2004 10:18 pm
Neither... the SCSI portion is some sort of firmware loader which is basically a SCSI-to-GB cartridge adaptor (it's the same box used for GBA and GBC dev; we also have a specially-modded GBA which hooks up to it), and then there's a Nitro TEG board which hooks up to it. (Nitro is the internal codename for the DS. I have no idea what TEG stands for, but the TEG is basically a single-screen DS prototype which uses a modified SNES controller for input and so on.)

I'd post pictures but I don't have a workable camera and I'd like to keep my job. Very Happy
#3247 Conspyre (unregistered) 08/02/2004 10:35 pm
Insteresting. So can you test the touchscreeny stuff at all, or are you just kinda hoping that it works?
#3248 08/03/2004 04:43 am
TEG board has a touchscreen. The emulator currently doesn't; also, Nintendo has said they'll be putting out a new emulator version "soon" since mid-June so who knows.
#3252 TheoEsc (unregistered) 08/03/2004 11:39 am I'd be careful what you post here
You're going into quite a lot of detail about specific people, which I'm not sure is wise.

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..."
#3253 08/03/2004 06:52 pm
Oh, sure, I'm like that to their faces. I only rant about them online. Very Happy

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. Smile
#3255 broken (unregistered) 08/03/2004 07:02 pm 3.8GHz dual P4?
Where did you get that? Is it a system that comes overclocked by default, or a custom box?
#3256 08/03/2004 07:15 pm
Well, I'm not sure if it's actually a dual or if it just has hyperthreading. I don't care enough to look under the lid. It was ordered for me to arrive on the day I started work, and I forget who built it (though it has a rather neat case with a fluorescent purple front panel).
#3282 08/08/2004 11:06 pm SMP P4
If it's actually a P4, not a Xeon, then it's hyperthreaded. AFAIK, Intel doesn't have an SMP P4 chipset. Xeons, of course, can be SMP (and HT, too, I think - though I think that would require a lot of dinking around at the OS level to not totally fucking suck and be inefficient as hell, so I' don't know).

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.)
#3285 08/09/2004 04:43 am
Silly, AGP is for gaming, and SATA is for serious work. If you want them both you'll just have to get a Powermac G5.
#3294 08/09/2004 11:50 pm Yeah, really.
Well, that, or an Ath64 (and seeing as Ath64 and Opteron use the same bloody chipsets, it's doubly infuriating that you can't seem to get an AGP+SATA 2xOpteron board). Unless you want dual. In which case, Apple seems like the only game in town. Not that this is a bad thing - I love my Mac. I just wish they had Powerbook G5s - arglebargle stupid heat problems Sad Apple really does have the best notebooks around.
#3297 08/10/2004 05:19 am
The new iMacs will be G5, and it seems like the iMac platform is basically their "small form factor" testbed these days. They might have something pbG5y up their sleeves.

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).
#3313 08/11/2004 12:12 am WebKit all wonky
Yeah, I noticed that too. It seems there's some gimpiness in other parts, too. I have one page that I grabbed offline that redlines the CPU in Safari - for whatever reason, Moz and IE don't do that. Although, Konq sucks cycles while viewing it too, so maybe it's tickling a KHTML bug. Ah well, better that than infinite security holes Wink

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.)