Skip to content

Reuse immutable alarm encoding across heartbeat recipients - #4886

Merged
trissim merged 2 commits into
mainfrom
perf/immutable-alarm-encoding
Nov 18, 2026
Merged

trissim merged 2 commits into
mainfrom
perf/immutable-alarm-encoding

Conversation

@trissim

@trissim trissim commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

132 checks passed, exit 0 in the completed four-file run. The installed occurrence/source/pickle controls passed. Installed schema constraints match: all 70 raw differences are enum ordering only; the allowed members and every other property agree. The worktree same-import-context schema comparison is byte-for-byte equal. Original timeout and queued-without-collection receipts remain.

Repair

The frozen Ping owner inherits native TaggedRecordMember encoding and caches its declaration-derived record per occurrence. Every public encoding returns an independent deep copy. Equal Ping keys may carry different text, source subjects or clocks, so equality never keys the cache. Replacing a frozen alarm creates a new occurrence and encoding. Process packets serialize only original dataclass fields; the derived JSON cache never crosses their pipes.

The original wire and file formats, schemas and decoder stay intact. No new daemon, throttle, store format or lost source evidence. Existing guarded imports remain outside this narrow hot-path repair; no whole-module slop cleanup is claimed.

Measurement

A synthetic18-publication encoding phase using one actual captured HUD with609 alarms, identical clocks and equal payloads: median2.906 seconds before /1.166 seconds after, three equally warm alternated pairs. This measures encoding only, not total CPU or publication/fsync. The exact original native structural encoder supplies the before side.

Live read-only diagnosis found18 frame files totaling25.9MB. A nonblocking8-second connector sample (52 samples,24 errors) ranked TeamFrame.write_all as28 samples. Neither is an overall CPU improvement claim.

Authored declaration-selected NRA plans applied the changes. Independent controls, schemas and phase timing supply the behavior evidence; empty guards are not a semantic proof.

Evidence: /home/ts/.cache/agent-scratch/codex-latency/team-frame-serialization/

Fixes P264. The overall CPU complaint remains open beyond this serialization saving.

Installed result

Merged as 4d0206b and installed at runtime lock45f12a4a0a51b053; no pending carries or store changes. Fresh native reply20771-9a7529ed91dd confirms live delivery. Exact-head independent acceptance is recorded at c7e781f, with one occurrence control passed exit0. Core readback marks P264 done.

A post-install65-second counter sample still showed connector55.6% and worker43.4% of one core, overlapping startup and the wider test run. A later unmatched10-second sample showed connector1.7% and worker11.2%; busiest open Toad remained30.5%. These are current-workload observations, not a matched overall CPU improvement claim. CPU investigation continues.

@trissim
trissim marked this pull request as ready for review November 18, 2026 07:45
@trissim
trissim merged commit 4d0206b into main Nov 18, 2026
2 of 3 checks passed
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