Build speed and binary size: sccache, linker, profiles, size budget #57
Closed
opened 2026-10-07 07:42:20 +00:00 by kayg
·
19 comments
No Branch/Tag specified
main
j470b-server-mesh-rejoin
mesh-compat-382
j444b-d381-key-wins-flood
j461b-macos-utun-reader-thread
j475b-remove-host-motion
fix-reconnect-new-link
j481-d380
dev
j479-mesh-soak
fix/j476-host-facts
j475-motion-pill-split
j470-mac-node-join
root-upgrade-d376
j474-review-merge
latency-targets-120hz
nightly-suite-shards
gotatun-pin-j469
macos-utun-reader-thread
fix-flood-echo-stall
wip/j416
motion-fast-ease-out
mesh-addhost-j259
takeover-close-terminals-d368
kbd-instant-followups
fix-trust-key-double-click
nightly-suite-partial-report
appwin-icons-j207
rusqlite-slice1
swipe-content-first-d374
mesh-mtu-381
addhost-instant-open
glass-contrast-d365-mock
glass-contrast-d365
signout-followups-442
fix-startup-toast-red
research-gotatun-matrix-j317
themes-sync-j304
fix-load-flakes
fix-nix-zig-patch
fix-compute01-browser-baseline
ratchet-size-baseline-419
predict-auto-d130
revoke-coverage-d367
nightly-suite-queue-timeout
nightly-browser-suite
fix-rustsec-2026-0459
fonts-ioskeley-obel
log-retention-d375
fix-kbd-no-anim-427
fix-dev-red-specs-2
takeover-proof-305-j205
wip/j410-server-pump
ui-consistency-d372
fix-osc52-clipboard
libghostty-vt-1.0
forget-retired-host-d369
j404-merge-426
fix-setup-lock-race
fix-touch-select-426
revoke-access-report-ui
fix-predictive-echo-specs
fix-selinux-agent-exec
wip/j395-checkpoint2
wip/j395
j391-review-scratch
ui-consistency-j195-deferred-rebased
fix-rustc-paths-421
decisions-wording-341
fix-install-suite-red
fix-dev-rtt-specs
fix-pending-removal-align
fix-privileged-skip
fix-install-suite-404
review-j368
mesh-dns-j254
revoke-access-report-d356b
revoke-privilege-round5
fix-removal-confirm
review-j360
gotatun-rotation-367
deps-refresh-340
review-j354
review-J351
review-j350
addhost-takeover-d359
revoke-report-items-347
revoke-end-sessions-d362
review-j348
size-mesh-ssh-346
size-trim-337
revoke-access-diff-d356
j259-pre-rebase-b06c5a6
j305-ended-at-start-spec
addhost-sudo-consent
fix-layout-real-specs-411
fix-shell-open-411
fix-console-hosts-373
fix-shell-exit
fuzz-host-name-353
fix-host-details-410
macos-filter-j197
research-gotatun-tricks
revoke-p3-j216l
stale-state-pill
revoke-followups-j216k
revoke-progress-j216e
backup/macos01-20261106/lume/j197
backup/macos01-20261106/lume/appwin-icons-j207-stash0
backup/macos01-20261106/claude/stash-0
backup/macos01-20261106/claude/stash-1
backup/macos01-20261106/claude/J80-macos-s1
backup/macos01-20261106/claude/J80
backup/macos01-20261106/claude/J80-slice1-20261102
backup/macos01-20261106/claude/J16b-appwin-on-dev
backup/macos01-20261106/claude/appwin-launch-idle-146
backup/macos01-20261106/claude/J80-s1-run
wip/j259
trust-285-p3c
runtime-lock-j216f
mesh-ssh-p3-j175
tun-proof-p3b
trust-285-p3
terminal-polish-j271
tun-proof-p3
ssh-install-flakes-j216i
fuzz-fixes-j264
trust-285-a
trust-285-b
restart-oversized-fixture-j198
backup/macos01-20261106/lume/appwin-icons-j207
restart-bound-j216h
up-preflight-p3-j198
backup/macos01-20261106/lume/j251
up-preflight-j198
wip/up-preflight-j198-j245-p2
wip/up-preflight-j198-j245-p1
agent-fsync-offloop-j196
wip/up-preflight-j198-j245
settings-offscreen-j231
wip/up-preflight-j198-j226-inspection
wip/j103f
themes-j206
wip/up-preflight-j198-j226
flakes-j216c
backup/macos01-20261106/claude/j197
flakes-j216b
backup/macos01-20261106/claude/j197-red
wip/up-preflight-j198-review
flakes-j216
backup/macos01-20261106/claude/appwin-icons-j207
engineering-j208b
appwin-mock-j209
toast-stack-j165
engineering-j208
decisions-d351
decisions-d350
decisions-d349
appearance-presets-mock-j129
decisions-d348
docs-audit-spec
doc-coverage-baseline-raise
decisions-d347
decisions-d346b
decisions-d346
j88h-profile
ui-consistency-j195-deferred
ui-consistency-j195
engineering-practices-j194
preferred-login-ui-j166
signin-pools-263-j174
macos-node-265-s1
decisions-d345
decisions-d344
proxy-cgroup-j164
verify-quick-fuzz-329
proxy-start-io-j168
timing-flakes-j163
up-263-s1
mcp-events-j147
verify-quick-fuzz-j158
proxy-p3-j159
agent-resource-j157-detect
wip/j103d-final
remote-cancel-hang-j155
proxy-traefik-281-j62d
j149-verify-quick
proxy-traefik-281-j62b
j150-drop-unnamed
wip/j79d-red-r4
wip/j103d-d332
rootless-toast-j142
wip/j103d-head
wip/j103d
j125c-mcp
macos-build-j136
backup/macos01-20261106/claude/j136
wip/j79d-red-cli
wip/j79d-red-server
j121-link-liveness
j118c-tracer-failures
wip/j79c-head
release-desktop-j131
j124c-signed-macos
wip/j79c-red-p3
wip/j79c-red-p23
wip/j79c-red-p22
merge-j128-check
perf-deferred-j128
sidebar-toggle-260
j127-shortcut-changed-dot
j125-mcp
j118-tracer-failures
j126-account-summary
settings-sections-mock-j92
j120-pinch-lock
sidebar-292
backup/macos01-20261106/claude/j120
taste-2026-11-03
row-actions-242-215
backup/macos01-20261106/claude/stash-0-untracked
backup/macos01-20261106/claude/J80-265-s1-run
backup/macos01-20261106/claude/J80-macos-s1-20261102
j112-canvas-commands
ui-no-overshoot-scroll
fix-recovery-restart
backup/macos01-20261106/claude/stash-1-untracked
taste-2026-11-02
size-baseline-ratchet
machine-cards-structure-j108
j109-boot-copy-mockups
fix-dev-red
wip/up-263-s1
j95b-settings-rows
proxy-traefik-281
j95-option-rows
docs-human-j91
docs-keys-palette
fix-flood-1013-270-j38d
mesh-ssh-s1
mesh-ssh-s0
addhost-d291-tunnel
test-stability-load
mesh-relay-220
repro-296
shim-thp-off-24
mesh-pins-258-v2
mesh-dns
signin-d311-merged
docs-pages
ui-size-283
fix-ui-batch-specs
wip/j12b-edge-update
gate-on-arm
fix-rename-sync-293
trust-285-j60b
fix-focus-ring-clip
integ-ui-1101
edge-update-v2
signin-d311
taste-2026-11-01
layout-per-tab-250
ui-approved-splitopt-224
ui-approved-splitopt-224-on-dev
icon-text-centre-282
ui-approved-189-212-216
research-reverse-proxy
transfer-budget-320
review-mesh-pins-258-r2
sidebar-pill-259
review-mesh-relay-220
wip/j12-edge-update-v2
nix-package
status-crash-loop-237
fix-dev-test-failures
fix-fixture-socket-path
wip/mesh-relay-220-pre-dev-advance-rebase
fix-canvas-side-clip
research-head-to-head
frosted-real-256
review-mesh-pins-258
wip/mesh-relay-220-pre-final-rebase
review-layout-per-tab-250-r2
broad-suite-triage
nix-devshell
review-status-crash-loop-237-r3
wip/nix-devshell-pre-p3
taste-frosted-real
wip/code-serve-demo-2026-10-30
wip/code-serve-glass-2026-10-30
wip/code-serve-clusters-2026-10-30
wip/code-merge-release94-dev-2026-10-30
wip/rproxy-delta-scratch-2026-10-30
wip/stale-note-257-staged-2026-10-30
wip/d241-size-staged-2026-10-30
review-broad-suite-207
wip/mesh-pins-258-pre-split
wip/mesh-relay-220-pre-rebase
mesh-measure-220
plan-211-update
review-edge-autoupdate-r3
perf24-reconnect
review-stale-note-r2
release-prod-live
d241-shell-marker
review-mesh-pins-server-258
review-revocation-r3
review-setup-token-r2
review-sync-journal-r3
wip/review-mesh-pins-258-prune-review-1995fee46
frosted-scroll-256
sync-journal-r3
revocation-per-account-wip
review-tokio-asyncfd-0386
review-sync-p3s
wip/stash-8by64-stash0-2026-10-30
mesh-drag-r2
setup-token-data-wip
release-9-4
auth-busy-1013
mesh-view-overlap
sync-p3s
review-auth-busy-wake
review-readd-r8-wip
mesh-drag-bounds
audit-auth-93
app-windows-stream-start
review-authority-cap-r3
app-windows-r7-measure
readd-minimal-r6
readd-minimal-r5
app-windows-r7-soak
readd-minimal-r4
app-windows-r7
app-windows-r6
readd-minimal-r3
readd-minimal-r2
readd-minimal
merge-release8-dev
review-busy-page-liveness-r2
review-busy-page-liveness
mesh-view-trim
review-authority-read-retry-r2
review-remove-uninstall-r2
release-retry-reattach
release-retry
review-remove-uninstall
review-authority-read-retry
app-windows-ship
mesh-autoswitch-p2
mesh-ssh
mesh-relay
mesh-macos-node
screen-and-control
session-labels
review-real-logins-r5
review-real-logins-r4
review-real-logins-r3
shim-memory-r2
review-real-logins-r2
shim-memory
shadow-addhost-instant
shadow-real-logins
shadow-same-session-flood
shadow-prod-perf-fix
hosts-from-server
app-windows-real
app-windows-transport
release-prod-6w
mesh-policy-verify
quiet-close-toast
dev-merge-r4
review-mesh-agent-transport
review-app-windows-transport
settings-roundtrip
review-release-pipeline-r4
mesh-agent-transport
ended-strip-fix
review-audit-ca-update-d244
settings-rows
phone-width
signout-clear
fix-restart-tests
dev-merge-rp
signer-hardening
review-audit-ca-update
terminal-fidelity
review-audit-ca-update-wip
mesh-integrate
review-mesh-agent-transport-515d3712
review-mesh-dataplane-feec1988
mesh-dataplane
signout
research-canvas-node
wip/review-renderer-cost
wip/review-terminal-fidelity
padlock-glyph
review-release-pipeline-2e95b689
phone-polish
sidebar-polish
inbox-generic
review-mesh-dataplane-378d4055
prod-batch
ui-inbox
ui-ca-unlock
ui-machine-sections
review-mesh-dataplane-a5f744fb
tls-session-prod
session-bounds-prod
fix-dead-session
session-bounds
tls-session
palette-polish
shortcuts-d222
research-appmeta
phone-gutter
ui-centre-button
wip/ui-centre-button
wip/tls-session
review-addhost-breakit
ui-platform
renderer-cost
remote-agents
mesh-api
ssh-bootstrap
prod-hotfix2
prod-fixes
review-remote-agents
review-mesh-dataplane
session-life
research-browser
review-mesh-api
research-capture
review-mesh-api-round3
review-mesh-api-round1
gate-stability
review-gate-stability
review-relay-direct
review-mesh-api-findings
proto-sessions
font-picker
proto-addhost
proto-windows
mesh-core
latency-gate
research-bsd
research-discovery
keytray-mods
mock-core
ui-tweaks
fix-motion-sel
fix-motion
integrate2
fix-robust
t-web
t-server
vt-ghostty
fix-snap-echo
t-web-auth
review-vt2
t-agent
lane-protocol
lane-shim
lane-auth
s1-base
s1-contracts
s1-workspace
No results found.
No labels
launch-qa
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set
Reference
kayg/infraternal#57
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Owner (2026-10-07): "keep our binary small; if builds take too long, set up a cache and other things to make Rust builds go brrr." There is no more RAM or compute until the Mac Studio arrives; the box has 8 cores and ~189 GB free disk.
Done (orchestrator, machine level): sccache and mold installed in the nix profile. Every infraternal Codex job now runs with
RUSTC_WRAPPER=sccache(cache~/.cache/sccache-infraternal, 40 GB cap), set in the job launcher only, so calternal builds on the shared box are untouched.To do (repo level, job queued for the next free slot):
cargo tree -d) to find the size drivers;scripts/verifythat fails on growth beyond an allowance;Starting measurements on branch build-speed, base
ac03b1913b. Issue has no existing comments or parent reference in its body.Measurement environment: Debian 13 KVM guest infraternal-dev, Intel i9-9900K, 8 CPUs, 31 GiB RAM; initial 1/5/15-minute load 7.10/5.60/7.06. RUSTC_WRAPPER=sccache v0.18.0 is set; cache is 5 GiB of 40 GiB with 12.57% prior hit rate. mold and cargo-bloat are installed. Current release profile already has LTO, one codegen unit, strip, opt-level 3 and panic=unwind; docs/RUST.md and Cargo.toml cite tokio task isolation as the reason to keep unwind (D5/D7).
Baseline timing started: clean cargo build --locked run 1/3 completed in 249.028 s inside systemd user scope at CPUWeight=10000. Load was 18.71/16.79/12.16 at start and 14.87/18.02/13.92 at finish on the 8-core i9-9900K; runs 2/3 and incremental runs continue.
Completed baseline clean cargo build timings (seconds, runs 1/2/3): 249.028 / 151.268 / 139.476, median 151.268. Incremental touch medians: server 2.353 s (2.353 / 2.607 / 2.346), protocol 2.375 s (2.370 / 2.387 / 2.375). All Cargo invocations were under CPUWeight=10000; the 8-core host load varied from 14.17 to 22.58 at run boundaries. SHA remains
ac03b1913b.Completed baseline cargo test --locked --no-run timings (seconds, runs 1/2/3): 153.214 / 173.071 / 190.448, median 173.071. Incremental touch medians: server 4.202 s (4.141 / 4.532 / 4.202), protocol 4.687 s (5.139 / 3.944 / 4.687). All Cargo invocations used CPUWeight=10000; host load at run boundaries ranged from 14.87 to 32.85. SHA remains
ac03b1913b.Static-build setup finding: the first direct x86_64 musl Cargo run stopped after 31.753 s because .cargo/musl-cc.sh requires the checksum-pinned Zig binary at CARGO_TARGET_DIR/auth-tools/zig/zig; PATH Zig alone is not used. The static gate prepares it with scripts/auth-toolchain. I am preparing the same toolchain under the approved scratch target and will repeat the timings.
Completed baseline x86_64 musl release timings (seconds, runs 1/2/3): clean 485.626 / 316.849 / 293.421, median 316.849; touch-server 68.863 / 82.421 / 72.731, median 72.731; touch-protocol 81.163 / 77.135 / 78.817, median 78.817. Binary is a stripped static PIE, 16,142,672 bytes. Cargo builds ran at CPUWeight=10000; host load at run boundaries ranged from 11.98 to 26.80. SHA remains
ac03b1913b. Bloat report is still building.Baseline cargo-bloat --release --crates, x86_64 musl: unstripped analysis binary was 49.0 MiB with 10.8 MiB .text. Top entries: openssl_sys 1.9 MiB, std 1.0 MiB, h2 503.6 KiB, infraternal_server 501.9 KiB, tokio 323.0 KiB, clap_builder 240.2 KiB, infraternal_shim 208.2 KiB, axum 186.9 KiB, hyper 159.7 KiB, webauthn_rs_core 155.6 KiB, serde_json 154.3 KiB, regex_syntax 146.6 KiB, sqlx_core 141.2 KiB, sqlx_sqlite 138.5 KiB, regex_automata 121.0 KiB. The shipped stripped binary measured 16,142,672 bytes. Full report is in the run output; SHA remains
ac03b1913b.Finding during aarch64 baseline run 1: build output recorded four sccache warnings that its server shut down unexpectedly and rustc fell back to local compilation. The run is continuing; I will include cache stats and timing when it completes.
Completed baseline aarch64 musl release timings (seconds, runs 1/2/3): clean 461.495 / 282.762 / 238.580, median 282.762; touch-server 65.646 / 67.610 / 66.060, median 66.060; touch-protocol 61.317 / 64.547 / 58.927, median 61.317. Binary is stripped static, 13,555,672 bytes. Final sccache stats: 80.62% overall hit rate, 9 GiB of 40 GiB; four server-shutdown fallback warnings occurred only in aarch64 clean run 1. cargo tree -d has 28 duplicate sections; only four crate names resolve multiple versions (base64, getrandom, hashbrown, syn), all through transitive dependency requirements, so no safe version change fits this task. SHA remains
ac03b1913b.Blocked on the required runtime benchmark runs: SSH to perf-test-69-63 fails with Host key verification failed, and ssh-keygen reports no trusted known_hosts entry. I will not bypass host-key verification. Needed from kayg: confirm the expected perf VM host key fingerprint or repair the trusted known_hosts entry, then I can run the existing benches under scripts/perf-run. Compilation measurements remain valid; local latency smoke and code review can continue.
Pre-change scripts/verify fast completed under CPUWeight=10000. Latency smoke output: METRIC name=network_rtt_selftest configured_rtt_ms=300 jitter_ms=30 loss=unsupported transport=tcp-stream n=3 p50_ms=294.96 p99_ms=295.46 result=PASS. Static sizes: x86_64 16142672 bytes; aarch64 13555672 bytes. Gate summary: fmt PASS; VT native fmt PASS; clippy PASS; test PASS; cargo-deny PASS; static builds PASS. Full gate log is at $HOME/.cache/codex-scratch/build-speed/logs/verify-before-fast.log. SHA remains
ac03b1913b.Post-mold build batch completed. cargo build --locked: clean median 242.983 s (250.571 / 158.894 / 242.983), server-touch 4.471 s (4.853 / 3.719 / 4.471), protocol-touch 5.586 s (5.624 / 5.300 / 5.586). Baselines were 151.268 s, 2.353 s, and 2.375 s. cargo test --locked --no-run: clean median 259.736 s (229.374 / 297.709 / 259.736), server-touch 10.361 s (10.361 / 10.675 / 9.183), protocol-touch 10.750 s (11.703 / 10.750 / 9.026); baselines were 173.071 s, 4.202 s, and 4.687 s. Post runs had one-minute load up to 37.27 versus baseline up to 32.85, so this does not establish a linker regression or speedup. I am verifying the selected linker path before deciding the commit.
Cargo --verbose confirmed native x86_64 GNU rustc invocations use .cargo/mold-cc.sh, and the package build completed successfully in 4m25s under the high-load guest. The wrapper invokes cc with -fuse-ld=mold when mold is installed and falls back to the system linker when absent; static musl targets retain .cargo/rust-lld.sh.
Native linker step committed as ea48642. Cargo verbose compilation confirmed .cargo/mold-cc.sh is selected for native x86_64 GNU; the musl builds keep rust-lld. Static sizes stayed at x86_64 16,142,672 bytes and aarch64 13,555,672 bytes. Before/after cargo build medians (seconds): clean 151.268/242.983, server touch 2.353/4.471, protocol touch 2.375/5.586. cargo test --no-run: clean 173.071/259.736, server touch 4.202/10.361, protocol touch 4.687/10.750. After runs had load up to 37 versus 33 before, so these do not establish a mold speedup. Latency smoke before/after p50/p99 was 294.96/295.46 ms and 297.77/323.81 ms, both PASS; pinned runtime benches remain blocked on the unverified perf VM host key.
scripts/verify fast Rust gate output:
+---------------------------+--------------+
| Rust gate | Result |
+---------------------------+--------------+
| fmt | PASS |
| VT native fmt | PASS |
| clippy | PASS |
| test | PASS |
| cargo-deny | PASS |
| static builds | PASS |
+---------------------------+--------------+
METRIC name=network_rtt_selftest configured_rtt_ms=300 jitter_ms=30 loss=unsupported transport=tcp-stream n=3 p50_ms=297.77 p99_ms=323.81 result=PASS
Size gate implementation is in progress. The budget helper now accepts the measured x86_64 and aarch64 static baselines with a 262,144-byte margin. A synthetic x86_64 static PIE at 16,404,817 bytes was rejected against the 16,404,816-byte maximum; both real baseline binaries remain available under the scratch target for the full gate.
Finished implementation at head 2de8da2aedc72aa96c565bf0aaf42dc9d9e09c97. The static size guard rejects an x86_64 artifact at 16,404,817 bytes and accepts both measured release artifacts; docs/PROCESS.md records the limits and build paths. No dependency versions, feature sets, or release profile settings changed: the four duplicate crate families are transitive, and runtime tuning awaits the pinned perf VM host key.
Final scripts/verify fast output, verbatim:
METRIC name=network_rtt_selftest configured_rtt_ms=300 jitter_ms=30 loss=unsupported transport=tcp-stream n=3 p50_ms=287.68 p99_ms=307.67 result=PASS
PT_INTERP: absent; size: 16142672 bytes (baseline 16142672 + allowance 262144 = max 16404816)
PT_INTERP: absent; size: 13555672 bytes (baseline 13555672 + allowance 262144 = max 13817816)
+---------------------------+--------------+
| Rust gate | Result |
+---------------------------+--------------+
| fmt | PASS |
| VT native fmt | PASS |
| clippy | PASS |
| test | PASS |
| cargo-deny | PASS |
| static builds | PASS |
+---------------------------+--------------+
stream differential: 134 streams, 11439 schedules, zero divergences
7 pass
0 fail
34390 expect() calls
Orchestrator measurement (2026-10-07 ~16:50): incremental
cargo build -p infraternalafter touching infraternal-server/src/lib.rs, alternating mold (ea48642) vs cc, 5 runs each under CPUWeight=10000, load 26-34: mold 27.97/30.93/29.99/27.49/29.03 s (median 29.03); cc 34.83/26.15/29.35/33.22/28.04 s (median 29.35). No measurable gain: compile time dominates link time on this host and load. ea48642 (mold) is not merged. The size-budget commit 2de8da2 is taken. The bigger lever for build time is fewer concurrent jobs and sccache hit rate; a later measurement on a quiet host may revisit mold.Closed by the orchestrator during the 2026-10-28 handover (#254), on the owner's request to close finished issues. Evidence: Size-budget commit 2de8da2 taken and measured-ratchet follow-ups landed (
4b2cd2ad4,e273fd309in dev); mold measured as no gain and deliberately not merged, sccache set up. Reopen if anything is still missing.kayg referenced this issue2026-10-28 17:53:54 +00:00