bearever.com · A Retrospective中文版

The Knot, Undone

A Garment Company’s System · 1990 — Today

In 1990, a Hong Kong garment company had an inventory system made to measure — written in C, on Informix C-ISAM, running on a DEC Alpha. More than three decades later it is still running, and still backed up every night.

It follows the goods the whole way: yarn and wool coming in, sales orders, the factory floor, quality checks, shipping, customs declarations — one system, end to end, from the days before any of that came in a box. In July 2026, a colleague was still printing shipping documents from it.

For years, the system was carried by my elder brother, Daniel. It was one of the knots he never got to untie.

1990
The year it was written
23
Fiscal-year worlds, 1998–99 to 2020–21
2,462
Change entries rebuilt one by one · 1990–2026
Still running
Backed up every night · in use in 2026

The people who wrote it

Systems like this were not products; they were commissions — and the vendor was a tiny team. Paul Chau wrote the core of it in 1990–92. Dennis Lai wrote the printer builder in 1992. Elisa Lau wrote the inventory monthly-summary specification in February 1994 — the table that kept accumulating and grew into the largest single table in the system; Angelina Kwan, the inventory transaction specification in 1992. Five developers, in the end, left their names in the code — and then the line went silent.

Five was the first count. Later, I rebuilt the system’s entire change record, entry by entry — 2,462 entries, spanning 1990 to 2026 — and the full picture emerged: the two most prolific hands were Elisa Lau and Sylvia So, with more than a thousand entries between them; 1993 and 1994 were the years the system was written most densely.

In the practice of the time, they left their full source code on the customer’s machine — headers, makefiles, everything — and maintained it there. The vendor company later folded. When the family looked for someone to take the system over, the would-be successor named a sky-high price; a full rewrite was quoted at an astronomical sum, and declined.

Traces of the vendor on the machine run to 2007 — a staging folder kept in Paul’s name — and to a last maintenance build in 2015. After that, there was no one left to call. My brother became the system’s keeper, and its living table of contents: the one person who knew where everything was.

The keeper’s baton had, in fact, already changed hands once. In the early years the machine was looked after by Paul Wong, the company’s own IT keeper — opening each new fiscal-year world was his job then; when he resigned in 2014, the world-opening passed to my elder brother, who carried it through to the seventy-fifth world, in 2020–21. On the users’ side, the accounts department used the system most heavily: Susanna, a senior hand there, was a frequent user — she has since passed away; Tania carried the accounting reports, her retained prints running to February 2024; and Wai, in shipping, was still printing documents from it in 2026.

Surviving the millennium bug

The system kept its dates as six digits of plain text — year, month, day — and never changed the format. So how did it cross the millennium? The craftsmanlike way: by hand, in place. The whole program library was re-landed on the machine on 3–4 January 2000. Through that spring and summer the menus went through round after round of patches; the old versions are still there, chained .ol2 to .ol9, February to July 2000.

And on 14 February 2000, a developer named Tak Yu wrote a small one-off program with a single job: to carry the inventory summary’s closing amounts across the boundary from 9912 to 0001 — December 1999 into January 2000. Nothing was ripped out or replaced. They patched it, and it held. It is holding still.

The last print

Every user of the system had a print counter, bound to their account; every job they printed took the next number. My brother Daniel’s counter reached 702 on 29 December 2021, at 11:02 in the morning, when he printed the gross-profit report for the year then closing — the whole year, division by division, the way he always closed it.

Number 703 is dated 30 March 2022. It is empty — zero bytes. A job opened under his name, from which nothing ever came out.

The counter has never moved again.

A chronicle: 1990 to 2026

Spread the thirty-odd years out flat, and the system’s history turns out to be a relay of people.

