Executable size and VT throughput
Measurements on 2026-11-06, x86_64, Rust 1.96, patched Zig 0.17. The gate is
5,000,000 bytes, interpreting the testing budget's MB as decimal. Sidecar fonts
are excluded. cargo xtask size builds the release executable, prints attribution,
and fails above that limit. cargo xtask size EXE MAP inspects a saved pair.
Reproduce
nix develop -c cargo xtask build-vt
nix develop -c cargo xtask size
nix develop -c cargo run --release -p v7-vt --example throughput
nix develop -c cargo build --release --target x86_64-pc-windows-gnu -p v7-vt --example throughput
python3 scripts/check-win7-imports.py target/x86_64-pc-windows-gnu/release/examples/throughput.exe
python3 scripts/win7vm.py exec 'if not exist C:\v7\w10 mkdir C:\v7\w10'
python3 scripts/win7vm.py push target/x86_64-pc-windows-gnu/release/examples/throughput.exe C:\v7\w10\throughput.exe
python3 scripts/win7vm.py exec C:\v7\w10\throughput.exe
python3 scripts/win7vm.py pull C:\v7\w10\throughput.txt build/w10/throughput.txt
The benchmark creates four synthetic streams of at least 32 MiB each: ASCII lines,
SGR color changes, CJK/emoji including a ZWJ sequence, and absolute/relative cursor
movement plus erase. It feeds 64 KiB chunks to a 120 × 40 v7_vt::Terminal, warms
1 MiB before timing, and reports the median of three independently created terminals.
Stream generation, terminal creation/destruction, and diagnostic formatting are outside
the timed region. Windows uses QueryPerformanceCounter and the application's heap;
Linux uses Instant and the host allocator. MB/s is decimal bytes per second.
This measures VT parsing/state updates, including scrollback, not rendering.
It does not establish a Renderer performance baseline. The Windows executable is
no_std and has its own process entry through v7-platform-windows.
Attribution method and limitations
The linker wrapper emits *.exe.map alongside Cargo's hashed artifact in release/deps.
Zig's cc frontend rejects both GNU -Map and MSVC /map switches; the wrapper captures
Zig's verbose LLD invocation and replays that exact command with its bundled
zig lld-link -lldmap:PATH before Rust deletes temporary objects. The second link
writes the shipped executable too, so the map corresponds to that artifact.
The report charges address intervals between symbols, bounded by each input section, intersected with PE bytes present on disk. Aliases at one address count once. PE headers, section padding, and linker-generated data are the remainder. Zero-filled virtual memory is excluded. Fat LTO folds and inlines code across crates; generic functions can mention multiple crates. Accordingly these are estimates of linked ownership, not precise independent crate costs or a claim that each table can be removed. A merged Rust data section stays in the shared data bucket because the map does not show where each named static ends and unnamed constants begin. PE unwind tables and resources are reported by section. Zig std uses module prefixes such as Io, heap, mem, array_list, and fmt. Wuffs has its own input objects and is directly identifiable.
The original executable was 3,844,096 bytes. Font discovery was being implemented in
the same checkout during this task. The mapped baseline below includes that concurrent
work and must not be presented as a byte-for-byte rebuild of the original executable.
Saved experimental artifacts and raw reports are in ignored build/w10/.
Candidates
- ReleaseSmall: rejected. With kitty graphics disabled it produces a much smaller executable, but both platforms lose throughput well beyond the 5% threshold.
- Kitty graphics/Wuffs: patch 0004 defaults lib-vt's existing upstream feature gate
off. No decoder implementation is copied or stubbed. This removes its parsing,
image storage, pixel operations, and Wuffs together. Re-enable with
KITTY_GRAPHICS=true nix develop -c scripts/build-vt.sh; raw Zig builds support-Dvoyager7-kitty-graphics=true, or an explicit-Dvt-featureslist, which takes precedence. Kitty image rendering was deferred at the time (implemented later; see kitty-graphics.md). Other VT features remain enabled. - Panic/debug machinery: upstream already uses its tiny panic handler in both
release modes and rejects accidental use of the full debug Io machinery at compile
time (
src/lib_vt.zig). No extra panic patch is justified. Assertions in Voyager7 remain enabled. - LTO/codegen/panic: fat LTO, one codegen unit, stripped symbols, and panic=abort were already configured. Retained; reducing correctness or losing diagnostics is not a size optimization here.
- Unicode duplication: Rust core, harfrust, unicode-bidi/linebreak/segmentation, and Ghostty have overlapping Unicode knowledge but different generated layouts, property sets and interfaces. Symbol identity does not prove byte equality or compatible Unicode versions. No unsafe table coalescing was attempted.
- PE: retain 4096-byte virtual section alignment, 512-byte file alignment, ASLR relocations, NX and high-entropy ASLR. Padding is small; removing relocations would sacrifice ASLR. No alignment change is justified.
cargo tree -d found actual parallel runtime versions: font-types 0.11.3/0.12.7,
read-fonts 0.37.0/0.41.0, and skrifa 0.40.0/0.44.0. Harfrust and cosmic-text use
the older family; swash uses the newer one. These are incompatible minor versions
for pre-1.0 crates; changing Cargo.lock cannot safely unify their APIs. Updating or
patching cosmic-text/swash is outside this task's profile-only Cargo ownership.
The size report combines versions under each crate's name because LTO symbols do
not reliably identify the version. miniz_oxide 0.8.9/0.9.1 is test-only through png.
Measured sizes
| Configuration | Bytes | Decision |
|---|---|---|
| Original task artifact, before concurrent font work | 3,844,096 | Reference only; no corresponding map |
| Mapped baseline, ReleaseFast, kitty enabled, Rust 3 | 3,968,000 | Before |
| ReleaseSmall, kitty disabled, Rust 3 | 3,013,120 | Reject throughput loss |
| ReleaseSmall, kitty disabled, external Rust dependencies s | 2,657,280 | Reject throughput loss |
| ReleaseFast, kitty disabled, Rust 3 | 3,429,888 | Keep feature removal |
| ReleaseFast, kitty disabled, external Rust dependencies s | 3,074,048 | Proposed final |
Disabling kitty graphics saves 538,112 bytes; Rust dependency optimization saves 355,840 more. Together they save 893,952 bytes (22.5%) against the mapped baseline, leaving 1,925,952 bytes below the decimal 5 MB gate. Workspace crates, including the VT wrapper and allocator, retain opt-level 3. The wildcard package override applies only to external dependencies. No new third-party crate was added. The example uses the existing platform crate as a Windows-only dev dependency.
| Attribution (estimated disk bytes) | Before | After |
|---|---|---|
| Ghostty Unicode | 86,752 | 83,376 |
| Ghostty Wuffs | 279,518 | 0 |
| Ghostty Zig std | 76,294 | 55,878 |
| Ghostty anonymous/shared | 306,786 | 282,612 |
| Ghostty terminal/core | 1,236,550 | 1,044,468 |
| PE headers/padding/linker | 20,247 | 20,201 |
| Rust anonymous/shared | 49,964 | 46,704 |
| cosmic_text | 156,226 | 94,823 |
| font_types | 0 | 123 |
| fontdb | 4,928 | 6,793 |
| harfrust | 452,024 | 370,288 |
| read_fonts | 243,812 | 224,965 |
| rest/runtime | 456,236 | 347,680 |
| skrifa | 320,080 | 238,285 |
| swash | 43,416 | 32,064 |
| ttf_parser | 32,960 | 12,951 |
| unicode_bidi | 16,760 | 16,738 |
| unicode_linebreak | 76,540 | 76,572 |
| unicode_properties | 0 | 0 |
| unicode_script | 0 | 0 |
| unicode_segmentation | 4,256 | 4,050 |
| v7_core | 1,696 | 1,696 |
| v7_gpu_d3d11 | 4,496 | 4,496 |
| v7_platform_windows | 18,355 | 18,531 |
| v7_text | 38,256 | 48,544 |
| v7_vt | 10,120 | 10,098 |
| voyager7 | 31,728 | 32,112 |
Zero means no separately identifiable symbol interval, not proof that a dependency has no linked code. Generic/runtime and anonymous buckets contain additional shared code and tables. Ghostty Unicode is a lower bound on named tables; anonymous table bytes cannot be reliably divided between std, Unicode, and terminal code.
Throughput results
Each cell is decimal MB/s, median of three samples, in stream order. Initial baseline and candidate runs overlapped other work on this shared host. Repeat baselines demonstrate substantial scheduling noise; they cannot support a precise 5% acceptance claim. All raw per-sample nanoseconds are retained in build/w10.
| Platform/configuration | Plain | SGR | CJK/emoji | Cursor |
|---|---|---|---|---|
| Linux initial baseline | 248.07 | 54.09 | 90.27 | 57.89 |
| Linux ReleaseSmall, kitty off | 200.50 | 41.75 | 55.87 | 47.78 |
| Linux ReleaseFast, kitty off, first run | 190.73 | 41.56 | 76.06 | 46.89 |
| Linux ReleaseFast, kitty off, repeat | 240.85 | 48.91 | 124.25 | 71.21 |
| Linux unchanged baseline, repeat | 192.97 | 29.58 | 52.03 | 33.62 |
| Linux final, repeat | 300.99 | 47.88 | 77.77 | 51.78 |
| Win7 initial baseline | 530.13 | 101.19 | 111.72 | 59.66 |
| Win7 ReleaseSmall, kitty off | 358.84 | 38.43 | 59.39 | 41.80 |
| Win7 final | 213.68 | 45.78 | 69.96 | 46.08 |
| Win7 unchanged baseline, repeat | 265.31 | 49.75 | 86.06 | 59.68 |
ReleaseSmall loses 32–62% against the initial Win7 baseline, and substantially regresses Linux too; the smaller binary does not justify it. It is not retained. The retained feature removal plus Rust optimization is worthwhile for its roughly 894 KB saving, but the throughput gate remains unresolved, requiring the parent's decision. The final Win7 run is more than 5% slower than the initial baseline on all streams. Even the unchanged Win7 baseline fell from 530.13 to 265.31 MB/s on plain text and 101.19 to 49.75 on SGR. Linux baseline repeats also vary severely. This supports host/VM contention as a confounder, not a conclusion that the retained change is free of regression. A paired baseline/final run on an otherwise idle host is needed. Rust dependency s has not separately been benchmarked for shaping or rendering; the VT benchmark does not exercise those libraries.
Validation and remaining gate
nix develop -c cargo xtask size: passes, 3,074,048 / 5,000,000 bytes.- A saved baseline extended to 5,000,001 bytes fails with
executable exceeds 5 MB. nix develop -c cargo test -p xtask: 3 passed, including PE/map interval accounting, alias deduplication, zero-filled virtual bytes, attribution, and gate boundaries.nix develop -c cargo test -p v7-vt --test corpus: 3 tests passed, including 46 fixtures.nix develop -c cargo xtask lint: passes formatting and both Clippy target passes.nix develop -c cargo xtask check-imports: passes. Final DLLs: kernel32, user32, gdi32, advapi32, d3d11, ntdll. No CRT and no forbidden known post-Win7 imports. Every benchmark exe executed on Win7 was also checked first.cargo xtask vm-smokereached Win7: 46 replays plus --smoke passed with the final 3,074,048-byte executable. I stopped that invocation after recognizing it uses the shared w7 guest directory; subsequent commands used the assigned C:\v7\w10 directory.- An equivalent smoke/replay runner in C:\v7\w10 passed Win10: 46 replays plus smoke.
- The existing four-case
xtask/src/render.rsWARP harness, compiled as a temporary host runner with only its guest directory changed to w10 and its domain restricted to Win10, passed 4/4 (dimensions, background, foreground, blank cells). It reports one draw call, zero paint allocations, and no missing clusters for these fixtures. - The full standard
cargo xtask vm-renderwas not verified on both VMs. Win7's guest agent disconnected before the final render run and throughput repeat:Guest agent is not responding: QEMU guest agent is not connected. No VM restart was attempted; the brief reserves that to the owner.
The owner must restore the Win7 guest agent, rerun final WARP checks, and settle the 5% throughput gate with controlled paired measurements before treating this as a release-ready reduction. The no-kitty build should also have a future feature-gate contract test when kitty graphics becomes part of the product's test corpus.
Ownership handoff: the benchmark dev dependency causes Cargo to add
v7-platform-windows to v7-vt's Cargo.lock dependency list. Cargo.lock was not an
owned file, so that generated entry was removed after verification; the parent must
regenerate/retain it when integrating. Other agents' lockfile changes remain intact.
Paired rerun and decision (parent, 2026-11-06)
The only change that touches VT parsing is patch 0004 (kitty graphics off); the
opt-level = "s" override applies to external Rust crates (fonts and shaping), not
libghostty-vt. Linux builds with kitty on and off ran in eight interleaved rounds,
pinned to one core, on a host loaded by unrelated work (load average about 15 on 12
cores). Per round the best of three samples was kept; the table is the median over
the rounds, decimal MB/s.
| Stream | Kitty on | Kitty off | Change |
|---|---|---|---|
| Plain | 304.3 | 304.7 | +0.1% |
| SGR | 58.5 | 56.4 | -3.6% |
| CJK/emoji | 113.6 | 102.5 | -9.8% |
| Cursor | 73.1 | 79.3 | +8.4% |
Differences go both ways and sit inside the run-to-run spread (the fastest single
samples favor kitty off on three of four streams). Decision: no measurable VT
regression; the 538 KB saving is kept. The s override is kept too, but shaping and
rasterization speed are not measured yet; re-check it with the Renderer benchmark
once one exists, and revert it if shaping regresses beyond 5%. A quiet-host rerun on
Windows 7 is still worth doing when the VM is free.
Size hunt (2026-11-27)
Splits, search and the small actions brought standalone-min (voyager7.exe plus its
appended hook DLL) to 4,946,476 of 5,000,000 bytes. These changes cut it without
removing features. Each saving was measured on its own; the exe is what
cargo xtask size reports.
| Change | voyager7.exe | standalone-min |
|---|---|---|
| Before (main 4a225fc) | 4,809,728 | 4,946,476 |
| swash resolves skrifa 0.40, as cosmic-text does (one font stack) | -99,840 | |
| Patch 0008: function/data sections in the static lib-vt | -354,816 | |
v7-platform-windows, v7-core, v7-tab-strip at opt-level s | -114,688 | |
Hook DLL appended zlib-compressed (V7HOOK02) | +512 | -72,028 |
| Patch 0009: lib-vt logs below error compiled out in release | -132,096 | |
| After | 4,108,800 | 4,173,520 |
- One font stack. swash 0.2.10 accepts skrifa
>=0.31.1, <=0.44, so Cargo can give it the skrifa 0.40 / read-fonts 0.37 that cosmic-text and harfrust already use; the earlier note that the versions could not be unified was wrong. 288,532 glyph rasters (seven fonts, hinted and unhinted, two weights, seven sizes) hash identically with both lockfiles. Keep swash's skrifa on cosmic-text's version when either is bumped. - Function sections. Zig emitted the static lib-vt as one
.text/.rdatasection, so lld kept every exported C API function and all it reaches. Code generation is unchanged; the link now drops unreferenced sections. - Logs. Voyager7 installs no
ghostty_sys_setlog callback, so warn/info/debug messages were formatted for nobody inside the stream handlers. - Cold crates at
s. Win7 first-frame time (--replay --render, 24 rounds) did not move withs; the same crates atzwere 8-14% slower, so they stay ats. - Hook overlay. The trailer hash is of the inflated DLL, so the cache directory for a given DLL keeps its name. The exe inflates and verifies before using it.
VT throughput (throughput example, best of three per run, median of runs) with
patches 0008 and 0009 against 0001-0007 alone, MB/s:
| Platform | Plain | SGR | CJK/emoji | Cursor |
|---|---|---|---|---|
| Linux, 8 rounds | 283.5 → 283.2 | 90.8 → 96.7 | 151.4 → 154.4 | 107.6 → 114.5 |
| Win7, 5 rounds | 253.0 → 263.0 | 92.2 → 92.6 | 132.0 → 131.8 | 100.1 → 106.1 |
| Win10, 5 rounds | 222.2 → 226.9 | 60.3 → 61.6 | 112.3 → 113.6 | 69.7 → 73.0 |
--render-burst row-miss cost (µs per shaped row) and --replay --render
first-frame time stayed within run-to-run noise on Win7 and Win10, and the rendered
bitmaps were byte-identical to main's.
Measured and rejected:
- External dependencies at
zinstead ofs(-76 KB): host shaping of mixed Latin/Arabic/box rows 35-45% slower, rasterization 20-40% slower, Win10 first frame about 30% slower. - v7-text at
s(-45 KB): shaping about 6% slower on the host, about 3.5% in the Win10 row-miss benchmark. It is a hot crate. - lld identical code folding: already on by default in lld-link; no change.
logcraterelease_max_level_offfor fontdb/cosmic-text: no saving.
Not done; these need a decision:
voyager7ats(-232 KB). The row-miss and first-frame benchmarks didn't move, but the binary crate's opt-level sets the fat-LTO pipeline for the whole program:-Oseverywhere and no loop vectorization in any Rust crate, including the Win7 scraper, which has no quick throughput benchmark.-glyph_protocolin the lib-vt features (-47 KB). Voyager7 doesn't render registered glyphs, yet lib-vt answers the support query and accepts registrations. Turning it off would stop that reply, which changes what TUIs see.- lib-vt error logs as well (-23.5 KB), with a no-op log function.
- v7-backend-conpty at
s(-39 KB). It holds the ConPTY pump and the Win7 scraper.
The cargo xtask size attribution charges unnamed constants to the preceding
named symbol. "unicode_linebreak" (about 157 KB) is really a 5.7 KB trie index
followed by about 137 KB of anonymous Rust .rdata; its whole crate is about 21 KB.
Size pass: application crates (2026-11-30)
The kitty graphics and 2026-11-29 feature rounds took voyager7.exe to 5,397,504 bytes (main 6d4d6b3). Three agents cut it without removing features; this section is the Rust application part. Each saving was measured on its own.
| Change | voyager7.exe |
|---|---|
| Before (main 6d4d6b3) | 5,397,504 |
Application code as the voyager7-app library at opt-level s | -320,000 |
One shared sort for the settings, menu and CLI lists (v7_core::sort) | -49,152 |
+boo frames stored by row before deflate | -26,624 |
| X11 colour table embedded deflated | -10,240 |
Own decimal parser for configuration numbers (v7_core::number) | 0 (about -17 KB once ttf-parser is gone) |
| After | 4,991,488 |
- The application is a library. The 2026-11-27 hunt left "
voyager7ats" undecided because the binary crate's opt-level is the one the whole-program LTO runs at: every Rust crate would lose loop vectorization.crates/voyager7is now only the entry point and stays at 3; the application (the same sources, still incrates/voyager7/src) builds asvoyager7-appats. Functions keep the optimization level of the crate they come from, so v7-text, v7-vt, v7-gpu-d3d11 and the backends are compiled as before.+versionreports the application crate's level, so its build mode line readsrelease (opt-level s). - Sorting.
slice::sort_bycompiles a complete sort, about 5 KB, for every element type. Twelve cold lists (themes, profiles, settings rows, fonts, toasts) now sort a list of indices with one copy of that code. v7-text's glyph sorts and v7-vt's per-frame placement sort are hot and keep the slice methods. +boo. The 235 frames are stored as 42 row streams, each holding that row's line in every frame, with a one-byte marker for a line equal to the frame before. A row changes little between frames, so the same deflate packs it to 43,173 bytes instead of 70,956. The player rebuilds the frames;+boooutput redirected to a file is byte-identical to main's on Win7 and Win10.- X11 colours.
colors.txt(15,434 bytes) is embedded deflated (4,723 bytes) and unpacked only for+list-colorsor to resolve a colour name. No name starts with#, holds:or is made of hex digits alone, so hex andrgb:values, which is every bundled theme, never unpack it. - Numbers.
str::parse::<f32/f64>links core's general decimal conversion: a 10 KB table and about 7 KB of code.v7_core::numbertakes the same grammar and is exact for up to 15 significant digits within 10^±22; tests compare it with core bit for bit, including everyf32split ratio a session file can hold. ttf-parser's CFF reader was the other caller, so the saving appears only when ttf-parser is no longer linked.
Speed, base against this branch, 10 interleaved rounds per VM (offscreen WARP):
| Win7 base | Win7 branch | Win10 base | Win10 branch | |
|---|---|---|---|---|
| First frame, 19-utf8-wide, median µs | 66,260 | 57,836 | 82,824 | 79,486 |
| First frame, 27-stress, median µs | 90,217 | 77,614 | 72,919 | 70,006 |
--render-burst row miss, median µs | 24.59 | 24.86 | 48.86 | 52.76 |
--render-burst row miss, best µs | 20.81 | 23.50 | 43.49 | 43.41 |
The differences are inside the run-to-run spread of the shared host, and the rendered bitmaps are SHA-256-identical on both systems.
Measured and rejected:
voyager7-appatz(-91 KB more, 4,900,352): bitmaps identical and first frame unchanged, but the row-miss cost rose (Win7 median 24.59 → 29.62 µs, Win10 best 43.49 → 51.20 µs).- The binary crate itself at
s(5,027,840 from the baseline, about 50 KB more than the library split): it changes code generation in every hot crate.
The diagnostic drivers the VM tests run were left for a decision here; see the next section.
VM test drivers out of packages (2026-12-01)
The --conpty-smoke driver (with its TUI stress, resilience, replay and
selection stress loops) and the --scraper-* probes run only in the VM tests.
They now build only with the vm-diagnostics feature of voyager7, which
cargo xtask vm-smoke and cargo xtask vm-tui turn on (conpty-experiment
implies it), and cargo xtask lint checks. Packages leave it off. Without it,
either flag exits with code 87 at once instead of opening a window.
--smoke, --replay, --render-burst, --list-fonts and --diag-profiles
stay in every build: the render, font and package tests run them on the
packaged exe.
| voyager7.exe | standalone-min | |
|---|---|---|
| Before (main 891ced4) | 4,935,168 | 4,999,903 |
| After | 4,870,144 | 4,934,879 |
The cost of this is the one named in the decision: the VM smoke and TUI tests run a build with these drivers added, not the byte-identical package. Everything else in that build is the same code.