Skip to content

perf(sessions): avoid retaining raw snapshot columns in resident actors - #183203

Merged
steipete merged 1 commit into
mainfrom
steipete/perf-resident-raw-columns-20261025
Oct 25, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/perf-resident-raw-columns-20261025

Conversation

@steipete

@steipete steipete commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Resident session actors retain serialized snapshot JSON beside the same decoded snapshots, consuming the existing residency budget twice. Cold hydration and committed replacement now omit those three raw columns. Initialization consumes the scan's already decoded lookup entries; exact node columns and entry_json remain for no-op SQL suppression.

User Impact

At a fixed four-actor working set, resident graph memory falls 42.3%. Under pressure, 95 actors fit instead of 52 (+82.7%) under the unchanged 8 MiB serialized-byte cap. The saturated resident graph rises 4.15%; this is not a lower maximum-memory claim. The 140-actor circular scan exceeds both capacities and shows no rehydration reduction.

There are no schema, durable-data, permission, or configuration changes. Production delta is +20 lines: the decoded scan contract and a type that disallows retained raw snapshot columns account for the growth. No new cache or state owner is added.

Measurement Decision

Memory/capacity improvement is established; timing qualification is inconclusive. Keep this PR open for the lead to decide and merge. All declared measurements are complete. Short and longer serial candidate runs had adverse patch tails, but identical-source controls also crossed timing gates. The final synchronized comparison uses the same frozen-source loader on both sides, separate synthetic databases, four A/A controls and two counterbalanced A/B pairs. All sides completed 7,000 reads and 1,400 patches; timed overlap was at least 99.3%.

The final candidate pairs cross no eligible adverse gate: CPU/op +0.34%, total GC +0.00119 ms/op (+0.65%), read p99 −3.04%, patch p95 −2.44%, patch p99 −2.91%. However, an identical-source control had max pause 41.218 → 97.147 ms, exceeding the 82.436 ms safeguard. Under the predeclared stop rule the timing protocol remains INCONCLUSIVE, not a candidate pass or a proven regression. No additional experiments, sample exclusions, pause trimming, or CI reruns were used to seek a passing result.

Allocation is neutral (−0.59% at four actors, +0.86% at 140). Separate traced promotion changes are +4.74% and −37.26%, respectively. This is synthetic owner evidence on Node 26.12.1/macOS, not whole-Gateway, model-turn, Linux, or production-wide qualification. Full before/after tables, sample counts, per-kind GC and both maxima follow below.

Evidence

  • session-actor-entry-residency.test.ts: 17 passed.
  • session-actor-initialization.test.ts: 3 passed.
  • session-entry-patch.test.ts: 25 passed.
  • eager-import-closure.test.ts and pr-wrapper-source-closure.test.ts: 22 passed.
  • Targeted pnpm tsgo:core, changed-file lint/format, export-name collision guard, and git diff --check: passed.
  • Exact-head CI run 40158510039: passed; 73 successful checks, 52 skipped, one neutral, no failures. No reruns or unrelated-failure exception.

The new capacity regression passes on the candidate and fails with baseline cold hydration and, independently, baseline committed replacement. It records versions immediately after each snapshot-changing patch so later reads cannot hide eviction. All three snapshots survive lookup-sibling initialization, warm metadata patches with zero snapshot-table writes, rollback, and database reopen. Sources were restored byte-for-byte after negative controls. No Testbox/Crabbox lease was used; focused local checks and PR CI provide validation.

Independent subagent review (autoreview route unavailable), GitHub Codex review, and ClawSweeper found no remaining actionable correctness/security findings on 1c82f49ff3df98d313f6a6d0f2071883b368e4b4. The autoreview provider mismatch was handled through the explicitly authorized fallback without changing operator configuration. ClawSweeper's earlier incomplete-measurement observation is addressed by the completed evidence below; the inconclusive timing limitation remains explicit.

Deployment Signal and Open Risks

At comparable working sets, look for smaller resident actor graphs and less hydration/query churn where the larger resident capacity avoids eviction. Watch patch tails and total GC. Do not expect a guaranteed lower saturated worker-heap ceiling or infer a production-wide percentage reduction. The fixture does not establish production working-set distribution, Linux scheduling, native SQLite memory effects, or whole-Gateway/model-turn performance.

Completed measurement report and reproduction

Resident session snapshot columns: synthetic owner evidence

Candidate: 1c82f49ff3df98d313f6a6d0f2071883b368e4b4. Baseline: ee9b334166b4124292846ed10bdba79824e446a3. The five affected source modules were frozen from each revision; every other runtime module and dependency came from the same candidate checkout. frozen-source-hashes.json records their SHA256 hashes. No source changed during measurement.

Runtime: Node 26.12.1 on macOS. This is a source-mode synthetic SQLite session-actor worker exercised through the real durable actor factory, not a whole-Gateway, model-turn, bundled-runtime or production-wide performance claim. The fixture has 5,000 stored sessions; 140 contain ~68 KiB skills prompts and 40 transcript messages. The two measured active sets contain 4 and 140 actors. Warm-up performs one read and two patches (on, then off) per actor, ending with needsSystemIntro=false. Each process starts a fresh worker. Host scheduling load was recorded, and no run was excluded for load, maintenance or pauses.

Memory and cache capacity

The four-actor set has five alternating baseline/candidate forced-GC worker snapshots per side. The pressured set has six per side: five original pairs plus the single predeclared mixed-sign timing follow-up. The resident-map count is obtained from its actual state wrappers, and bytes are its exclusive V8 dominator graph; no session-key-reference count is substituted for Map.size. Snapshots are taken after timing and analyzed with the existing dominator analyzer; task-owned snapshot files were deleted only after their numeric result was saved.

Metric Four actors (5 pairs) 140 actors (6 pairs)
Residents 4 → 4 (+0.00%) 52 → 95 (+82.69%)
Resident map graph, B 682539.2 → 393856.0 (-42.30%) 8734417.3 → 9096766.7 (+4.15%)
Post-GC worker heapUsed, B (context) 165381124.8 → 164762059.2 (-0.37%) 174025742.7 → 174425292.0 (+0.23%)
Timed rehydrations per side 0 → 0 1680 → 1680 (+0.00%)

The fixed working set retains 42.3% fewer resident graph bytes. At pressure, capacity increases 52 → 95 actors (+82.7%), while the resident graph increases about 4.15%. This is not a lower saturated memory ceiling: the existing cap measures serialized bytes, and smaller residents fill that unchanged cap with more actors. Both capacities are below the 140-actor circular scan, so every timed operation still rehydrates; this workload does not demonstrate fewer rehydrations. Whole-worker heap includes substantial source/module/tooling overhead and is context, not the attributed saving.