1990
The first line of code. On 16 March, Paul Chau wrote the first code that survives. The system was not bought; a tiny team wrote it from nothing, line by line.
1992
Launch. On 1 September the system entered service; that same year, Dennis Lai wrote the printer builder and Angelina Kwan the inventory transaction specification.
The GMS10 main menu — five options, still at their original coordinates.
The GMS10 main menu — five options, still at their original coordinates.
1993–94
The great build-out. The two years the system was written most densely. Elisa Lau wrote the inventory monthly-summary specification in February 1994 — the table that accumulated until 2023; Sylvia So left a great body of programs and changes alongside her, the second most prolific hand in the whole record.
1998
The millennium work begins. In April, Ricky Hui carved a new field into the company specification, made for deciding which century a year belongs to — with more than a year still to go before 2000, the preparation had already started.
2000
Surviving the millennium. The program library was re-landed in January; the menu patches chained on, .ol2 to .ol9; and on 14 February, Tak Yu wrote his small boundary program.
2007
A migration that never happened. The machine keeps a prepared set of data-migration programs and test data — but the migration itself was never carried out. Prepared, and set down.
2010
The vendor’s last maintenance. In December, Tak Yu was still patching the BOM module. After that, the vendor’s side left no further trace of maintenance.
2012
The whole machine moves onto an emulator. I moved the Alpha’s entire workload onto the Charon emulator — the machine no longer needed the old hardware to keep going; to the colleagues using it, the move was invisible.
2014
The baton passes. Paul Wong, the company’s IT keeper, resigned. Opening each new fiscal-year world — his work in the early years — passed from this year to my elder brother.
2020–21
The last world. The seventy-fifth fiscal-year world was opened. The yearly ritual had run its course.
2021–22
The last print. On 29 December 2021 my brother printed that year’s full-year report; on 30 March 2022 his print counter ticked its final step, and never moved again.
2023–24
The quiet years. No one changed the system any more, but it kept running: Tania, in accounts, printed the last retained batch of general-ledger reports in February 2024.
2026
Untied. Wai, in shipping, was still printing shipping documents from it in July; in November the format was decoded end to end, preserved byte for byte, and the modern reading copy was built — its front door keeping the same menu tree and the same program numbers.

Untying

In November 2026, the format was finally decoded, end to end. The data dictionary — the table of contents the system never had — was recovered from the vendor’s own header files, still sitting where they were left in the nineties. The company register read out twenty-three fiscal-year worlds, 1998–99 to 2020–21 — and no twenty-fourth: the yearly ritual of opening a new world had stopped with my brother. The print archive was decoded too, job by numbered job.

The whole system — database, programs, documents, print spool — has now been preserved byte for byte, with checksums. A modern reading copy has been built with the original 1990 field names; its front door keeps the same menu tree and the same program numbers, so that the colleagues who still use the system will walk in and know where everything is.

This page is the exhibition of that work.

The Knot

This system was one of my brother Daniel’s knots.

Not because it was worth money. Because in the whole company, he was the only one who knew all of it: he opened the worlds, he read the numbers; where it hurt, where something was wrong — no one else knew. The vendor was gone; the man who offered to take it over named a sky-high price; and he would not let the system die in his hands — so the worry followed him, year after year.

Now the knot is undone. Nothing is missing — not a single record; and the knowledge of how to read it is written down and preserved, no longer living only inside one person's head. This chapter is my accounting to him.

How it was opened

Above is the story. This section is how the work was actually done — how the data was extracted, how it was imported into a modern database, and what shape a database of that era actually had.

1. Extracting the data

The system had no server, and no central dictionary: every table was a pair of files — a .dat holding fixed-length records, and a .idx that was its index. The way in was the C header files the developers had left on the machine all those years ago: every table’s field names, positions and lengths were written there. From there, the system’s own file address book located each table’s files across the disks; each table’s true record length was calibrated against the files themselves before anything was read. The standard for reading correctly was the retained print archive — a printed report cannot lie, and what you compute has to reconcile with it. The whole extraction was read-only: not one byte of an original file was touched; every extracted file went into a SHA-256 checksum manifest, and together with the frozen snapshot of the nightly backup tape, that forms the preservation layer.

SO101-A as it was: the buyer information form, with its original help popup intact.
SO101-A as it was: the buyer information form, with its original help popup intact.
Anatomy of a record: the 70-byte layout of fam.dat — key, path and filler — and the sixty million records it locates.
Anatomy of a record — for thirty-odd years, every one of the system's sixty million records was found through this 70-byte address book.

Start with what the lock actually was. Not encryption — nothing in the chain is encrypted, and nothing is compressed. The lock was obscurity, at three depths.

The first depth is the container. The backup is a .vtape: a 40-gigabyte virtual tape written by Charon-AXP, an emulator impersonating a DEC Alpha. Inside it sit Tru64 vdump savesets, laid out in fixed 61,440-byte blocks. Parse the saveset headers, walk the blocks in order, and the files come back out byte for byte as the Alpha last wrote them — a claim we did not take on faith: the extraction was verified against a hand-cut sample, SHA-256 hash against SHA-256 hash, before the full pass was trusted.

The second depth is the file format. Every table is a pair of files: a .dat of fixed-length records laid end to end — no delimiters, no schema stored inside the file — and an .idx holding the B-tree index. C-ISAM appends one extra byte to every record: the deletion flag. A record is never physically removed, only marked, and the mark travels with it. So a record's true length is the struct's length plus one. Misjudge that single byte and every record after it shears: fields slide out of alignment, text turns to garbage, numbers to noise. The plus-one is the smallest fact in the entire recovery, and everything else stands on it.

