Skip to content

perf(gateway): reuse prepared session list ordering facts - #179211

Merged
steipete merged 5 commits into
mainfrom
steipete/perf-micro-sessions-list-order-filter-20260919
Oct 21, 2026
Merged

steipete merged 5 commits into
mainfrom
steipete/perf-micro-sessions-list-order-filter-20260919

Conversation

@steipete

@steipete steipete commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Large sessions.list inventories repeatedly derive the same pin and activity facts while sorting and filtering, and sharing checks allocate two wrapper objects for each selected row.

User Impact

Session lists do less repeated work while preserving ordering, pagination, filters, aliases, and viewer-specific disclosure. No configuration, schema, or protocol changes are required.

Why This Change Was Made

The resident row projection already owns revision-bound selection facts, bounded top-k selection, and ordered views maintained on writes. This change adds readonly sort facts to that existing snapshot, carries it through selection, and compares it directly. It removes per-comparison tuple allocation and repeated pin/key normalization and activity calculation. Sharing authorization consumes the role and capability resolved in the same synchronous frame, avoiding per-row parameter spreads; live profile and source-authority checks remain intact.

The alias lookup fallback remains because it serves a real alias contract. Request-bound sharing/profile preparation also remains: it revalidates the requester and operator authority after asynchronous preparation and before synchronous consumption. This change does not introduce cross-request sharing-policy reuse or change the fallback profile/alias snapshot lifetime. There is no new ordering cache or cross-viewer authorization cache. The small runtime LOC increase is the readonly tuple/caller contract and four prepared scalar facts needed to preserve all three sorts and canonical pin eligibility across revision changes. Measurement includes that preparation cost.

Evidence

Current head 6b95f3571458cf858a8608264bd8dfc25519fac4 is rebased onto main 41b9f21f382010852c4d564c8b5902e7ff614707. The original four changes remain patch-equivalent; a reviewed harness-only follow-up permits sessions.list --capture-responses without allocation or CPU profiling. This avoids repeating the already-collected attribution profile when retrying a golden capture. Changed-file formatting and lint pass, and the follow-up review is scoped-clean. Current-head CI is fully green: run 39633857638 succeeded, and the exact-head rollup has all required checks passing. The refreshed Gateway acceptance measurements are complete and pass the declared v5 rule.

Historical exact-head PR CI run 39591225531 passed all 84 jobs on 566c11e8; its combined CI/security publisher run 39592258789 passed too. Those results are retained as prior-head evidence, not current-head success.

Measurement sources are pinned to baseline 41b9f21f382010852c4d564c8b5902e7ff614707 and candidate 6b95f3571458cf858a8608264bd8dfc25519fac4, with identical committed measurement support on both. Source hashes and dependency versions were verified; the changed acpx setup closure was rebuilt once and staged identically. Retained synthetic fixtures were brought to current config and credential readiness through the existing owners before capture. All four fixtures pass current config validation and credential readiness. Preparation stayed sequential and within the sandbox.

The strict golden comparison passed for all 20 representative list requests, with 100 RPCs completed on each revision. Both normalized response sets have SHA-256 59a854f2964ffcf84d4c3d2a4f6a22f92a093c0ad4cd6720b83c0f0e0a7fe4a4. Only the documented top-level ts, process-local rowsRevision, and exact fixture-root prefix are excluded; row clocks, IDs, order, filters, and payload fields remain unchanged. The successful baseline capture was retained across candidate setup recovery, and both result files identify the expected exact revisions. The candidate's single attribution CPU-profile pass is complete. The earlier baseline CPU profile remains historical attribution only and is not used for a current-head timing claim. Both concurrent landing pairs completed successfully on their first attempts.