Original untraced owner timing

Each short side performs 1,400 reads plus 280 patches (1,680 operations). Read p95/p99 each have n=1,400; patch p95 has n=280 and patch p99 is context-only. CPU is the SQLite worker's thread CPU. Full per-pair tail counts, per-kind GC totals/p95/p99, both maxima and loop sample counts are preserved in timing-tables.md.

Paired-mean metric Four actors (5 pairs) 140 actors (6 pairs)
Worker CPU, ms/op 1.070 → 1.075 (+0.54%) 3.334 → 3.326 (-0.24%)
Total GC, ms/op 0.063 → 0.059 (-5.64%) 0.193 → 0.186 (-3.75%)
Total GC, ms/min 564.419 → 566.342 (+0.34%) 1348.942 → 1239.359 (-8.12%)
Read p95, ms 13.463 → 12.907 (-4.13%) 18.442 → 18.734 (+1.58%)
Read p99, ms 22.714 → 23.684 (+4.27%) 33.514 → 30.264 (-9.70%)
Patch p95, ms 29.771 → 22.499 (-24.42%) 23.764 → 30.128 (+26.78%)
Loop p99, ms 21.430 → 20.252 (-5.50%) 27.737 → 28.568 (+3.00%)

The four-actor GC/min increase is only +1.923 ms/min, below the +50 ms/min materiality threshold; GC/op fell. No GC pauses were trimmed. The pressure patch p95 gate remained adverse after the predeclared sixth pair: +6.364 ms/+26.78%, with mixed signs. This was not waived or called passing.

Four same-workload baseline/baseline short controls then produced a false-positive read p99 gate on identical source: all-four mean +23.93%; first-two block +62.26%, both pairs ≥10% adverse (n=1,400 per side). Short timing is therefore INCONCLUSIVE, not proof that the candidate passed or regressed. aa-tables.md includes all control deltas, counts and maxima; short-aa-detail-tables.md preserves each GC kind and percentile.

Allocation and promotion (separate instrumentation)

Allocation sampling uses a 32,768-byte interval with objects collected by both minor and major GC included. There are two counterbalanced paired passes per working set, each with the same 1,680 operations. Their timings are context only; no timing gate uses allocation-profiled or traced runs.

Working set Sampled allocated B/op, baseline → candidate Delta Sampling points by pair, baseline → candidate
4 251998.45 → 250501.77 -0.59% [10007, 9918] → [9949, 9793]
140 791057.98 → 797876.09 +0.86% [34382, 33725] → [34319, 34470]

Allocation is neutral; no allocation improvement is claimed. Promotion is measured in separate --trace-gc passes, using Node 26's marker-bounded JSON GC records matched to the identified PID, isolate address and worker thread. In all eight traced runs, matched trace collection counts exactly equal GCProfiler Scavenge plus MarkSweepCompact counts. Forced collections are outside the marked timed windows; no normalization by major-cycle count is used.

Working set Promoted B/op, baseline → candidate Delta Timed trace collections by pair, baseline → candidate
4 13388.27 → 14022.48 +4.74% [63, 63] → [61, 62]
140 183613.36 → 115199.88 -37.26% [152, 154] → [145, 146]

Small-set promotion rose 4.74% (below the declared gate); pressured promotion fell 37.26% on the paired mean, with reductions in both counterbalanced comparisons. Traced timing includes a 170.043 ms candidate pause; v5.4 requires untraced timing/max-pause gates, so that traced pause is reported as context and never substituted for the untraced maxima.

Longer serial controls and candidate pairs

The declared refinement used 140 actors, 7,000 reads plus 1,400 patches (8,400 operations) per side. Read tails have n=7,000 and patch tails n=1,400; patch p99 now qualifies. Four fresh A/A pairs and two A/B pairs were interleaved AA1, AB1, AA2, AA3, AB2, AA4. Every pair is retained.

Candidate patch p95 was +17.54%; patch p99 was +4.118 ms/+23.79%, with paired deltas +8.594 and −0.358 ms. However, identical-source A/A pairs 3–4 falsely triggered the same patch p99 gate: 26.667 → 42.115 ms (+15.448 ms/+57.93%), both deltas adverse (+19.312 and +11.583 ms), n=1,400 per side. Longer serial timing is also INCONCLUSIVE. The reserved third serial A/B was not executed because failed controls make another identical serial repetition unable to validate the verdict. See long-summary.json, long-timing-tables.md, and long-aa-detail-tables.md.

Final concurrent refinement — complete, timing inconclusive

The final bounded protocol addresses two identified confounders: changing host scheduling between serial windows, and asymmetric source-loader mode. It uses separate freshly seeded synthetic states, the same frozen-source override hook on both variants, a shared fixed start deadline, 140 actors and 7,000 reads/1,400 patches. It keeps forced collections before/after but omits post-window snapshots on both sides because memory graphs are already established.

All four fresh A/A and two counterbalanced A/B pairs completed in the declared order AA1, AB1, AA2, AA3, AB2, AA4, swapping launch/state roles. There were no failed startups or excluded runs. Actual start skews were 10–93 ms, and timed-window overlap was 99.342–99.965%. concurrent-windows.md records each actual start/end, overlap, launch role and work count.

The final candidate pairs cross no declared gate, but timing remains INCONCLUSIVE because the identical-source controls fail the max-pause safeguard. A/A pair 1 has a maximum pause of 41.2178 → 97.1468 ms, exceeding max(50, 2×41.2178)=82.4356 ms. This is the only eligible control gate in the complete four-pair set. It is preserved as a false positive on identical source, not candidate harm or a reason to trim a pause. The reserved extra A/B was not executed; the bounded measurement campaign is finished.

Final A/B paired-mean metric Baseline → candidate Signed absolute delta Relative delta Samples per side per pair
Worker CPU, ms/op 3.23597 → 3.24689 +0.01092 +0.34% 8,400 operations
Total GC, ms/op 0.18407195 → 0.18526386 +0.00119191 +0.65% 8,400 operations
Read p95, ms 18.91725 → 19.69740 +0.78015 +4.12% 7,000 reads
Read p99, ms 36.37829 → 35.27123 −1.10706 −3.04% 7,000 reads
Patch p95, ms 27.65706 → 26.98150 −0.67556 −2.44% 1,400 patches
Patch p99, ms 52.61390 → 51.08092 −1.53298 −2.91% 1,400 patches
Loop p99, ms 29.73696 → 28.90138 −0.83558 −2.81% See per-pair counts below