The third depth is the schema, which lives outside the data entirely, in the vendor's C header files. Take cf_fam.h — Paul Chau, 11 April 1990. It defines the record drawn above: fam_file_id, char 8 at offset 0, the unique key (the index is declared ISNODUPS — it refuses duplicates); fam_path, char 50 at offset 8; fam_filler, char 11 at offset 58 — eleven bytes reserved in 1990 for a future that never came to claim them. 252 table specs were recovered this way. Six were never found — cf_acs, ert, fra, gpf, ucm and uct. For the 75 tables with no surviving spec at all, the rule was strict: preserve the bytes raw, decode nothing that cannot be proven. They sit in the database still, intact and unread, waiting for a key that may never turn up.

Some fields are not fields at all but arrays packed inside the record — a sales order's sizes and prices stored as fixed-width runs within a single row, meaningless until you know the stride. Even the calendar was a parameter, not a constant: the system's start period is anchored at 1955, giving it a hundred-year window. Its dates run to 2055 — not the 2038 cliff everyone assumes for a system this old.

In the end: 598 tables, 60,559,551 records, loaded with zero failures. And there is a proof stronger than “it looks right”. Double-entry bookkeeping is, in effect, a checksum that has been running for thirty years: every debit must meet its credit. When the oldest company's ledger was totalled from the decoded records — 2,546 vouchers — it balanced to the cent. One byte of drift, anywhere, compounds into an imbalance. There was none.

The mystery was never whether the past had survived. It was whether anyone would come back, thirty-six years later, and read it at the resolution it was written.

The journey of one record: the 71 bytes of fam.dat slot 0, the 1990 header that keys them, and the row they became.
One record's journey — seventy-one bytes as they lie on disk, the 1990 header that keys them, and the row they became. The record is ACS, the first entry in the address book.

2. Importing it into SQL

The reading copy uses SQLite — one file is the whole database. Its schema was not redesigned; it was generated directly from those 1990 header files, keeping the original field names throughout. Each dataset was loaded once, as the canonical copy, in full — no sampling, no summarising; the other physical copies of each table on other disks were recorded, every one, in a provenance table. The bytes the specifications never defined — about seven per cent of the whole archive — were not thrown away: they were preserved, cell for cell, in companion tables, kept until someone can read them. Verification came in two kinds. The general ledger keeps double-entry books: journal by journal, debits must equal credits — and every journal balanced. And one classic report was re-computed from the decoded data and compared against its 2019 printout. The numbers did not match in full, and the reason was established beyond doubt: in the seven years between, the data had gone on being maintained. Time had changed the numbers; the decoding had not got them wrong.

3. The shape of a database, then

ISAM thought about databases very differently from today: there was no central server — the database was a library, linked into each program individually. One table, one pair of files; records of fixed length, with spare space deliberately left inside them — filler — so a field could be added later without changing the structure. Dates were six characters of text, and the century was never stored: it was inferred from a one-hundred-year window anchored at 1955 — which is why the system’s own cliff edge is the year 2055, not the famous 2038. The one thing it never had, from first to last, was a table of contents: what the fields meant lived only in the header files, in the programs, and in the heads of the people who used it. That is exactly what the reading copy repairs — the specifications of all 252 tables are now themselves queryable data. Reading this system no longer depends on any one person remembering everything.

How a table went from a pair of files to a table of contents you can query.
How a table went from a pair of files to a table of contents you can query.

4. What carries it

The weight changed, too. The system was born on a dedicated DEC Alpha; when that machine retired, its world lived on inside an emulator — a Windows virtual machine on the company's ESXi server, running Charon-AXP, translating instruction by instruction to impersonate the 1990 hardware. The price of the impersonation was the host CPU, held near its limit for years, the whole installation on guard: never switched off, never touched. The reading copy inverts all of that: one Python program and one SQLite file on a small virtual machine — 2 vCPUs, 4 GB of memory, measured load near zero. Thirty-odd years and sixty million records now rest quietly inside a single 17.5 GB file, and the CPU that carries them can finally rest.

Hosting contrast: the emulator years needed an enterprise server on guard; the reading copy runs on a 2 vCPU, 4 GB virtual machine at near-zero load.
What carries it, then and now.
The GMS10 main menu in nostalgia mode: the original terminal screen transcribed line for line on a navy CRT face (company name masked)The reading copy's modern home page: glass shell, English sidebar and the system's statistics (company name masked)
Two faces of the same system. Left: the GMS10 main menu in nostalgia mode — the original terminal screen, transcribed line for line, on a navy CRT face. Right: the modern home, where the same system opens onto its statistics. The menu inside is the same one, at the same coordinates. Company names and the account name are masked, as everywhere in this gallery.

