Description
What
Including one of the UI headers on its own, with nothing else in the translation unit, costs this much peak compile memory under CI's clang-asan flags (-O0 -gline-tables-only -fsanitize=address,undefined -fno-sanitize-recover=undefined -fno-omit-frame-pointer, the project's other flags from compile_commands.json, clang 23):
ui/grid.hpp: rc=0 2.61 GB
ui/mount.hpp: rc=0 2.27 GB
ui/table_state.hpp: rc=0 1.91 GB
ui/interpreter.hpp: rc=0 0.67 GB
core/bridge.hpp: rc=0 0.65 GB
include/morph/ui/grid.hpp is 5,399 lines. A source file or test that touches table or grid types therefore starts at about 3.0-3.4 GB before its own code. That limits how far splitting a file can go. When src/ui/interpreter.cpp and tests/test_ui_table_model.cpp were split into 13 and 14 files, the heaviest new files still peaked at 3.64 GB (interpreter_forms.cpp) and 3.78 GB (test_ui_table_model_cell_walk.cpp).
Hosted Linux runners have 16 GB and build with --parallel $(nproc) (4), so four such files compiling at once use about 15 GB. When they ran out of memory, the runner died with exit 143 or "lost communication".
Verification status
- Measured on
5d3f4f911(branchfeat/table-pending-cells) on a local workstation with clang 23. Each header was included alone in an empty.cppand compiled with theinterpreter.cppcompile command. Peak RSS was read fromgetrusage(RUSAGE_CHILDREN). - Not measured: GCC peaks, clang 22 (CI's version), or which parts of
grid.hppcost the most (templates instantiated in the header, inline function bodies, or transitive includes).
What would close it
Each of these headers costs no more than about 1 GB to parse alone under the same flags, or a measurement shows the cost is unavoidable at that size. Possible ways in: split grid.hpp by concern, move inline bodies out of line into src/ui, and cut transitive includes from the table headers.
Activity
Yaraslaut commentedon Nov 27, 2026
Correction: this weight comes from the branch, not from master. Measured the same way (each header included alone, CI's clang-asan flags, clang 23):
feat/table-pending-cells(PR #1128) adds about 25k lines of fully inline UI headers, none of which useMORPH_API, andmount.hppnow includestable_rows.hpp(4,820 lines). This belongs to that change, so it is being fixed there: non-template bodies move out of line intosrc/uiand the headers' includes are trimmed. This issue closes when #1128 lands with each of these headers at about 1 GB or less.