Candidate max-pause comparisons are 83.2809 → 111.068 ms and 47.3261 → 56.3828 ms; neither crosses its max(50 ms, 2×baseline max) safeguard. The +0.00119 ms/op GC difference is far below the +1 ms/op materiality threshold. These candidate observations are not a protocol pass: failed controls leave the timing verdict inconclusive.

Each side completed exactly 7,000 reads and 1,400 patches, totaling 8,400 operations and 8,400 epoch-change rehydrations. That is 50 complete read rounds and 10 complete patch rounds (five on/off cycles). No reset commands are issued; zero resets is a workload-construction fact, not an independently sampled reset counter. Full per-pair GC kinds, totals, pause percentiles and counts, eligible latency counts, loop counts and both maxima are in concurrent-aa-tables.md and concurrent-timing-tables.md. No heap snapshots were taken in this final protocol.

Final machine-readable results are concurrent-summary.json and the six concurrent-*-pair.json files; concurrent.log records successful completion. Full declared rules and every protocol transition are in protocol.md.

Reproduction

The committed entrypoints contain usage instructions; no build, dev Gateway, production state or credentials are needed. Freeze the five changed runtime files under separate variant trees preserving their src/config/sessions/ paths: session-accessor.sqlite-entry-read.ts, session-accessor.sqlite-initial-entry.ts, session-actor-hydration.worker.ts, session-actor-transaction.ts, and session-actor-hydration.types.ts.

node --import ./scripts/tsx.mjs scripts/perf/session-actor-retention-seed.ts --state-dir <new-synthetic-directory>
node --import ./scripts/tsx.mjs scripts/perf/session-actor-retention-measure.ts --state-dir <synthetic-directory> --output <new-output-directory> --sessions 4 --reads 1400 --writes 280 --baseline-dir <frozen-variant-tree> --snapshot
node scripts/perf/session-actor-residency-snapshot.mjs <worker.heapsnapshot> <resident-result.json>

Use --sessions 140 for pressure; --allocation or --trace-gc in separate passes without snapshots. For the final concurrent protocol, prepare two separate state directories sequentially, launch two measure commands with their own output/state/variant paths, --reads 7000 --writes 1400, and the same --start-at <epoch-ms> 120 seconds ahead. Omit --snapshot on both sides. The local controllers run-campaign.py, run-aa.py, run-long.py and run-concurrent.py preserve the exact executed sequence; summary programs retain signed absolute deltas and all sample arrays.

Interpretation and deployment signal

The reliable owner finding is fewer bytes at a fixed resident set and more actors fitting the same serialized residency cap, with unchanged durable data and operation counts. After deployment, inspect the session-actor resident graph and hydration/query behavior at comparable active working sets. Do not infer a production-wide percentage reduction or promise a lower aggregate worker heap ceiling. This owner fixture does not qualify whole-Gateway throughput, a model turn, Linux scheduling, native SQLite memory, or production workload distribution. Memory and capacity are proven for this synthetic owner fixture; allocation is neutral, and pressure promotion improves. Final candidate timing crosses no declared gate, but the timing verdict remains inconclusive because identical-source controls failed. The lead should retain that uncertainty when deciding whether to merge.

Original candidate pairs: all latency, GC, sample counts and maxima

4 actors: 5 paired repetitions

Every cell is baseline → candidate. Timed work per side: 1,400 reads + 280 patches. All timing/GC runs are untraced; snapshots are outside the timed phase.

Pair Read p95 / p99 ms (n=1,400 each) Patch p95 / p99 ms (n=280 each; p99 context) Loop n Loop p95 / p99 ms Loop max ms GC n GC total ms Max GC pause ms
1 15.506 → 16.908 / 24.222 → 36.972 42.953 → 22.655 / 121.663 → 45.679 2924 → 2742 13.058 → 12.173 / 28.033 → 24.429 164.102 → 58.786 74 → 64 164.717 → 112.470 31.937 → 15.981
2 15.195 → 12.807 / 26.913 → 26.958 38.236 → 32.919 / 71.618 → 67.538 3059 → 2753 11.928 → 11.067 / 24.199 → 26.477 96.993 → 125.698 63 → 65 111.179 → 97.438 14.425 → 20.452
3 10.533 → 11.536 / 16.861 → 17.025 16.093 → 21.777 / 30.670 → 33.593 2784 → 2740 9.142 → 10.346 / 13.500 → 17.465 45.679 → 60.064 65 → 65 90.523 → 105.937 11.333 → 21.922
4 14.093 → 11.683 / 27.803 → 17.541 29.524 → 17.281 / 51.658 → 23.627 2743 → 2615 11.526 → 10.215 / 24.510 → 16.327 54.395 → 23.904 65 → 65 74.947 → 87.845 7.968 → 10.548
5 11.990 → 11.602 / 17.771 → 19.923 22.046 → 17.865 / 46.852 → 25.501 2881 → 2754 10.101 → 10.772 / 16.908 → 16.564 86.442 → 40.731 65 → 65 83.713 → 91.770 7.967 → 6.674

GC kind details below retain every collection, including major collections. GC p95 needs ≥200 collections per side and p99 ≥1,000; major percentiles are context below 50. Values are n / total ms / p95 ms / p99 ms / max ms.