5. Rebuilding the screens themselves

With the data in a database, the system still needed a door people could walk through. The rebuilt reader keeps the original's menu structure, numbering and field positions, so anyone who used the old system knows where everything is the moment they step in. The door has two faces: a modern one, and a facsimile that reproduces the original terminal screens cell by cell. The facsimile was the harder of the two.

The original screens ran on a hardware character grid: 80 columns by 25 rows, every character exactly one cell, position guaranteed by the machine itself — nothing to compute. A web page has no grid. Text is measured, not placed; every machine and every typeface measures it slightly differently, and the same screen in two window sizes is already two different layouts. Rebuilding the facsimile meant buying back, cell by cell and in software, an accuracy the hardware once gave away free.

Comparison diagram: the character-grid terminal of the past, and the web of today
Then, the character grid; now, the web — the same field under two different geometries. Rebuilding the screens was the hardest part of the door.

The surviving specifications hindered as much as they helped. Their labels are whole sentences written as documentation, never meant to fit inside the box they name; a field's width has to be inferred from wherever its neighbour happens to start. Some fields are not one line at all — a buyer's address is a block four lines tall, and the geometry data says nothing about it; only a line of help text mentions "up to 4 lines". Infer it wrong once, and the whole address collapses into a strip four cells wide. Across 327 screens, each crowded differently, the conditions never change: nothing may overlap, nothing may be clipped, and it must still look like that screen — all three at once. In the end every screen was audited, cell by cell, before the facsimile could be called finished.

It would have been easier to draw a prettier door. But the door was not made to be admired — it was made so that people who used this system for decades would recognise it the moment they walked in. Recognition is the entire point.

An accounting

598 tables. 60,559,551 records — all of them recovered, all of them reconciled. The small part that could not be found is in here too, unhidden. This section is written for the man who carried this system for years — my brother.

Daniel — this is the report I owe you. You carried this system for years: you opened its worlds, you read its numbers, and when something was wrong you were the one who knew where it hurt. The vendor was gone, and you would not let it die in your hands. So before anything else, here is what I found, and what I have done with it — all of it, including the parts that are not finished.

First, nothing has been lost, and nothing was disturbed getting it out. The whole system — database, programs, documents, print spool — was taken read-only from the nightly backup and preserved byte for byte, with a checksum on every file. The original still runs where it always ran; Wai was still printing shipping documents from it in July of this year. What I built stands beside it, not over it.

The format is decoded, end to end. The key turned out to be the vendor’s own header files, still sitting on the machine where they were left in the nineties — 252 table specifications recovered. In the end the count stood at 598 tables and 60,559,551 records, loaded with zero failures. The address book you knew as fam — 8,254 entries — is what led us to every other file in the system.

And it is not merely decoded; it reconciles. The oldest company’s ledger, rebuilt from the decoded records — 2,546 vouchers — balances to the cent, debit against credit, the way you closed it every year. We re-computed a 2019 report from the data and checked it against its printout: where the numbers differed, it was because the system had gone on living and being maintained — not because a single byte had been misread.

Your own traces are accounted for too. The company register holds twenty-three fiscal-year worlds, 1998–99 to 2020–21 — and no twenty-fourth; the ritual of opening a new world ended with you, and the seventy-fifth world you opened stands as the last. Your print counter is in the record as well: 702, the full-year gross-profit report, on 29 December 2021 — and 703, dated the following March, empty. It has never moved again, and now it never needs to: the numbers are all out, and they all agree.

An accounting has to state what is missing, so here it is. Six specifications were never found — cf_acs, ert, fra, gpf, ucm and uct. Seventy-five tables had no surviving spec at all; they are preserved raw, byte for byte, under a strict rule — decode nothing that cannot be proven — and they sit in the database intact and unread, waiting for a key that may never turn up. About seven per cent of the bytes answer to no surviving definition; every one of them is kept, cell for cell, until someone can read them. I would rather hand you an honest gap than a tidy guess.

What carries it now would make you smile, I think. The reading copy is one file on a small virtual machine — two processors, four gigabytes — and the processor that once ran near its limit for years, impersonating the old hardware instruction by instruction, can finally rest. The front door keeps the same menu tree and the same program numbers, so anyone who walks in still knows where everything is.

The knot is undone, Daniel. Everything you held in your head — where things were, how they fitted, what the numbers meant — is written down now, and it no longer depends on one person remembering. You carried it so that it would not die in your hands. It did not die. It is all here. You can rest now.

bearever.com · A Retrospective — The Knot, Undone