Reset accounting is a precondition for interpreting promotion/GC: compare completed work and reset boundaries on both sides, discard mismatches unless a common aligned window can be recovered. For this sessions.list workload, sessionResets is omitted from JSON because it is a memory-soak-only field. Each side performs two setup reset RPCs (parent plus one child) before warmup; the measured list branch bypasses turn cohorts and performs zero measured resets. The result checker requires one measured sample and 100,000 completed list RPCs per side, 25,000 warmup operations, zero measured streams/turns, and no other measured RPC methods. Actual per-side counts are recorded below; both pairs passed this comparability check.

Acceptance: identical selected keys and normalized JSON payloads for 20 representative requests; exactly two concurrent combined allocation/GC/diagnostic A/B pairs with 16 CPUs per side, swapping interleaved CPU sets under the shared acquire-slot.sh admission helper (slot B: evens 64–94 / odds 65–95; slot A: evens 96–126 / odds 97–127). Record the actual slot per pair; a pair stays within one slot, while the two pairs may use different slots; target two minutes warmup and eight minutes measurement per side (equivalent operation count for sessions.list); gate on main-isolate trace promotion MB/RPC, total GC seconds/minute (minor + major), event-loop tail, and sessions.list RPC tail under the lead's final v5 rule (2026-10-21). For each gated metric, use the mean of the two paired percentage deltas, 100 × (B − A) / A. Stop if that mean is adverse by at least 20%, or the same metric is adverse by at least 10% in both pairs. p99 requires at least 1,000 samples per side; otherwise use p95 with at least 200 per side and report p99 as context. Insufficient samples or missing percentiles require more workload; they never pass by omission. Per-side percentile counts and major-GC collection counts appear below. Separate major GC with fewer than 50 collections is context; total GC carries the gate. CPU, p50, minor/major GC, and sampled allocation remain reported context. This list-only workload has no turn cohorts or other measured RPCs. Passing also requires lower mean allocation or promotion because the runtime change is not a net deletion. Heap samples include collected objects. The 100-RPC golden capture uses a deterministic list/filter/projection clock through a fixture-only loader at the existing read-clock sites, and supplies the candidate's single CPU-profile pass under its acquired guarded slot; baseline capture omits profiling because its one attribution pass is already retained as historical context. Lifecycle, worker, and authority clocks remain real. That profile is for attribution only; all timed landing runs use the ordinary uninstrumented entry point and real time. Preparation is sequential on CPUs 0–63; CPU and I/O weights are 10, memory is capped at 64 GiB, and the shared production guard may abort a pair. Owner microbenchmarks run interleaved A/B without the quiet lock.

The decision uses the mean of swapped pairs because of SMT placement bias. On this host logical CPU N and N+64 share a physical core; contiguous halves exposed each side to different sibling-block load. The lead’s 2026-10-21 SMT addendum reports sign reversals in four of five decided comparisons (lanes 1541, 1544, 1548, and 1535). Interleaved placement distributes sibling-block load, and the swapped-pair mean cancels residual placement bias. No landing pair in this lane ran before that addendum. The later either-slot addendum preserves interleaving and v5. The driver checks the shared deployment blackout schedule before queueing, after acquisition and after guard admission, reserving 10 minutes for the golden phase and 20 minutes for a pair. No runs are allowed during 2026-10-21 12:35–13:00Z or 13:55–14:55Z; the shared guard remains active throughout each run.

Completed Gateway measurements

Baseline 41b9f21f382010852c4d564c8b5902e7ff614707; candidate 6b95f3571458cf858a8608264bd8dfc25519fac4. Both pairs used slot B: pair 1 baseline even / candidate odd CPUs, pair 2 swapped. Both completed on their first attempts with guard success and all four processes exiting 0. The raw heap totals, main-isolate trace windows, and all 38 evidence-manifest file hashes were independently verified. Figures use decimal MB.