Pair Kind Baseline Candidate
1 IncrementalMarking 3 / 1.659 / 0.611 / 0.611 / 0.611 2 / 0.633 / 0.438 / 0.438 / 0.438
1 MarkSweepCompact 3 / 40.202 / 31.937 / 31.937 / 31.937 2 / 10.960 / 5.872 / 5.872 / 5.872
1 Scavenge 68 / 122.856 / 7.301 / 22.575 / 22.575 60 / 100.877 / 7.526 / 15.981 / 15.981
2 IncrementalMarking 2 / 0.734 / 0.373 / 0.373 / 0.373 2 / 0.514 / 0.321 / 0.321 / 0.321
2 MarkSweepCompact 2 / 11.748 / 7.155 / 7.155 / 7.155 2 / 25.324 / 20.452 / 20.452 / 20.452
2 Scavenge 59 / 98.698 / 4.881 / 14.425 / 14.425 61 / 71.601 / 3.215 / 11.350 / 11.350
3 IncrementalMarking 2 / 0.438 / 0.250 / 0.250 / 0.250 2 / 0.552 / 0.314 / 0.314 / 0.314
3 MarkSweepCompact 2 / 16.691 / 11.333 / 11.333 / 11.333 2 / 26.557 / 21.922 / 21.922 / 21.922
3 Scavenge 61 / 73.394 / 3.680 / 4.971 / 4.971 61 / 78.829 / 3.837 / 7.681 / 7.681
4 IncrementalMarking 2 / 0.400 / 0.201 / 0.201 / 0.201 2 / 0.611 / 0.316 / 0.316 / 0.316
4 MarkSweepCompact 2 / 11.978 / 7.968 / 7.968 / 7.968 2 / 15.626 / 10.548 / 10.548 / 10.548
4 Scavenge 61 / 62.569 / 2.683 / 6.932 / 6.932 61 / 71.609 / 3.035 / 8.987 / 8.987
5 IncrementalMarking 2 / 4.402 / 4.143 / 4.143 / 4.143 2 / 0.618 / 0.375 / 0.375 / 0.375
5 MarkSweepCompact 2 / 12.028 / 7.939 / 7.939 / 7.939 2 / 8.252 / 4.294 / 4.294 / 4.294
5 Scavenge 61 / 67.283 / 2.882 / 7.967 / 7.967 61 / 82.900 / 5.101 / 6.674 / 6.674

140 actors: 6 paired repetitions

Every cell is baseline → candidate. Timed work per side: 1,400 reads + 280 patches. All timing/GC runs are untraced; snapshots are outside the timed phase.

Pair Read p95 / p99 ms (n=1,400 each) Patch p95 / p99 ms (n=280 each; p99 context) Loop n Loop p95 / p99 ms Loop max ms GC n GC total ms Max GC pause ms
1 28.781 → 18.227 / 56.062 → 28.796 34.669 → 28.456 / 93.406 → 68.117 2996 → 2785 19.431 → 15.368 / 45.875 → 26.362 113.902 → 129.303 160 → 154 394.473 → 310.958 25.193 → 26.117
2 22.314 → 26.552 / 37.220 → 44.931 34.377 → 63.004 / 66.314 → 116.737 2877 → 3018 19.005 → 21.529 / 33.882 → 48.071 107.217 → 137.888 165 → 153 393.145 → 418.204 13.447 → 30.963
3 26.023 → 17.462 / 49.329 → 28.389 26.574 → 21.336 / 41.886 → 32.738 3026 → 2655 19.546 → 14.590 / 33.325 → 24.773 129.630 → 78.578 162 → 149 407.180 → 286.520 52.329 → 14.407
4 11.608 → 15.346 / 19.616 → 24.189 14.655 → 15.025 / 22.665 → 20.348 2267 → 2620 9.757 → 11.977 / 16.794 → 18.809 121.111 → 112.329 152 → 154 238.998 → 267.272 10.780 → 25.936
5 10.041 → 11.691 / 15.769 → 17.679 12.932 → 27.378 / 22.059 → 42.876 2239 → 2378 9.134 → 12.591 / 14.442 → 21.578 33.653 → 113.181 158 → 149 240.323 → 227.343 20.655 → 10.079
6 11.886 → 23.124 / 23.088 → 37.603 19.376 → 25.567 / 31.517 → 72.119 2300 → 2703 10.936 → 16.622 / 22.102 → 31.818 46.793 → 82.510 158 → 152 273.450 → 364.190 25.697 → 41.528

GC kind details below retain every collection, including major collections. GC p95 needs ≥200 collections per side and p99 ≥1,000; major percentiles are context below 50. Values are n / total ms / p95 ms / p99 ms / max ms.

Pair Kind Baseline Candidate
1 IncrementalMarking 8 / 3.751 / 0.664 / 0.664 / 0.664 9 / 3.958 / 0.600 / 0.600 / 0.600
1 MarkSweepCompact 8 / 73.916 / 16.492 / 16.492 / 16.492 9 / 66.857 / 13.121 / 13.121 / 13.121
1 Scavenge 144 / 316.806 / 6.196 / 18.698 / 25.193 136 / 240.143 / 4.493 / 7.898 / 26.117
2 IncrementalMarking 9 / 8.870 / 5.067 / 5.067 / 5.067 8 / 19.754 / 12.710 / 12.710 / 12.710
2 MarkSweepCompact 9 / 84.992 / 13.447 / 13.447 / 13.447 8 / 59.197 / 11.575 / 11.575 / 11.575
2 Scavenge 147 / 299.283 / 5.966 / 12.348 / 13.205 137 / 339.253 / 10.609 / 26.363 / 30.963
3 IncrementalMarking 8 / 4.341 / 1.357 / 1.357 / 1.357 8 / 3.780 / 1.411 / 1.411 / 1.411
3 MarkSweepCompact 8 / 119.802 / 52.329 / 52.329 / 52.329 8 / 75.803 / 14.407 / 14.407 / 14.407
3 Scavenge 146 / 283.037 / 4.772 / 10.423 / 16.500 133 / 206.937 / 4.732 / 8.650 / 12.720
4 IncrementalMarking 8 / 5.151 / 1.351 / 1.351 / 1.351 8 / 3.828 / 0.778 / 0.778 / 0.778
4 MarkSweepCompact 8 / 54.625 / 10.780 / 10.780 / 10.780 8 / 73.514 / 25.936 / 25.936 / 25.936
4 Scavenge 136 / 179.222 / 2.922 / 4.095 / 6.758 138 / 189.930 / 3.276 / 5.758 / 6.871
5 IncrementalMarking 5 / 4.110 / 1.800 / 1.800 / 1.800 5 / 2.261 / 0.606 / 0.606 / 0.606
5 MarkSweepCompact 5 / 48.643 / 20.655 / 20.655 / 20.655 5 / 27.180 / 7.260 / 7.260 / 7.260
5 Scavenge 148 / 187.570 / 2.748 / 3.667 / 4.523 139 / 197.903 / 4.689 / 6.011 / 10.079
6 IncrementalMarking 6 / 3.034 / 0.866 / 0.866 / 0.866 7 / 2.564 / 0.575 / 0.575 / 0.575
6 MarkSweepCompact 6 / 56.058 / 25.697 / 25.697 / 25.697 7 / 66.608 / 27.397 / 27.397 / 27.397
6 Scavenge 146 / 214.359 / 3.374 / 10.322 / 10.399 138 / 295.018 / 7.281 / 22.198 / 41.528
Short identical-source controls: summary

