Repository navigation
perf(chat): forecast incoming transcript rows for flings and wheel input - #196173
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs changes before merge. What this changesThis PR forecasts approaching transcript rows and paints them outside normal flow before active admission. Example: Fast scrolling through a completed 400-message transcript near scroll offset 59,693 px.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep this PR open: it addresses a demonstrated rendering defect, but the added regression coverage needs its required test-budget allocation. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe Control UI range owner consumes transcript rows, scroll samples, and virtualizer geometry; its presentation snapshot tells the Solid renderer which rows enter flow or paint in estimated slots. flowchart LR
A[Transcript rows] --> C[Initial range owner]
B[Reader movement] --> C
D[Virtualizer geometry] --> C
C --> E[Solid row renderer]
E --> F[Browser paint]
E --> G[Native measurement]
G --> D
Technical reviewBest possible solution: Keep forecasting in the existing range owner, preserve measured admission, and account for the retained regression coverage before landing. Do we have a high-confidence way to reproduce the issue? The unchanged main range policy and inspected baseline capture support the missing-mounted-coverage failure during fast scrolling; no target code was executed during this review. Is this the best way to solve the issue? The smallest coherent runtime repair uses the existing range and renderer owners to forecast bounded rows while retaining out-of-flow measurement; the added diagnostics directly investigate paint attribution. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 51833f164e45. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource +9, Tests +19, Other +952. Total +980 across 9 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 9, 2026, 1:08 PM ET / 18:08 UTC. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Inspected synthetic fast-scroll proofChromium, 1440×1000, 400-message wheel trajectory, pair 1. The first two frames are 97.5/98.9 ms after the first trusted input; they illustrate the full matrix result and are not identical viewport offsets. The black strips are the probe's snapshot marker and scroll ruler, outside the measured text crop. All content is synthetic. Before: After: Settled views after the same wheel scenario, showing the preserved UI styling (different native resting offsets): |
|
Matched synthetic before/after captures for the merged-head candidate ( These examples illustrate visible incoming content; the full census determines acceptance. Eleven uncalibrated records and their pairs were excluded only from this bounded media search. No observations were removed from the census. The downward-wheel follow-up remains under qualification. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
|
Coordinator note for the record: the final Chat growth of +794 B normalized gzip is coordinator-accepted in full. This covers the original +432 B plus the wheel-forecast work. It's justified by the measured blank-fraction reductions: 400 interpolation −21.3%, 2,000 interpolation −79.0%, 400 wheel −50.1% and 2,000 wheel −85.1%. Bounce stays at 0 px and frame p95 at 16.8 ms. The coordinator is an automated agent; this is not a maintainer approval. |
…put (openclaw#196173) * perf(ui): forecast paintable transcript rows ahead of flings * fix(ui): bound transcript forecasts to the next scroll step * test(ui): avoid offscreen text layout in paint probe * perf(ui): bound fast-scroll row preparation to the entering edge * perf(ui): forecast transcript rows beyond mounted overscan * test(ui): account for fast-scroll regression coverage * test(ui): align fast-scroll proof with one-row forecasting * perf(ui): prepare transcript rows for pending wheel input * perf(ui): retain wheel forecasts after native consumption * fix(ui): consume subpixel wheel forecast residue * perf(ui): account for qualified transcript forecast cost * perf(ui): skip unchanged consumed-wheel range publications * perf(ui): retain hidden layout boxes for parked transcript rows * perf(ui): set transcript forecast cap to qualified size * perf(ui): ratchet the qualified transcript forecast cap * fix(ui): reject stale zero-height transcript receipts * fix(ui): measure growing end destinations before renewal * test(ui): reconcile transcript allocation with current main * test(ui): match transcript allocation to merge input
PR openclaw#196173 already reconciled the inherited test-line debt. Keep openclaw#196496 allocation at its exact 210 regression lines instead of counting 70 inherited lines twice. Production and test LOC are unchanged.





Fast flings and wheel input can move the viewport beyond the transcript's admitted rows. Forecast the arriving viewport within the existing row allowance, and paint incoming rows at estimated slots while measurement catches up. Measured/admitted rows alone determine flow and anchoring, preserving #195097's bounce correction and #194751's anchoring.
The passive wheel path forecasts eligible pixel deltas without preventing native input or writing scroll offsets. Nested scrollers, modifiers and canceled input retain their behavior. The owner consumes native travel, ignores subpixel residue, retains the destination briefly after consumption, and expires the forecast after 100 ms. Retained rows keep hidden zero-height layout boxes so forecasting does not repeatedly rebuild their layout trees; only arriving/current viewport rows need live layout. Unchanged consumed-wheel publications are skipped.
The coupled header change avoids rebuilding unmeasured positions between individual row measurements while preserving key anchoring for prepend/trim. Non-overflowing Markdown tables avoid an unnecessary computed-style read. Both have regression coverage.
Merged-head qualification
Synthetic completed-run fixture, headless Chromium 156, 1440×1000. Frozen base
8bb413e6a3bbeeab7210587f2c16efd7476fa34e, runtime85c1a92bc8dce089537e1e9894168fcd471d28f2, qualification head2f58961bbc30c05438f274f3ccbb233e6a7e8c7b; qualification follow-up67b7d720030d30f528a5d5aaeb6d9290a3a9ff72adds the stale-zero guard; the final repair also gates an existing end journey on measurement, as described below. Includes #196181 and newer transcript End/measurement-owner changes. All 45 packaged inputs and 67 output plugin assets match between builds.One serial session per matrix, 20 rotated base/head/base triplets per cell: 240 uninstrumented timing observations and 240 separate paint observations. All completed, no dropped census records. The two baseline arms supply A/A. The requested acceptance band is improvement beyond A/A for interpolation, wheel not worse, exact-zero initial bounce, and frame p95/task CPU within 5%. The 400-wheel CPU cell received 20 further rotated triplets on the identical bundles; both sessions are retained, not selectively pooled.
Blank means exactly zero gray<180 ink within the fixed transcript crop/masks. Sparse and populated are pixel-density classes, not semantic partial/correct/stale labels. Counts describe sampled images, not every display refresh or duration spent blank. All four predeclared whole cells improve beyond A/A. Equal offered wheel commands do not guarantee equal actual offset paths or motion duration. The 2,000-wheel downward paired median improves by 0.306 percentage points against base and 0.954 against control, with wide scatter; no universal directional or blank-duration improvement is claimed. Earlier runs on older base/runtime pairs remain historical and are not pooled into this matrix.
400-wheel has a real small CPU cost, not noise. Combined raw task p95 is 1241.055 → 1285.245 ms (control 1238.553 ms). Against control, head paired median/p95 are +3.151%/+3.770%. Style CPU rises +6.162% median/+8.018% p95. Bootstrap p95 intervals reach above 5% (+1.501 to +6.451% against base; +2.032 to +6.193% against control), so uncertainty remains. The lead accepts the point estimates under the requested 5% whole-task band; this is not a strict zero-tail-regression result. The diagnostic's
raw_p95_worse_review_control_and_noiseremains valid and disclosed. First downward movement medians base/head/control are 3.0/18.75/3.05 ms (p95 21.3/22.1/21.5); input latency is not uniformly unchanged.Frame-p95 tails are 16.8 ms for every cell/arm. Rich initial bounce is exactly 0 px at 400 and 2,000 messages, with all 60 interpolation setters verified. Four rich-bounce scenarios, two ordinary-wheel scenarios and six Firefox correctness scenarios pass. The bounce result is the initial upward-wheel boundary, not zero row motion throughout every fling.
Head mount maxima: 400 interpolation 10, 2,000 interpolation 16, 400 wheel 12, 2,000 wheel 24. The moving cap stays
max(K, B + S), where B is the normal active/overscan/focus/end/preparation window; medium paired histories use K=6/S=4, other histories K=12/S=8. Forecast shares this allowance. These are DOM bounds, not proof of heap equivalence.Remaining blank attribution
D's 1,028 captures split into 532 model/DOM disagreements, 65 missing-probe cases, 311 backward-snapshot disagreements and 120 weak-geometry cases:
All 520 interpolation model/DOM disagreements have matching decoded/sample offsets and committed active indexes disjoint from the live range. That establishes an observed live-model/committed-row divergence, not synchronized physical-placement causality. Two inspected examples make that lag concrete: at 400 messages, live indexes 187–189 had committed active indexes 190–193 at offset 89,326 px; 10.9 ms later the same offset had active 187–190 and glyph coverage. At 2,000 messages, live 1893–1897 had active 1926–1931 at offset 454,334 px; 13.1 ms later the same offset had active 1893–1898 and glyph coverage. These are observed commit-lag examples, not a CSS-positioning defect. All 12 wheel model disagreements have mismatched offsets, so they cannot certify a placement defect. C=0: no nonzero compositor/raster floor is established. D is unresolved evidence, not browser behavior. The forecast and wheel changes improve the whole cells substantially; remaining model/DOM divergence still warrants owner-level investigation.
Reproduction and checks
Use
scripts/bench-control-ui-engines.ts --fresh-browser --engines chromium --pairs 20 --viewport desktopwith base/head/base frozen bundles and stepscompleted-direct-run-400-scroll,completed-direct-run-400-wheel,completed-direct-run-2000-scroll,completed-direct-run-2000-wheel. Run once with--transcript-timing-only, separately with--transcript-layout-audit --transcript-paint-probe; classify withscripts/control-ui-transcript-paint-classify.py. The opt-in ruler/DOM probe and classifier are included for reproducibility, not production diagnostics. CPU means renderer-main-thread TaskDuration, not total process CPU.pnpm tsgo:ui, final geometry-update browser tests (32/32), post-merge prepared-row tests (30/30), earlier unchanged initial-range/offset/header/Markdown tests, scoped lint/format andgit diff --checkpassed. Independent full P0–P2 review, cap review and stale-zero correction review are clean. Solid refactor counts are unchanged: effects/render effects/untrack/direct listeners/onCleanup/getOwner 0; queries 9, flush 1, runWithOwner 1, memos 13, listen 14.Strict asset check: zero violations or warnings. Production Knip exits 1 on both base and head with byte-identical output: three unrelated unlisted binaries (
taskkill.exeinbench-session-source-notifications.mjs;btrfsin the two worktree-provisioning scripts). No new ignores.WebKit's single allowed smoke timed out after ~45 s before page creation. The coordinator reports a logged-out WindowServer/console session; that host diagnosis is distinct from the observed launch timeout. Chromium and Firefox run successfully, as do another lane's timing matrices. No system settings changed. WebKit correctness/performance remains an explicit gap for a recovered host.
CI correction after qualification
The first final-head run,
42767245270, caught an obsolete no-layout-box expectation in the retained-row geometry test. Updating that expectation exposed a real stale measurement: a zero-height parked row now retains its width, so its delayed ResizeObserver receipt could erase the restored row’s height. The measurement owner now checks current height only when a presented row receives zero; nonzero receipts and parked rows keep their existing path. The existing regression is red before the repair (0 instead of 598 px) and green afterward, including fresh visible zero-height acceptance, resize and nested-scroll preservation (32/32).The 20-triplet timing/paint qualification above is pinned to runtime
85c1a92b; the final guard changes only stale-zero rejection, not forecasts, wheel input, mount allowances, layout styles or nonzero measurement. The final guard has focused browser/type/format proof, followed by 12/12 corrected-build Chromium/Firefox correctness scenarios. Chromium rich initial bounce remains exactly 0 px at both sizes, with all 60 interpolation setters verified. Firefox passes 6/6 behavior checks; its final rich bounce sample has no common row before interpolation, so no exact Firefox bounce value is claimed. No additional performance improvement is claimed from the guard. The build was produced from the guard-bearing working tree before commit67b7d720, so its metadata names parent2f58961; the later cap-only edit does not affect UI output. The final matched build has zero strict comparison violations/warnings.The same CI run also failed the mobile/tablet/desktop cases named “opens the active model’s thinking levels above the composer” in
chat-thinking-arguments.e2e.test.ts. CI tested merge3cd9921fwith main parent46589542, which includes #196123. All three exact failing names independently reproduce the same assertion on that main commit, using the native wrapper and headless Chromium. Fresh single-case tablet/desktop invocations were needed after Chromium crashed following the mobile assertion. The final PR run will be checked against those exact names; inherited failures are not being relabeled green.The next run,
42770004600, also found the retained-row unit fixture still reporting a positive current height while simulating a fresh zero; its DOM fixture now changes that height explicitly (7/7 pass). Its cached-history end case reported 144 px excess movement: a 240 px estimated append was followed by a 72 px reverse correction when the rows measured 168 px. That exact case passed on both main and the unmodified PR in a local replay, so it was not classified as inherited or as deterministically reproduced. Inspection found that renewal of an existing automatic end journey bypassedprepareEndreadiness. Renewal now uses the same native measurement gate as a new journey, retaining the command identity and smooth behavior. A deterministic regression fails before this correction and passes after; the existing renewal scenario passes with native row receipts, and the exact cached-history E2E case passes on the corrected production build. The broad local file attempt passed its first case then Chromium crashed before the next context; the remaining cases were setup failures, not assertions. CI remains responsible for the broad final-head proof.The final end-renewal build also passes all 12 fresh-browser correctness scenarios (six Chromium, six Firefox), with Chromium bounce still exactly 0 px at both sizes and all 60 interpolation setters verified. Firefox retains the same missing pre-interpolation common-row sample; its six behavioral checks pass, but no exact Firefox bounce value is claimed. The bundle was built after the owner edit and before its commit, so its metadata names
67b7d720; the source is committed in868595e39bc.The updated test-line grant covers 402 branch-added lines plus exactly 293 inherited lines already over the ceiling on current main
cdd7ee54ee8d; the owner's merged-tree allocation checker passes with zero slack. This does not raise any UI size cap. The end-renewal correction affects automatic following, not native wheel forecasting or the qualified timing path; no new performance improvement is claimed from it.Bytes and size trade
Matched normalized gzip: startup 91,884 → 91,884 B, one startup CSS request; New Session 803,789 → 803,789 B; Chat 1,299,935 → 1,300,729 B (+794 B). Actual served Chat gzip is 1,306,770 → 1,307,771 B (+1,001 B); metadata/hash variance makes normalized bytes the comparison metric. The earlier interpolation-only +432 B was coordinator-accepted, not Peter-approved; the complete wheel-capable result costs another 362 B including the stale-zero and end-renewal corrections. Round five authorizes moving only Chat's cap after qualification. It remains 1,300,795 B, 66 B above this final build (the preceding build measured 2 B larger). Its prior configured cap was below this matched baseline, so configured-cap movement includes that existing gap and must not be confused with the measured +794 B branch growth. No other cap moves.
The behavior-preserving shrink search stayed within the requested 30 minutes and found no safe material deletion. Physical LOC across changed files: production 3447 → 3660 (+213); tests 4262 → 4664 (+402); tooling 4963 → 6009 (+1046). Tooling growth is opt-in capture/classification; production growth is the bounded forecast/native-input path replacing the one-row preparation path.
Inspected synthetic before/after
Base left, candidate right. Top: 400-message upward interpolation, pair 0, overlapping decoded offset 76,971–76,973 px. Bottom: 2,000-message upward wheel, pair 14, 415,596–415,598 px. Both base examples are blank; both head examples contain sparse painted content. These are selected examples, not aggregate rates. All four full screenshots and the composite were inspected: synthetic-only, unchanged pixels. Black strips are probe rulers. Eight uncalibrated records/pairs were excluded only from bounded media selection, never from the census.
Final repair head
9125a4e21573b2d7723ada2dad431144d96b1c09(allocation-only follow-up to runtime868595e39bca8733d3451da9447f976cc05313b4). Broad exact-final-head checks run throughci:fullPR CI.The
868595eCI run (42772937895) passed all UI unit checks and all six cached-history snapshot cases. Its allocation guard found that inherited debt had shrunk by one line;dc4dfeupdates the grant from 473 to 472, and the exact merged-tree checker passes at 6,618,779 lines with zero slack. Three thinking-menu failures match the latest completed scheduled main run (42769178432) by exact test name and assertion. The Gateway retry-count failure and pinned-session renderer crash both passed once on exact main, then passed in the next full PR run; neither was waived as inherited.The next run (
42775381614) built the PR against newer main261b24e6bc8; main’s inherited test-line deficit had grown from 70 to 293. The final allocation-only correction uses 695 (402 branch lines plus 293 inherited), verified againstcdd7ee54ee8dat 6,619,391 total and ceiling, zero slack. It changes no UI behavior or asset bytes.42775381614completed with only the ratchet mismatch above and the three exact thinking-menu failures. All other UI E2E, unit, browser-extension, and real-Gateway jobs passed. The allocation-only final head is now9125a4e21573b2d7723ada2dad431144d96b1c09; its exact-head CI remains the landing authority.Final exact-head CI
42777869413completed on9125a4e21573b2d7723ada2dad431144d96b1c09, testing merge1bb1cf60a53440bf31e7f6f522be8ed1b33305bewith main parentcdd7ee54ee8d. The ratchet passes at 6,619,391 total/ceiling. Every other selected job passes except the three mobile/tablet/desktop thinking-menu assertions: expected/think ultra, received/think. The latest completed scheduled main run42775238950at261b24e6bc8fails the same three exact names and assertions. Native inherited-failure replacement recovery is used solely for these and their aggregate gate; no other failure is waived.