From 01ab0cf0bf46d3f5e9507c3303322a933edffbdd Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 8 Jul 2026 15:48:27 +0000 Subject: [PATCH] test(geode): keep deletion-settle benchmark as robust shape guard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drop the flaky publish-into-large-relay warmup from DeletionSettleBenchmark (it timed out the measured reconcile at N=100k — the container noise the docstring already warns against) and remove the throwaway ScratchSettleTiming investigation tool. Record in the docstring what the phase breakdown proved: the settle's extra time over a bare reconcile is O(K) relay-ingest of the K residual deletions, dominated by one-time JVM/JIT warmup of the publish path (consecutive K-note batches fell ~3100->570ms), not the deletion algorithm and not O(N). Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01JgL1WTV4Hkp2uuXcUHCHGt --- .../com/vitorpamplona/geode/DeletionSettleBenchmark.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/geode/src/test/kotlin/com/vitorpamplona/geode/DeletionSettleBenchmark.kt b/geode/src/test/kotlin/com/vitorpamplona/geode/DeletionSettleBenchmark.kt index 109163fddd..46e4b7a1ca 100644 --- a/geode/src/test/kotlin/com/vitorpamplona/geode/DeletionSettleBenchmark.kt +++ b/geode/src/test/kotlin/com/vitorpamplona/geode/DeletionSettleBenchmark.kt @@ -52,6 +52,14 @@ import kotlin.test.assertEquals * (the O(N) part it shares with any sync) next to the settle cost, so the deletion * overhead is visible as "≈ a couple of reconciles + K", not "+ a content re-download". * + * Why the printed settle can read as several× a bare reconcile at large N: the extra time + * is NOT the deletion algorithm (a phase breakdown showed reconciles stay ~sub-second at + * N=100k, and the settle re-fetches K=20, not N). It is entirely the K `publishAndConfirm` + * ingests into a large geode relay — publishing K *plain* notes costs the same — and that + * ingest path is JVM-cold on first use: consecutive K-note batches dropped monotonically + * (~3100 → ~570 ms) purely from JIT warmup. So the cost is O(K) relay-ingest dominated by + * one-time warmup, independent of N. + * * Default N is small so it doubles as a fast correctness guard; scale it with * `-DdelBenchN=200000` to see the shape at size. Not a speed assertion (container noise). */