Skip to content

fix(ui): keep compact menus free of a scrollbar gutter - #529

Merged
nixuuu merged 1 commit into
devfrom
fix/menu-scroll-gutter
Nov 10, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/menu-scroll-gutter

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 10, 2026

Copy link
Copy Markdown
Member

Compact menus inherited a reserved scrollbar gutter from #512. With classic scrollbars, even a short context menu left an empty strip beside its highlighted rows and separators. Remove that reservation from the shared popover and picker lists, including project filters and inline mention suggestions. Long picker lists still scroll within their own viewport.

Sidebar, settings, timeline and large-panel gutters remain in place. The motion.css gutter belongs to the growing composer input and remains unchanged. Update the UI scale rule to distinguish large panels from compact overlays and require any future overlay gutter to live on an inner list with balanced insets.

Fixes: #512

Validation:

  • bun install, bun run gen:check, bun run typecheck, bun run lint, bun run format:check and the web build passed.
  • Inspected actual components in a temporary gallery using Chromium with classic scrollbars and native Android overlay-scrollbar emulation: context/action menus and submenus, popovers, hover cards, tooltips, model/effort/branch/project/worker pickers, project filters, SearchPicker, VirtualCombobox, Select and autocomplete. Covered short/long lists, light/dark themes and desktop/phone widths, including scrolled lists and long labels.
  • The short context menu now has 4 px row insets and 12 px separator insets on both sides; its empty 15 px gutter is gone. The large-panel fixture keeps its 15 px gutter with classic scrollbars and uses 0 px in overlay emulation.
  • UI copy is unchanged; the copy audit does not apply. No UI tests added or E2E suite run. Browser fixtures, diagnostics and before/after screenshots stay outside the repository.

Remove gutter reservation from compact popovers and picker lists so short menus keep equal row and separator insets with classic scrollbars. Keep stable gutters on large growing panels and document the overlay exception.

Fixes: #512
@nixuuu
nixuuu merged commit fe71726 into dev Nov 10, 2026
9 checks passed
@nixuuu
nixuuu deleted the fix/menu-scroll-gutter branch November 10, 2026 21:25
nixuuu added a commit that referenced this pull request Nov 11, 2026
Streaming command output replaced a growing text node on every reveal,
and the feed repeated key/group projection and map allocation across
unchanged history. The snapshot reducer and ThreadState also scanned the
entire item history for every delta. This change preserves completed
output chunks and independent Markdown blocks, reuses timeline rows,
contains layout at the existing scroll viewport, and indexes own items
by id.

**Draft: performance acceptance not achieved.** On latest-dev baseline
`ae09805d2e8c7d218850d07e5d5ae44ccde238bc` versus rebased head
`85c3e4a811ae7ad385268ab0d057e894996da516`, two final-series pairs
qualified under the agreed host gates. Their after runs measured
**34.51% / 34.18% main-thread busy**, above the <25% target; dropped
deadlines were **0.57% / 0.53%** and p95 rAF **16.70 / 16.70 ms**. Pair
3 was rejected for a 1796 KiB/s swap-in spike. There are only **2 of the
required 3 qualified pairs**. The maintainer designated this the last
series in the window, so no further recordings or readiness command were
run. CI is green. Earlier rejected attempts remain separately documented
below and are not pooled into the result.

### Changes

- Render plain output in immutable groups of 32 complete lines; only the
trailing group changes. Preserve every byte, whitespace, selection,
horizontal scrolling and the existing height cap. Avoid splitting the
full output when no tail view is requested.
- Re-lex the last Markdown block while independent preceding blocks
retain token identity. Use the full lexer for edits, option changes, CR
normalization and reference syntax; late reference definitions refresh
earlier inline tokens. Existing line-reveal timing, motion tokens and
reduced-motion behavior remain intact.
- Retain feed rows without allocating a full key map per delta.
Reconcile by key when positions change; skip unchanged immutable rows
when projecting virtual-feed keys/groups.
- Replace the per-event item `findIndex` in the shared snapshot reducer
and web `ThreadState` with id → position maps. Replacements reuse the
map; appends add one position. Snapshots, history prepends and projected
removals/reorders rebuild it. Inherited items never occupy an own-item
key. The reducer transfers cache ownership to the next immutable array
so reducing an older snapshot branch rebuilds independently; indexes are
weakly held and are not serialized. Array copying and downstream feed
projections remain linear.
- Apply size/layout/style/paint containment to the already constrained,
clipped scroll viewport. Keep ResizeObserver, follow-end and
reader-intent handling.
- Document the rules and measurement requirements in Polish. No sidebar
or global-store changes in this PR; the branch now includes merged #526
through `dev`. The shared reducer is also consumed by mobile. No mobile
source, native configuration or dependency changes; its JS lookup
receives the same optimization. No native runtime profiling or new
fingerprint generation was performed in this static-only follow-up.

### Trace findings and acceptance plan

Read the full #522 analysis and reused its fixture, `measure.mjs` and
`analyse.py`. The exploratory traces still identify growing output
layout and whole-document paint as costs; key/group projection and feed
reconciliation also appear in CPU samples. All three exploratory timing
runs encountered host contention and were discarded for acceptance.
Their durations/load differ, so they are not a before/after performance
claim.

The prepared runner performs **before-1 → after-1 → before-2 → after-2 →
before-3 → after-3**, each 120 seconds. The current series is pinned to
baseline `ae09805d2e8c7d218850d07e5d5ae44ccde238bc` (latest `dev`,
including the GitHub stack and #529–#533) and rebased head
`85c3e4a811ae7ad385268ab0d057e894996da516`. Both halves retain all
merged changes; the baseline patch reverses only this PR's streaming web
changes and shared snapshot reducer. Earlier rejected sessions used
older bases and heads; do not pool their results with this series. The
runner retains the same #522 1,000-turn fixture, four running subagents,
four expanded commands, seeded 500-thread sidebar plus six running rows,
and 40 ms agent/tool tick. Chromium inherits `taskset` affinity to two
complete physical cores (four logical CPUs); both versions use the same
affinity. Affinity does not reserve cores against other processes, so a
quiet window and host-log review are still required.

Each recording logs loadavg and vmstat before and continuously during
the run, along with the measured interval timestamps and CPU affinity. A
separate Svelte `$effect` counter pass follows the timing runs. The
first session's counter incorrectly included mount/remount initial
effects and was inconclusive. The corrected counter excludes the first
effect per instance and **passed in the latest session**. Traces were
analysed serially after the browser and private stack stopped. The
application head is unchanged. The runner now checks preflight and each
pair automatically, archives rejected attempts, and stops after three
failed preflight probes or three contaminated attempts for a pair; it
never marks a PR ready automatically.

The acceptance table below contains **only qualified pairs P1 and P2**,
in that order. It is a partial two-pair result, not a completed
three-pair acceptance. Pair 3 is excluded. Values separated by `/` are
individual runs, not an aggregate.

| Metric | Before: P1 / P2 | After: P1 / P2 |
| --- | --- | --- |
| Main-thread busy % | 44.05 / 42.99 | **34.51 / 34.18 — target missed**
|
| Long tasks/min (>50 ms) | 1.00 / 1.00 | 1.00 / 1.00 |
| Dropped compositor deadlines % | 1.56 / 1.51 | 0.57 / 0.53 |
| p95 rAF frame gap, ms | 16.70 / 16.70 | 16.70 / 16.70 |
| Style, ms/s | 36.11 / 35.68 | 34.45 / 34.48 |
| Layout, ms/s | 59.62 / 59.77 | 15.64 / 15.53 |
| Paint, ms/s | 48.41 / 48.02 | 38.82 / 38.62 |
| Delivered ticks per ~120 s | 2992 / 2992 | 2993 / 2994 |
| Used heap P1: first → last; peak MB | 164.0 → 202.7; 234.2 | 164.3 →
183.9; 207.2 |
| Used heap P2: first → last; peak MB | 164.5 → 222.4; 244.2 | 165.8 →
222.7; 222.7 |
| Follow-end gap, px | 0 / 0 | 0 / 0 |
| Reader-anchor drift, px | 0 / 0 | 0 / 0 |

Busy is the union of renderer RunTask intervals between trace marks.
Dropped frames use compositor deadline markers; rAF does not measure
presentation. p95 is reported at the harness's 0.1 ms precision. Memory
is sampled used JS heap, not retained heap after GC. Both qualified
pairs show less layout and busy time with the full streaming patch; this
comparison does not isolate the item index from the output/feed changes.
The busy target fails in both qualified after runs, irrespective of the
missing third pair.

### Final series and host qualification — 2026-11-11 UTC

The maintainer confirmed no other delegate was active. After the initial
strict-zero-swap preflight and three earlier pair attempts were
rejected, the host gates were explicitly revised **before** this final
series:

- reject swap-out ≥128 KiB/s in any sample, or cumulative swap-out ≥1024
KiB across both measured halves of a pair;
- reject swap-in ≥1024 KiB/s, or ≥128 KiB/s for three consecutive
seconds;
- retain the CPU gates: loadavg ≥6, or ≥12 runnable with ≤15% idle;
- preserve smaller swap reads/writes in the report. The host has about 6
GB of old swapped pages; small reads are not treated as CPU contention.

No prior rejected pair was reclassified. Samples are aligned to the
logged measurement start/end timestamps, excluding vmstat's since-boot
row. Totals below sum the 1-second rate samples and are approximate KiB
transferred. Values are **before / after** within each pair.

| Final pair | Max loadavg | Max runnable | Min idle % | Swap-in total
KiB | Swap-in max KiB/s | Swap-out total KiB | Swap-out max KiB/s | Pair
swap-out KiB | Qualification |
| --- | --- | --- | --- | --- | --- | --- | --- | ---: | --- |
| P1 | 1.64 / 1.60 | 7 / 6 | 75 / 82 | 184 / 848 | 24 / 436 | 0 / 0 | 0
/ 0 | 0 | Qualified |
| P2 | 1.85 / 1.90 | 8 / 8 | 72 / 77 | 112 / 124 | 16 / 32 | 0 / 0 | 0 /
0 | 0 | Qualified |
| P3 | 1.90 / 1.65 | 6 / 8 | 76 / 75 | 48 / 1936 | 8 / **1796** | 0 / 0
| 0 / 0 | 0 | **Rejected** |

P3's `after-3` sample at **01:41:22 UTC** recorded swap-in **1796
KiB/s**, 2 runnable and 84% idle, within its 01:40:48.287–01:42:48.601
interval. CPU stayed quiet, but the explicitly agreed swap-in threshold
was exceeded, so **both halves are excluded**. P1's isolated 436 KiB/s
read did not sustain the 128 KiB/s threshold for three seconds and
therefore qualified. No final-series pair was retried.

**P3 diagnostic results only — rejected:**

| Run | Busy % | Long/min | Dropped % | p95 ms | Style ms/s | Layout
ms/s | Paint ms/s | Ticks | Heap first → last / peak MB | End gap /
drift px |
| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | --- |
--- |
| before-3 | 42.79 | 1.00 | 1.25 | 16.70 | 34.65 | 59.44 | 47.60 | 2992
| 160.0 → 180.3 / 228.6 | 0 / 0 |
| after-3 | 35.43 | 1.00 | 0.60 | 16.70 | 34.46 | 15.67 | 38.65 | 2994 |
156.5 → 195.4 / 226.7 | 0 / 0 |

**Next bottleneck from qualified `after-2`:** renderer frame tasks
occupy about **280.5 ms/s**. Relevant native stages include **Layerize
50.38 ms/s**, **Paint 38.62 ms/s** (union, excluding nested double
counting), visibility intersection processing about **38.6 ms/s**, and
style **34.48 ms/s**. Layout is **15.53 ms/s**; script-forced layout is
only **31 events / 7.187 ms total** over 120.010 s. Frame tasks include
these stages, so the figures must not be summed with their parent. Paint
remains rooted at `#document` with a viewport clip; that does not prove
every pixel was repainted or identify the subtree that initiated
invalidation. The next investigation is frame-wide paint/layer and
visibility work, rather than another synchronous follow-end read
optimization. The remaining long tasks include Svelte flushes reaching
sidebar rows; no sidebar code was changed here.

**Behavioral evidence:** all six final recordings observed 0 px end gap
and 0 px reader-anchor drift. The separate corrected Svelte probe passed
over 200 ticks: zero updates to its 22 mounted completed-history row
props, excluding first effects/remounts; each active command row updated
50 times, the active agent row 199 times and the live fold once. This
verifies that probe's row-prop isolation, not every application effect.

Final artifacts:
`/var/tmp/canopy-perf-streaming/acceptance-20261111T012656Z/`, including
all six traces/reports, per-pair `host-review.json` snapshots,
loadavg/vmstat logs, swap samples, frame-stage breakdown, metrics,
anchors and row counters. The private stack stopped; the worktree is
clean. No benchmark artifacts were committed.

### Attempts immediately before the final series — rejected, never
reclassified

`acceptance-20261111T010231Z` stopped before any recording: the original
zero-swap gate rejected three preflight probes with mostly 4–16 KiB/s
swap-in and 98–99% idle. The maintainer then permitted small swap-in
while retaining rejection of **any swap-out**. Under that interim
policy, `acceptance-20261111T010651Z` made three attempts at pair 1; all
were rejected and remain excluded under their original policy:

| Attempt | Swap-in total KiB before / after | Swap-in max KiB/s before
/ after | Swap-out total KiB before / after | Swap-out max KiB/s before
/ after | Rejection |
| --- | --- | --- | --- | --- | --- |
| 1 | 180 / 532 | 24 / 248 | 252 / 8 | 252 / 4 | 252 KiB/s at 01:07:27;
after also had two 4 KiB/s writes |
| 2 | 7228 / 120 | 696 / 24 | 0 / 12 | 0 / 12 | 12 KiB/s at 01:16:08,
90% idle |
| 3 | 164 / 208 | 44 / 32 | 0 / 4 | 0 / 4 | 4 KiB/s at 01:21:38, 91%
idle |

| Rejected attempt/run | Busy % | Long/min | Dropped % | p95 ms | Style
ms/s | Layout ms/s | Paint ms/s | Ticks | Heap first → last / peak MB |
| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | --- |
| A1 before | 44.11 | 1.00 | 1.24 | 16.70 | 34.90 | 58.54 | 47.36 | 2991
| 163.9 → 201.5 / 235.9 |
| A1 after | 34.93 | 1.00 | 0.78 | 16.70 | 35.88 | 15.81 | 39.96 | 2992
| 165.3 → 189.8 / 204.3 |
| A2 before | 42.98 | 1.00 | 1.00 | 16.70 | 34.15 | 58.52 | 47.13 | 2992
| 157.6 → 227.1 / 239.9 |
| A2 after | 36.17 | 1.00 | 0.69 | 16.80 | 35.56 | 15.76 | 39.40 | 2992
| 162.9 → 190.1 / 203.6 |
| A3 before | 42.77 | 1.00 | 0.90 | 16.70 | 34.75 | 58.19 | 47.52 | 2992
| 159.8 → 232.0 / 243.7 |
| A3 after | 37.39 | 1.00 | 0.62 | 16.70 | 37.38 | 17.03 | 42.56 | 2992
| 157.9 → 195.0 / 208.2 |

All six interim recordings had 0 px end gap/drift. Their raw evidence is
in the three `rejected-pair-1-attempt-*` directories; these are not
extra qualified pairs for the final series.

### Validation

**Latest-dev rebase:** rebased without conflicts onto
`ae09805d2e8c7d218850d07e5d5ae44ccde238bc`, keeping both sets of
changes. `bun install --frozen-lockfile`, `bun run typecheck`, `bun run
lint`, and `bun run format:check` passed on head
`85c3e4a811ae7ad385268ab0d057e894996da516`. The initial typecheck
exposed a missing local `graphql` dependency from the merged GitHub
stack; installing the existing lockfile resolved it. The branch was
force-pushed with an explicit lease on its previous remote head.
Fixture/counter/runtime patch applicability passed. No product-code
changes were needed for the rebase.

**Current remote CI on `85c3e4a811ae7ad385268ab0d057e894996da516`: all
checks passed**, including static checks, all four test shards,
web/Linux build, commitlint and the aggregate check. The previous head's
shard-4 failure in linked-computer integration tests is historical; no
CI rerun or unrelated code fix was made in this measurement session.

**Index follow-up, rebased onto #526:** `bun run typecheck`, `bun run
lint`, and `bun run format:check` passed on head
`767411e526eb15bdbf469a9138bbcd4d3454fd14`. Rebase completed without
conflicts and preserves both documentation sections. Added five pure
reducer regressions covering a 7,000-item stream, inherited-id
collisions, append/branch isolation, interleaved threads, replacement
snapshots, projected reconnect removals and replayed/unknown events.
These cases were typechecked but **not run locally**, per the latest
instruction to perform static checks only. No build, browser, benchmark
or test suite was run in this follow-up. Scratch runner syntax and
fixture/counter/runtime patch applicability passed; the runner itself
was not started.

**Earlier validation, before this follow-up:**

- `bun install`, `bun run typecheck`, `bun run lint`, `bun run
format:check`, `bun run --filter @canopy/web build` — passed.
- `bun test apps/web/test/streaming-render.test.ts
apps/web/test/feed-prefix.test.ts apps/web/test/feed-rows.test.ts
apps/web/test/work-fold-state.test.ts` — **16 passed, 921 assertions**.
These are pure-data tests, including full-lexer equivalence at every
streamed character boundary, not UI tests.
- Exploratory Chromium checks: **0 px follow-end gap and 0 px
reader-anchor drift**. Short/long output, blank lines, tabs and Unicode
had identical text, selection, height and scroll extents to the original
single-text-node surface. Light/dark screenshots at 1512 px and 390 px
were inspected. These establish observed behavior, not acceptance
performance.
- No UI/E2E suite, full integration/temp suite, native runtime profiling
or fingerprint generation was run. Mobile code and native configuration
are untouched. Svelte per-row update verification is inconclusive and
the accepted paired table remains pending a future quiet-window run.

Copy audit (§8): no visible strings, labels, controls or terminology
changed. Output is complete; existing truncation and accessible labels
are retained. No traces, diagnostic scripts, screenshots or run
artifacts are included in the commit.

### Paint/Layerize follow-up from the saved #526 trace

Reused the existing analyser on `p2-anim-after-trace.json` from the
parallel sidebar work; no browser or new recording was started. Over its
120.027 s interval, the trace records Paint 3,689.574 ms (30.74 ms/s),
Layerize 6,640.412 ms (55.32 ms/s), PrePaint 3,662.294 ms and Commit
2,068.552 ms. Paint remains rooted at `#document` with the viewport
clip. The four expanded output `<pre>` spans each account for
approximately 284–289 ms across the whole recording, nested within root
paint; they must not be added to it. Script-forced layouts total only
9.979 ms across 28 events.

This narrows the next investigation to document paint traversal/layer
preparation and visibility processing after combining #524 and #526. It
does not attribute the root cost to the streaming output subtree or
establish an improvement for the new indexes. #526 already changes
offscreen sidebar rendering on this same document. No additional
CSS/layer promotion was introduced from these unpaired observations: the
combined head still needs the controlled series, including anchor
checks, before attributing residual costs or claiming any performance
target.

### Latest indexed-head attempts — REJECTED, not acceptance evidence

Session `acceptance-20261110T223545Z`, recorded 2026-11-10 UTC
(23:36–23:51 CET). Baseline is merged #526 at
`6b1531fe36d7250d29ed79d7d6dab4e4124a70d9`; after is
`767411e526eb15bdbf469a9138bbcd4d3454fd14`. Same #522 fixture,
120-second trace windows, CPUs `4,5,10,11`. **Every row below is
rejected. No accepted aggregate can be calculated.**

| Rejected run | Busy % | Long tasks/min | Dropped deadlines % | p95 rAF
ms | Style ms/s | Layout ms/s | Paint ms/s | Ticks | Used heap first →
last / peak MB | End gap / reader drift px |
| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | --- |
--- |
| before-1 | 51.71 | 17.50 | 7.55 | 16.80 | 42.05 | 69.02 | 54.12 | 2933
| 159.8 → 165.6 / 228.7 | 0 / 0 |
| after-1 | 37.41 | 1.00 | 0.96 | 16.70 | 38.16 | 16.40 | 41.89 | 2992 |
154.8 → 177.7 / 225.3 | 0 / 0 |
| before-2 | 43.21 | 1.00 | 1.19 | 16.80 | 35.75 | 60.06 | 48.33 | 2992
| 162.3 → 185.5 / 220.4 | 0 / 0 |
| after-2 | 36.26 | 2.00 | 1.06 | 16.70 | 36.73 | 16.47 | 41.28 | 2989 |
155.3 → 205.8 / 219.7 | 0 / 0 |
| before-3 | 48.89 | 20.50 | 6.90 | 16.80 | 39.48 | 71.86 | 53.79 | 2920
| 161.1 → 200.4 / 240.9 | 0 / 0 |
| after-3 | 37.02 | 1.00 | 0.86 | 16.70 | 36.62 | 16.08 | 40.49 | 2993 |
155.1 → 221.4 / 221.4 | 0 / 0 |

**Reasons for rejecting whole pairs (UTC):**

1. Pair 1: `before-1` at 22:36:27–30 had 22–26 runnable, 1% idle and
swap-out up to **124,576 KiB/s**; at 22:37:39–41 it had 19–29 runnable
and 0–1% idle. These are inside 22:36:05.849–22:38:06.164.
2. Pair 2: `after-2` at **22:46:11** had 23 runnable, 1% idle and 736
KiB/s swap-out. The recording ended at **22:46:11.643**, so the spike is
inside the measured interval.
3. Pair 3: `before-3` at 22:48:04–06 had 26–27 runnable and 1% idle; at
22:48:29–33 it had 12–30 runnable, 0–12% idle and swap-in up to 3620
KiB/s. These are inside 22:46:58.759–22:48:59.057.

The gates were declared before inspecting results: reject for measured
swap I/O, loadavg ≥ 6, or ≥12 runnable with ≤15% idle. Host samples were
aligned to each measurement's timestamps; vmstat's initial since-boot
average was excluded. **All three pairs independently fail the CPU
criterion**, regardless of the smaller swap reads elsewhere. Low pre-run
loadavg did not describe the full recording.

The retry `acceptance-20261110T225704Z` made **no recordings**: all
three preflight probes at 22:57:13–22 failed for swap I/O. The last
probe also reached 25 runnable/11% idle and 17 runnable/2% idle. The
runner restored the worktree and stopped its private stack. The
maintainer then explicitly stopped further attempts until no other agent
is active.

**Directional interpretation only:** all three `after` runs show lower
busy and layout time than their respective `before` runs. This is
consistent with a cheaper streaming path, but contention was asymmetric
and the patch toggles all of #524, not only the new indexes. Therefore
it does **not** isolate the effect of id → position lookup or support a
controlled speedup claim. The attribution helper also produced an
invalid negative sampled total for the reducer in `after-2`; that
estimate is discarded, not reported as a saving. A separate index-only
comparison would be needed to quantify that component. The displayed
busy figures remain above 25%; dropped deadlines straddle 1%. Rounded
p95 is 16.70 ms in the after runs. None of these observations
constitutes target acceptance.

**Next bottleneck:** native paint/layer preparation remains a
substantial cost. In `after-3`, over 120.023 s, Paint is **4859.792 ms
(40.49 ms/s)**, Layerize **6293.423 ms (52.43 ms/s)**, style **4394.809
ms (36.62 ms/s)** and layout **1930.511 ms (16.08 ms/s)**. Paint remains
rooted at `#document`; nested node timings do not identify the
initiating subtree and must not be added to the root. Forced layouts
total only **31 events / 6.278 ms**, so synchronous follow-end reads are
not the main recorded cost. Feed assembly and ThreadState's derived
projections remain visible in samples; the index does not make the whole
delta handler O(1).

**Behavioral observations:** all six recordings have 0 px follow-end gap
and 0 px reader-anchor drift. The corrected 200-tick Svelte row probe
passed: no updates to its 22 mounted completed-history row props after
excluding initial effects/remounts. Active command rows each updated 50
times; the agent row updated 199 times and the live fold once. This
checks row-prop update isolation in that probe, not every effect in the
application or performance acceptance.

Artifacts remain outside the repo under
`/var/tmp/canopy-perf-streaming/acceptance-20261110T223545Z/` and
`/var/tmp/canopy-perf-streaming/acceptance-20261110T225704Z/`, including
raw traces, reports, attribution output, `host-review.json`,
`rejections.md`, host logs and counter results. No product code or
commits changed; no test suite or build was run in this recording
session. **PR stays draft; the acceptance table above stays pending.**

### Earlier attempts on the pre-index head — REJECTED, not acceptance
evidence

All rows below are **unaccepted measurements**. Do not average them into
an acceptance result or interpret the before/after differences as a
controlled performance improvement. Both halves of a pair are excluded
when either half is contaminated. Affinity was identical for every run:
CPUs `4,5,10,11` (two complete physical cores). Each measured interval
was approximately 120 seconds; the requested tick rate was 25/s.

| Rejected run | Busy % | Long tasks/min | Dropped deadlines % | p95 rAF
ms | Style ms/s | Layout ms/s | Paint ms/s | Delivered ticks | Sampled
used heap: first → last / peak MB | End gap / reader drift px |
| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | --- |
--- |
| before-1 | 69.61 | 3.00 | 9.32 | 16.80 | 55.68 | 97.26 | 166.37 | 2985
| 160.1 → 186.9 / 218.4 | 0 / 0 |
| after-1 | 59.53 | 8.50 | 9.59 | 16.80 | 53.81 | 23.45 | 164.99 | 2962
| 161.0 → 188.0 / 238.6 | 0 / 0 |
| before-2 | 61.03 | 5.00 | 8.22 | 16.80 | 45.25 | 88.75 | 150.19 | 2972
| 163.6 → 233.1 / 233.1 | 0 / 0 |
| after-2 | 50.31 | 3.00 | 4.24 | 16.80 | 42.50 | 19.36 | 141.30 | 2991
| 160.6 → 172.3 / 205.7 | 0 / 0 |
| before-3 | 66.58 | 3.00 | 10.01 | 16.80 | 51.93 | 95.06 | 162.09 |
2977 | 155.3 → 204.3 / 217.8 | 0 / 0 |
| after-3 | 52.60 | 3.00 | 4.71 | 16.80 | 49.89 | 20.54 | 150.26 | 2996
| 163.7 → 226.8 / 226.8 | 0 / 0 |

**Rejection evidence (UTC; vmstat logs use CET, UTC+1):**

1. Pair 1: `after-1` overlapped 12–21 runnable processes and only 8–11%
idle CPU at 18:32:41–18:32:43; swap-in reached 1152 KiB/s. Its recording
interval was 18:31:30–18:33:30.
2. Pair 2: `before-2` hit 25 runnable processes and 1% idle CPU at
18:35:44, despite 96–98% idle before starting. `after-2` independently
hit 27 runnable processes and 1% idle at 18:38:44. Both spikes fall
inside the respective 18:34:15–18:36:16 and 18:36:59–18:38:59 intervals.
3. Pair 3: `after-3` recorded 30,972 and 68,284 KiB/s swap-out at
18:43:11 and 18:43:12, inside its 18:42:28–18:44:29 interval. The
substantial shared-memory pressure invalidates the pair even though CPU
was not saturated then.

The maintainer explicitly stopped further attempts while the other
agents remain active. None of these pairs was retried in this session.
The next invocation must repeat all three pairs; the old traces and
rejection log remain preserved.

**Trace findings, diagnostic only:**

- In the three `after` traces, paint costs **141.30–164.99 ms/s**,
Layerize **73.56–89.20 ms/s**, style **42.50–53.81 ms/s**, and layout
**19.36–23.45 ms/s**. The largest paint spans are rooted at `#document`
with the viewport clip. This identifies paint traversal and layer
preparation as the next bottleneck to isolate; the trace does not
establish which subtree initiated every invalidation, nor prove that
every viewport pixel was repainted.
- For example, `after-3` records **18,033.54 ms Paint**, **9,643.04 ms
Layerize**, **5,987.21 ms style**, and **2,465.22 ms layout** over
120.02 seconds. Per-node paint spans nest inside root spans and must not
be added together. Script-forced layout is only **35 events / 11.97 ms
total** in this trace, so follow-end's synchronous reads are not the
dominant recorded cost.
- Script samples still include feed assembly and ThreadState/snapshot
traversal: `after-3` has approximately **760.5 ms** self samples in
`FeedBuilder.build`, **745.9 ms** in a ThreadState callback, and **640.5
ms** in the snapshot reducer callback. These are sampled estimates, not
additive inclusive timings. They are smaller than the native paint/layer
stages and do not establish an O(1) delta path.
- All six runs observed **0 px follow-end gap and 0 px reader-anchor
drift**. The separate 200-tick counter probe saw 200 active-agent row
effects and 50 effects for each command. Three completed-history keys
each had one effect; initial mounts/remounts were not distinguished by
the original probe, so unchanged-row update isolation remains
unverified.

The observed `after` numbers are above the requested thresholds, but
host contamination prevents an accepted pass/fail performance
conclusion. **The PR remains draft.** No readiness command was run.

Artifacts stay outside the repository in
`/var/tmp/canopy-perf-streaming/acceptance-20261110T182822Z/`: six
traces/reports, per-run metrics/anchor/inventory/layers, timestamped
host logs, `rejections.md`, `row-counters.json`, and `comparison.md`.
The ready-to-invoke scratch runner remains `bash
/var/tmp/canopy-perf-streaming/run-pairs.sh`; it checks the expected
head, restores temporary patches, and never marks the PR ready
automatically. No diagnostic artifacts were committed.

Related: #522

Related: #526
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