Metric Pair 1 baseline → candidate Pair 1 Δ Pair 2 baseline → candidate Pair 2 Δ Mean paired Δ
Sampled allocation, MB/RPC 2.536227 → 2.488045 -1.900% 2.539362 → 2.500140 -1.545% -1.722%
Promotion, MB/RPC (gated) 0.104812 → 0.108669 +3.680% 0.099008 → 0.115272 +16.427% +10.053%
Total GC, s/min (gated) 2.224027 → 2.245157 +0.950% 2.089322 → 2.209646 +5.759% +3.355%
Event-loop p99, ms (gated) 23.461887 → 23.887871 +1.816% 25.853951 → 26.198015 +1.331% +1.573%
sessions.list p99, ms (gated) 5.556926 → 5.639801 +1.491% 7.786597 → 8.005796 +2.815% +2.153%
sessions.list p50, ms 3.337132 → 3.388770 +1.547% 3.589973 → 3.605927 +0.444% +0.996%
Main-isolate CPU, ms/RPC 2.992995 → 3.060435 +2.253% 3.398239 → 3.432889 +1.020% +1.636%
Process CPU, ms/RPC 3.803039 → 3.914746 +2.937% 4.082809 → 4.337112 +6.229% +4.583%
Minor GC, s/min 1.995131 → 1.994360 -0.039% 1.950439 → 1.965889 +0.792% +0.377%
Major GC, s/min (context) 0.228896 → 0.250797 +9.568% 0.138882 → 0.243757 +75.514% +42.541%

Decision: passes v5 with a 1.722% mean sampled-allocation reduction. Promotion rises 10.053% on the paired mean (3.680% and 16.427% individually); this is below the 20% mean stop and is not at least 10% in both pairs. The other gated means are also below the declared thresholds. This is not a promotion, GC, CPU, or latency win. The allocation reduction supplies the required measured win for the +24-line runtime change; no net-simplification exception is used.

Work and validity Pair 1 baseline / candidate Pair 2 baseline / candidate
Completed list RPCs / RPC p99 samples 100000 / 100000 100000 / 100000
Event-loop p99 samples 16895 / 17057 18646 / 18700
Minor-GC collections 8943 / 8954 9061 / 8956
Major-GC collections 71 / 80 44 / 88
Warmup duration, s 82.937 / 82.202 83.132 / 82.637
Capture duration, s 352.925 / 358.478 399.075 / 400.351
Warmup list RPCs 25,000 / 25,000 25,000 / 25,000
Setup resets before warmup 2 / 2 2 / 2
Measured resets, turns, cohorts (each side) 0, 0, 0 0, 0, 0
Candidate start skew +8 ms −4 ms

All gated p99 values have at least 1,000 samples per side. Major GC alone is context: pair 2 baseline has only 44 major collections, and its large separate-major percentage change is not used as a stop under v5. Total GC remains gated. sessionResets and completedTurns are not emitted by this list-only scenario; zero measured resets/turns is source-derived and corroborated by the measured RPC map and zero stream/tool counts, rather than an invented JSON field. Both sides have one uninterrupted measured round. The operation-count equivalent ran for 352.925/358.478 seconds in pair 1 and 399.075/400.351 seconds in pair 2. Across these two windows, allocation median / window-p95 is 2.537795 / 2.539362 MB/RPC before and 2.494092 / 2.500140 after; with only two windows that window-p95 is the maximum, not a population-tail estimate. Client RPC p99 above is based on 100,000 samples per window.

Reproduction per side: node --import ./scripts/tsx.mjs scripts/perf/transcript-broadcast-measure.ts --entry src/entry.ts --state-dir <isolated-fixture> --port <owned-port> --mock-port <owned-mock-port> --clients 1 --runs 1 --operations 100000 --warmup-operations 25000 --rounds 1 --heap-sampling-interval 524288 --scenario sessions.list --row-mode sidebar --limit 200 --capture-responses --start-at <shared-epoch-ms> --revision <exact-sha> --allocations --trace-gc --diagnostics, within the declared guarded per-side resource envelope. No additional CPU profiles were run for these pairs.

The measured response size is 180,016 versus 180,021 bytes because the isolated candidate fixture-root spelling is five bytes longer. The fixed-clock 20-request golden removes only that exact top-level root prefix and the declared process-local envelope fields, and matches byte for byte.

