I’m Old, Part X: College Setup

College Desk

This is the desk in my college dorm room my junior year in 1987. The computer there is ostensibly a Mac Plus, although the badge on the front is of an original Macintosh. The interior was upgraded to a Mac Plus motherboard and maxed out to 4Mb of RAM. On top was an aftermarket fan called a “Fanny Mac” which helped keep it cool, since this setup had notoriously bad heat problems. Attached to the Mac was a Hyperdrive 20Mb SCSI drive. Sitting to the side was an ImageWriter printer and a 2400 baud modem.

I did not own this system. It was leant to me by Bell Communications Research, where I had worked the year before, and I dutifully returned it when I graduated.

For perspective, the machine had a plain Motorola 68K processor that ran at 8MHz, there was neither floating point unit nor memory management unit, nor memory protection.

I used the machine to write papers for school, log into the CS department’s VAX 11/750 to do homework or play Rogue or Hack, and to write code to amuse myself.

I also caught in this photo some 5.25″ floppies that I kept around because there was an old Apple II in the CS lab to play with. There is a Hamilton music stand, which I need from time to time, and other detritus.

Here are the books that you can see.

Bookshelf

The books are:

  1. The Complete Book of Cartooning
  2. Outdoor Survival Skills
  3. Are We Having Fun Yet
  4. A Liar’s Autobiography
  5. Musical Acoustics
  6. The Official Boy Scout Handbook
  7. The Fundamentals of Computer Algorithms
  8. The Pooh Cookbook
  9. Living, Loving, and Learning

I’m not fully a pack rat, but I do still own most of these books. I’ve also referred to 4 of them within the past 3 years for one reason or another.

The last one on there was one in a small set of books that I had to help manage depression. In any creative endeavor, you will find a lot of us who are plagued by depression. It’s taken me many years to come to understand what was going on in my head and to be able to manage it in a way that works most of the time.

In my own case, I had the non-constructive voice that was tremendously harsh. On a typical day, I would refer to it as my Inner Dread Pirate Roberts (“You did a good job today, Westley, but I’ll likely kill you in the morning.”). On worse days, it was an on-board terrorist.

If you are among us, take time to congratulate yourself for making through a day and remember that depression lies. Thousands of lies of convenience and disempowerment.

I’m Old, Part IX: Jokes. Oh We Like Jokes

I went to Oberlin College. It was an intense experience and one that I really enjoyed. I went there because a high school friend of mine, Kazumi Umeda, had gone to Oberlin a year ahead of me and on his fall break he came back to visit and told me directly that I needed to go there. I took it almost as a royal command.

Initially, I thought I would be a math major as there was just a fledgling CS department, but the major was announced while I was there and I was the 5th student to declare.

In the program, I met a number of people who had similar backgrounds to mine and wonderful senses of humor.

At various points, we played jokes on one of the CS/Math professors, Mike Henle, who was teaching an assembly language class.

I think it was a bit of a passive-aggressive response to some of the assignments. He assigned us the task of writing a program in VAX assembly that would maintain a family tree, which is a fine high-level language task, but a really crappy assembly language task. I wrote mine in Pascal first, then hand compiled it because while I probably could’ve done it from the ground up, I’m lazy.

At any rate, three of us: me, David King, and Tom McHugh had about enough of the assignment, so we walked into Mike’s office and sang a rendition of  a song called, “I Feel Tired” to the tune of “I Feel Pretty” from West Side Story.

At some point, we created our own ficticious computer with a complex instruction set that included such instructions as JEO (jump and execute operator) and the very important BVP (be very paranoid). Before we did anything to Mike, we usually told him “Be Very Paranoid”.

One day, we decided that we were going to throw him a surprise birthday party in class. We went to a bakery and got a cake that read “Get Well Soon Grandma” crossed out with “Happy Birthday Mikey” on the edges. We said we got a discount because Gramdma didn’t make it. We put 4 candles on it in a row and decided that this was his 6th birthday and lit 2, because binary. While we set up, the head of the math department walked in and sat down saying, “I heard something good was happening today.” Uh-oh. Meanwhile, Mike had run downtown to get a bag of lollipops, hoping to appease us.

He showed up, we sang “Happy Birthday” and he turned bright red and walked into a corner and stood while we finished. We cut the cake and served everyone. Class started on time.

Another time, around 11:00 one day, we decided to steal his door. We all had pocket knives so we undid the screw on the hinges and pulled the door and did a fantastic job of hiding it in plain sight. We waited for him, but he was late for office hours, so we decided to have a quick lunch and come back. When we came back, the head of the CS department and another professor were madly searching for the door. When the head spotted us, he said in a very stern voice, “OK – What did you do with it?” I pointed at the door, which was in plain sight. “Put it back.” “Couldn’t we just wait for Mi-” “Put it back now.” Fine. Whatever.

We put it back on and it didn’t close right. It was really sticky, so we took it off again and fixed it.

Right then Mike showed up. I said, “Mike, hypothetically, if you got here and your door was gone, how would you feel?” “Pretty angry – unless you guys were here.”

Good.

That means we read him right. “Mike – was your door sticky?” “Yes – it was.” We quickly wrote him a bill for fixing his door. He never paid it.

Over time, I’ve played a number of jokes on people I’ve worked with (and gotten my fair share in return). One of my recent co-workers told me that when I play a joke on someone, the joke is so thorough that the victim has no choice but to understand that s/he is loved.

I’ve been more or less consistent in my overall approach and when I worked at Atalasoft, I codified it for my peers: play jokes, but they should be in good fun, cause no permanent harm, and you should be able to clean them up in 15 minutes or less. In college, we made sure that nothing we did would prevent class from starting on time and that nothing was mean-spirited. After college, there was one April Fool’s joke that was an exception to that, but only one that I remember.

I’m Old, Part VIII: Teamwork

The printer division at Adobe had a structure wherein a manager was usually associate with a handful of manufacturers who wanted PostScript on their printers. The managers would have a single engineer assigned to each printer (or in some cases to each class of printer) who would port PostScript to that device.

Sometimes, projects ran long and when that happened, other engineers would be brought onto the project to help bring it to completion.

In one case another engineer, Jeannie, was working on a product for HP. They wanted a cartridge that would plug into any one of the HP LaserLet III series of printers and provide PostScript.

III

The problem in this was there were three separate products that needed to use this cartridge, the IIIp, III, and IIID. All of them are Canon engines, but the IIIp is the Canon LX engine, which is the “low cost” laser printer. The latter two were based on the Canon SX engine, and the IIID was a duplex printer, meaning it could print on both sides.

My boss had a formula for estimating the length of time of a printer project that depended on the number of complications in the project. 3 printers on one code base was one, running off a cartridge (where PostScript didn’t own the machine) was another, duplex was another, an LCD front panel was another. There may have been more, but that was plenty.

I was assigned to work on the project to help get the printer out the door. Unfortunately, adding more engineers always results in an immediate slowdown in the project because it takes time for new engineers to come up to speed and the expert will be busy fielding questions instead of fixing bugs.

In this project, we had some interesting conflicts because of different QA departments. HP had theirs and Adobe had theirs. Often, an printer manufacturer would approve a product that Adobe would reject or vice versa because of difference in acceptance criteria. HP, for example, had a metric where bugs were rated in severity from 1 – 10, where 10 was most severe. They would accept a product when the sum of the squares of the severity of all the bugs was less than or equal to 100. In other words, if there was 1 10 bug and no others, they would accept it, or 100 1 bugs.

I was assigned an interesting bug. When a page was printer in duplex and printing a legal-sized page, there was a long delay from when the engine fired up and when the page fed. If I recall correctly, the delay was close to 4 seconds.