All A/A sides execute baseline source through the same loader, 140 actors, 1,400 reads and 280 patches; n=280 per patch p95, n=1,400 per read p99.

Pair Patch p95 A→B ms Delta ms / % Read p99 A→B ms Loop p99 A→B ms (n) GC/op A→B ms Max pause A→B ms
1 56.762 → 26.868 -29.894 / -52.67% 35.599 → 47.035 46.465 → 29.901 (2809→2851) 0.290 → 0.193 92.198 → 20.146
2 19.076 → 19.183 +0.107 / +0.56% 19.396 → 42.200 17.809 → 29.868 (2601→2978) 0.166 → 0.189 16.443 → 24.438
3 13.540 → 18.109 +4.568 / +33.74% 35.114 → 20.198 21.594 → 17.334 (2509→2358) 0.144 → 0.167 8.028 → 21.374
4 26.393 → 24.367 -2.026 / -7.68% 27.967 → 36.903 25.739 → 26.345 (2605→3167) 0.177 → 0.180 26.667 → 33.734

pairs1-2: patch p95 37.919 → 23.026 ms, signed mean delta -14.893 ms (-39.28%); 20% mean gate=False, both-pairs 10% gate=False.

pairs3-4: patch p95 19.967 → 21.238 ms, signed mean delta +1.271 ms (+6.37%); 20% mean gate=False, both-pairs 10% gate=False.

all4: patch p95 28.943 → 22.132 ms, signed mean delta -6.811 ms (-23.53%); 20% mean gate=False, both-pairs 10% gate=False.

Same-source control gate: readP99 pairs1-2, 27.497 → 44.617 (+62.26%), mean=True, both-pairs=True.

Same-source control gate: readP99 all4, 29.519 → 36.584 (+23.93%), mean=True, both-pairs=False.

Short identical-source controls: per-kind GC

140 actors: 4 paired repetitions

Every cell is baseline A → identical baseline B. Timed work per side: 1,400 reads + 280 patches. All timing/GC runs are untraced; snapshots are outside the timed phase.

Pair Read p95 / p99 ms (n=1,400 each) Patch p95 / p99 ms (n=280 each; p99 context) Loop n Loop p95 / p99 ms Loop max ms GC n GC total ms Max GC pause ms
1 20.293 → 20.745 / 35.599 → 47.035 56.762 → 26.868 / 127.222 → 40.562 2809 → 2851 18.170 → 15.966 / 46.465 → 29.901 134.611 → 120.783 162 → 161 487.061 → 325.022 92.198 → 20.146
2 12.957 → 21.667 / 19.396 → 42.200 19.076 → 19.183 / 25.664 → 31.416 2601 → 2978 11.952 → 14.475 / 17.809 → 29.868 137.626 → 92.930 161 → 161 279.375 → 317.981 16.443 → 24.438
3 13.292 → 10.651 / 35.114 → 20.198 13.540 → 18.109 / 17.438 → 26.196 2509 → 2358 10.838 → 10.854 / 21.594 → 17.334 152.568 → 108.855 160 → 159 241.833 → 280.461 8.028 → 21.374
4 16.217 → 19.450 / 27.967 → 36.903 26.393 → 24.367 / 51.222 → 42.744 2605 → 3167 14.197 → 12.706 / 25.739 → 26.345 138.150 → 107.676 162 → 159 296.537 → 302.410 26.667 → 33.734

GC kind details below retain every collection, including major collections. GC p95 needs ≥200 collections per side and p99 ≥1,000; major percentiles are context below 50. Values are n / total ms / p95 ms / p99 ms / max ms.

Pair Kind Baseline Candidate
1 IncrementalMarking 9 / 7.872 / 3.776 / 3.776 / 3.776 8 / 9.979 / 7.334 / 7.334 / 7.334
1 MarkSweepCompact 9 / 170.560 / 92.198 / 92.198 / 92.198 8 / 60.390 / 16.894 / 16.894 / 16.894
1 Scavenge 144 / 308.629 / 5.367 / 26.967 / 35.495 145 / 254.653 / 3.820 / 13.597 / 20.146
2 IncrementalMarking 8 / 4.008 / 0.777 / 0.777 / 0.777 8 / 5.186 / 2.272 / 2.272 / 2.272
2 MarkSweepCompact 8 / 60.798 / 16.443 / 16.443 / 16.443 8 / 89.914 / 24.438 / 24.438 / 24.438
2 Scavenge 145 / 214.569 / 3.012 / 4.413 / 5.614 145 / 222.880 / 3.790 / 5.461 / 8.385
3 IncrementalMarking 7 / 3.450 / 0.803 / 0.803 / 0.803 6 / 4.435 / 1.006 / 1.006 / 1.006
3 MarkSweepCompact 7 / 40.933 / 7.068 / 7.068 / 7.068 6 / 46.155 / 17.716 / 17.716 / 17.716
3 Scavenge 146 / 197.450 / 2.633 / 6.325 / 8.028 147 / 229.870 / 3.920 / 6.036 / 21.374
4 IncrementalMarking 8 / 3.195 / 0.664 / 0.664 / 0.664 6 / 2.361 / 0.517 / 0.517 / 0.517
4 MarkSweepCompact 8 / 73.209 / 26.667 / 26.667 / 26.667 6 / 70.496 / 31.266 / 31.266 / 31.266
4 Scavenge 146 / 220.133 / 3.520 / 4.738 / 12.985 147 / 229.553 / 3.047 / 7.551 / 33.734
Long serial candidate pairs

140 actors: 2 paired repetitions

Every cell is baseline → candidate. Timed work per side: 7,000 reads + 1,400 patches. All timing/GC runs are untraced; snapshots are outside the timed phase.

Pair Read p95 / p99 ms (n=7,000 each) Patch p95 / p99 ms (n=1,400 each) Loop n Loop p95 / p99 ms Loop max ms GC n GC total ms Max GC pause ms
1 11.673 → 14.326 / 19.565 → 26.878 13.676 → 17.226 / 24.240 → 32.834 11112 → 12071 10.027 → 11.182 / 16.572 → 21.774 83.952 → 95.355 763 → 710 1064.558 → 1078.808 8.315 → 26.709
2 7.306 → 7.603 / 14.873 → 12.886 7.214 → 7.328 / 10.376 → 10.018 9646 → 9888 6.488 → 6.533 / 12.042 → 10.945 101.319 → 45.056 755 → 700 817.697 → 808.111 15.227 → 23.702

GC kind details below retain every collection, including major collections. GC p95 needs ≥200 collections per side and p99 ≥1,000; major percentiles are context below 50. Values are n / total ms / p95 ms / p99 ms / max ms.

