Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

docs(eval): #5984 round-trip diet 2 — pipelining spike, per-phase critical path, effects, statement classification, before/after gates

garrytanad9ebf802595
diff --git a/docs/architecture/key-files/google-and-loops-continued.md b/docs/architecture/key-files/google-and-loops-continued.md
index cab0f99526..ba63a7cde1 100644
--- a/docs/architecture/key-files/google-and-loops-continued.md
+++ b/docs/architecture/key-files/google-and-loops-continued.md
@@ -17,7 +17,7 @@
- **`src/core/persistence/sync-discovery.ts`** + **`sync-origin.ts`** — managed owner-only Git discovery with source-relative exclusions and one-statement page identity/revision snapshots. Reserved skillpack paths (`skills/` at any depth and `skillpack.json`, `src/core/skill-reserved-paths.ts`) never enter discovery: the shared skill publisher owns them and `managedImportContent` refuses them, so a seeded pack cannot block a sync. Nested full discovery filters source scope before slicing paths. Windows separator aliases retain their page identity; ambiguous aliases refuse, while POSIX backslashes/case remain exact. Under `source-root` mode a stored `<scope>/<path>` origin (the Git-root form older write-through minted from the slug, recognized because `<path>` names the page slug) is accepted as `<path>` at discovery, freeze, preparation and the page-origin query, and an import rewrites it in place; when both readings name existing files the stored origin refuses with `detail: ambiguous_source_path`. A genuine origin mismatch refuses with `detail: sync_origin_mismatch` and the filled paths. Deletions must be absent from the pinned Git target or their explicitly selected working tree. Deleting a file that no page records as its origin (for example a skipped slug twin) while its slug's page keeps another origin commits an explicit no-op receipt (`unownedDeletion`, outcome reason `unowned_deleted_path`) that preserves that live page or tombstone; freeze and publication re-prove that no page owns the path and that the file is still absent. Existing cursors reuse their accepted manifests, with unknown old deletion provenance refused rather than rewritten. Active Git holds of the source are re-screened when their blob or working bytes changed, the file left, a `sources retry-held` request names them, the hold predates the current `RECOVERY_VERSION`, or the code is `frontmatter_slug_conflict`, `file_too_large`, `rename_held` or `parser_regression`; holds of now-excluded paths are released at the checkpoint. A held rename destination (or a held path renamed again) carries the hold's `renameFrom` when the old page is unchanged, else `renameHeld` (held as `rename_held` / `rename_source_changed`), and a full walk never deletes an origin a hold's `rename_from` names. Imports whose origin has no page claim their slug together: a live page whose own file is still in the tree keeps the slug, otherwise the file named like the slug (else the first path) wins, and the losers leave the manifest and are reported as `slugCollisions` (the library path's `slug_collision` skip) instead of failing the run. A winner whose slug is held by a page with a vanished or deleted origin takes that page over (`renameFrom`, same slug). A Git-detected rename to an unoccupied slug becomes one import carrying `renameFrom` in place of a delete plus a create. Origins for one slug that differ only by case or separator spelling refuse, except a case-only respelling whose old file the same sync removes. Code files keep exact per-origin identity. On Windows a path containing `:` is reported in `SyncDiscovery.fileRefusals` (code `colon_slug_windows_write_through`, with its filled `gbrain sync --source <id> --no-pull` hint) and kept out of the run and its origin checks, so one such file no longer fails the whole sync (#5032).
- **`src/core/persistence/sync-drain.ts`** — #5984: drains a managed sync in one invocation. `runDrain` re-enters the single-pass `performManagedSync` (which keeps returning `partial / writer_pending | writer_yield`) until the cursor is done, the caller's signal stops it, a strict registered run deadline is about 15 s away (`forward-progress.ts` `registerRunDeadline`, set by `cli.ts` when it arms the sync watchdog), a writer head needs intervention (`recovery_required`, `owner_unavailable`, unexpected bytes), or the no-progress detector sees the awaited request and its worktree head unchanged for 30 s and 3 passes with nothing claimable here. It retries only `worktree_refreshing` (its `retry_after_ms`), `database_contention`, connection errors and statement timeouts (3 attempts). Every page commit notes forward progress, so the progress-aware watchdog never stops a progressing drain. The result carries `drain: { outcome: synced | resumable | blocked, stop_reason, written, waived, remaining, rate_pages_per_min, eta_seconds, stall }`; `drainNext` builds `next` for the CLI from the shared `syncResumeCommand` (`sync-reconcile.ts`). The CLI (`sync/run.ts` single source, `--all`, `--watch`) sets `SyncOpts.drain`; the PGLite owner delegate uses `runDrain` over IPC; jobs, serve, the cycle, `sync-administration.ts` and `worktree-refresh.ts` keep their own loops. `readManagedSyncBacklog` reads unfinished cursors' `progress` window (stamped by `sync-run.ts` on each advance, reset per drain) for `gbrain doctor` (`managed_sync_backlog`) and `sources status`. Tests: `test/sync-drain.test.ts`, `test/managed-sync-drain.test.ts`.
-- **`src/core/persistence/sync-group.ts`** + **`group-publish.ts`** — #5984 bulk publication for draining managed Postgres syncs. `sync-group.ts` resolves bulk settings (`--no-bulk` > `GBRAIN_SYNC_BULK` > `sync.bulk` > on; `sync.bulk_size` 16, `sync.bulk_max_txn_ms` 15 s; PGLite off), sizes the next group from the last group's admission-to-commit time per member, freezes followers (four at a time, stopping at a rename, company plan, overtaken entry or one the waiver would take) and admits a group in one transaction (`admitWriteGroupInTransaction`, which keeps one request row, ID and digest per page and replays priors). `sync-run.ts` keeps the head in `pending` and all members in the cursor's `group` (members carry `intent.group` = the head's request ID), waits for the last member and advances over the committed prefix; a terminal failure becomes the single pending entry, a still-pending member returns `writer_pending`. Any caller finishes an existing group; only a drain forms one. The consumer claims a head's directly following queued members (`claimGroupFollowers`, never past an unfinished non-member) and `executeClaimedGroup` prepares four at a time, then `publishGroup` publishes them in one transaction: one worktree lock, ownership guard and coordinated write (each member set as the attributed actor with `setMemberAttribution`), per-member authorization, snapshot, sync validation (its source-wide part shared per transaction), apply, effects and receipt, counters locked after the members are applied. Any failure rolls the group back; members then publish singly, later members are cancelled after a terminal failure or released after a requeue. Sync validation accepts a group member through the cursor's `group`. Tests: `test/managed-sync-bulk.test.ts`.
+- **`src/core/persistence/sync-group.ts`** + **`group-publish.ts`** — #5984 bulk publication for draining managed Postgres syncs. `sync-group.ts` resolves bulk settings (`--no-bulk` > `GBRAIN_SYNC_BULK` > `sync.bulk` > on; `sync.bulk_size` 16, `sync.bulk_max_txn_ms` 15 s; PGLite off), sizes the next group from the last group's admission-to-commit time per member, freezes followers (four at a time, stopping at a rename, company plan, overtaken entry or one the waiver would take) and admits a group in one transaction (`admitWriteGroupInTransaction`, which keeps one request row, ID and digest per page and replays priors). `sync-run.ts` keeps the head in `pending` and all members in the cursor's `group` (members carry `intent.group` = the head's request ID), waits for the last member and advances over the committed prefix; a terminal failure becomes the single pending entry, a still-pending member returns `writer_pending`. Any caller finishes an existing group; only a drain forms one. The consumer claims a head's directly following queued members (`claimGroupFollowers`, never past an unfinished non-member) and `executeClaimedGroup` prepares four at a time, then `publishGroup` publishes them in one transaction: one worktree lock, ownership guard and coordinated write (each member set as the attributed actor with `setMemberAttribution`), per-member authorization, preimage read, sync validation (its source-wide part shared per transaction), apply (which reads the postimage the receipt and effects use), effects and receipt; `completeGroup` then reads every member's effect bytes, and pipelines the counter lock with one `UPDATE ... FROM unnest(...) RETURNING` that checks each member's claim and terminal reservation and releases the counters (a short `RETURNING` throws, so the single path reports each member's own code). Any failure rolls the group back; members then publish singly, later members are cancelled after a terminal failure or released after a requeue. Sync validation accepts a group member through the cursor's `group`. Tests: `test/managed-sync-bulk.test.ts`.
- **`src/core/persistence/sync-run.ts`** + **`sync-authority.ts`** — one immutable request at a time, bounded fairness and pinned-target resumption. Cursors and requests freeze `noEmbed`, `noExtract` and `noSchemaPack`. A resume adopts the stored options for every option the caller did not set explicitly (`SyncOpts.explicitProcessing`: CLI flags, wire flags, job params; autopilot and the cycle set none); an explicit conflict refuses with `detail: cursor_processing_options_conflict`, the stored options and the exact resume command. Callers that omit `explicitProcessing` stay strict. Explicit idle ordinary-source retry creates fresh discovery/admission and retains terminal receipts, also when the run has a recorded failure and its pending write already committed before the cursor advanced; company consent retry retains its approved manifest/run. Active work blocks replacement. Claimed/inactive sync, including connector/company dispatch, remains refused: existing leases and native locks do not fence already-running engine-only legacy writers. No automatic activation or new transition protocol. `freezeEntry` checks a rename's source page (id, revision, origin) as well as its target slug, and a committed rename counts in `renamed`. #5522: a new-file entry (`pageId: null`) whose origin another cursor of the source has since imported is re-frozen against that page when it is live, holds exactly that origin at the entry's slug in the cursor's incarnation, and the sync preparer finds its content unchanged; otherwise the origin refusal stands, and the manifest is never rewritten. #5751: the working-tree screen passes the kernel waivers for working-tree entries and counts them into `legacySkips` (printed by `sync-diagnostics.ts` with `gbrain repair contextual-mode`). A terminal `checkpoint_validation_timeout` receipt gets its hint from `checkpoint-validation.ts`. Content holds (#5988, `sync-screen.ts`): `freezeEntry` screens each import (company-profile cursors and `sync.holds=fail` excepted); a refused file becomes a hold written in the same transaction as the cursor step (`saveCursor`'s `inTx`), with no request admitted, and an over-bound pinned blob is held by size before it is read. A cursor whose pending request failed with a content refusal (`isContentRefusal`, old message shapes included) converts in place with its stored options: held, or re-frozen once per distinct bytes (`converted`), so a refusal the screen misses stays blocked without minting receipts. Results carry this run's holds, the outstanding total, escalation, `converted_from_failed` and `recovered_frontmatter` (`buildHoldReport`); dry runs list `would_hold` / `screen_skipped`. After the checkpoint commits (and unless `noExtract`), the owner derives links for the source's stale pages through `links-maintenance.ts`, so a PGLite-delegated sync and a Postgres sync take the same path; the result carries `links`, and an extraction failure leaves pages stale without failing the committed sync.
- **`src/core/persistence/sync-holds.ts`** + **`sync-screen.ts`** + **`sync-blobs.ts`** — Git holds (#5988). One `op_checkpoints` row per held file (`sync-hold`, fingerprint `source:incarnation:path`) plus a per-source `sync-hold-summary` row (`count`, and `stale`: holds whose page exists); `writeGitHold` / `clearGitHold` lock the summary row and are conditional on the writing run's discovery time (`observed_at`), so an older run never replaces or clears a newer hold. Managed and legacy sync write the same rows; `readGitSourceHolds` (current incarnation only) feeds `retry-held` and legacy sync, and `readGitHoldListing` (count from the summary row, rows limited per source in SQL) feeds `sources status`, never `readAllSourceHolds`. `recordSyncConversion` logs each blocked request a managed run converted in place (`sync-conversions`, newest 20 per source, in the transaction that saves the converted cursor); `sources status` shows the newest 5. `gitHoldItem` gives every surface code, reason, key, line, location-only message, `fix` Action and `docs` anchor. Policy keys: `sync.holds` (`hold`/`fail`), `sync.hold_cap` (detail shown, default 500), `sync.hold_escalate_count` (50), `sync.hold_escalate_pct` (5, from 40 screened imports), `sync.parser_regression` (`stop`/`hold`). `screenFrozenImport` turns a refusal into a hold, or throws `sync_parser_regression` only when `sync-import-provenance` proves a validating gbrain imported the same bytes. `sync-blobs.ts` reads blob ids/sizes with chunked `ls-tree -l` and contents with `cat-file --batch`. `held-reads.ts` is the read side: `get_page.file_held`, `stale` on search/query hits and the `held_files` retrieval meta and notice, from one lookup by page id (`op_checkpoints_sync_hold_page_idx`, migration v200) and one summary read per call, cached per request; remote callers get codes and counts, never paths, and a fix addressed to the brain host operator. Tests: `test/sync-holds-store.test.ts`, `test/persistence-sync-holds.test.ts`, `test/sync-all-hold-notes.test.ts`, `test/held-read-signals.test.ts`.
- **`src/core/persistence/file-repair.ts`** — `managed_file_repair` (#5988), the owner-internal `put_page` kind `gbrain repair frontmatter --apply` submits (accepted only from the trusted local CLI with `managedFileImport`; MCP is refused by the reserved-field gate, remote authority by the preparer). The preparer confines the path (`isWriteTargetContained` plus a component-wise `lstat` walk, no symlinks), requires the file's sha256 to equal the previewed `beforeHash` (`changed_since_preview` otherwise), recomputes `prepareRepairPublication` (the `screenSyncImport` + `importFromContent` preparation a managed sync import gets) and refuses a different result digest or a canonical overlay. It publishes the exact bytes as `file` (`expectedBeforeHash` = previewed hash; no `file_database_drift` check), applies the import (a held new file creates its page, a `renameFrom` moves the page with `updateSlug`), clears the Git hold and records `sync-import-provenance` in the same transaction; the file write queues the Git target effect. Tests: `test/repair-frontmatter.test.ts`.
diff --git a/docs/eval/managed-sync-catchup.md b/docs/eval/managed-sync-catchup.md
index 24150bdeab..d42741886e 100644
--- a/docs/eval/managed-sync-catchup.md
+++ b/docs/eval/managed-sync-catchup.md
@@ -16,6 +16,9 @@ With the drain loop, the diet and bulk publication (v0.60.48.0), one
backlog in about 11 h instead of 49 h) and 775 pages/min near the
database, with foreground writes unharmed. See
[Results on the #5984 branch](#results-on-the-5984-branch-v060480).
+The second round-trip diet brings a page's publication inside a group
+to about 17 round trips (from 48) and the 57 ms rate to 24.5 pages/min;
+see [Round-trip diet 2](#round-trip-diet-2-150-pagesmin-plan-phases-0-and-1).
This page is the research and decision record for the #5984 plan
(CEO-A1, A2, A3, A4, A6, A17, A19, A25, A26, A27, A29; ENG-A5, A9,
@@ -36,6 +39,12 @@ bun scripts/bench/managed-sync-catchup.ts --files 500 --deletes 34 --rtt 57,0 \
# issue-sized row: 10k files, 300-word pages, 300 pages of existing receipt history
bun scripts/bench/managed-sync-catchup.ts --files 10000 --deletes 34 --receipt-history 300 --pad-words 300 \
--rtt 57,0 --rows cli --max-minutes 15 --label <branch>-10k
+
+# re-print the critical-path, publication and counter-hold tables of a kept trace (--keep)
+bun scripts/bench/managed-sync-catchup.ts --analyze <home>/sql-trace.jsonl
+
+# pipelining spike: direct Postgres (prepare true/false) and transaction-mode PgBouncer
+bun scripts/bench/managed-sync-pipeline-spike.ts --rtt 57
```
Rows run in sequence by default. Rows at 57 ms are latency-bound and
@@ -157,6 +166,10 @@ has:
| `cli_is_owner_host` | ENG-A9. |
| `foreground_idle`, `foreground_during_catchup` | `foreground` row: writes, p50/p95 ms, failures, lock_timeouts, failure codes (ENG-A5). |
| `effects_backlog_at_cli_exit`, `readiness`, `retrieval_ready`, `retrieval_ready_after_sync_s`, `embedding_stub` | `effects` row (CEO-A17, ENG-A18). Ready = no unembedded chunks for the source, no queued or running effects, no pending minion jobs, and no page with stale link extraction. |
+| `trace.critical_path` | Sync-process phases (`publication (group)`, `publication (single)`, `freeze`, `admission`, `cursor`, `claim`, `prepare`, `wait`, `commit_gap`, `background`): occurrences, wall ms total and p50, statements, waves, describes, per page; `wave_check`; `rules`. |
+| `trace.publication` | Group transactions: members, `fit` (waves and statements = fixed + per member), `steady_member_chain`, `first_member_chain`, `completion_per_member`, `per_page_publication_round_trips` / `_statements`, `counter_hold` (statements, waves, ms; from the counter row lock to commit), `by_members[]`, `transactions[]`, `rules`. |
+| `effects`, `effects_backlog` | Effects per group and by kind (with `needs_worktree_lock`), and the queued/running backlog sampled every 2 s during the run. |
+| `foreground_*.round_trips` | Per `put_page`: write transactions, their statements and waves, and the whole write window (p50, p95). |
| `e1_cold_start_to_first_progress_ms`, `e1_cold_start_to_first_stderr_ms`, `e1_wall_ms`, `newcomer_sync_runs`, `newcomer_to_search_hit_s`, `search_hit` | `newcomer` row (DX-A12). |
## Baseline (master `f4739fff`, v0.60.39.0, 2026-10-04)
@@ -487,3 +500,136 @@ the target, and both need their own design approval:
The worktree fence + bulk import + reconcile alternative (CEO-A27) stays
unbuilt: it measures 51 pages/min as unmanaged sync but gives up
per-page receipts and effects during the import.
+
+## Round-trip diet 2 (150 pages/min plan, Phases 0 and 1)
+
+The 150 pages/min plan starts with a measured floor and a second
+round-trip diet. The bench reports where the sync process spends its
+time (`trace.critical_path`), what one bulk group costs
+(`trace.publication`), the effects each group queues (`effects`,
+`effects_backlog`) and the round trips of each foreground `put_page`
+(`foreground_*.round_trips`). A **round trip** here is a wave: records
+on one connection whose time spans overlap count once, so pipelined
+statements count as one, and every describe counts as its own wave.
+At 57 ms the wave count times the RTT matches the wall time (61 ms per
+wave against a 59.5 ms proxy RTT). `--analyze <trace.jsonl>` prints the
+same tables for a kept trace.
+
+### Pipelining spike
+
+`scripts/bench/managed-sync-pipeline-spike.ts` (57 ms, toxiproxy)
+issues `tx.executeRaw` calls inside one gbrain `engine.transaction`
+without awaiting between them, on direct Postgres and through
+transaction-mode PgBouncer (`edoburu/pgbouncer`, `MAX_PREPARED_STATEMENTS=0`).
+Wall times include `BEGIN` and `COMMIT`.
+
+| Case | prepare=true | prepare=false | PgBouncer txn mode (prepare=false) |
+|---|---|---|---|
+| 2 dependent statements, awaited one by one (warm) | 2 round trips, 240 ms | 4, 358 ms | 4, 360 ms |
+| same 2, issued without await (warm) | **1 round trip, 180 ms**; the read sees the write | 4, 359 ms | 4, 359 ms |
+| 5 inserts without await (first one cold) | 5 round trips, ids in issue order | 12, 837 ms | 12, 837 ms |
+| failure first, then 2 statements, without await | 1 round trip; `23505`, then `25P02`, `25P02` | `23505`, `25P02`, `25P02` | same |
+| 3 unparameterized statements without await | 1 round trip | 1 | 1 |
+| new statement text per call, without await | 6 round trips (3 describes) | 6 | 6 |
+
+postgres.js pipelines statements issued back to back on the
+transaction's connection and keeps their order, and after a failure the
+first error is the real one while later statements fail with `25P02`.
+Only statements already prepared on that connection pipeline: a
+parameterized statement the connection has not prepared waits for its
+describe round trip and holds back the statements behind it. With
+`prepare: false` (and therefore under transaction-mode PgBouncer) every
+parameterized statement pays a describe and an execute and nothing
+pipelines; unparameterized statements still do. So the spike passes for
+direct Postgres, which the gates below are measured on, and fails for
+transaction-mode poolers, where the diet's statement cuts still apply
+but pipelining gives nothing.
+
+### What one page costs now
+
+Each member of a bulk group reads its page twice: the **preimage**
+under the page guard (identity, revision check, the version row on
+update and delete) and the **postimage** after apply (read-back check,
+projection target, text-projection seal, receipt revision, effects).
+Configuration rows, the local writer and source membership are read
+once per transaction (`transactionMemo`, `src/core/page-state/transactions.ts`).
+The chunk insert binds its rows as one JSON document, so its text is
+stable per brain and prepared; a complete replacement seals
+`chunker_version` in the statement that also locks the page row. The
+text projection is sealed once per page. Group completion is set-based
+(`completeGroup`, `src/core/persistence/group-publish.ts`): each
+member's queued effect bytes are read before the counters are locked,
+then the counter lock and one `UPDATE persistence_requests ... FROM
+unnest(...) RETURNING` that checks every member's claim and terminal
+reservation are pipelined, and a short `RETURNING` rolls the group back
+to the single path, where `completeWrite` gives each member its own
+code.
+
+Statements of the steady member chain after the diet (a page import,
+bench fixture), by dependency:
+
+| Statements | Depends on | Sent |
+|---|---|---|
+| attribution `set_config` | member boundary | alone (never pipelined across) |
+| `savepoint`, page `INSERT`/`UPDATE`, contextual-retrieval `UPDATE`, chunk `DELETE` | nothing returned earlier (independent) | one by one: engine calls with their own savepoint |
+| chunker seal `UPDATE ... RETURNING id` | nothing (produces the page id) | alone |
+| chunk `INSERT` | page id (data-dependent) | alone |
+| alias `savepoint` + `DELETE` | independent | one by one (savepoint) |
+| `source_path` repair | independent | alone |
+| postimage read | must follow every page write (produces id, revision, timeline) | alone |
+| facts expiry, take collision check, take delete, timeline delete/inserts/refresh | postimage page id; independent of each other | **one pipeline** (`insertFacts`/`addTakesBatch` end it) |
+| text-projection seal, hold check, import provenance | postimage; independent of each other | **one pipeline** |
+| chronicle check (effects) | postimage | alone |
+| next member's preimage | must precede its validation and apply | alone |
+| sync-origin check (validation) | independent | alone |
+
+### Effects per group
+
+With `--no-embed` (the `cli` rows) a database-only group queues no
+effects: the embedding is deferred and no file is written. Without it,
+each live page queues one `embedding` effect, which does not take the
+worktree lock; `git` effects, which do, come only from file-backed
+writes (each foreground `put_page` queues `embedding` + `git`). The
+effects backlog during the catch-up stayed at 0 to 2.
+
+### Before and after
+
+Master `6622a119` (v0.60.48.0) against this diet, same host and bench
+(500 files, 34 no-op deletes, 57 ms rows time-boxed at 10 min):
+
+| Measure | Master | Diet | Gate |
+|---|---|---|---|
+| Per-page publication, round trips (describes counted), 57 ms | 48.1 (42 statements) | **16.7** (23 statements) | ≤ 22 with pipelining (≤ 24 without): pass, −65% |
+| Per-page publication, ~0 ms | 44.7 (43 statements) | 17.6 (24 statements) | pass |
+| Counter hold, lock to commit | 12 round trips p50, 20 max (3 + 3 statements per member; 0.72 s at 57 ms) | **2 p50**, 5 max (3 statements for any group size; 0.12 s) | ≤ 3 with pipelining: pass at p50; the max is a connection that has not prepared the two statements yet (2 describes), within the 5-round-trip bound without pipelining |
+| `cli` pages/min, 57 ms (10 min) | 10.6 | **24.5** | measured (2.3x) |
+| `cli` pages/min, ~0 ms (3 runs) | 496 (493 to 512) | 504 (471 to 530) | not regressed |
+| Idle foreground `put_page` round trips, 57 ms (3 runs, 15 writes) | 151 p50, 166 p95 (102 statements) | **146 p50, 156 p95** (99 statements) | no worse: pass |
+| Idle foreground `put_page` wall, 57 ms (median of run p50 / p95) | 12.6 s / 15.4 s | 12.8 s / 15.0 s | within noise (+1% p50, −3% p95) |
+| Foreground during catch-up, 57 ms | p95 22.2 s, 1 failure | p95 14.7 s, 0 failures, 0 lock timeouts | |
+
+A warm foreground publication transaction is 61 statements with no
+describe (master: 66 with 2). Golden SQL (regenerated only for the chunk
+insert and the export surface), attribution and engine-parity suites pass
+on both engines.
+
+Per-phase critical path of the sync process, 57 ms `cli` row (p50 per
+occurrence; the group size adapts to the 15 s budget, so groups grew
+from 3 to 7 to 9 pages):
+
+| Phase | Master wall / waves | Diet wall / waves |
+|---|---|---|
+| publication transaction | 9.3 s / 155 (3 pages) | 10.8 s / 179 (9 pages) |
+| freeze | 0.66 s / 12 | 1.08 s / 30 |
+| admission | 1.14 s / 19 | 1.02 s / 17 |
+| cursor save | 0.36 s / 6 | 0.36 s / 6 |
+| claim | 0.30 s / 5 | 0.30 s / 5 |
+| prepare | 1.15 s / 48 | 2.33 s / 126 |
+| gap between group commits | 14.4 s | 18.1 s |
+
+Per committed page the diet's sync process spends 21.6 publication
+waves (master: 54.3), 16.2 prepare, 5.2 cursor, 4.6 freeze, 2.5
+admission and 1.4 claim waves. Between two group commits about 7 s is
+freeze, admission, cursor saves, claim and prepare, all strictly after
+the previous commit; that is the gap Phase 1.5 (the cursor window)
+targets.