Owner probe: 5,000 mixed rows, top 200, all three sorts; five interleaved A/B process pairs, five samples per process (25 per revision). The owner batches ran on CPUs 64–95 before the slot-B addendum; subsequent prep first used CPUs 32–63 under the earlier rule; all further prep uses CPUs 0–63 under the SMT rule. Values below are medians/p95 of the five batch medians; percentage changes are paired batch changes. Base a6f48263b7129212127a9876938c158208a25152.

Metric Before After Change
Warm allocation bytes/sort, median / p95 370,411 / 373,248 292,441 / 298,483 -21.60% paired median (-21.70% to -17.77%)
Warm thread CPU ms/sort, median / p95 0.61531 / 0.62220 0.30589 / 0.32658 -50.44% paired median (-50.87% to -46.03%)
Preparation allocation bytes/row, median / p95 1,168.61 / 1,179.84 1,259.63 / 1,267.54 +7.43% paired median (+7.08% to +8.44%)
Preparation CPU microseconds/row, median / p95 0.82106 / 0.91042 0.94792 / 1.03880 +15.45% paired median (+0.07% to +30.97%)
Comparisons across three sorts 36,544 36,544 unchanged
Pin eligibility / key normalization calls 2,890 / 2,890 0 / 0 removed from sorting
Activity derivations during sorting 28,330 0 prepared on revision

The selected 200 keys are byte-identical for every sort. Cold preparation does more work once per revision; the table reports that cost explicitly. A sum of separately measured preparation and one-sort batch medians is 4.72→5.04 ms and 6.22→6.59 MB for 5,000 rows (+6.81% paired CPU, +5.73% allocation). This is an estimate, not a directly measured cold RPC. Reuse across three sorts amortizes CPU but still adds about 2.86% cold allocation; Gateway promotion/GC gates remain mandatory. A count-only Gateway pass confirms warm cached lists perform zero comparisons on both revisions, with 1,807.35 versus 1,806 key-normalization calls/RPC. Warm Gateway results therefore measure the sharing/allocation portion, not the sorting speedup. All five interleaved owner process pairs selected byte-identical keys. The 20-request golden comparison and both concurrent Gateway pairs passed their declared acceptance checks.

Focused proof: 166 behavior/consumer tests passed across selection, sharing, filters, search, snooze, session-ID resolution, resident resolution, TUI consumers, and the shared Control UI fixture. They cover pin eligibility after child/root transitions, archive rematerialization, sentinel ties, fresh profile aliases, and mutation authority. The profiling helper passes all 9 tests; two import-closure guard files pass 22 tests. The export-name collision guard, changed-file oxfmt, and scoped lint passed. Independent reviews of the runtime change, consumer/type cutover, and measurement support returned scoped-clean. Pre-rebase PR CI passed behavior, UI/e2e, production types, lint, architecture, source contracts, and security-fast; the inherited tooling type failure from that head is documented below. No Testbox/Crabbox lease or broad local validation was used.

Reproduce with the committed scripts/perf/session-list-order-measure.ts (and separate --count-work pass) and scripts/perf/transcript-broadcast-measure.ts --scenario sessions.list --row-mode sidebar --limit 200 --allocations --capture-responses against identical synthetic team-shape fixtures. Golden normalization is restricted to top-level ts, the process-local random rowsRevision token, and the exact isolated fixture-root prefix in top-level path; row identities, clocks, ordering, filters, and payload fields remain unchanged.

The team-shape fixture disables plugins. This change measures the sessions.list row pipeline and makes no plugin invocation, hook, tool, API, or reload performance claim. The two concurrent Gateway pairs are complete. This is a modest sampled-allocation win with higher promotion and slightly higher GC/latency, within the explicitly declared v5 thresholds; no latency or promotion improvement is claimed.