Pair Kind Baseline Candidate
1 IncrementalMarking 34 / 17.408 / 0.812 / 0.869 / 0.869 33 / 21.076 / 2.030 / 6.205 / 6.205
1 MarkSweepCompact 34 / 183.964 / 8.306 / 8.315 / 8.315 33 / 207.117 / 15.552 / 16.049 / 16.049
1 Scavenge 695 / 863.186 / 2.352 / 3.931 / 5.451 644 / 850.614 / 2.520 / 6.519 / 26.709
2 IncrementalMarking 27 / 16.188 / 0.798 / 2.218 / 2.218 28 / 14.145 / 0.708 / 0.852 / 0.852
2 MarkSweepCompact 27 / 139.262 / 10.386 / 15.227 / 15.227 28 / 158.401 / 11.098 / 23.702 / 23.702
2 Scavenge 701 / 662.247 / 1.526 / 2.440 / 7.942 644 / 635.565 / 1.579 / 3.305 / 7.694
Long serial identical-source controls

140 actors: 4 paired repetitions

Every cell is baseline A → identical baseline B. Timed work per side: 7,000 reads + 1,400 patches. All timing/GC runs are untraced; snapshots are outside the timed phase.

Pair Read p95 / p99 ms (n=7,000 each) Patch p95 / p99 ms (n=1,400 each) Loop n Loop p95 / p99 ms Loop max ms GC n GC total ms Max GC pause ms
1 15.836 → 13.851 / 27.479 → 22.218 22.788 → 20.888 / 33.441 → 34.224 12790 → 12356 13.754 → 12.747 / 23.200 → 20.431 150.471 → 117.834 768 → 766 1576.571 → 1333.740 27.093 → 14.199
2 19.592 → 13.383 / 37.964 → 25.027 27.870 → 19.783 / 43.376 → 33.816 14073 → 11981 15.876 → 11.493 / 30.015 → 20.611 150.471 → 78.381 782 → 757 1811.876 → 1258.323 38.831 → 22.323
3 11.505 → 11.112 / 18.952 → 18.568 15.038 → 24.265 / 23.340 → 42.652 11480 → 11697 10.322 → 10.412 / 17.318 → 20.054 58.065 → 131.465 769 → 759 1221.981 → 1296.940 24.958 → 27.402
4 14.485 → 15.114 / 26.124 → 27.063 18.832 → 15.937 / 29.994 → 41.578 12219 → 12614 11.985 → 11.821 / 20.922 → 22.315 135.922 → 220.201 754 → 766 1241.702 → 1306.510 23.960 → 19.482

GC kind details below retain every collection, including major collections. GC p95 needs ≥200 collections per side and p99 ≥1,000; major percentiles are context below 50. Values are n / total ms / p95 ms / p99 ms / max ms.

Pair Kind Baseline Candidate
1 IncrementalMarking 38 / 26.541 / 3.068 / 3.198 / 3.198 39 / 35.979 / 3.831 / 5.995 / 5.995
1 MarkSweepCompact 38 / 306.502 / 19.910 / 23.823 / 23.823 39 / 239.388 / 12.938 / 14.120 / 14.120
1 Scavenge 692 / 1243.528 / 4.939 / 10.967 / 27.093 688 / 1058.372 / 3.284 / 6.814 / 14.199
2 IncrementalMarking 47 / 27.664 / 1.507 / 6.437 / 6.437 32 / 16.848 / 0.877 / 0.882 / 0.882
2 MarkSweepCompact 47 / 383.385 / 16.506 / 32.385 / 32.385 32 / 198.784 / 9.345 / 18.653 / 18.653
2 Scavenge 688 / 1400.828 / 5.565 / 15.240 / 38.831 693 / 1042.691 / 3.236 / 9.372 / 22.323
3 IncrementalMarking 38 / 37.533 / 6.216 / 9.255 / 9.255 30 / 17.265 / 1.090 / 1.336 / 1.336
3 MarkSweepCompact 38 / 239.868 / 9.818 / 24.958 / 24.958 30 / 221.979 / 20.110 / 21.220 / 21.220
3 Scavenge 693 / 944.579 / 2.812 / 5.688 / 7.462 699 / 1057.697 / 2.830 / 7.520 / 27.402
4 IncrementalMarking 27 / 13.977 / 0.803 / 0.867 / 0.867 35 / 25.152 / 2.091 / 4.195 / 4.195
4 MarkSweepCompact 27 / 190.483 / 21.622 / 23.960 / 23.960 35 / 247.032 / 19.354 / 19.482 / 19.482
4 Scavenge 700 / 1037.243 / 3.265 / 6.711 / 18.389 696 / 1034.326 / 3.126 / 7.183 / 14.956
Final synchronized candidate pairs

140 actors: 2 paired repetitions

Every cell is baseline → candidate. Timed work per side: 7,000 reads + 1,400 patches. All timing/GC runs are untraced; no heap snapshots are captured; forced collections stay before/after timing.

Pair Read p95 / p99 ms (n=7,000 each) Patch p95 / p99 ms (n=1,400 each) Loop n Loop p95 / p99 ms Loop max ms GC n GC total ms Max GC pause ms
1 20.370 → 21.535 / 36.279 → 36.501 33.398 → 32.573 / 68.816 → 64.176 13405 → 13586 17.695 → 17.711 / 31.916 → 31.621 141.558 → 139.198 762 → 711 1586.563 → 1638.864 83.281 → 111.068
2 17.465 → 17.860 / 36.477 → 34.042 21.916 → 21.390 / 36.412 → 37.985 13224 → 13220 14.410 → 14.385 / 27.558 → 26.182 150.077 → 136.708 762 → 715 1505.846 → 1473.569 47.326 → 56.383

GC kind details below retain every collection, including major collections. GC p95 needs ≥200 collections per side and p99 ≥1,000; major percentiles are context below 50. Values are n / total ms / p95 ms / p99 ms / max ms.

