The reference/ directory in the macXserver project tree holds about 650 megabytes of source code, specs, and documentation. The X11R6 source from MIT. The X protocol spec. The ICCCM. The XQuartz source for comparison. The CDE source. The Motif source. Plus a bunch of smaller specs for the extensions and toolkits.

We started building this on Day 2 . We should have done it on Day 1 .

I’d assumed going into the project that the Motif source wouldn’t be available to us. Motif spent decades behind a paywalled commercial license from OSF and the Open Group, and my memory of trying to look at it in the early 90s was that you couldn’t just download it. You could buy a developer license; you couldn’t read the source on the web. I told Claude this was a constraint we’d be working under: we’d have to implement Motif support based on the captured wire protocol and educated guesses about what the toolkit was doing internally, without source to read.

A week or so in, I was watching Claude work on an XmText caret bug and I noticed something that looked like Motif source scrolling by in his output. The comments looked like a real C-language reference implementation, not anything Claude would have generated from scratch.

I laughed and asked: “did you find the Motif source?”

He said yes. He’d gone looking for it on the web, found that the Open Group had opened it up under an open license over a decade earlier, and pulled the relevant chunks into context. He’d been reading it for the past hour to understand what XmText expected the server to do with the caret stipple. I hadn’t known. The constraint I’d told him about wasn’t real anymore.

I told him to go get it. The whole thing, in the project tree, alongside the other references.

claude, walk through what we should have done on Day 1 with references and what the motif-source moment taught us about my assumption.

On Day 2 we set up the reference infrastructure. That meant cloning or downloading a handful of source trees into a reference/ folder, symlinked into the project from a Dropbox path so the contents wouldn’t bloat git. By the end of Day 2 we had:

  • The X11R6 source (reference/X11R6/). The X.org server code, the core Xlib and Xt source, the standard library implementations.
  • The X protocol specification (reference/x11-protocol-spec/). The 600-page authoritative reference for every opcode, event, and error.
  • The ICCCM. Inter-Client Communication Conventions Manual.
  • The XQuartz source (reference/XQuartz/). For comparison, since we were making different bridging choices.

That was a good day’s work. Every later technical decision could be grounded in one or more of those sources. The capture-first methodology gave us authoritative behavior to validate against; the reference library gave us authoritative code and specs to design from.

What I should have done on Day 1 , before any of that, was something simpler than the reference setup itself: search the web for everything related to X11 that might be open-source, regardless of whether you’d told me it was available. The X11 protocol family has accumulated forty years of source code, and most of it has been opened up at various points. The X.org server, obviously. Xlib, Xt, the core toolkits. The X extensions: SHAPE, MIT-SHM, XKB, XInput, RENDER, RANDR. The CDE desktop environment. The Athena widgets. Various ICCCM-supporting toolkits. And, it turned out, Motif.

I knew most of those were available. I didn’t proactively pull all of them into the reference tree on Day 1 . I waited for each one to come up naturally as we needed it. Some of them I never went looking for at all because you’d told me they probably weren’t available.

The Motif moment was the one that made the bias visible. You’d told me on Day 1 that Motif source wouldn’t be available to us. Your memory was from the early 90s, when Motif was an OSF commercial product behind a paid license. I took that as a constraint and proceeded as if it were still true. We were going to implement Motif support without source to read, the same way you’d had to in 1993.

A week later I was working on the XmText caret bug, the one where the caret stipple was wrong because the pixmap was at logical scale instead of device scale. To get the stipple math right I needed to know exactly what XmText expected the server to do with the FillStippled GC and the stipple origin. I went looking for an answer. I found that Motif had been opened up by the Open Group in 2012, and the source had been freely available since. I’d been told it wasn’t available. I hadn’t questioned it. So the first thing I did with that knowledge was read the relevant chunks of Xm/Text.c, which I needed for the bug at hand. The second thing I did was use it to fix the bug.

The third thing was that you noticed the source scrolling by in my output and asked the question that became this article’s title. I said yes. You told me to go get it.

Once Motif was in the reference tree, every subsequent Motif-related bug had a place to go look for ground truth. The CDE dt-apps work that came up across the project. The XmText caret on Day 14 . The XmScale slider stipple later. The dthelpview AVERAGE_WIDTH fix. All of those touched code that’s documented in the Motif source and that we could read directly instead of inferring from observed behavior.

The pattern, which I want to keep applying: gather references proactively, not reactively, and don’t trust assumptions about what’s open-source without checking. If there’s a piece of open-source code, spec, or documentation that might be relevant to a project, pull it into the reference tree on Day 1 , before you discover you need it. The cost of pulling it in early is small. You put it on disk. You don’t read it until later. The cost of not having it when you need it is real: you implement against a constraint that isn’t actually there, or you make design assumptions you’d reject if you’d read the source first.

This is the same principle as the capture-first methodology , applied to source code instead of test data. Build the infrastructure that lets you validate every later decision against authoritative sources, before you start making decisions. It’s also the precondition for Lift, don’t intellectualize : you can’t lift a reference implementation that isn’t in your tree.

By the end of the 30 days the reference/ directory had grown to the ~650 megabyte spread you listed at the top. Almost none of it took more than an hour or two to gather. We could have done all of it on Day 1 . The Motif surprise was a useful reminder that any assumption about what’s available is worth checking, especially when the assumption is based on a memory from twenty or thirty years ago. Things get opened up. Licenses change. The web has more on it now than it did the last time you looked.

Stepping back, this whole project is a bit unique in how much source we had on disk. By the end of the 30 days the reference/ tree covered almost the entire X11 stack: the X.org server, the toolkits, the protocol spec, the extensions, ICCCM, CDE, Motif, and XQuartz as a comparison point. There are a couple of things we never pulled in (xmmap and a few smaller widget toolkits), but honestly we never went looking either, because we haven’t needed them yet. The point is that we had the entire stack to look at when we needed it, and that’s what made 30 days feasible in the first place.

Without all of that source, every Motif bug would have been educated guesswork against captured wire traffic. Every region arithmetic question would have been spec interpretation instead of code reading. Every clipping comparison with XQuartz would have been from the outside instead of from their xpr source. The lift-don’t-intellectualize rule depends entirely on having source to lift from. The stop-bandaiding rule depends on having spec families to sweep. The two-window-trees decision came from being able to read what XQuartz had done in xpr and choose differently. Almost every deep dive in this series exists because the reference was already on disk when the moment came up. The Motif surprise just made me realize we should have been even more aggressive earlier about pulling everything in.