Core runtime delta: +24 lines (112 added, 88 removed). The existing revision snapshot gains four readonly scalar facts, and readonly triples carry them through existing owners; no extra cache or invalidation system was introduced. The requested whole-change filter (git diff --stat origin/main...HEAD -- ':!*.test.ts' ':!*test-support*' ':!docs/*') totals +214 lines (333 added, 119 removed), including the committed owner benchmark, measurement support, its README, and the shared UI synthetic fixture. That proof machinery accounts for the additional growth outside the runtime cutover.

Measurement support: sessions.list response-only capture can omit profiling, while other RPC scenarios retain their profiling admission requirement. RPC warmup can use a smaller request count than the measured round, and the existing heap profiler accepts a sampling-interval override. This permits one uninterrupted eight-minute-class round at 512 KiB sampling; stopping multiple short samples would force GC between them and distort the promotion/GC gate. Existing defaults are unchanged. The focused profiling helper test file passes all 9 tests and the support change received an independent scoped-clean review.

CI history: the earlier head ef2cf502 had an inherited tooling-type error in ci-changed-node-test-plan.test.ts (identical diagnostics on its exact main base, runs 39563876151 and 39563487228), plus GitHub installation API rate limits in analysis/upload jobs. Those remain historical failed results; they are not labeled successful scans. The required integration of landed presentation changes prompted the rebase. Current-head CI run 39633857638 completed successfully; the live rollup for 6b95f3571458cf858a8608264bd8dfc25519fac4 has all required checks passing. No CI rerun or update-branch was used to chase green.

@clawsweeper

clawsweeper Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review October 21, 2026 07:18
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T16:34:11.205910Z 6b95f35 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime scripts Repository scripts size: M labels Oct 21, 2026
@steipete
steipete force-pushed the steipete/perf-micro-sessions-list-order-filter-20260919 branch from 9dced46 to aef5629 Compare October 21, 2026 07:30
@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Oct 21, 2026
@steipete
steipete force-pushed the steipete/perf-micro-sessions-list-order-filter-20260919 branch from aef5629 to ef2cf50 Compare October 21, 2026 07:41
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 21, 2026
@clawsweeper

clawsweeper Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR prepares session ordering facts once per row revision and removes temporary sharing-authorization wrappers.

Example: List 200 sessions from a 5,000-session inventory sorted by activity.

  • Before: Sorting repeatedly derives activity timestamps during comparisons.
  • After: Sorting consumes prepared timestamps and preserves the selected keys.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation is focused and source-consistent, with useful consumer coverage; the declared end-to-end performance acceptance gate is unfinished.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Large session inventories consume repeated Gateway CPU and allocation work while clients list sessions.
Reason: The maintainer-authored direction removes demonstrated repeated work using existing ownership and preserves the public behavior.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it is a distinct, maintainer-directed optimization, and source review found no actionable correctness defect.

Priority: P2
Reviewed head: ef2cf502b9489290b27539ba17d997692001f418

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Complete the already-declared real-Gateway A/B performance gate and 20-request payload-equivalence comparison, including preparation cost, promotion, GC, event-loop p99, and RPC p99.
Agent review details

How this fits together

The Gateway resident session projection receives committed session metadata and supplies ordered, filtered, viewer-authorized rows to session-list requests and related consumers.

flowchart LR
  A[Committed session metadata] --> B[Resident row projection]
  B --> C[Prepared selection facts]
  C --> D[Ordering and filters]
  E[Current viewer authority] --> F[Sharing policy]
  D --> F
  F --> G[Session list response]
Loading

Technical review

Best possible solution:

Keep revision-bound ordering facts in the existing row owner and retain the current synchronous sharing boundary.

Do we have a high-confidence way to reproduce the issue?

Current-main source directly shows repeated pin and activity derivation during sorting, and the supplied owner measurements quantify that work; no target code was executed during this read-only review.

Is this the best way to solve the issue?

