Leanpub Header

Skip to main content

Constraint-Based Design: A Gateway to AI

The HPC Tradecraft Master Practitioner, Volume 3

A 1986 text adventure game written inside the Cray I/O Subsystem turns out to be architecturally isomorphic to modern transformer design. This capstone volume uses the playable game and its assembly language source as a case study in constraint-based design, including the bare metal thinking we stopped teaching around 1995.

Minimum price

$45.00

$55.00

You pay

$55.00

Author earns

$44.00
$

...Or Buy With Credits!

You can get credits with a paid monthly or annual Reader Membership, or you can buy them here.
PDF
EPUB
WEB
19
Pages
4,028Words
About

About

About the Book

This is Book 3 of The HPC Tradecraft Master Practitioner series, a capstone demonstrating that pre-1995 bare metal design methods remain directly relevant to modern AI architecture.

In 1986, the author wrote a text adventure game as a bare metal device driver inside the Cray I/O Subsystem. The game, Swiss Adventure, was inspired by Colossal Cave Adventure and written during a Cray Research training class. The source code architecture turns out to be isomorphic to the 2017 "attention is all you need" transformer architecture. Similar constraints shape similar solutions.

This book is a work in progress. The current release covers the user experience: what the game does, why it was designed that way, and what the adventurer learns by playing it. The game itself is live and playable at ewbarnard.com with no registration or data collection. The 1986 assembly language source and its PHP port are available on GitHub.

This book is not a normal code walkthrough. This book models the expert thinking common to HPC tradecraft as practiced in the Cray Research era. Typical IT books with sample code work through from one topic to the next. This book builds out a system layer by layer, first designing the user experience, then designing a way to capture and encode the user experience, and then taking advantage of bare metal features and constraints. The companion website allows you to execute the code (by playing the game) while observing the event trace and AI pattern trace moving from request to response.

This book requires a strong working knowledge of Part II of the earlier book Nobody but Us: A History of Cray Research's Software and the Building of the World's Fastest Supercomputer. Part II introduced the necessary concepts for working on bare metal.

Bundles

Bundles that include this book

Author

About the Author

Edward W. Barnard

No Time to Be Beginners

What was it like to stand in the breach, with nobody else to take the decisions, and do-overs are too late? Margaret Hamilton, the first programmer hired for the Apollo project at MIT, explained:

Because software was a mystery, a black box, upper management gave us total freedom and trust. We had to find a way and we did. Looking back, we were the luckiest people in the world; there was no choice but to be pioneers; no time to be beginners.

During the Cold War when it was "nobody but us," our decisions and solutions were shaped by constraints. At Cray Research constraints and barriers pointed us to the best point of leverage. To remain the best in the world, we had no other option. But before considering leverage, we carefully identified and proved relevant capabilities. Those capabilities showed us what solutions might be plausible. We also found that if it wasn't fun, it probably was not worth doing.

This forced way of working, where responsibility could not be abstracted away, has been mostly lost to time.

My Role as Custodian of Lost Skills

I am bringing you those skills because they were never passed to the next generation. I created a primary source document showing what it was like: Nobody but Us: A History of Cray Research's Software and the Building of the World's Fastest Supercomputer. But I wrote a second primary source, reproducing the Cray Research skills for you right now, in 2026. The Wizard's Lens: Learn to Think Like AI is an apprenticeship drawing you in to experience, not merely read about, how we continuously "achieved the impossible" at Cray Research.

Those Cray Research skills did not begin with software, or even hardware. They began outdoors. Experiential education, with real risks and real consequences, has also been abstracted away. That is where judgement is formed. For this I wrote Surviving Spring Break on the Mountain: The Power of Experiential Education.

Pure Entertainment

If it isn't fun, it probably isn't worth doing. I continued practicing the most important debugging skill I know: spotting patterns and connections that others miss. I wrote Unexpected Histories to show you shifted perspectives, purely for entertainment, but showing real history that matters today. In each case, once you see it, you cannot "un-see" it.