The problem was that in this printer, the back side of the page needs to be printer before the front side of the page and you don’t know that the page is duplex until the very last moment. And then the full page image needed to be rotated 180 degrees.

In my examination of the code, it appeared that it was the rotation code that was the culprit, which was a shame, because it was very pretty code. I think it was originally written by Amy Fasnacht.

char *start = fmbufstart;
char *end = fmbufend;
while (start <= end) {
    char temp = bitrev[*start];
    *start++ = bitrev[*end];
    *end-- = temp;
}

It was a tight little loop, but when run on 1.4Mb of frame buffer on an 8MHz 68K, processor, it took a big chunk of time.

So how do you make this better, when the loop is so tight?

The problem is the while loop. That test will get run 1.4 million times and it will fail 1.4 million times. So the first this I tried was Duff’s device. I will point out, that I learned Duff’s device by reading some of his code when I was in high school working at Bell Labs (thanks, Tom!). This brought the time down to 2.5 seconds. We ran that past HP and they were still not happy with it.

,Damn.

A brief interlude on compiler design. If I recall correctly (and it has been more than 25 years), this particular chunk of code was compiled using the Sun 68K compiler, which was decent enough, but it couldn’t compile PostScript correctly with optimization on, so we were forced to ship with non-optimized code. In addition, when compilers generate code, they often use a subset of the available instructions because that’s what the back-end code generator chose. Unfortunately, that usually means that there are a number of instructions available that the compiler will ignore that may be very convenient for certain tasks. The 68K had a very useful instruction, SOBGTR, which the Sun compiler wouldn’t use in debug. It means subtract one and branch if greater than zero. Using this instruction with carefully set up registers can cut the overhead of loop way down compared to a typical SUB/DEC/BLT triple.

Also, I would like to say that I loved working with the 68K processor and was disappointed that it has more or less disappeared. It was easy to write a compiler target for it, the instructions were mosly sane and had relatively few bizarro exceptions, it had a buttload of registers at hand, and it was pretty easy to read and write. Beyond that, I could look at a 68K disassembly and figure out the source language, and in some cases the compiler, fairly easily.

Back to this task. I rewrote the routine in 68K assembly, unrolling the loop and using SOBGTR to drive the loop. I got the execute time down to 1.5 seconds, and we sent that off to HP.

Still not acceptable.

Damn.

I had one other trick in my bag. The code, as written, operates on bytes. This printer used a plain-Jane 68000, which does not like to operate on bytes as it has a 16 bit data bus. It really wants to operate on 16 bit words. The problem is that the bit reverse buffer for 8 bits is 256 bytes, but for 16 bits it’s 128K. Since we were on a cartridge, we had a limited budget for space, and using a 128K buffer would blow us past it.

HP had the memory partitioned off and they had a no-man’s-land in the address space that they had set aside aside for just such a contingency. We made a request for the extra memory and it was granted. Now, with the the huge reverse buffer in play, I could operate on 16 bits at a time. In addition, I put in one other optimization. On a typical printed page, most of the frame buffer is white, which in the PostScript world is a 0 word. Fortunately, when you read memory in the 68K, it sets the condition codes, so I could probabilistically skip the table look up on 0 words.

The final result was .5 seconds, and HP accepted it. And thank goodness, because I had no idea what I was going to do next.

I really liked doing this kind of work and when the group worked together well, it was fantastic.

I remember that this project carried in to Hallowe’en and we had a weekly conference call with HP in Boise. The manager, John Gaffney, showed up in the conference room with a package of wax teeth and lips for every engineer in the project.

John wore his teeth up until every moment when he had to speak. Jeannie was wearing big red wax lips and was nearly apoplectic trying to keep herself from laughing.

I have a theory. Actually, I have a lot of theories, most of them wrong, but this theory there exists a specific Valhalla for software engineers. When we die, we go there and drink mead/beer/wine and tell tales of engineering prowess. This particular one will be one of mine.