Autological Artifacts
Files that describe, contain, and interrogate themselves.
A source-grounded survey of what happens when the boundaries between program, container, index, dependency graph, and state collapse into one byte stream. The two seeds are redbean/APE — a file whose own bytes are its archive — and SELF — a file whose own bytes are its schema. The catalog exists because those two artifacts are usually described as the same idea, and the evidence says they are opposite corners of the same space.
Last reviewed: August 26, 2026
This survey answers ten questions:
- What does autological mean here, what are the four axes every artifact is scored on, and what do prefix-tolerant, footer-anchored, and dispatch owner mean? → Concepts
- How far can format superposition actually be pushed, and what does it cost? → Cosmopolitan/APE/redbean, polyglot craft, boot hybrids
- Which formats compose, and can that be predicted rather than catalogued? → ZIP parasitism develops the tolerance partial order; boot hybrids supplies the amendment
- What goes wrong when two dispatchers disagree about one byte stream? → Parser differentials and LangSec
- What does it mean for an executable to be a database, and what does it break? → SELF/selfdb/self-httpd, with sqlelf as the precursor that changed no format at all
- Where does an index live, why, and what does that cost over a network? → Footer-indexed formats, range-request consumption, debug info and out-of-band indexes
- Who decides what a file is? →
binfmt_misc, the dynamic loader, the Wasm component model - How do you carry your dependencies without carrying them twice? → The Nix store, content-addressed chunking
- What is already known about programs that mutate themselves, and about trusting them? → Image-based systems, SQLite as an application file format, the VFS seam, embedded provenance, the threat model
- Why did the systems that already shipped this idea lose? → Single-level store, Plan 9 and 9P
The synthesis is in comparison.md — including a section of corrections to the premises this survey started from, five of which did not survive contact with the sources. The research agenda that remains is in open-questions.md. Methodology, and an explicit line between measured, derived, and claimed by a source, is in measurement.md.
NOTE
Scope. This tree is about the artifact's internal structure. How an artifact reaches a machine — installers, stores, notarization, update channels — is docs/research/application-packaging/'s subject, and is cross-linked rather than re-surveyed. General single-binary packaging is out of scope unless the artifact is queryable or polyglot; see what is out of scope.
Master catalog
One row per surveyed subject. M/R/C/Mu are the four axis scores — Multiplicity, Reflexivity, Closure, Mutability — each 0–3, defined in concepts and argued in each deep-dive's spine. They are ordinal judgements assigned by this survey, not measurements.
| Subject | Cluster | M/R/C/Mu | Index anchoring | Dispatch owner | What it is | Link |
|---|---|---|---|---|---|---|
| Cosmopolitan / APE / redbean | Superposition | 3/2/3/2 | footer (ZIP EOCD) | shell → kernel | The maximal polyglot: PE + ELF + Mach-O + shell script + MBR + ZIP, collapsing on first run | deep-dive |
| ZIP suffix parasitism | Superposition | 3/1/2/1 | footer | consumer | The footer index that makes every ZIP-suffixed format from JAR to APK to redbean possible | deep-dive |
| Polyglot craft | Superposition | 3/1/1/0 | mixed by construction | consumer | Corkami, mitra, and 23 PoC‖GTFO issues — multiplicity maximal, reflexivity zero | deep-dive |
| Boot-adjacent hybrids | Superposition | 3/1/2/0 | header + reserved hole | firmware | An ISO that is also an MBR disk; a PE that is also kernel + initrd + cmdline, signed as one | deep-dive |
| Parser differentials / LangSec | Superposition | 3/0/0/1 | footer + stream-scanned | consumer | GIFAR, Master Key, Janus, MalDoc-in-PDF — the adversarial dual of every entry above | deep-dive |
| SELF / selfdb / self-httpd | Binary-as-database | 1/3/2/3 | header (b-tree) | kernel | The executable is a SQLite database; strip/ldd/patchelf/LD_PRELOAD become SQL | deep-dive |
| sqlelf | Binary-as-database | 0/2/1/0 | out-of-band | kernel | SQL over unmodified ELF — the same reflexivity, achieved by changing no format at all | deep-dive |
| Format→query layers | Binary-as-database | 1/3/0/2 | out-of-band | consumer | LIEF, goblin, pyelftools against the declarative grammars Kaitai and DFDL | deep-dive |
| Relational system surfaces | Binary-as-database | 1/3/1/1 | out-of-band | consumer | osquery, Steampipe, Datasette, dsq — Datasette is self-httpd run backwards | deep-dive |
| Code as a database | Binary-as-database | 1/3/2/1 | out-of-band | consumer | CodeQL, Glean, Kythe, SCIP/LSIF, ddisasm — and why they all chose Datalog | deep-dive |
binfmt_misc | Dispatch | 1/2/1/0 | header (256-byte window) | kernel | The kernel turning a masked byte pattern into a choice of interpreter | deep-dive |
| The dynamic loader | Dispatch | 1/2/1/1 | header + ld.so.cache | loader | ld.so re-running the same symbol-resolution query at every process start | deep-dive |
| Wasm component model / WIT | Dispatch | 1/3/2/0 | stream-scanned | loader | Imports and exports as a typed graph the binary carries — at the price of no index | deep-dive |
| Footer-indexed formats | Index anchoring | 2/2/0/1 | footer | consumer | Parquet, ORC, seekable zstd, eStargz — and the writer-side constraint that explains them | deep-dive |
| Range-request consumption | Index anchoring | 0/2/1/0 | footer / header+b-tree | consumer | DuckDB httpfs, sql.js-httpvfs, OCI, debuginfod: cost is round trips, not bytes | deep-dive |
| Debug info and OOB indexes | Index anchoring | 1/2/1/1 | stream-scanned + bolt-ons | consumer | DWARF: five index generations, because the format shipped with no query surface | deep-dive |
| The Nix store and closures | Closure | 0/2/3/1 | out-of-band | consumer | Dependencies discovered by scanning bytes for hashes, never declared | deep-dive |
| Content addressing and chunking | Closure | 0/1/3/1 | out-of-band + footer TOC | consumer | OSTree, casync/desync, OCI layers, zstd:chunked — 0.00% vs 99.88% sharing, same two artifacts | deep-dive |
| Image-based systems | Self-mutation | 1/2/2/3 | header | loader | Squeak, SBCL, Emacs unexec→pdumper, CRIU, Erlang — five collisions with demand paging | deep-dive |
| SQLite as an app file format | Self-mutation | 1/3/2/3 | header | consumer | The design position SELF is a maximal instance of; Fossil is the shipped proof | deep-dive |
| The SQLite VFS as substrate | Substrate | 1/2/0/2 | out-of-band (negotiable) | consumer | One b-tree over pread, OPFS, HTTP 206, memory — where portability actually lives | deep-dive |
| Embedded provenance | Provenance | 0/2/1/0 | mixed by design | consumer | build-id, Go buildinfo, cargo-auditable, SBOM-in-binary — all opt-in, all unauthenticated | deep-dive |
| Threat model | Trust | 0/1/0/3 | out-of-band | kernel | Every OS primitive identifies its subject by inode or path — never by content | deep-dive |
| Single-level store | Prior art | 0/3/1/2 | out-of-band | kernel | IBM i/OS-400, Multics, Pick, VMS RMS — the commercial system that shipped "the OS is a database" | deep-dive |
| Plan 9 and 9P | Prior art | 1/2/0/1 | out-of-band | kernel | The namespace, not the table, as the uniform interrogation interface — 13 messages | deep-dive |
| Method and measurement | Method | 0/1/0/1 | out-of-band | consumer | A prescriptive protocol; explicitly reports no results | deep-dive |
Taxonomies
The same 26 subjects, re-cut one axis at a time.
By index anchoring
Out-of-band is the most common answer — the index is more often outside the artifact than in it, and every such index is a materialized view that can go stale.
| Anchoring | Count | Subjects |
|---|---|---|
| Out-of-band | 11 | sqlelf, inspection, relational, codedb, nix, chunking, vfs, threat, sls, plan9, measure |
| Header | 6 | SELF, binfmt, ld (+ cache), images, aff, boot (+ hole) |
| Footer | 5 | APE, zip, footer, range, chunking (zstd:chunked TOC) |
| Stream-scanned | 4 | wasm, dwarf, differentials, provenance (Go buildinfo) |
By dispatch owner
| Dispatcher | Count | What acts on the bytes |
|---|---|---|
| Consumer | 15 | A library, a SQL engine, a renderer, a sniffing heuristic — no privileged arbiter |
| Kernel | 6 | binfmt_misc, binfmt_elf, binfmt_script, and the systems that were the OS (sls, plan9) |
| Loader | 3 | ld.so, a Wasm engine, a language runtime opening its own image |
| Firmware | 1 | BIOS El Torito / UEFI LoadImage |
| Shell | 1 | The shebang, and the ENOEXEC fallback that APE exploits |
By axis extreme
| Axis | Scores 3 | Reading |
|---|---|---|
| Multiplicity | APE, zip, polyglot, boot, differentials | All five are format-superposition entries; none exceeds reflexivity 2 |
| Reflexivity | SELF, inspection, relational, codedb, wasm, aff, sls | None exceeds multiplicity 1 — see the shape of the space |
| Closure | APE, nix, chunking | One carries everything; two share everything |
| Mutability | SELF, images, aff, threat | The axis where signing stops working (provenance) |
Milestones
When the load-bearing capabilities actually landed. Every date is established and cited on the deep-dive that owns it; entries marked ≈ are approximate there too.
| Date | Event | Page |
|---|---|---|
| 1965-11 | Multics segments described at FJCC — one address space over memory and disk | sls |
| 1978 | VAX/VMS RMS 1.0; ETXTBSY in V7 Unix | sls, threat |
| 1980 | Smalltalk-80 images; IBM System/38 ships | images, sls |
| 1982 | Emacs unexec — dumping a running process back into an executable | images |
| 1986-12 | ECMA-119 (ISO 9660) reserves Logical Sectors 0–15 — hole-tolerance, on purpose | boot |
| 1988-06 | AS/400 announced (OS/400 V1R1): single-level store + TIMI + integrated database | sls |
| 1989 | PKZIP 0.9 and APPNOTE.TXT — the footer index the whole catalog turns on | zip |
| 1993-07-27 | DWARF 2, including .debug_pubnames — the first of five index generations | dwarf |
| 1995 | ELF dynamic linking in Linux; El Torito 1.0 | ld, boot |
| 1997 | binfmt_misc in Linux 2.1.43; HTTP byte ranges standardised (RFC 2068, January) | binfmt, range |
| 2002-04 | 9P2000 ships with Plan 9 Fourth Edition | plan9 |
| 2003-03-13 | Nix's first commit — dependencies discovered by scanning, never declared | nix |
| 2004-06-18 | SQLite 3.0.0; the file format has been backwards-compatible ever since | aff |
| 2007 | build-id lands in Fedora 8; sqlite3_vfs ships in SQLite 3.5.0 | provenance, vfs |
| 2011 | DFDL v1.0; OSTree's first commit; the term LangSec is coined | inspection, chunking, differentials |
| 2013 | Parquet 1.0.0 and ORC; PoC‖GTFO 0x00 (2013-08-05) | footer, polyglot |
| 2013-05-20 | SQLite 3.7.17 adds xFetch/xUnfetch — mapped pages are shared between processes | aff |
| 2016 | OpenBSD pledge (5.9); Kaitai Struct compiler 0.2 | threat, inspection |
| 2017 | casync (January); seekable zstd 0.1.0 (2017-11-04); DWARF 5 .debug_names | chunking, footer, dwarf |
| 2019 | debuginfod (elfutils 0.178); fs-verity (Linux 5.4); Wasm 1.0 W3C Recommendation | dwarf, threat, wasm |
| 2020-08-24 | APE announced — the maximal artifact of the format-level strategy | ape |
| 2020 | Emacs 27.1 replaces unexec with pdumper, after ASLR and PIE broke it | images |
| 2021 | Landlock (Linux 5.13); sql.js-httpvfs and DuckDB httpfs; OCI distribution-spec v1.0 | threat, range |
| 2023-03-09 | sqlelf's first commit — SQL over ELF, changing no format | sqlelf |
| 2023 | systemd ukify (253); SLSA v1.0 (2023-04-19); in-toto Attestation v1 | boot, provenance |
| 2024-05-06 | The sqlelf paper submitted (arXiv:2405.03883) | sqlelf |
| 2024-08-17 | redbean 3.0.0 | ape |
| 2026-07-09 | SELF's first commit; the repository is made public 2026-08-23 | self |
WARNING
SELF's repository has been public for three days at the time of this review, and its first commit is seven weeks old. Several of its claims — including the startup cost model and the page-sharing loss — have never been measured by anyone, its own DESIGN.md included. Treat every SELF performance figure in this tree as the project's claim, not as a result.
Runnable examples
Six single-file D programs, compiled and run by the repository's ci helper on every pass, each establishing one structural claim from first principles rather than asserting it:
| Example | What it proves |
|---|---|
zip-eocd-scan.d | Builds a shell-script + ZIP polyglot with prefix-biased offsets, then enumerates it reading 0.3% of the file; a system unzip independently agrees |
magic-superposition.d | Runs ten recognizers over four buffers at once — superposition is independent predicates with no arbiter |
sqlite-header-probe.d | Decodes application_id at offset 68 and page_size at 16, from a synthesized SELF header and a real database |
binfmt-magic-match.d | The kernel's magic+mask+offset predicate, transcribed; two ELF headers differing in one byte, separated by the mask |
elf-note-buildid.d | Reads its own build-id from /proc/self/exe — and shows that emitting one is an opt-in link option |
relocation-join.d | The loader as a query engine: LD_PRELOAD as one inserted row that changes 4 of 8 resolutions, plus the same query in SQL and Datalog |
Suggested reading paths
"I want the argument, not the catalog."concepts → comparison → open-questions. About an hour; the corrections section in the middle of comparison is the part that changed as a result of the research.
"I came for redbean / APE."APE → ZIP parasitism → polyglot craft → parser differentials → boot hybrids.
"I came for SELF."SELF → sqlelf → SQLite as an app file format → binfmt_misc → the VFS seam → measurement. Read the threat model before forming an opinion about deploying it.
"I want to know whether this is actually new."Single-level store → Plan 9 → image-based systems → comparison § thesis 2. Short answer: no, and the reasons the predecessors lost are better documented than the current wave admits.
"I have to make a format decision."concepts § tolerance → footer-indexed formats → range-request consumption → debug info. The writer-side constraint in footer-indexed-formats is the one that will decide it.
"I need to measure something."measurement, and nothing else first.
Sources
Each deep-dive owns its own primary sources and pinned citations; this umbrella cites none of its own. Grounding state at the last review: 590 GitHub blob citations across the tree, 495 verified to resolve at their pinned commit against local clones (ci --check-blob-paths), every GitHub URL pinned to a 40-character SHA (ci --check-vcs-urls), and 154 individually-recorded claims that could not be verified, each either dropped or explicitly marked on the page that raised it.