Эдвард Барнард

Когда нет времени быть новичком

Каково это — стоять на переднем крае, когда больше некому принимать решения и на повторные попытки уже нет времени? Маргарет Хэмилтон, первый программист, нанятый для проекта Apollo в MIT, объясняла это так:

Поскольку программное обеспечение было загадкой, «чёрным ящиком», высшее руководство предоставило нам полную свободу и доверие. Мы должны были найти выход — и мы его нашли. Оглядываясь назад, можно сказать, что мы были самыми везучими людьми в мире: у нас не было выбора, кроме как быть первопроходцами; не было времени на ученичество.

Во времена холодной войны, когда всё сводилось к принципу «никто, кроме нас», наши решения и подходы формировались под давлением жёстких ограничений. В Cray Research именно ограничения и барьеры указывали нам на наиболее эффективную точку приложения усилий. У нас просто не было иного пути, кроме как стать лучшими в мире. Но прежде чем прилагать усилия, мы тщательно искали и проверяли соответствующие компетенции. Именно они показывали, какие решения вообще могут быть осуществимы. Мы также поняли: если дело не приносит удовольствия — вероятно, не стоит им заниматься.

Этот вынужденный стиль работы, при котором ответственность нельзя переложить на других, почти утрачен со временем.

Моя роль как хранителя утраченных навыков

Я передаю вам эти навыки, потому что они так и не были переданы следующему поколению. Я написал книгу воспоминаний о том, как это было на самом деле: Nobody but Us: A History of Cray Research's Software and the Building of the World's Fastest Supercomputer. («Только мы: история программного обеспечения Cray Research и создания самого быстрого суперкомпьютера в мире»). Но я написал и вторую книгу, возрождающую стиль мышления Cray Research для вас прямо сейчас, в 2026 году. The Wizard's Lens: Learn to Think Like AI («Линза волшебника: научитесь думать как ИИ») — это учебник, который погружает вас в атмосферу и дает опыт, а не просто рассказывает о том, как мы постоянно «достигали невозможного» в Cray Research.

Истоки подхода Cray Research лежат не в программном обеспечении и даже не в железе, а в холодной реальности жизни. Обучение через опыт, с реальными рисками и реальными последствиями, подвергнутое переосмыслению. Именно так формируется суждение. Об этом я написал книгу Surviving Spring Break on the Mountain: The Power of Experiential Education («Выжить на весенних каникулах в горах: сила обучения через опыт»).

Чистое развлечение

Если это не приносит удовольствия — вероятно, этим не стоит заниматься. Я продолжал практиковать самый важный навык профессионального отладчика, который знаю: замечать закономерности и связи, которые другие упускают. Я написал Unexpected Histories («Неожиданные истории»), чтобы показать вам смещенные перспективы — исключительно ради развлечения, но опираясь на реальную историю, которая имеет значение и сегодня. В любом случае, увидев это однажды, вы уже не сможете «развидеть» увиденное.

Leanpub Podcast

Episode 317

An Interview with Edward W. Barnard

Contents

Table of Contents

User Experience

  1. Problem of Credibility
  2. Gateway to AI
  3. Show Me The Code
  4. Survival Requirements

Developer Experience

  1. The Case Method
  2. Bare Metal Case
  3. Which Part is Relevant
  4. Work in Progress
  5. Road Map

Appendix A. HPC Tradecraft Road Map

  1. The 1995 Barrier
  2. Two Series
  3. Book 1. HPC Tradecraft for Computer Scientists: What We Stopped Teaching
  4. Book 2. Nobody but Us: A History of Cray Research and the Building of the World’s Fastest Supercomputer
  5. Book 3. The Wizard’s Lens: Learn to Think Like AI
  6. Book 4. High-Stakes Ethics
  7. Book 5. Unexpected Histories: Spotting Patterns and Making Connections That Others Miss
  8. Book 6. Constraint-Based Design: A Gateway to AI

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub