Skip to content

0.27.3: the tables of attenuated directories in .bss — 141,824 bytes fewer in every program that links them - #61

Open
Sunrisepeak wants to merge 1 commit into
mainfrom
rights-tables-in-bss
Open

Sunrisepeak wants to merge 1 commit into
mainfrom
rights-tables-in-bss

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

The table of handles (g_entries: 4,096 entries of 32 bytes) and the table of roots (g_roots: 64 of 168 bytes) in src/rights.cpp began with members initialised to -1 (no descriptor, no root, no record), so the compiler placed both — 141,824 bytes — in .data. Every program that links the attenuation carried them in its file and loaded them, whether it attenuated a directory or not.

A free entry and a free root are now all zero bytes: an entry is known to be in use by its used flag, a root by live as before, and each is given its values where it is made (new_entry, new_root). Both tables lie in .bss.

  • Behaviour: unchanged. mcpp test: 24 programs, 24 cases pass. In openkal_0_23's program both symbols move from d (.data) to b (.bss); nm -S before and after.
  • Measured downstream: omui's smallest terminal application with its agent endpoint (tests/size/terminal-agent, which links openkal-linux 0.26.3 through mcpplibs.os) carries both tables in .data — 141,824 bytes of its 1,980,368 loaded at -Oz; the first tier carries g_roots, 10,752 bytes.
  • Version 0.27.3 and a "What 0.27.3 fixes" section in the README, as the previous releases do.

…fewer in every program that links them

The table of handles (4,096 entries of 32 bytes) and the table of roots (64 of 168 bytes) began with members
initialised to -1, so both were placed in .data: every program that links the attenuation carried 141,824 bytes
in its file and loaded them, whether it attenuated a directory or not. A free entry and a free root are now all
zero bytes (an entry in use by its `used` flag, a root by `live` as before), and each is given its values where it
is made (new_entry, new_root): both tables lie in .bss. The conformance tests pass unchanged (24 programs); in
openkal_0_23's program both symbols move from `d` to `b`.
Sunrisepeak added a commit to Sunrisepeak/mui that referenced this pull request Nov 26, 2026
… 1,835,968 B (within 2 MB)

The day's measurement after the size check builds the tiers as the terminal design states them (the `small`
profile) and this line's cuts; the bars are unchanged (1 MB, 2 MB).
- check size --native (bytes loaded, small profile: -Oz, NDEBUG, the system's libstdc++): tests/size/terminal
  1,047,242 B — over 1,000,000 by 47,242 (1,215,758 at 1d69ab4 built the same way; 2,211,981 at -O3);
  tests/size/terminal-agent 1,835,968 B — within 2,000,000 (2,001,804; 3,849,938 at -O3). strip --strip-all:
  1,053,440 and 1,846,336 B. Both link the 51 packages their budgets list.
- The budgets' `why`: the cuts, what is left by owner and what would take it off (openkal-linux's tables in .bss,
  mcpplibs/openkal-linux#61: 10,752 B of the first tier and 141,824 B of the second; the theme's framework motion
  defaults and the view's pixel effects at slots; std::format; unwind tables).
- The lead ledger: terminal.size.counter.program.bytes and .runtime.bytes, lines of 2026-11-27 at 8bd34cb —
  1,053,440 B against FTXUI 0.3173x, ratatui 0.5908x, Ink's bundle 0.6448x (with Node 141x): behind; the lead pages
  regenerated (omui-devtools lead docs).
- tests/size/README.md, tests/size/terminal's manifest, tests/bench/competitors/terminal/README.md: the profile and
  the numbers.

Verified: on a pty (util-linux script, 60x20), Tab, Tab, Enter, Ctrl+C: both tiers draw "Count 0", write the cell
"1" at row 2, column 9, move the focus brackets, leave the alternate screen, exit 0, nothing on stderr. Example 01
(check size --native, its row at the size profile as before): 18,112,667 B loaded, within 18,530,000, 89 packages,
its installs as listed. mcpp build --profile ci -p showcase/fighting -p tests/bench: built. lint 0, lint
--self-test 55/55, docs --check, lead check.
Sunrisepeak added a commit to Sunrisepeak/mui that referenced this pull request Nov 26, 2026
…no JSON parser: 493 -> 420 KB

Scope: mlibs.json and omui.entry.launcher.

- mlibs.json: its scanner (the one locate walks) checks RFC 8259's grammar and says why it stops;
  Scan::read/text/texts/problem read a few values of a text in place, nothing built and nlohmann's
  parser not linked; quote() writes a string as nlohmann's dump does. Document::problem and
  Scan::problem place a pointer the same way (one function). Additive interface (api.omui.txt).
- omui-launch: runtime.json read through Scan, --which written with quote(): nlohmann no longer
  linked (its package stays in the graph through mlibs.json, 0 bytes); its lines written through
  mcpplibs.os's stdio instead of std::cerr; its dist profile -Oz (-Os was 4,096 B more stripped).
- size.budget.xdef.json beside it: program.shipped <= 200,000 B at the `small` profile, its links.

Measured (small profile, -Oz, omui-gen size, loaded bytes): at f6145e0 493,062 (505,664
stripped); Scan -71,652; stdio -1,706: 419,704. Left: openkal-linux's tables 141,824 in .data
(mcpplibs/openkal-linux#61, open); toml++ 76,998 (probe without it: 344,412, so 202,588 with #61);
std 76,506 (std::format's engine and Unicode tables, used by mcpplibs.os and cmdline too).
The manifest's TOML reader is a decision: no TOML reader in the tree but toml++, and no JSON
snapshot of an application's manifest exists.

Evidence: mcpp test mlibs.json 8 cases (3 new: acceptance held to nlohmann on 47 texts at the
grammar's edges, values in place and their problems placed as Document places them, quote
round-trips through nlohmann); launcher 5 cases; omui.core core/json_test 5 cases (json_location
walks the same scanner); devtools builds (ci); check size --native -p omui.entry.launcher --budget:
419,704 B over 200,000 (exit 1, the red); lint 0, self-test 55 of 55; docs --check 0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant