# Keleusma Research Spike: What It Costs to Compile a Data Structure Whose Shape Is Already Decided

DevFeed: [Keleusma Research Spike: What It Costs to Compile a Data Structure Whose Shape Is Already Decided](<https://devfeed.tech/articles/keleusma-research-spike-what-it-costs-to-compile-a-data-structure-whose-shape-is-already-decided-39755.md>)

Original publisher: [Read original article](<https://sgeos.github.io/engineering/compilers/verification/2026/08/09/cost_of_compiling_aggregates.html>)

Author: Brendan Sechter

Published: 2026-08-09T09:00:00Z

Content type: article

Language: en

Sources: [Brendan A R Sechter's Development Blog](<https://devfeed.tech/sources/brendan-a-r-sechter-s-development-blog.md>)

Topics: [Compiler](<https://devfeed.tech/topics/compiler.md>), [Back end](<https://devfeed.tech/topics/backend.md>), [Data structures](<https://devfeed.tech/topics/data-structures.md>)

Tags: [arrays](<https://devfeed.tech/tags/arrays.md>), [case-study](<https://devfeed.tech/tags/case-study.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [compilers](<https://devfeed.tech/tags/compilers.md>), [data-structure](<https://devfeed.tech/tags/data-structure.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [research](<https://devfeed.tech/tags/research.md>), [verification](<https://devfeed.tech/tags/verification.md>)

## AI overview

This case study examines the cost of compiling aggregate data types in the Keleusma compiler backend. Measurements of 331 aggregate operations found that most reduce to constant offsets and typed loads, challenging an estimate based on the feature's general name rather than its actual instances.

## Source excerpt

The largest remaining item in a compiler backend was estimated at a quarter's work. Measured, it is pointer arithmetic over compile-time constants, and two of the three representation forms it was supposed to need account for two operations in the entire corpus. The item is aggregate data types, meaning structs, tuples, arrays and enumerations. It blocks 34.5 percent of the corpus, more than every other unimplemented feature combined, and it had never been scoped because everyone knew it was large. Everyone was reasoning from the wrong artefact. Aggregates are large in a compiler that must decide their layout. This compiler decided it already, in an earlier pass, and bakes the answer into the instruction stream. What reaches the backend is not a type system. It is a byte offset and a scalar kind. The measurement that establishes this took twenty minutes to write and two and a half seconds to run. It reports that of 331 aggregate operations in the corpus, 300 are a constant offset and a typed load, 2 need anything resembling a value representation, and 0 use the general mechanism the instruction set still carries. This article reports that, and reports why the author's own recommendation to run it deserves more scepticism than the result. What this is a case study of The setting is compiler backend scoping and the project is Keleusma, whose backend is described in the first, second and third articles of this series. No compiler background is required. The general shape is estimating the cost of a feature from its name rather than from its instances. "Aggregate data types" names something with a large literature, a hard general case, and a well-known set of representation decisions. None of that is evidence about the work in front of you, and the gap between the category and the instance is where the estimate went wrong. The transferable question is what remains once a decision has already been made upstream. The answer is often mechanical, and the mechanical residue