Pair Kind Baseline Candidate
1 IncrementalMarking 28 / 13.009 / 0.818 / 2.123 / 2.123 29 / 20.946 / 1.124 / 9.415 / 9.415
1 MarkSweepCompact 28 / 264.002 / 22.021 / 83.281 / 83.281 29 / 401.126 / 108.668 / 111.068 / 111.068
1 Scavenge 706 / 1309.553 / 5.340 / 12.919 / 31.006 653 / 1216.792 / 5.578 / 16.639 / 40.567
2 IncrementalMarking 27 / 20.111 / 2.646 / 4.819 / 4.819 34 / 20.930 / 2.808 / 3.093 / 3.093
2 MarkSweepCompact 27 / 232.409 / 23.939 / 28.112 / 28.112 34 / 401.873 / 55.397 / 56.383 / 56.383
2 Scavenge 708 / 1253.326 / 4.630 / 8.657 / 47.326 647 / 1050.766 / 4.026 / 8.322 / 19.696
Final synchronized identical-source controls

140 actors: 4 paired repetitions

Every cell is baseline A → identical baseline B. Timed work per side: 7,000 reads + 1,400 patches. All timing/GC runs are untraced; no heap snapshots are captured; forced collections stay before/after timing.

Pair Read p95 / p99 ms (n=7,000 each) Patch p95 / p99 ms (n=1,400 each) Loop n Loop p95 / p99 ms Loop max ms GC n GC total ms Max GC pause ms
1 18.901 → 19.407 / 34.969 → 38.196 28.131 → 26.758 / 50.914 → 61.104 13020 → 12944 16.130 → 16.114 / 29.901 → 30.769 475.267 → 291.766 773 → 775 1585.956 → 1836.456 41.218 → 97.147
2 19.074 → 19.389 / 30.868 → 32.881 29.053 → 27.173 / 47.276 → 42.116 13579 → 13772 16.114 → 16.204 / 28.049 → 28.017 151.257 → 135.660 782 → 782 1884.750 → 1770.041 50.354 → 29.187
3 23.100 → 23.039 / 51.428 → 52.430 81.051 → 83.082 / 148.027 → 148.148 13557 → 13625 20.529 → 20.169 / 58.851 → 58.655 339.476 → 376.701 787 → 794 2208.464 → 2569.882 75.970 → 142.686
4 34.775 → 32.001 / 82.258 → 88.230 53.641 → 57.353 / 107.574 → 101.776 13744 → 13946 22.692 → 22.954 / 69.403 → 68.289 177.078 → 234.357 781 → 773 2647.780 → 2449.038 111.885 → 80.913

GC kind details below retain every collection, including major collections. GC p95 needs ≥200 collections per side and p99 ≥1,000; major percentiles are context below 50. Values are n / total ms / p95 ms / p99 ms / max ms.

Pair Kind Baseline Candidate
1 IncrementalMarking 38 / 21.426 / 1.903 / 1.938 / 1.938 38 / 28.537 / 2.708 / 8.891 / 8.891
1 MarkSweepCompact 38 / 284.250 / 19.920 / 20.088 / 20.088 38 / 458.996 / 43.118 / 78.512 / 78.512
1 Scavenge 697 / 1280.280 / 5.125 / 10.559 / 41.218 699 / 1348.923 / 4.457 / 14.935 / 97.147
2 IncrementalMarking 47 / 25.128 / 1.434 / 2.744 / 2.744 48 / 19.672 / 0.580 / 2.264 / 2.264
2 MarkSweepCompact 47 / 471.722 / 17.850 / 50.354 / 50.354 48 / 339.189 / 12.506 / 16.854 / 16.854
2 Scavenge 688 / 1387.900 / 6.210 / 11.364 / 26.281 686 / 1411.181 / 6.450 / 12.919 / 29.187
3 IncrementalMarking 49 / 90.424 / 9.715 / 44.163 / 44.163 52 / 23.793 / 0.952 / 2.110 / 2.110
3 MarkSweepCompact 49 / 560.801 / 52.553 / 60.046 / 60.046 52 / 825.386 / 53.085 / 105.556 / 105.556
3 Scavenge 689 / 1557.239 / 6.280 / 27.005 / 75.970 690 / 1720.702 / 5.701 / 25.197 / 142.686
4 IncrementalMarking 42 / 68.695 / 0.674 / 52.281 / 52.281 37 / 34.970 / 4.744 / 15.441 / 15.441
4 MarkSweepCompact 42 / 601.760 / 52.948 / 111.885 / 111.885 37 / 601.465 / 60.029 / 80.913 / 80.913
4 Scavenge 697 / 1977.324 / 9.226 / 36.429 / 92.816 699 / 1812.604 / 9.318 / 28.314 / 47.884
Final synchronized timing windows and work counts

Final concurrent windows. Both sides perform 7,000 reads, 1,400 patches and observe 8,400 rehydrations; no reset command is issued (50 read rounds, 10 patch rounds). All start/end values are worker timestamps.

Pair Left role: actual start → end Right role: actual start → end Start skew ms End skew ms Window overlap
AA1 a: 2026-10-25T04:32:47.348Z → 2026-10-25T04:34:06.262Z b: 2026-10-25T04:32:47.441Z → 2026-10-25T04:34:05.836Z 93 426 99.342%
AB1 base: 2026-10-25T04:36:07.446Z → 2026-10-25T04:37:29.926Z candidate: 2026-10-25T04:36:07.483Z → 2026-10-25T04:37:30.271Z 37 345 99.539%
AA2 b: 2026-10-25T04:39:31.624Z → 2026-10-25T04:40:53.963Z a: 2026-10-25T04:39:31.667Z → 2026-10-25T04:40:54.390Z 43 427 99.432%
AA3 a: 2026-10-25T04:42:55.770Z → 2026-10-25T04:44:33.258Z b: 2026-10-25T04:42:55.790Z → 2026-10-25T04:44:33.272Z 20 14 99.965%
AB2 candidate: 2026-10-25T04:46:34.007Z → 2026-10-25T04:47:49.168Z base: 2026-10-25T04:46:33.980Z → 2026-10-25T04:47:48.769Z 27 399 99.433%
AA4 b: 2026-10-25T04:49:50.045Z → 2026-10-25T04:51:32.637Z a: 2026-10-25T04:49:50.055Z → 2026-10-25T04:51:32.968Z 10 331 99.669%

@clawsweeper

clawsweeper Bot commented Oct 25, 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 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-25T03:33:07.106968Z 1c82f49 PR opened
ℹ️ 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 scripts Repository scripts size: M labels Oct 25, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 25, 2026
@clawsweeper

clawsweeper Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR removes redundant serialized snapshots from resident session actors and reuses decoded lookup entries during initialization.

Example: A synthetic working set contains 140 sessions with roughly 68 KiB skill prompts.

  • Before: 52 actors fit under the existing serialized residency budget.
  • After: 95 actors fit; the saturated resident graph grows 4.15%, so this does not establish a lower maximum heap.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused implementation has no actionable finding and preserves the durable format; synthetic owner evidence is substantial, but timing qualification remains inconclusive.
