Olio

I neglected to write up anything on the blog in November despite it being the penultimate of months, so here’s a meandering catch-up post to atone. My apologies for the gratuitous self-linking that is about to ensue.

On Halloween: our 2-year old went as Kung Fu Panda (his favorite movie, and yes, shame on his parents for letting him watch movies) for Halloween this year. He was quite excited to learn that you can just go ask for candy from strangers and they will give it to you. He has mastered enough language to say “Pumpkin Scary,” which he did given every opportunity on seeing the skull I had carved on the pumpkin on the right. The other pumpkin is supposed to be McQueen from the Disney Cars property; Alex called it “Pumpkin Car.” They are now composting. So it goes.

On Thanksgiving: being a half-US, half-Canadian family, we get to celebrate both Thanksgivings: the fake one and the real one. And so we did. It was great spending time with the family and meeting up with some old friends in Atlanta, though we learned painful lessons about air travel with young children.

On Canada: I’ve now been in Canada for a little over a year. Among the observations I had detailed previously, I can now add these:

  • We do have a few days here in the summer that qualify as hot, but no, it does not get Georgia-in-August-hot.
  • Canadian Coca-cola is superior to non-KFP USA Coke, and despite what the PR machine in Atlanta will tell you, you can easily tell the difference between sugar and HFCS when you’re used to one or the other.
  • Canadian TV is even more a wasteland when there is no hockey.

On Bash Goto: per my last post, I considered how hard it would be to write an x86 emulator in bash. Conclusion: despite the potential good fun in simulating %eip using ‘nl’ and sed, I’ll leave this task to someone else. However, I did improve my actual implementation of this somewhat. One easy win is to put the jump labels inside comments so that an ordinary run of the script won’t barf. And so that is what I did.

On Work: while I’ve been a contractor in name for the last year, I have now taken on some other contracts and thereby made this status more official. It was a tough decision to go this route versus, say, working on a salaried basis with some large, hypothetical mobile chipmaker with a Canadian presence, but so far I am happy with the choice. Most recently, I have been doing some Linux mesh networking stuff with Cozybit. It may be a while before any of it finds its way upstream (there are NDAs involved) but I claim that it is cool stuff. In the meantime, I get to continue slaying big data dragons at LP/Xmarks.

On HBase: speaking of HBase, two things have recently come to my attention. First, there is Hannibal, a cluster monitoring tool which was inspired by my post about beating gnuplot over the head with perl. I had nothing to do with its implementation otherwise, but it looks pretty cool. Secondly, I recently had an enquiry about my cache-oblivious code from some HBase folks. I’m not working on that either, but I am hopeful that something comes of it since it would be great if these ideas (not my own) percolate out into mainstream practice.

Halloween!

Jack-o-lanterns 2011 I made two Jack-o-lanterns this year. On the left we have Elmo and Cookie Monster, a nod to our 16-month-old’s second Halloween. On the right, my best attempt at a cacodemon from the old video game Doom. My general technique is to sketch up the design in Inkscape, print it out, transfer the design to the pumpkin somehow, then go to work with one of those little pumpkin carving saws. The cacodemon was a bit simpler so I skipped Inkscape and free-handed it with a sharpie.


Pumpkin seedsWe tried toasting the pumpkin seeds. While edible, I found the eating experience akin to that of eating un-popped popcorn kernels. I’ll probably give this experiment a miss next year.


IMG_9177 In Canada, giving out chips is almost as popular as giving out candy. As new Canadians, we are following suit: visitors to our house will get tiny bags of Doritos. I guess that means no Coffee Crisps, Aero bars, or Smarties for me (these locally available confections have yet to cross the Lake).


IMG_9175I also had grandiose plans to make Alex a costume, but faith in my fabric sewing skills waned a bit as the deadline approached. Angeline saved the day by picking up a costume at the local Carter’s, so he’ll be a tiger this year. Fear.

Hello from Canada!

My family picked up and moved from the DC area to the surroundings of Toronto last week, and we still have all our limbs intact! My wife and son are here as citizens, while I am a lowly visitor, at least until my immigration paperwork goes through.

We are in the so-called Greater Toronto Area (GTA), which means we are in the part of Canada that is not Montreal, Vancouver, or Toronto itself. That’s Greater-with-a-capital-G: it’s about a 90 minute drive to get downtown from here.

So far my experience as a Canadian resident is much the same as that as a US resident. One must just learn the proper mental substitutions: Comcast is now Rogers, Target is Zellers, Digiorno is Delissio, Nabisco is Mr. Christie, bathroom is washroom, miles are kilometers, degrees Fahrenheit are now degrees Celsius, Throwing Away Garbage is now Composting.

Things are expensive. A whole chicken costs $12, while it would be $7 at our previous place. And the Canadian dollar is more or less at parity with USD these days so that’s still real money. Albeit money that comes in various pretty colors and shiny coins.

We live near one “Taunton Road.” I can’t shake the image of the internal organs of Hothian beasts whenever I drive on this one.

