You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "Astro-Han (via GitHub)" <gi...@apache.org> on 2026/08/30 06:29:42 UTC

[PR] fix(runtime-host): preserve complete transcript edge turns [maka]

Astro-Han opened a new pull request, #4244:
URL: https://github.com/apache/maka/pull/4244

   ## Summary
   
   Follow-up to #4206. The Runtime Host pager seeded a 256-message range with `maxMessages - 1`, assuming the far-edge Turn needed at most one extra message. A valid multi-message Turn could therefore make the Host reject the transcript or expose an incomplete edge.
   
   This removes that heuristic. The existing Host pager now groups the selected records by complete Turn, keeps the largest complete prefix within the formal message/byte bounds, and signs the next cursor at the first excluded Turn. The same owner covers older/newer and owner/shared projection; the Renderer protocol and state model do not change.
   
   ## Performance
   
   A is merged `main` `c33617fd8`; B is this PR `52487f2ea`. Both used production builds, Electron/Chromium 43.4.1, the same 120-Turn fixture and read-only CDP spec, 1000×700, one worker, and the same Apple M5 Pro. Runs were interleaved `A1-B1, B2-A2, A3-B3, B4-A4, A5-B5, B6-A6, A7-B7`.
   
   | Pair | Task A / B (ms) | RecalcStyle A / B (ms) | Frame P95 A / B (ms) |
   |---:|---:|---:|---:|
   | 1 | 104.5 / 100.4 | 10.3 / 10.3 | 8.5 / 8.9 |
   | 2 | 103.3 / 96.3 | 10.5 / 10.3 | 8.9 / 8.9 |
   | 3 | 270.4 / 258.2 | 23.3 / 23.1 | 9.7 / 9.9 |
   | 4 | 221.4 / 248.9 | 18.8 / 20.7 | 10.1 / 9.7 |
   | 5 | 255.4 / 249.5 | 23.8 / 22.5 | 9.4 / 10.0 |
   | 6 | 234.0 / 184.4 | 23.4 / 15.5 | 10.1 / 8.5 |
   | 7 | 194.2 / 271.2 | 17.4 / 22.7 | 10.0 / 9.9 |
   
   | Metric | A median / P95 / P99 | B median / P95 / P99 | A / B IQR | Paired median | Wins |
   |---|---|---|---|---:|---:|
   | Task | 221.4 / 265.9 / 269.5 | 248.9 / 267.3 / 270.4 | 95.4 / 111.4 | -3.93% | 5/7 |
   | RecalcStyle | 18.8 / 23.7 / 23.8 | 20.7 / 23.0 / 23.1 | 9.4 / 9.7 | -0.83% | 5/7 |
   
   The warm samples are bimodal, so the paired result is the no-regression comparison. Heap paired median was -0.01%; DOM and Nodes were unchanged; frame P95/P99 were unchanged; session switch was +2.65%. All 14 runs reported LoAF support, zero frames over 12.5 ms, and zero LoAF over 50 ms.
   
   The exact-head 640-Turn stress completed two full 126-page sweeps to Turn 1. Mounted Turns stayed at 10; Nodes stayed within 2,815–3,021; full-sweep forced-GC heap endpoint/projected growth was 2.64% / 5.14% and 2.23% / 4.98%, below the predeclared 10% resource gate.
   
   ## Entropy ledger
   
   | Scoped concept | Before | After |
   |---|---:|---:|
   | Transcript authorities | 1 Host | 1 Host |
   | Runtime/protocol state owners | 1 / 1 | 1 / 1 |
   | Transcript representations | 1 | 1 |
   | Schedulers/observers added | 0 | 0 |
   | Edge-capacity mechanisms | seed reservation + lookahead | complete-Turn prefix |
   
   The same diff deletes the `maxMessages - 1` reservation and its separate lookahead helper. The only retained mechanism is the complete-Turn selection inside the existing Host pager; it is required to enforce the already-public message/byte bounds without partial Turns.
   
   ## Verification
   
   - RED on merged `main`: a three-message far-edge Turn throws `Session transcript Turn range exceeds its capacity limit`
   - Runtime Host pager/client focused tests: 40/40
   - Desktop transcript range-store tests: 29/29
   - prompt-rail, transcript-scroll, and onboarding E2E: 21/21
   - Full `npm run build` and `npm run typecheck`
   - Biome on changed files and `git diff --check`
   - Exact-head 640-Turn two-sweep stress and 7-pair interleaved production CDP A/B
   - Three independent adversarial reviewers: GO, no P0–P2 findings
   
   ## AI use
   
   Select exactly one:
   
   - [ ] No generative tool made a substantive contribution
   - [x] Generative tooling made a substantive contribution
   
   Tool(s) and scope: Codex diagnosed the edge contract, implemented the Host-owned fix, authored tests, ran the benchmark, and performed delegated review. The material commit includes a `Generated-by: Codex` trailer.
   
   ## Checklist
   
   - [x] Tests cover the change and fail without it
   - [x] Lint, format, typecheck and the affected suites pass locally
   
   Does this PR entail a change in behavior?
   
   - [x] Yes — described under Summary above
   - [ ] No
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] fix(runtime-host): preserve complete transcript edge turns [maka]

Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han merged PR #4244:
URL: https://github.com/apache/maka/pull/4244


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org