The patch follows the smallest complete approach: prepare facts at the existing revision owner, carry them through consumers, and remove comparator and authorization-wrapper allocation without introducing another cache.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against e3fbdbc7e238.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned introduction: Reviewed the merge-base-to-head hunks; the unrelated update-reconciliation base changes are outside this PR's introduction. (ef2cf502b948)
  • Existing owner retains lifecycle: Four scalar ordering facts join the existing selection snapshot; lineage acquisition rebuilds that snapshot when entries change, and archive demotion retains it. (src/gateway/session-row-projection-record.ts:621, ef2cf502b948)
  • Current main still performs repeated derivation: Fetched main still computes pin eligibility and activity inside the comparator; this PR's prepared ordering facts are not implemented there. (src/gateway/session-list-order.ts:12, e3fbdbc7e238)
  • Sharing semantics preserved: All production callers supply the same resolved role and capability within the existing synchronous consumption boundary; profile freshness and source-authority checks remain in place. (src/gateway/session-sharing-policy.ts:464, ef2cf502b948)
  • Behavioral coverage: The added integration assertions cover retained pins becoming eligible and ineligible as a child becomes and ceases to be a sidebar root, checking both ordering and pinned filtering. (src/gateway/session-row-selection.test.ts:272, ef2cf502b948)
  • Declared performance gate remains pending: The fully read body reports owner-level sorting improvements and increased preparation cost, but explicitly leaves concurrent Gateway promotion, GC, latency, and the 20-request payload comparison pending. Captured body identity: 427a2ce13df271831360c3afb2829da304a2b3fdcb44c64cba5ad424ec4790c5. (ef2cf502b948)

Likely related people:

  • Peter Steinberger: Raw commit 21cd12c adds src/gateway/session-list-target.ts:9 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 21cd12ce96b0; files: src/gateway/session-list-target.ts)

PR surface

Source +24, Tests +25, Docs +24, Other +162. Total +235 across 19 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 12 112 88 +24
Tests 3 59 34 +25
Docs 1 25 1 +24
Config 0 0 0 0
Generated 0 0 0 0
Other 3 169 7 +162
Total 19 365 130 +235

Review metrics

Metric Value Why it matters
Core runtime versus behavioral tests Runtime +112/-88; tests +38/-12 lines, excluding benchmark and fixture support. The small runtime growth carries readonly facts through existing consumers; added assertions protect pin eligibility across row revisions.

Labels

Label changes:

  • add P2: A bounded performance improvement for large session inventories, with no established urgent user-facing regression.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: A bounded performance improvement for large session inventories, with no established urgent user-facing regression.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Publish the already-declared Gateway A/B and payload-equivalence results against the written acceptance rule.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 21, 2026, 6:01 AM ET / 10:01 UTC.

@steipete
steipete force-pushed the steipete/perf-micro-sessions-list-order-filter-20260919 branch from ef2cf50 to 566c11e Compare October 21, 2026 11:20
Keep sort and pin facts with the revision-bound row selection snapshot, compare those facts without temporary tuples, and pass prepared sharing authorization inputs directly. Preserve canonical aliases and viewer-specific disclosure. Add reproducible owner measurements and fixed-fixture list response capture.
@steipete
steipete force-pushed the steipete/perf-micro-sessions-list-order-filter-20260919 branch from 566c11e to 6b95f35 Compare October 21, 2026 16:18
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The declared proof is complete and the PR body is current. All 20 golden requests match after the documented envelope-only normalization. Both swapped concurrent pairs completed on their first attempts with 100,000 list RPCs per side, valid percentile counts, and verified main-isolate GC traces. The v5 decision passes: mean sampled allocation −1.722%; promotion +10.053%; total GC +3.355%; sessions.list p99 +2.153%; event-loop p99 +1.573%. The higher promotion and GC costs are stated explicitly. Exact-head CI and code review are clean.

@clawsweeper