Proof confidence 🦐 gold shrimp (3/6) The ordinary contributor proof gate is exempt for this maintainer-authored PR; its completed Node 26.12.1/macOS native-worker campaign exercises hydration and real patch commits and establishes bounded memory and capacity results.
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 snapshots consume residency capacity twice, reducing the number of active sessions retained by the worker.
Reason: The maintainer-authored direction has measurable owner-level value and uses existing storage and lifecycle contracts.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep this PR open: it provides a focused, useful memory improvement with no actionable correctness findings; the completed measurements leave a lead decision about inconclusive timing.

Priority: P2
Reviewed head: 1c82f49ff3df98d313f6a6d0f2071883b368e4b4
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should the lead accept the established memory and capacity gains despite inconclusive timing qualification?
  • Recommendation: Accept the bounded performance uncertainty: Land the focused representation change with its existing limitations: synthetic memory and capacity gains are established, while latency improvement and a lower saturated heap are not claimed.
  • Why: The bounded campaign is complete, but identical-source controls invalidate a timing pass; the author's recorded decision explicitly leaves this tradeoff to the lead.

Before merge

  • Await maintainer action - Lead: decide whether to accept the completed campaign's inconclusive timing qualification for this head.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.

Findings

None.

Tests

  • Missing end-to-end proof: Supplied evidence exercises the real durable actor and SQLite worker on synthetic state, without a shipped Gateway or model-turn performance run.
Agent review details

How this fits together

Session database workers hydrate and update resident actors from persisted entries, then publish detached session facts and commit receipts to callers.

flowchart LR
  A[Session operations] --> B[Database worker]
  C[Persisted entries and snapshots] --> B
  B --> D[Decoded resident actor]
  D --> E[Entry writer]
  E --> C
  D --> F[Detached reads and receipts]
Loading

Technical review

Best possible solution:

Retain decoded snapshots through the existing actor owner while preserving exact node comparisons, detached public results, and transaction rollback.

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

Current-main source retains serialized snapshot columns beside decoded snapshots, and the supplied native-worker measurements demonstrate their residency cost; this review executed no target code.

Is this the best way to solve the issue?

The patch removes redundant representation at both existing retention producers and updates the sole raw-row initialization consumer without adding a cache, state owner, or durable format.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Hydrated persisted row columns keeps the original intent (852875e: Retain exact selected node columns so unchanged hydrated entries do not trigger redundant writes.)
  • Shared decoded actor entry keeps the original intent (8f5390d: Share the actor-owned decoded entry while preserving detached public results and rollback preimages.)
  • Initialization identity snapshot keeps the original intent (fc32338: Use one row scan and the writer postimage instead of rereading initialization identities.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Introduced change and current main: The pinned introduced diff strips three raw snapshot columns in hydration and replacement; fetched main retains the original representation, so the central improvement remains outstanding. (src/config/sessions/session-actor-hydration.worker.ts:320, 1c82f49ff3df)
  • Snapshot comparison contract: The existing writer compares decoded snapshots through splitSessionEntrySnapshots; exact node columns remain available for no-op suppression, and initialization consumes decoded entries rather than reparsing stripped rows. (src/config/sessions/session-entry-snapshots.ts:61, 1c82f49ff3df)
  • Distinct regression coverage: The added capacity case covers cold hydration and snapshot-changing replacement; initialization covers lookup-sibling snapshots, while extended existing coverage checks unchanged snapshot writes, rollback, and reopen. (src/config/sessions/session-actor-entry-residency.test.ts:997, 1c82f49ff3df)
  • Completed measurement evidence: The complete PR body reports a 42.30% smaller four-actor resident graph and capacity increasing from 52 to 95 actors. It explicitly preserves the failed identical-source timing control and the inconclusive verdict. The previous measurement-completion request is addressed. Captured body identity: SHA256 842b8389212247ae9720e27f33dfc0781694aa1582f1a7688185bd63460aa508. (1c82f49ff3df)
  • CI attribution: The cited exact-head code CI run succeeded. The separate failed PR context check requests authored Evidence sections in the body; its annotations identify a paperwork failure rather than a code defect. (1c82f49ff3df)
  • Feature history and original intent: Current-main history repeatedly identifies Peter Steinberger across actor hydration, rollback, and residency work. perf(sessions): avoid redundant actor entry writes #175191 explains retaining exact node columns, and perf(sessions): share resident actor entries across projections #182934 explains sharing decoded entries. This PR preserves both contracts. Following older history reached an unavailable creation-boundary object; no unsupported introduction attribution is made. (src/config/sessions/session-actor-hydration.worker.ts:318, 4f0fe4f6be21)

PR surface

Source +20, Tests +116, Other +233. Total +369 across 11 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 5 50 30 +20
Tests 2 124 8 +116
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 4 235 2 +233
Total 11 409 40 +369

Review metrics

Metric Value Why it matters
Production versus tests Runtime +50/−30; tests +124/−8 Runtime growth supplies the decoded scan contract and excludes raw snapshot fields; test growth protects capacity, sibling initialization, and persisted snapshot preservation.

Labels

Label changes:

  • add merge-risk: 🚨 other: Performance qualification remains uncertain: timing controls failed, so latency neutrality is not established despite the memory benefit.
  • add status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: ⏳ waiting on maintainer.

Label justifications:

  • P2: A bounded session-worker memory improvement with demonstrated capacity value and no established urgent runtime failure.
  • merge-risk: 🚨 other: Performance qualification remains uncertain: timing controls failed, so latency neutrality is not established despite the memory benefit.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-25T03:45:22.042Z sha 1c82f49 :: needs maintainer review before merge. :: none

Reviewed October 25, 2026, 12:59 AM ET / 04:59 UTC (Revision 2).

@steipete

Copy link
Copy Markdown
Contributor Author

Completed the pinned-head measurement evidence and updated the PR body with memory/capacity results, separate allocation/promotion passes, all paired sample counts and GC maxima, and the final synchronized A/A controls. The memory/capacity improvement is established; timing remains inconclusive because an identical-source max-pause control failed. Exact-head CI is green. This PR remains open for the lead's decision and merge.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 25, 2026
@steipete
steipete merged commit 8e9bf7e into main Oct 25, 2026
178 of 179 checks passed
@steipete
steipete deleted the steipete/perf-resident-raw-columns-20261025 branch October 25, 2026 05:15
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: M status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant