Transport and conversation update fixes
Doc status: history. Record of the first optimization batch of 2026-10-27. Checked 2026-11-10.
First batch of optimizations, on top of the base abacee6, on 2026-10-27. This base already uses the trusted React in the host ShadowRoot. The compositor and the durable persistence were not changed: the earlier data does not yet isolate their bottlenecks enough to change GPU synchronization or durability.
Changes
/api/state?view=hostomits the legacy HTML/JavaScript of the profile and the candidate bundle. Adapted CSS, revision, migration warning and recovery information remain available./api/statewithout this option keeps the full contract.- The host reports the revision of the content it keeps in memory. The SHA-256 revision covers IDs, messages and surfaces; only different content is sent again. Name, status, cost, approval, archiving and other metadata arrive in every query, without resending messages for a status change. Each client has its own cache. Reloading starts with the full history; an inconsistent response discards the cache and the host immediately tries a single full query before it shows an error.
- The projection for React contains the active conversation and the public status/connection fields. Navigation, overview and recovery keep the full history in the protected host. Inline documents and unchanged projections are reused.
- React compares only the content it actually draws, reuses references when possible and stops committing/reading layout on identical updates. Surfaces now have lookup by ID in a
Map. Initialization and real updates remain synchronous; the preview contract was not weakened. /state.jswas added both to the server and to the list of local resources the Electron host allows.
The hash still serializes the content in the core on every query, so that it also detects mutations on the same object. No reduction of this CPU cost was claimed. The first response and a real change in the history still send all the content. Polling every 600 ms, Smithay IPC, virtualization, a long first mount and full persistence remain opportunities for later.
Measured comparison
New before/after trial on the same trusted host, Chrome 156, same machine and fixture. Do not mix these numbers with the first baseline, which used the previous architecture. There were three repetitions per version, 100 measured updates per repetition after ten warm-up updates, 1 KB messages and 16 static surfaces. Cloning happens outside the timer, and the updates repeat identical content. This is the fixed case, not the cost of rendering a new conversation.
| Messages | Before, median of medians (ms) | After (ms) | p95 range before (ms) | p95 range after (ms) |
|---|---|---|---|---|
| 100 | 1.2 | 0.2 | 1.9 to 3.3 | 0.3 to 0.4 |
| 1,000 | 6.3 | 0.6 | 9.3 to 10.9 | 0.9 to 1.2 |
| 10,000 | 61.6 | 3.5 | 74.4 to 116.7 | 5.1 to 5.1 |
At the largest load, the median dropped by about 94%. This is the synchronous time of the React callback, not a global system gain, FPS or physical latency. The optimized host still avoids calling this callback when the projection does not change; the trial forces the call to exercise the protection of the renderer. Both versions finished the nine runs (three loads × three repetitions) through the UI. Loads were not interleaved between versions, and other applications stayed open; interpret small differences with caution.
The transport fixture, without models/account/WM and without surfaces, showed the following JSON body sizes:
| Messages | Old full response | First host response | Valid cache | Status change only |
|---|---|---|---|---|
| 100 | 343,886 B | 106,290 B | 208 B | 210 B |
| 1,000 | 1,298,786 B | 1,061,190 B | 208 B | 210 B |
| 10,000 | 10,856,786 B | 10,619,190 B | 208 B | 210 B |
These are fixture sizes, not the promised size of each real response. The production host adds the metadata of the services. Inactive conversations stay in the protected cache, but their inline documents are not rebuilt on every query.
Reproduce
In web-shell/, run node scripts/benchmark-performance.js --browser --comparison and open the loopback URL. The mode compares 100/1,000/10,000 messages with 16 surfaces, three repetitions. BENCHMARK_UI_DIR can point to a copy of the three files of the previous bundle; use the same harness and CSS for each version. The benchmark was adapted to the trusted UI in the ShadowRoot. It does not run the custom JavaScript of the profile. End the tab and the server when you finish; raw results stay out of Git.
Verification
The Luna high review found the route that was missing from the Electron allow list and the need to keep the public metadata; both were fixed. The cache fallback was also adjusted so that a transient warning does not stay stuck in the UI after recovery. npm ci, build, format:check, check and the 132 tests passed after the integration of main. The protocol received tests for mutation on the same object, independent cache, metadata without history, lost/inconsistent cache and compatibility of the old route. The visual harness confirmed no DOM mutations with clones/status, title update, iframe preservation, reordering, draft, isolation and scroll anchor.
On the HTTP host with a synthetic provider, the UI confirmed CSS editing through the journal, publishing of an opaque surface and restoration through recovery. The five messages and the surface stayed present. No real provider was called. Validation in Electron and the activation status are recorded separately after the coordinated operation.
Integration and activation
The implementation was published in 0d2136a, including the integration of the application-opening fix 1f80e99. After this integration, format:check, check and the 132 tests passed. The README now points to this specific comparison, without promising general performance.
The attempt to prepare/activate the existing session found coordination.lock held by another activation operation. The block was recorded in the shared log. This operation did not change the active checkout in the home directory, did not restart the host/core/compositor and did not update the profile. The functional proof of this change is in the browser with a synthetic core; activation and validation in Electron of the real session remain pending until coordination is released. No additional session was created.
Activation in the session in use, at 20:04 on 2026-10-27
After the lock was released, the active folder was synchronized by fast-forward to 553a4b3, which contains the performance fixes. The preparer finished build/check and the suite passed again, with 132 tests. An external user service held coordination.lock, the persistent plan, a copy of the previous artifacts and the rollback during the whole switch and verification.
Only the core received SIGTERM; its exit made the host end, and the existing supervisor restarted host/core. The GDM/TTY2 session stayed the same, and so did the PID/start of the Smithay compositor and of the supervisor. The hash comparison confirmed active conversation, conversations/messages/surfaces/sessions, model and frames; the hash of the UI manifest stayed the same. All the external windows observed before stayed present.
The new core became ready=true, busy=false and connected to Smithay. The optimized route answered without the legacy bundle and omitted the history when the revision was known: in this session, the bodies were 30,995 bytes on the initial query and 9,098 bytes with cache. These numbers include the real metadata of the services and are not a new CPU/FPS benchmark.
Proof in the browser connected to the real core: React mounted, six articles of the active conversation, protected field visible, send enabled, and typing/clearing of a draft without sending to the model. Electron proof: new host/core PIDs, served assets identical to the prepared ones, and shell surfaces confirmed by Smithay. The Wayland capture attempt with grim reported the absence of wlr-screencopy-unstable-v1; therefore there is no new visual proof of the Electron pixels on the monitor, nor of physical input. No provider was triggered in this validation.
The external guardian finished the activation, with continuity confirmed and the lock released. The earlier documentation of the block describes only the initial attempt. The next login also has a prepared build, but this operation did not perform a new login and did not restart the compositor.