Moving our 92 boxes worth of earthly goods (among them, over 600 books) turned out to be easier than we expected, apart from the two weeks of packing time. Customs took us about two hours in all. The movers delivered our stuff within a week. It will still be some time before various wrinkles, such as managing to receive snail mail, are ironed out, but hopefully before long this house we are renting will feel like home.

To our stateside friends, look us up if you happen this way. Our email addresses survived the move but not much else in the way of contact info.

me &= ~grad_school

An unassuming cardboard tube arrived in the mail the other day, containing my MSCS diploma from Hopkins. Thus passes my academic career. I doubt the experience will ever pay for itself financially, but I did learn a great deal, even as a crusty practitioner of some years. Returning to the student life of never-ending deadlines took quite some getting used to, and the corresponding lack of sleep was good training for Alex’s concurrent arrival. (Said arrival also made up my mind to not pursue the thesis option.)

In the main, the classes were excellent, but the small size of the school means the catalog is limited compared to Georgia Tech. For example, I would have liked a class or two on the hardware side. Hopkins only offered the equivalent of GT’s CMPE 2510 (MIPS architecture with the Hennessy and Patterson book).

Through projects and reading papers, I gained a new appreciation for the difficulty of good science, and the prevalence of bad. I’ll always be an engineer first, as I lack the patience to do science well. Banging out a project out in 2-6 weeks was de rigeur; here are some of them:

  • A handwriting recognition program based on HMMs (basic stuff, but I had no prior machine learning experience)
  • A user-space version of mac80211 hwsim. With the simulator, I evaluated the Linux rate controllers for different rates of packet loss, and found and fixed a bug in Pid. There are a few things in Minstrel that can still be improved, but there’s no surprise that it is much better than Pid.
  • A failed investigation into cache-oblivious data structures for filesystems. It’s tough to beat B-Trees at their own game. Still, I’m very excited about CO algorithms since this stuff wasn’t even around when I was an undergrad. Hopefully the right problem will come along.
  • Demand paging and swap support for xv6. This was a class assignment, but I had a lot of fun putting it together. [Code deleted from the internet at prof's request.] The swap daemon was crap due to time constraints, but most groups didn’t get beyond identity mapping.
  • An evaluation of parallel algorithms on massive graphs. I now have a better appreciation for the ease of implementation, and horrible performance, of barrier synchronization.
  • A streaming categorical ranking system for twitter graphs. Note to NoSQL graph DB developers: Postgres is still much faster.

There are of course writeups associated with all of these, but my latent inner perfectionist is not very happy with most of them. I might revisit them with more rigor if I get bored some day.

Snow day

"Driving" in the snowLast night I had the pleasure of driving my car less than a mile from the nearby metro to our apartment, during a heavy snow, in rush hour. Normally I walk, but this area is bad about keeping sidewalks clear in snowy weather, so driving is sometimes the safer option. It took me an hour and a half to cover the distance, at a blazing average speed of 2/3 mph.

Along the way I learned some unwritten rules of driving in DC snowstorms:

  1. Traditional traffic patterns no longer apply. If a road once traveled east-to-west, it now goes west-to-east.
  2. Ditto with traffic lights: let’s just collectively ignore them.
  3. When traffic is blocked, do attempt, and fail, to perform a three-point turn. This will ensure that traffic in front of you will begin moving again, and traffic behind you will get to participate in pushing your car out of a snowbank.
  4. At random, get out of your car and just leave it there. Say, in the middle lane of a three-lane highway.
  5. If three cars are already abandoned at various places halfway up a short, inclined on-ramp, try it yourself anyway. They probably just weren’t doing it correctly.

Wrapping up

I just submitted my application for graduation here at Hopkins, so as my grad_school bit settles over the next couple of months, I must now contemplate what to do next. I haven’t given it a whole lot of thought, except that I will be glad to be out of academics for the rest of eternity. I’ll save an account of my experience here for another post, but it has been generally positive. Anyway, my dance card is far from empty, but while I’m in limbo between real work and finishing school, and deciding where our family will live, I might as well be promiscuous and see what’s out there.

I guess if I had to enumerate my occupational preferences, they would go something like this:

  • Unix kernel hacker or driver developer. Between school and the new parental status, time for my ath5k / karma / android hobby has dwindled to a trickle. I hate to see my x86 assembly skills go to waste. Looking at you, Ginormous Linux Company.
  • Systems work on problems of huge scale. This has been a recent theme of my studies, and there are some fascinating problems to tackle.
  • Systems work on small scales. Embedded work is just a lot more fun than desktops.
  • Any cool project with smart coworkers
  • Open source
  • Usual niceties like close to home, close to child care, health plan, big bag of cash…

Minus points for: UI work, remote object technologies, anything with angle brackets, function names with too many capital letters, centralized version control, marginally reinvented functional languages

New syscall proposal

CLONE3(2)                   System Programmer's Manual                 CLONE3(2)



NAME
       clone3 - create a child process

SYNOPSIS
       #include <clone.h>

       int clone3(pid_t parent, pid_t co_parent,
                 int (*fn)(void *), void *child_stack,
                 int flags, void *arg, ... );

DESCRIPTION
       clone3()  creates  a new process, in a manner similar to fork(2).

       Unlike fork(2), these calls allow the child process to share  parts  of
       its  execution  context  with  the  parent and co-parent processes,
       such as their home, food, and approximately half of their genetic
       material.

       The main use of clone3() is to implement offspring: sentient beings
       that run concurrently with the parents in a shared environment.

       When  the  child  process  is  created  with  clone3(),  it executes the
       function  application  fn(arg).   (This  differs  from  fork(2),  where
       execution  continues  in the child from the point of the fork(2) call.)
       The fn argument is a pointer to a function that is called by the  child
       process  at the beginning of its execution.  The arg argument is passed
       to the fn function.  Although the parent processes may supply a suitable
       fn function, the child process has a mind of its own and may deviate
       from its execution at will.

       Executing clone3 will randomly select half of the genes from each
       parent, resulting in a selection of phenotypes according to
       Mendelian inheritance.  By design this process increases the
       number of bits in the global entropy pool, making recovery of the
       random state impractical.

       The  child_stack  argument  specifies the location of the pile of
       diapers used by the child process.  After the child process leaves
       the EMBRYO state and until it acquires the CAP_POTTY capability,
       it may frequently dump core.  The calling process must therefore
       set up a large store of waste disposal units and pass a pointer to
       this store to clone3().  After a successful core dump it is necessary
       for a parent to handle the condition as soon as possible.

       The flags parameter may  be  bitwise-or'ed  with zero or more of the
       following constants, in order to specify  the behavior of the system
       call:

        CLONE_XY
              Setting CLONE_XY indicates to the system that a child of the
              male gender is requested.  This is only a hint to the system
              and may not be honored.

        CLONE_XX
              Setting CLONE_XX indicates to the system that a child of the
              female gender is requested.  This is only a hint to the system
              and may not be honored.

              If both CLONE_XY and CLONE_XX are set, results are undefined.

RETURN VALUE
       On  completion,  the  thread  ID  of  the child process is returned in
       both parents' thread of execution.  During execution, the child process
       may signal an error condition by raising any of the following signals.

SIGNALS
       HUNGRY  The stomach monitor process has detected an empty condition.
               The parent may correct the condition by supplying food.

       TIRED   The process has executed too many cycles and must enter
               sleep(3).

       GRUMPY  The process is raising signals at full volume for unknown
               reasons.  The parent process should attach pacifier(2) to
               the child process and attempt to cause it to enter sleep(3).

       HAPPY   The process is in a suitable state for taking pictures for
               grandparents.

CONFORMING TO
       Biology 101.

BUGS
       Child process may spit-up on your new shirt; a burping cloth is
       recommended.

EXAMPLE
       The following psuedo-code illustrates the intended usage:

       #include <clone.h>

       int main(int argc, char *argv[])
       {
            pid_t ange = /* ... */
            pid_t bob =  /* ... */
            pid_t alex;

            alex = clone3(ange, bob, fn, stack, CLONE_XY, NULL);
            sleep(86400 * 30 * 9);

            take_snapshot(alex);
       }

       This yields the following:

       
       Alexander Yit-Keung Copeland
       Born 26 June, 2010
       Weight 7 lbs 12 oz

SEE ALSO
       fork(2),    futex(2),    getpid(2),    gettid(2),   set_thread_area(2),
       set_tid_address(2),  tkill(2),  unshare(2),  wait(2),  capabilities(7),
       pthreads(7)


CLONE3(2)                         2010-06-26                          CLONE3(2)

Moved

Apologies, dear reader, for not having updates lately: I have been quite busy.

Angeline and I just “completed” moving from one side of the street to the other side (the lie-quotes indicating our plan to live out of boxes for the near future). If you have our old mailing address or home phone number, it’s probably a good idea to drop me an email to get the new data.

The new place seems nice so far except for the water being shut off the day we moved in, and the towing of my car from the space they told us to park in (evidently they were just kidding when they said that).

Here’s the view from our window:


Moving on up

Proof (as if you needed any) that Ange and I are inveterate nerds — 8 of the dozens of boxes crammed full of books:


Books

19110

Welcome belatedly to the tens. I suppose I should summarize the previous year as is my typical MO in January.

We kicked off 2k9 freezing our appendages watching the inauguration in DC. Still worth it.

Angeline settled in to her new private practice, wowing patients and colleagues alike with her acumen and meticulousness. At the same time, in a series of poor decisions, I gained a renewed respect for Clark Kent jobs as I went part time with mine to attend grad school.

We cheered the Caps on in another playoff run from our seats in aisle 117, row G. I took ice skating lessons. My cred as honorary Canadian waxes.

We spent some time in Germany, increasing our vocabulary slightly beyond words learned from Castle Wolfenstein.

I’m close to making good pizza at home. Ange is mastering Cirque du Soleil yoga. She has also picked up lots of trivia on hockey great Bobby Orr, and learned the true meaning of “imaret” through daily application to the NYT crossword puzzles.

My goal of 100 kernel patches in 2009 was reached (123). This year, my goal is to be a better maintainer and stop sitting on patches, even while having much less time to contribute due to school.

’10 promises to be a big year as we continue that whole nucleotide ordering experiment.