clawsweeper Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete merged commit 2e36582 into main Oct 21, 2026
187 of 189 checks passed
@steipete
steipete deleted the steipete/perf-micro-sessions-list-order-filter-20260919 branch October 21, 2026 18:28
steipete added a commit that referenced this pull request Oct 22, 2026
Revert the ordering facts and sharing-wrapper changes from 2e36582 while preserving #179796 profile-reference handling and #180067 archive filtering. Retain the pin/sidebar-root behavior regression and reusable measurement support.

The owner comparator gain did not produce the required per-request production gain. Gateway pairs were flat (+10% promotion, +1.6% CPU/RPC), and the change added 24 runtime lines. Production profiles include other commits, so the next production profile must establish the effect of this revert.
steipete added a commit that referenced this pull request Oct 22, 2026
Revert 6cb819f (#180067) on top of the #179211 revert, preserving #179796 and later unrelated fixes. Restore archive-prefiltered ordering views and their callers.

Production r182 made filterSessionEntries the top OpenClaw self frame: 233 to 1751 samples, inclusive selectSessionEntries samples/rpm 8.27 to 25.2, and main-thread busy 37% to 57% despite lower traffic. All 108 golden cases remain identical to the historical owner path.
steipete added a commit that referenced this pull request Oct 22, 2026
…179211 and #180067 (#180166)

* revert(gateway): restore sessions.list ordering before #179211

Revert the ordering facts and sharing-wrapper changes from 2e36582 while preserving #179796 profile-reference handling and #180067 archive filtering. Retain the pin/sidebar-root behavior regression and reusable measurement support.

The owner comparator gain did not produce the required per-request production gain. Gateway pairs were flat (+10% promotion, +1.6% CPU/RPC), and the change added 24 runtime lines. Production profiles include other commits, so the next production profile must establish the effect of this revert.

* revert(gateway): restore archive-specific session list filtering

Revert 6cb819f (#180067) on top of the #179211 revert, preserving #179796 and later unrelated fixes. Restore archive-prefiltered ordering views and their callers.

Production r182 made filterSessionEntries the top OpenClaw self frame: 233 to 1751 samples, inclusive selectSessionEntries samples/rpm 8.27 to 25.2, and main-thread busy 37% to 57% despite lower traffic. All 108 golden cases remain identical to the historical owner path.

* chore(perf): remove retired session ordering benchmark registration
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 22, 2026
…79211)

* perf(gateway): reuse prepared session list ordering facts

Keep sort and pin facts with the revision-bound row selection snapshot, compare those facts without temporary tuples, and pass prepared sharing authorization inputs directly. Preserve canonical aliases and viewer-specific disclosure. Add reproducible owner measurements and fixed-fixture list response capture.

* test(ui): carry prepared session sort facts in the shared fixture

* refactor(gateway): narrow the session ordering type dependency

* perf(sessions): support uninterrupted RPC allocation samples

* fix(perf): allow unprofiled session list captures
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 22, 2026
…penclaw#179211 and openclaw#180067 (openclaw#180166)

* revert(gateway): restore sessions.list ordering before openclaw#179211

Revert the ordering facts and sharing-wrapper changes from e3c341e while preserving openclaw#179796 profile-reference handling and openclaw#180067 archive filtering. Retain the pin/sidebar-root behavior regression and reusable measurement support.

The owner comparator gain did not produce the required per-request production gain. Gateway pairs were flat (+10% promotion, +1.6% CPU/RPC), and the change added 24 runtime lines. Production profiles include other commits, so the next production profile must establish the effect of this revert.

* revert(gateway): restore archive-specific session list filtering

Revert f46e5d9 (openclaw#180067) on top of the openclaw#179211 revert, preserving openclaw#179796 and later unrelated fixes. Restore archive-prefiltered ordering views and their callers.

Production r182 made filterSessionEntries the top OpenClaw self frame: 233 to 1751 samples, inclusive selectSessionEntries samples/rpm 8.27 to 25.2, and main-thread busy 37% to 57% despite lower traffic. All 108 golden cases remain identical to the historical owner path.

* chore(perf): remove retired session ordering benchmark registration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant