Optimize storage, GC, and upload hot paths

This commit is contained in:
DioCrafts
2026-07-22 02:06:04 +02:00
parent 67fe944c2a
commit d66956824c
68 changed files with 16500 additions and 108 deletions
@@ -0,0 +1,771 @@
{
"schemaVersion": 1,
"generatedAt": "2026-07-22",
"benchmark": "admin user created_at index representative cost gate",
"environment": {
"platform": "darwin",
"arch": "arm64",
"cpu": "Apple M4 Pro",
"postgresImage": "postgres:18.2-alpine3.23",
"container": "oxicloud-postgres-1",
"client": "psql through docker exec"
},
"method": {
"rowsPerDistribution": 500000,
"independentTransactions": 3,
"samplesPerTransactionAndShape": 5,
"totalSamplesPerShape": 15,
"warmupsPerTransactionAndShape": 1,
"order": "A/B for the accepted timestamp-only result; a later A/B/C gate rotated no-index/simple/compound order inside every transaction",
"harnessEvolution": "the current representative SQL is the expanded A/B/C version; the top-level distribution samples retain the earlier A/B authorization run, while compoundRepresentativeABC retains the later isolated rerun",
"cleanup": "every transaction ended in ROLLBACK",
"commonIndexes": "both baseline and candidate tables have the same UUID primary-key index",
"insertBatchRows": 10000,
"insertValues": "prebuilt identical A/B batches with new timestamps and an indexed sample selector"
},
"previousTiedFixtureComparison": {
"timestampMultiplicity": 100,
"indexBytes": 3448832,
"uniqueToTiedIndexByteRatio": 3.263,
"reasonForFollowup": "PostgreSQL posting-list deduplication compressed repeated created_at keys and understated a normal mostly-unique registration workload"
},
"uniqueTimestamps": {
"distinctTimestamps": 500000,
"indexBytesEachRound": [
11255808,
11255808,
11255808
],
"indexBytesPerInitialUser": 22.512,
"indexBytesAfter50000InsertsEachRound": [
13271040,
13271040,
13271040
],
"firstPage": {
"noIndexSamplesMs": [
98.496,
121.451,
98.425,
81.049,
94.833,
57.602,
62.54,
56.785,
56.918,
55.854,
57.217,
57.131,
54.457,
56.319,
56.651
],
"indexSamplesMs": [
0.459,
0.454,
0.242,
0.207,
0.215,
0.287,
0.208,
0.225,
0.14,
0.2,
0.232,
0.366,
0.146,
0.207,
0.203
],
"noIndexMedianMs": 57.217,
"indexMedianMs": 0.215,
"speedup": 266.13
},
"offset50000": {
"noIndexSamplesMs": [
230.025,
227.108,
191.025,
183.211,
178.795,
126.075,
132.155,
127.478,
120.407,
126.377,
123.691,
115.336,
119.425,
119.952,
120.519
],
"indexSamplesMs": [
6.437,
10.281,
11.446,
7.55,
8.74,
5.219,
5.244,
5.063,
5.215,
4.835,
5.165,
5.278,
5.169,
5.181,
4.767
],
"noIndexMedianMs": 126.377,
"indexMedianMs": 5.219,
"speedup": 24.21
},
"insert10000Rows": {
"noIndexSamplesMs": [
47.392,
56.38,
58.991,
80.918,
46.37,
34.132,
36.737,
37.678,
37.218,
38.92,
32.183,
35.237,
34.152,
36.031,
34.256
],
"indexSamplesMs": [
57.039,
65.393,
90.559,
54.394,
67.488,
42.624,
42.795,
44.224,
43.115,
47.013,
44.017,
43.637,
42.657,
43.835,
43.25
],
"noIndexMedianMs": 37.218,
"indexMedianMs": 44.017,
"extraMicrosecondsPerUser": 0.68
},
"correctness": {
"initialOrderMatchesEachRound": [
true,
true,
true
],
"finalCountsMatchEachRound": [
true,
true,
true
],
"finalOrderMatchesEachRound": [
true,
true,
true
]
}
},
"tenUserBursts": {
"distinctTimestamps": 50000,
"indexBytesEachRound": [
4751360,
4751360,
4751360
],
"indexBytesPerInitialUser": 9.503,
"indexBytesAfter50000InsertsEachRound": [
5603328,
5603328,
5603328
],
"firstPage": {
"noIndexSamplesMs": [
113.795,
129.772,
121.759,
114.103,
107.905,
76.321,
76.417,
74.491,
73.517,
75.56,
75.307,
74.247,
73.836,
74.131,
76.213
],
"indexSamplesMs": [
1.134,
0.219,
0.24,
0.7,
0.219,
0.286,
0.19,
0.269,
0.244,
0.212,
0.228,
0.196,
0.237,
0.237,
0.191
],
"noIndexMedianMs": 76.213,
"indexMedianMs": 0.237,
"speedup": 321.57
},
"offset50000": {
"noIndexSamplesMs": [
221.554,
235.467,
327.723,
220.735,
219.383,
139.801,
142.349,
136.331,
143.815,
149.221,
137.129,
133.334,
133.841,
132.927,
139.428
],
"indexSamplesMs": [
14.06,
15.705,
12.723,
12.931,
12.787,
7.385,
7.884,
7.219,
7.374,
7.475,
7.951,
7.783,
7.626,
7.465,
7.622
],
"noIndexMedianMs": 142.349,
"indexMedianMs": 7.783,
"speedup": 18.29
},
"insert10000Rows": {
"noIndexSamplesMs": [
52.854,
59.003,
62.892,
70.446,
70.98,
32.716,
33.745,
32.633,
34.996,
34.804,
43.5,
33.932,
32.596,
35.148,
34.663
],
"indexSamplesMs": [
61.26,
68.779,
58.442,
60.291,
100.505,
38.469,
39.399,
39.874,
39.556,
40.619,
40.819,
42.759,
40.281,
39.762,
41.015
],
"noIndexMedianMs": 34.996,
"indexMedianMs": 40.819,
"extraMicrosecondsPerUser": 0.582
},
"correctness": {
"initialOrderMatchesEachRound": [
true,
true,
true
],
"finalCountsMatchEachRound": [
true,
true,
true
],
"finalOrderMatchesEachRound": [
true,
true,
true
]
}
},
"decision": {
"status": "accepted_by_explicit_user_tradeoff",
"productionVariant": "timestamp-only created_at DESC index accepted; compound index rejected and not present in production",
"reason": "After seeing the corrected representative cost, the user explicitly accepted 11,255,808 bytes and +0.680 us per inserted user for unique timestamps (24.21x-266.13x read gains), plus 4,751,360 bytes and +0.582 us per user for ten-user bursts (18.29x-321.57x read gains). This decision does not cover the compound index. The isolated representative A/B/C follow-up rejected the compound index: it regressed the unique-timestamp first page and materially increased disk/write cost."
},
"compoundRepresentativeABC": {
"status": "rejected",
"candidate": "created_at DESC, id DESC compound index versus the accepted created_at DESC index",
"method": {
"rowsPerDistribution": 500000,
"independentTransactions": 3,
"samplesPerTransactionAndShape": 5,
"totalSamplesPerShape": 15,
"warmupsPerTransactionAndShape": 1,
"order": "A/B/C order rotated inside every transaction",
"cleanup": "every transaction ended in ROLLBACK",
"commonIndexes": "all tables have the same UUID primary-key index",
"insertBatchRows": 10000,
"timingIsolation": "canonical rerun after other CPU/PostgreSQL benchmark agents stopped"
},
"indexStorage": {
"uniqueTimestamps": {
"simpleBytesEachRound": [
11255808,
11255808,
11255808
],
"compoundBytesEachRound": [
20275200,
20275200,
20275200
],
"compoundMinusSimpleBytes": 9019392,
"compoundToSimpleRatio": 1.8013,
"compoundIncreasePercent": 80.131,
"simpleBytesAfter50000InsertsEachRound": [
13271040,
13271040,
13271040
],
"compoundBytesAfter50000InsertsEachRound": [
23920640,
23920640,
23920640
],
"afterInsertCompoundIncreasePercent": 80.247
},
"tenUserBursts": {
"simpleBytesEachRound": [
4751360,
4751360,
4751360
],
"compoundBytesEachRound": [
20324352,
20324352,
20324352
],
"compoundMinusSimpleBytes": 15572992,
"compoundToSimpleRatio": 4.2776,
"compoundIncreasePercent": 327.759,
"simpleBytesAfter50000InsertsEachRound": [
5603328,
5603328,
5603328
],
"compoundBytesAfter50000InsertsEachRound": [
24068096,
24068096,
24068096
],
"afterInsertCompoundIncreasePercent": 329.532
}
},
"uniqueTimestamps": {
"firstPage": {
"noIndexSamplesMs": [
79.055,
63.205,
69.033,
64.688,
66.893,
57.082,
56,
64.918,
70.986,
74.456,
88.976,
61.345,
56.376,
57.135,
59.125
],
"simpleSamplesMs": [
0.237,
0.124,
0.231,
0.256,
0.15,
0.37,
0.138,
0.219,
0.186,
0.141,
0.509,
0.167,
0.279,
0.175,
0.138
],
"compoundSamplesMs": [
0.121,
0.198,
0.164,
0.291,
0.204,
0.151,
0.216,
0.214,
0.118,
0.221,
0.477,
0.214,
0.164,
0.106,
0.194
],
"noIndexMedianMs": 64.688,
"simpleMedianMs": 0.186,
"compoundMedianMs": 0.198,
"compoundRegressionVsSimplePercent": 6.452
},
"offset50000": {
"noIndexSamplesMs": [
133.653,
122.937,
165.654,
154.255,
255.245,
124.888,
125.983,
139.393,
140.968,
137.235,
151.742,
143.292,
137.627,
147.725,
137.94
],
"simpleSamplesMs": [
6.273,
5.542,
5.288,
10.254,
6.294,
4.821,
5.034,
5.457,
5.628,
5.614,
15.465,
5.859,
5.174,
5.198,
5.096
],
"compoundSamplesMs": [
5.575,
3.119,
3.254,
8.087,
3.706,
3.137,
3.406,
3.505,
3.371,
4.983,
4.168,
4.069,
2.931,
3.018,
3.219
],
"noIndexMedianMs": 139.393,
"simpleMedianMs": 5.542,
"compoundMedianMs": 3.406,
"compoundSpeedupVsSimple": 1.627
},
"insert10000Rows": {
"noIndexSamplesMs": [
41.324,
42.365,
34.69,
37.787,
38.282,
49.078,
54.823,
58.893,
40.822,
56.537,
45.011,
38.21,
42.21,
35.842,
36.346
],
"simpleSamplesMs": [
54.828,
48.465,
42.161,
45.736,
58.347,
102.65,
71.567,
64.681,
56.949,
55.432,
55.426,
46.866,
47.472,
46.171,
46.097
],
"compoundSamplesMs": [
53.643,
51.835,
69.438,
44.606,
45.863,
65.229,
55.378,
56.733,
48.836,
47.771,
66.354,
47.254,
58.389,
44.03,
43.741
],
"noIndexMedianMs": 41.324,
"simpleMedianMs": 54.828,
"compoundMedianMs": 51.835,
"simpleExtraMicrosecondsPerUserVsNoIndex": 1.3504,
"compoundExtraMicrosecondsPerUserVsNoIndex": 1.0511,
"compoundDeltaMicrosecondsPerUserVsSimple": -0.2993
}
},
"tenUserBursts": {
"firstPage": {
"noIndexSamplesMs": [
97.536,
83.007,
82.563,
77.801,
81.854,
80.281,
84.272,
86.625,
117.336,
91.597,
78.241,
100.035,
73.378,
76.37,
73.884
],
"simpleSamplesMs": [
0.22,
0.124,
0.238,
0.371,
0.146,
0.231,
0.157,
0.612,
0.368,
0.436,
0.276,
0.133,
0.545,
0.224,
0.154
],
"compoundSamplesMs": [
0.11,
0.163,
0.343,
0.156,
0.192,
0.132,
0.206,
0.24,
0.175,
0.486,
0.134,
0.158,
0.137,
0.106,
0.235
],
"noIndexMedianMs": 82.563,
"simpleMedianMs": 0.231,
"compoundMedianMs": 0.163,
"compoundSpeedupVsSimple": 1.417
},
"offset50000": {
"noIndexSamplesMs": [
181.149,
185.834,
155.003,
151.478,
153.175,
139.144,
140.267,
213.158,
188.745,
190.545,
184.289,
159.779,
156.309,
160.642,
157.767
],
"simpleSamplesMs": [
8.038,
8.418,
7.489,
7.892,
9.026,
7.378,
7.724,
8.3,
8.486,
11.09,
10.755,
7.569,
7.527,
7.927,
7.424
],
"compoundSamplesMs": [
4.191,
3.245,
3.386,
3.44,
3.327,
3.745,
3.893,
4.017,
4.171,
4.551,
7.326,
3.198,
3.402,
3.314,
3.317
],
"noIndexMedianMs": 159.779,
"simpleMedianMs": 7.927,
"compoundMedianMs": 3.44,
"compoundSpeedupVsSimple": 2.304
},
"insert10000Rows": {
"noIndexSamplesMs": [
56.852,
67.311,
35.277,
41.769,
38.984,
43.076,
40.612,
46.572,
41.514,
38.331,
56.728,
39.23,
36.724,
36.912,
36.015
],
"simpleSamplesMs": [
75.665,
73.424,
43.871,
43.275,
43.638,
59.345,
50.214,
44.475,
40.879,
46.694,
65.48,
42.844,
44.616,
44.221,
42.984
],
"compoundSamplesMs": [
48.496,
59.438,
42.891,
43.67,
45.941,
70.587,
57.743,
49.954,
48.921,
57.737,
58.111,
45.346,
49.969,
43.602,
45.851
],
"noIndexMedianMs": 40.612,
"simpleMedianMs": 44.475,
"compoundMedianMs": 48.921,
"simpleExtraMicrosecondsPerUserVsNoIndex": 0.3863,
"compoundExtraMicrosecondsPerUserVsNoIndex": 0.8309,
"compoundDeltaMicrosecondsPerUserVsSimple": 0.4446
}
},
"correctness": {
"initialOrderMatchesEachRound": [
true,
true,
true
],
"finalCountsMatchEachRound": [
true,
true,
true
],
"finalOrderMatchesEachRound": [
true,
true,
true
]
},
"decision": "rejected: versus the accepted narrow index, the compound index regressed the common unique-timestamp first page by 6.45%, enlarged the btree by 80.13%-327.76%, and added 0.445 us/user to burst inserts. Its 1.63x-2.30x deep-page gains do not pass the no-regression resource gate."
}
}
@@ -0,0 +1,272 @@
{
"schemaVersion": 1,
"generatedAt": "2026-07-22",
"benchmark": "admin user listing full component-path A/B",
"environment": {
"platform": "darwin",
"arch": "arm64",
"cpu": "Apple M4 Pro",
"postgresImage": "postgres:18.2-alpine3.23",
"container": "oxicloud-postgres-1",
"client": "release Rust/sqlx harness over the local container bridge"
},
"scope": {
"historical": "full-row SQL -> full DTO -> COUNT SQL -> Serde JSON",
"candidate": "hot Moka user-flags lookup -> system-admin policy check -> narrow summary SQL -> summary DTO -> COUNT SQL -> Serde JSON",
"commonWork": "one sqlx connection, identical 100-user ordering/count/pagination, identical temporary fixture and JSON page envelope",
"excluded": "Axum routing, JWT parsing, socket-level HTTP framing and browser parsing; the historical side also omits the old handler's intermediate serde_json::Value materialization, making its baseline optimistic. This is a conservative component-path gate, not a whole HTTP-stack claim"
},
"method": {
"users": 100,
"limit": 100,
"offset": 0,
"minimalProfile": "small ordinary account-detail fields",
"heavyProfile": "512 KiB image and 8 KiB UI-preference payload per user",
"timing": "interleaved/alternating paths after three warmups; isolated from other benchmark agents",
"rss": "three fresh client processes per path/profile using /usr/bin/time -l; process setup is common and included in max RSS",
"databaseState": "per-process PostgreSQL TEMP table; no persistent rows or indexes"
},
"minimal": {
"timing": {
"samples": 31,
"warmups": 3,
"order": "interleaved and alternated",
"historicalFullSamplesMs": [
4.4581669999999995,
0.8505,
0.9585,
0.808334,
0.865125,
0.867916,
0.8726670000000001,
0.937375,
1.013833,
1.114166,
5.163166,
206.010333,
208.088916,
4.949625,
1.5272919999999999,
2.3782080000000003,
0.9502090000000001,
8.851790999999999,
3.048167,
1.546792,
1.5305410000000002,
1.380125,
1.295833,
1.279625,
1.33425,
0.9305410000000001,
8.786916,
1.217792,
5.245125,
0.967917,
1.1993749999999999
],
"candidateSummaryHotAuthzSamplesMs": [
1.0223330000000002,
0.7933330000000001,
0.829875,
0.793083,
0.86025,
0.7274160000000001,
5.1122499999999995,
0.9088339999999999,
0.707833,
0.746458,
0.8647079999999999,
10.13475,
1.094375,
206.91925,
1.455792,
1.13725,
0.791542,
4.578875,
1.0007499999999998,
1.060708,
1.033833,
0.9833330000000001,
1.194166,
0.917292,
0.966334,
5.308375,
0.965333,
1.058333,
0.804084,
0.829,
0.885375
],
"historicalFullMedianMs": 1.295833,
"candidateSummaryHotAuthzMedianMs": 0.966334,
"medianSpeedup": 1.3409783780763174,
"historicalFullP95Ms": 206.010333,
"candidateSummaryHotAuthzP95Ms": 10.13475,
"p95Speedup": 20.327125286760896,
"historicalJsonBytes": 43759,
"candidateJsonBytes": 28726,
"byteReductionPercent": 34.35407573299207,
"summaryProjectionEqual": true,
"totalEqual": true
},
"freshProcessMemory": {
"runsPerMode": 3,
"historical": [
{
"maxRssBytes": 7782400,
"responseElapsedMs": 1.56875,
"jsonBytes": 43759,
"exitCode": 0
},
{
"maxRssBytes": 7782400,
"responseElapsedMs": 204.553417,
"jsonBytes": 43759,
"exitCode": 0
},
{
"maxRssBytes": 7782400,
"responseElapsedMs": 2.007917,
"jsonBytes": 43759,
"exitCode": 0
}
],
"candidate": [
{
"maxRssBytes": 7651328,
"responseElapsedMs": 3.949834,
"jsonBytes": 28726,
"exitCode": 0
},
{
"maxRssBytes": 7667712,
"responseElapsedMs": 1.091208,
"jsonBytes": 28726,
"exitCode": 0
},
{
"maxRssBytes": 7684096,
"responseElapsedMs": 0.982916,
"jsonBytes": 28726,
"exitCode": 0
}
],
"historicalMedianMaxRssBytes": 7782400,
"candidateMedianMaxRssBytes": 7667712,
"candidateMinusHistoricalRssBytes": -114688,
"rssReductionPercent": 1.473684210526316,
"historicalColdMedianElapsedMs": 2.007917,
"candidateColdMedianElapsedMs": 1.091208,
"coldMedianSpeedup": 1.8400863996598267
}
},
"heavy": {
"timing": {
"samples": 11,
"warmups": 3,
"order": "interleaved and alternated",
"historicalFullSamplesMs": [
3519.616458,
4157.738708,
870.990208,
301.8805,
1296.212125,
1141.4217500000002,
60.022708,
297.898916,
2261.6492089999997,
1438.1172920000001,
398.208167
],
"candidateSummaryHotAuthzSamplesMs": [
4.283292,
0.9297500000000001,
0.933166,
0.719,
219.19591699999998,
16.399291,
0.919209,
0.654208,
0.965792,
5.121874999999999,
1.2095
],
"historicalFullMedianMs": 1141.4217500000002,
"candidateSummaryHotAuthzMedianMs": 0.965792,
"medianSpeedup": 1181.8504916172428,
"historicalFullP95Ms": 4157.738708,
"candidateSummaryHotAuthzP95Ms": 219.19591699999998,
"p95Speedup": 18.96813939285192,
"historicalJsonBytes": 53306743,
"candidateJsonBytes": 28726,
"byteReductionPercent": 99.9461118830689,
"summaryProjectionEqual": true,
"totalEqual": true
},
"freshProcessMemory": {
"runsPerMode": 3,
"historical": [
{
"maxRssBytes": 151683072,
"responseElapsedMs": 4506.601708,
"jsonBytes": 53306743,
"exitCode": 0
},
{
"maxRssBytes": 144162816,
"responseElapsedMs": 2585.629333,
"jsonBytes": 53306743,
"exitCode": 0
},
{
"maxRssBytes": 146292736,
"responseElapsedMs": 6410.820542,
"jsonBytes": 53306743,
"exitCode": 0
}
],
"candidate": [
{
"maxRssBytes": 7667712,
"responseElapsedMs": 1.080875,
"jsonBytes": 28726,
"exitCode": 0
},
{
"maxRssBytes": 7651328,
"responseElapsedMs": 1.061042,
"jsonBytes": 28726,
"exitCode": 0
},
{
"maxRssBytes": 7667712,
"responseElapsedMs": 2.09175,
"jsonBytes": 28726,
"exitCode": 0
}
],
"historicalMedianMaxRssBytes": 146292736,
"candidateMedianMaxRssBytes": 7667712,
"candidateMinusHistoricalRssBytes": -138625024,
"rssReductionPercent": 94.75865158472394,
"historicalColdMedianElapsedMs": 4506.601708,
"candidateColdMedianElapsedMs": 1.080875,
"coldMedianSpeedup": 4169.401372036545
}
},
"correctness": {
"exactRenderedFieldProjectionAndOrder": true,
"exactTotalCount": true,
"hotAuthorizationFlagsAsserted": {
"role": "admin",
"isExternal": false,
"active": true
},
"allProcessesExitedSuccessfully": true
},
"decision": {
"status": "accepted",
"productionVariant": "summary=true compact admin listing with authoritative service-layer AuthZ",
"reason": "The representative minimal profile improved median component latency 1.296 -> 0.966 ms, reduced JSON 34.35%, and saved 112 KiB median max RSS. The heavy profile improved median latency 1141.422 -> 0.966 ms, reduced JSON 99.946%, and saved 138,625,024 bytes median max RSS. Exact projected fields, order, and counts matched."
}
}
@@ -0,0 +1,175 @@
{
"schemaVersion": 1,
"generatedAt": "2026-07-22",
"decisions": {
"adminUserProjection": "accepted: conservative component-path gate passed latency, JSON bytes, exact fields/counts, and fresh-process RSS for minimal and heavy profiles",
"adminCreatedAtIndex": "accepted_by_explicit_user_tradeoff: after the tied fixture was superseded, the user explicitly accepted representative unique timestamps at 11,255,808 bytes and +0.680 us per inserted user (24.21x-266.13x read gains), plus burst10 at 4,751,360 bytes and +0.582 us per user; the later representative compound candidate was rejected",
"adminCountWindowFusion": "rejected; no production change",
"localSyncPreparation": "accepted; empty fast return and every measured non-empty size improved; path/directory equivalence passed"
},
"environment": {
"platform": "darwin",
"arch": "arm64",
"cpu": "Apple M4 Pro",
"rustc": "1.93.0",
"postgres": "oxicloud-postgres-1 local Docker container"
},
"adminUserProjection": {
"timingScope": "psql query execution, row transfer, and client decoding; excludes HTTP/Serde and the service-layer authorization check",
"fixture": {
"users": 100,
"avatarBytesPerUser": 524288,
"preferencesBytesPerUser": 8192
},
"current": {
"jsonBytes": 53315361,
"samplesMs": [79.871, 64.878, 42.010, 63.094, 59.987],
"medianMs": 63.094
},
"compactSummary": {
"jsonBytes": 31671,
"samplesMs": [0.764, 0.535, 0.660, 0.304, 0.524],
"medianMs": 0.535
},
"speedup": 117.93,
"byteReductionPercent": 99.9406,
"decision": "accepted"
},
"adminCountWindowFusion": {
"fixtureUsers": 100000,
"currentPagePlusCountSamplesMs": [11.081, 5.255, 5.604, 10.597, 5.237],
"currentMedianMs": 5.604,
"countWindowSamplesMs": [61.966, 39.277, 36.788, 42.287, 64.007],
"countWindowMedianMs": 42.287,
"candidateSlowdown": 7.55,
"decision": "rejected; no production change"
},
"adminCreatedAtIndex": {
"fixtureUsers": 500000,
"tiedTimestampGroups": 5000,
"allOrdersMatch": true,
"timestampIndexBytes": 3448832,
"timestampIndexBytesPerUser": 6.90,
"compoundIndexBytes": 20332544,
"compoundIndexBytesPerUser": 40.67,
"firstPage": {
"noIndexSamplesMs": [162.111, 181.379, 185.911, 193.284, 193.223],
"noIndexMedianMs": 185.911,
"timestampSamplesMs": [0.368, 0.316, 0.397, 0.173, 0.438],
"timestampMedianMs": 0.368,
"timestampSpeedup": 505.19,
"compoundSamplesMs": [0.178, 0.397, 0.234, 0.245, 0.240],
"compoundMedianMs": 0.240,
"compoundSpeedup": 774.63
},
"offset50000": {
"noIndexSamplesMs": [343.654, 333.319, 343.129, 363.514, 347.188],
"noIndexMedianMs": 343.654,
"timestampSamplesMs": [21.305, 24.210, 26.183, 24.117, 20.882],
"timestampMedianMs": 24.117,
"timestampSpeedup": 14.25,
"compoundSamplesMs": [6.530, 9.761, 5.968, 8.284, 8.557],
"compoundMedianMs": 8.284,
"compoundSpeedup": 41.48
},
"insert10000Rows": {
"noIndexSamplesMs": [5.916, 8.354, 10.674, 5.658, 9.169],
"noIndexMedianMs": 8.354,
"timestampSamplesMs": [16.209, 14.310, 12.504, 11.911, 16.665],
"timestampMedianMs": 14.310,
"timestampExtraMicrosecondsPerUser": 0.596,
"compoundSamplesMs": [18.748, 19.204, 19.819, 17.212, 21.492],
"compoundMedianMs": 19.204,
"compoundExtraMicrosecondsPerUser": 1.085
},
"decision": "evidence_only_superseded_by_representative_gate: tied-timestamp read results remain valid, but posting-list deduplication understated timestamp-only resource cost and invalidated the original compound comparison",
"representativeGateResult": "admin-user-index-representative-postgres18-macos-arm64.json"
},
"localSyncEmpty": {
"paths": 0,
"processes": 11,
"samplesPerProcess": 31,
"repetitionsPerSample": 100000,
"historicalProcessMediansNs": [26.501, 25.283, 26.715, 30.093, 29.759, 24.388, 25.102, 25.163, 32.574, 24.982, 25.607],
"fastReturnProcessMediansNs": [21.679, 23.283, 24.260, 25.231, 22.946, 21.540, 20.316, 20.186, 24.095, 25.565, 21.287],
"historicalMedianAcrossProcessesNs": 25.607,
"fastReturnMedianAcrossProcessesNs": 22.946,
"candidateWins": 10,
"speedup": 1.116,
"decision": "accepted"
},
"localSyncPreparation": [
{
"paths": 1,
"cloneGroupsUs": 0.157,
"moveGroupsUs": 0.128,
"groupSpeedup": 1.22,
"sortParentDirsUs": 0.119,
"prefixBitmapDirsUs": 0.088,
"directorySpeedup": 1.36
},
{
"paths": 8,
"cloneGroupsUs": 0.673,
"moveGroupsUs": 0.409,
"groupSpeedup": 1.64,
"sortParentDirsUs": 1.599,
"prefixBitmapDirsUs": 0.902,
"directorySpeedup": 1.77
},
{
"paths": 32,
"cloneGroupsUs": 3.424,
"moveGroupsUs": 2.166,
"groupSpeedup": 1.58,
"sortParentDirsUs": 4.078,
"prefixBitmapDirsUs": 3.318,
"directorySpeedup": 1.23
},
{
"paths": 128,
"cloneGroupsUs": 5.916,
"moveGroupsUs": 3.250,
"groupSpeedup": 1.82,
"sortParentDirsUs": 12.291,
"prefixBitmapDirsUs": 8.333,
"directorySpeedup": 1.47
},
{
"paths": 400,
"cloneGroupsUs": 17.000,
"moveGroupsUs": 8.958,
"groupSpeedup": 1.90,
"sortParentDirsUs": 97.500,
"prefixBitmapDirsUs": 16.958,
"directorySpeedup": 5.75
},
{
"paths": 1600,
"cloneGroupsUs": 64.541,
"moveGroupsUs": 33.083,
"groupSpeedup": 1.95,
"sortParentDirsUs": 800.708,
"prefixBitmapDirsUs": 22.584,
"directorySpeedup": 35.45
},
{
"paths": 10000,
"cloneGroupsUs": 622.000,
"moveGroupsUs": 260.458,
"groupSpeedup": 2.39,
"sortParentDirsUs": 4006.875,
"prefixBitmapDirsUs": 38.125,
"directorySpeedup": 105.10
},
{
"paths": 100000,
"cloneGroupsUs": 5893.958,
"moveGroupsUs": 2856.792,
"groupSpeedup": 2.06,
"sortParentDirsUs": 45596.041,
"prefixBitmapDirsUs": 214.750,
"directorySpeedup": 212.32
}
]
}
@@ -0,0 +1,98 @@
{
"date": "2026-07-22",
"status": "accepted",
"scope": "CachedBlobBackend range reads",
"contract": {
"range_semantics": "[start, end)",
"production_change": "Replace end - start + 1 with end.saturating_sub(start) on cold and hot cached reads."
},
"baseline_correctness_probe": {
"ranges": [
"[0, 1)",
"[1, 3)",
"[3, 3)",
"[2, EOF)"
],
"expected_lengths": [
1,
2,
0,
4
],
"local_backend_lengths": [
1,
2,
0,
4
],
"historical_cached_backend_lengths": [
2,
3,
1,
4
],
"cold_fill": {
"remote_gets": 1,
"remote_bytes": 6,
"elapsed_us": 408.5
},
"hot_read_loop": {
"iterations": 500,
"local_bytes": 1000,
"historical_cached_bytes": 1500,
"local_average_us": 32.16,
"historical_cached_average_us": 30.839
},
"outcome": "failed: the cached backend returned one extra byte whenever end was present"
},
"candidate_correctness": {
"cached_backend_lengths": [
1,
2,
0,
4
],
"cold_fill_remote_gets": 1,
"cold_fill_remote_bytes": 6,
"hot_read_loop_bytes": 1000,
"focused_test": "cargo test --lib cached_blob_backend::tests::range_end_is_exclusive_on_cold_and_hot_cache_reads",
"focused_test_result": "1 passed; 0 failed"
},
"standalone_ab": {
"source": "tools/perf-audit/cached_range_ab.rs",
"command": "cargo run --release --manifest-path tools/perf-audit/Cargo.toml --bin cached_range_ab",
"environment": {
"os": "macos",
"arch": "aarch64"
},
"range": {
"start": 1,
"end_exclusive": 3
},
"warmups_per_variant": 1000,
"iterations_per_variant": 10000,
"historical_inclusive": {
"bytes": 30000,
"bytes_per_read": 3,
"p50_us": 8.459,
"p95_us": 28.292,
"checksum": 2970000
},
"corrected_exclusive": {
"bytes": 20000,
"bytes_per_read": 2,
"p50_us": 8.459,
"p95_us": 26.917,
"checksum": 1970000
},
"delta_percent": {
"bytes": -33.333,
"p50_latency": 0.0,
"p95_latency": -4.86
}
},
"decision": {
"status": "accepted",
"reason": "The candidate restores the exclusive-end contract, removes exactly one surplus byte per bounded cached range, adds no remote request or round trip, and is latency-neutral at p50 while improving this sample's p95."
}
}
@@ -0,0 +1,99 @@
{
"schemaVersion": 1,
"generatedAt": "2026-07-21T20:11:44.735Z",
"decision": "evidence only; the above-10000 batching candidate was rejected by the full workflow gate and reverted",
"environment": {
"node": "v26.5.0",
"platform": "darwin",
"release": "25.5.0",
"arch": "arm64",
"cpu": "Apple M4 Pro",
"logicalCpus": 14,
"gcExposed": true
},
"config": {
"suite": "dedup",
"warmup": 3,
"samples": 15,
"queueCounts": [
10000,
50000
],
"progressCases": [
{
"items": 1000,
"updates": 10000
},
{
"items": 10000,
"updates": 5000
},
{
"items": 20000,
"updates": 5000
}
],
"hashCounts": [
25000
],
"dedupBatchSize": 10000,
"dedupConcurrency": 4,
"serverLatencyMs": 0,
"modeledFileBytes": 65536
},
"notes": {
"heap": "Median heap delta is indicative only; timing is the primary microbenchmark metric.",
"dedup": "The current >10k path is faster only because it is rejected and returns no owned hashes."
},
"suites": {
"dedup": [
{
"hashCount": 25000,
"current": {
"sampleCount": 15,
"medianMs": 13.010667000000012,
"p95Ms": 319.40154200000006,
"minMs": 5.714707999999973,
"maxMs": 319.40154200000006,
"medianHeapDeltaBytes": 4069400,
"medianRssDeltaBytes": 1687552
},
"candidate": {
"sampleCount": 15,
"medianMs": 25.275750000000016,
"p95Ms": 310.1661670000001,
"minMs": 9.728249999999662,
"maxMs": 310.1661670000001,
"medianHeapDeltaBytes": 12869632,
"medianRssDeltaBytes": 344064
},
"speedup": 0.5147489985460374,
"representative": {
"current": {
"checksum": 0,
"ownedCount": 0,
"contentBytesAvoided": 0,
"requests": 1,
"acceptedRequests": 0,
"rejectedRequests": 1,
"requestBytes": 1675012,
"responseBytes": 27,
"maxBatchHashes": 25000
},
"candidate": {
"checksum": 156237500,
"ownedCount": 12500,
"contentBytesAvoided": 819200000,
"requests": 3,
"acceptedRequests": 3,
"rejectedRequests": 0,
"requestBytes": 1675036,
"responseBytes": 837533,
"maxBatchHashes": 10000
}
}
}
]
},
"blackhole": 0
}
@@ -0,0 +1,99 @@
{
"schemaVersion": 1,
"generatedAt": "2026-07-21T20:11:34.135Z",
"decision": "evidence only; the above-10000 batching candidate was rejected by the full workflow gate and reverted",
"environment": {
"node": "v26.5.0",
"platform": "darwin",
"release": "25.5.0",
"arch": "arm64",
"cpu": "Apple M4 Pro",
"logicalCpus": 14,
"gcExposed": true
},
"config": {
"suite": "dedup",
"warmup": 3,
"samples": 15,
"queueCounts": [
10000,
50000
],
"progressCases": [
{
"items": 1000,
"updates": 10000
},
{
"items": 10000,
"updates": 5000
},
{
"items": 20000,
"updates": 5000
}
],
"hashCounts": [
25000
],
"dedupBatchSize": 512,
"dedupConcurrency": 4,
"serverLatencyMs": 0,
"modeledFileBytes": 65536
},
"notes": {
"heap": "Median heap delta is indicative only; timing is the primary microbenchmark metric.",
"dedup": "The current >10k path is faster only because it is rejected and returns no owned hashes."
},
"suites": {
"dedup": [
{
"hashCount": 25000,
"current": {
"sampleCount": 15,
"medianMs": 21.21845900000062,
"p95Ms": 263.2436670000002,
"minMs": 5.763707999999951,
"maxMs": 263.2436670000002,
"medianHeapDeltaBytes": 4066384,
"medianRssDeltaBytes": 1687552
},
"candidate": {
"sampleCount": 15,
"medianMs": 294.9569169999995,
"p95Ms": 607.8072920000004,
"minMs": 39.99287500000037,
"maxMs": 607.8072920000004,
"medianHeapDeltaBytes": 16555112,
"medianRssDeltaBytes": 49152
},
"speedup": 0.07193748570405845,
"representative": {
"current": {
"checksum": 0,
"ownedCount": 0,
"contentBytesAvoided": 0,
"requests": 1,
"acceptedRequests": 0,
"rejectedRequests": 1,
"requestBytes": 1675012,
"responseBytes": 27,
"maxBatchHashes": 25000
},
"candidate": {
"checksum": 156237500,
"ownedCount": 12500,
"contentBytesAvoided": 819200000,
"requests": 49,
"acceptedRequests": 49,
"rejectedRequests": 0,
"requestBytes": 1675588,
"responseBytes": 838039,
"maxBatchHashes": 512
}
}
}
]
},
"blackhole": 0
}
@@ -0,0 +1,110 @@
{
"schemaVersion": 1,
"generatedAt": "2026-07-21T20:31:30.847Z",
"decision": "evidence only; confirms the unchanged <=10000 fast path, while the above-10000 batching candidate was rejected and reverted",
"environment": {
"node": "v26.5.0",
"platform": "darwin",
"release": "25.5.0",
"arch": "arm64",
"cpu": "Apple M4 Pro",
"logicalCpus": 14,
"gcExposed": true
},
"config": {
"suite": "dedup",
"warmup": 7,
"samples": 41,
"queueCounts": [
64,
256,
1024,
10000,
50000
],
"progressCases": [
{
"items": 1,
"updates": 100
},
{
"items": 10,
"updates": 500
},
{
"items": 100,
"updates": 5000
},
{
"items": 1000,
"updates": 10000
},
{
"items": 10000,
"updates": 5000
}
],
"hashCounts": [
1000
],
"dedupBatchSize": 10000,
"dedupConcurrency": 4,
"serverLatencyMs": 0,
"modeledFileBytes": 65536
},
"notes": {
"heap": "Median heap delta is indicative only; timing is the primary microbenchmark metric.",
"dedup": "The current >10k path is faster only because it is rejected and returns no owned hashes."
},
"suites": {
"dedup": [
{
"hashCount": 1000,
"current": {
"sampleCount": 41,
"medianMs": 5.374666999999988,
"p95Ms": 30.969750000000204,
"minMs": 1.3017919999999776,
"maxMs": 59.26037499999984,
"medianHeapDeltaBytes": 575104,
"medianRssDeltaBytes": 0
},
"candidate": {
"sampleCount": 41,
"medianMs": 4.9794579999999655,
"p95Ms": 42.28670899999997,
"minMs": 1.1001249999999345,
"maxMs": 125.80937499999999,
"medianHeapDeltaBytes": 574760,
"medianRssDeltaBytes": 0
},
"speedup": 1.0793678749775628,
"representative": {
"current": {
"checksum": 249500,
"ownedCount": 500,
"contentBytesAvoided": 32768000,
"requests": 1,
"acceptedRequests": 1,
"rejectedRequests": 0,
"requestBytes": 67012,
"responseBytes": 33511,
"maxBatchHashes": 1000
},
"candidate": {
"checksum": 249500,
"ownedCount": 500,
"contentBytesAvoided": 32768000,
"requests": 1,
"acceptedRequests": 1,
"rejectedRequests": 0,
"requestBytes": 67012,
"responseBytes": 33511,
"maxBatchHashes": 1000
}
}
}
]
},
"blackhole": 0
}
@@ -0,0 +1,251 @@
{
"schemaVersion": 1,
"generatedAt": "2026-07-21T20:31:04.178Z",
"decision": "evidence only; the above-10000 batching candidate was rejected by the full workflow gate and reverted",
"environment": {
"node": "v26.5.0",
"platform": "darwin",
"release": "25.5.0",
"arch": "arm64",
"cpu": "Apple M4 Pro",
"logicalCpus": 14,
"gcExposed": true
},
"config": {
"suite": "dedup",
"warmup": 5,
"samples": 15,
"queueCounts": [
64,
256,
1024,
10000,
50000
],
"progressCases": [
{
"items": 1,
"updates": 100
},
{
"items": 10,
"updates": 500
},
{
"items": 100,
"updates": 5000
},
{
"items": 1000,
"updates": 10000
},
{
"items": 10000,
"updates": 5000
}
],
"hashCounts": [
1000,
10000,
10001,
25000
],
"dedupBatchSize": 10000,
"dedupConcurrency": 4,
"serverLatencyMs": 0,
"modeledFileBytes": 65536
},
"notes": {
"heap": "Median heap delta is indicative only; timing is the primary microbenchmark metric.",
"dedup": "The current >10k path is faster only because it is rejected and returns no owned hashes."
},
"suites": {
"dedup": [
{
"hashCount": 1000,
"current": {
"sampleCount": 15,
"medianMs": 4.66216600000007,
"p95Ms": 23.915542000000016,
"minMs": 1.9842080000000237,
"maxMs": 23.915542000000016,
"medianHeapDeltaBytes": 583320,
"medianRssDeltaBytes": 0
},
"candidate": {
"sampleCount": 15,
"medianMs": 5.586167000000046,
"p95Ms": 22.62520799999993,
"minMs": 3.662083999999993,
"maxMs": 22.62520799999993,
"medianHeapDeltaBytes": 578504,
"medianRssDeltaBytes": 0
},
"speedup": 0.8345912322349174,
"representative": {
"current": {
"checksum": 249500,
"ownedCount": 500,
"contentBytesAvoided": 32768000,
"requests": 1,
"acceptedRequests": 1,
"rejectedRequests": 0,
"requestBytes": 67012,
"responseBytes": 33511,
"maxBatchHashes": 1000
},
"candidate": {
"checksum": 249500,
"ownedCount": 500,
"contentBytesAvoided": 32768000,
"requests": 1,
"acceptedRequests": 1,
"rejectedRequests": 0,
"requestBytes": 67012,
"responseBytes": 33511,
"maxBatchHashes": 1000
}
}
},
{
"hashCount": 10000,
"current": {
"sampleCount": 15,
"medianMs": 12.211541000000125,
"p95Ms": 138.27816600000006,
"minMs": 5.708917000000156,
"maxMs": 138.27816600000006,
"medianHeapDeltaBytes": 4629728,
"medianRssDeltaBytes": 671744
},
"candidate": {
"sampleCount": 15,
"medianMs": 10.960124999999834,
"p95Ms": 68.23608400000012,
"minMs": 7.660417000000052,
"maxMs": 68.23608400000012,
"medianHeapDeltaBytes": 4629608,
"medianRssDeltaBytes": 671744
},
"speedup": 1.1141789897469516,
"representative": {
"current": {
"checksum": 24995000,
"ownedCount": 5000,
"contentBytesAvoided": 327680000,
"requests": 1,
"acceptedRequests": 1,
"rejectedRequests": 0,
"requestBytes": 670012,
"responseBytes": 335011,
"maxBatchHashes": 10000
},
"candidate": {
"checksum": 24995000,
"ownedCount": 5000,
"contentBytesAvoided": 327680000,
"requests": 1,
"acceptedRequests": 1,
"rejectedRequests": 0,
"requestBytes": 670012,
"responseBytes": 335011,
"maxBatchHashes": 10000
}
}
},
{
"hashCount": 10001,
"current": {
"sampleCount": 15,
"medianMs": 5.437792000000172,
"p95Ms": 10.699207999999999,
"minMs": 2.1932090000000244,
"maxMs": 10.699207999999999,
"medianHeapDeltaBytes": 2370176,
"medianRssDeltaBytes": 0
},
"candidate": {
"sampleCount": 15,
"medianMs": 10.77975000000015,
"p95Ms": 13.00845900000013,
"minMs": 7.553665999999794,
"maxMs": 13.00845900000013,
"medianHeapDeltaBytes": 5290256,
"medianRssDeltaBytes": 0
},
"speedup": 0.5044450938101623,
"representative": {
"current": {
"checksum": 0,
"ownedCount": 0,
"contentBytesAvoided": 0,
"requests": 1,
"acceptedRequests": 0,
"rejectedRequests": 1,
"requestBytes": 670079,
"responseBytes": 27,
"maxBatchHashes": 10001
},
"candidate": {
"checksum": 25005000,
"ownedCount": 5001,
"contentBytesAvoided": 327745536,
"requests": 2,
"acceptedRequests": 2,
"rejectedRequests": 0,
"requestBytes": 670091,
"responseBytes": 335089,
"maxBatchHashes": 10000
}
}
},
{
"hashCount": 25000,
"current": {
"sampleCount": 15,
"medianMs": 9.382499999999709,
"p95Ms": 19.153124999999818,
"minMs": 5.52666599999975,
"maxMs": 19.153124999999818,
"medianHeapDeltaBytes": 4065728,
"medianRssDeltaBytes": 1687552
},
"candidate": {
"sampleCount": 15,
"medianMs": 31.40979100000004,
"p95Ms": 122.20316700000058,
"minMs": 10.393082999999933,
"maxMs": 122.20316700000058,
"medianHeapDeltaBytes": 12853840,
"medianRssDeltaBytes": 0
},
"speedup": 0.29871258933240585,
"representative": {
"current": {
"checksum": 0,
"ownedCount": 0,
"contentBytesAvoided": 0,
"requests": 1,
"acceptedRequests": 0,
"rejectedRequests": 1,
"requestBytes": 1675012,
"responseBytes": 27,
"maxBatchHashes": 25000
},
"candidate": {
"checksum": 156237500,
"ownedCount": 12500,
"contentBytesAvoided": 819200000,
"requests": 3,
"acceptedRequests": 3,
"rejectedRequests": 0,
"requestBytes": 1675036,
"responseBytes": 837533,
"maxBatchHashes": 10000
}
}
}
]
},
"blackhole": 0
}
@@ -0,0 +1,116 @@
{
"schemaVersion": 1,
"generatedAt": "2026-07-21T21:22:59.466Z",
"environment": {
"node": "v26.5.0",
"platform": "darwin",
"arch": "arm64"
},
"fixture": {
"hashes": 10001,
"bytesPerFile": 4096,
"uploadConcurrency": 2
},
"note": "Loopback mock includes every dedup, by-hash and content request. Hashing is excluded. Backend SQL is unmodeled: current rejects before ownership lookup while candidate would execute two accepted queries, so candidate wall time is optimistic.",
"cases": [
{
"hitPercent": 0,
"current": {
"wallSamplesMs": [
13455.567,
7274.844,
11384.656
],
"wallMedianMs": 11384.656,
"peakHeapDeltaBytesMedian": 26577840,
"peakRssDeltaBytesMedian": 1376256,
"protocol": {
"ownedCount": 0,
"hitPercent": 0,
"dedupAccepted": 0,
"dedupRejected": 1,
"dedupRequestBytes": 670079,
"dedupResponseBytes": 27,
"uploadRequests": 10001,
"uploadContentBytes": 40964096,
"byHashRequests": 0,
"byHashRequestBytes": 0
}
},
"candidate": {
"wallSamplesMs": [
12545.523,
9374.644,
14373.866
],
"wallMedianMs": 12545.523,
"peakHeapDeltaBytesMedian": 27057808,
"peakRssDeltaBytesMedian": 2408448,
"protocol": {
"ownedCount": 0,
"hitPercent": 0,
"dedupAccepted": 2,
"dedupRejected": 0,
"dedupRequestBytes": 670091,
"dedupResponseBytes": 24,
"uploadRequests": 10001,
"uploadContentBytes": 40964096,
"byHashRequests": 0,
"byHashRequestBytes": 0
}
},
"wallSpeedup": 0.907,
"uploadByteReductionPercent": 0
},
{
"hitPercent": 50,
"current": {
"wallSamplesMs": [
8511.511,
10370.193,
7271.146
],
"wallMedianMs": 8511.511,
"peakHeapDeltaBytesMedian": 25917352,
"peakRssDeltaBytesMedian": 1753088,
"protocol": {
"ownedCount": 0,
"hitPercent": 50,
"dedupAccepted": 0,
"dedupRejected": 1,
"dedupRequestBytes": 670079,
"dedupResponseBytes": 27,
"uploadRequests": 10001,
"uploadContentBytes": 40964096,
"byHashRequests": 0,
"byHashRequestBytes": 0
}
},
"candidate": {
"wallSamplesMs": [
8095.953,
10204.387,
7060.576
],
"wallMedianMs": 8095.953,
"peakHeapDeltaBytesMedian": 50966480,
"peakRssDeltaBytesMedian": 29622272,
"protocol": {
"ownedCount": 5001,
"hitPercent": 50,
"dedupAccepted": 2,
"dedupRejected": 0,
"dedupRequestBytes": 670091,
"dedupResponseBytes": 335089,
"uploadRequests": 5000,
"uploadContentBytes": 20480000,
"byHashRequests": 5001,
"byHashRequestBytes": 574561
}
},
"wallSpeedup": 1.051,
"uploadByteReductionPercent": 50.005
}
],
"decision": "rejected; production reverted because the all-miss case was 10.2% slower with higher heap/RSS, while the 50%-hit case doubled heap and added about 27.9 MiB RSS"
}
@@ -0,0 +1,371 @@
{
"schemaVersion": 1,
"generatedAt": "2026-07-21T20:09:18.980Z",
"decisions": {
"progressAccumulator": "accepted",
"queueCursor": "superseded by the process-isolated memory gate; accepted only by explicit user trade-off",
"dedupAbove10000": "rejected by the full workflow gate; production reverted"
},
"environment": {
"node": "v26.5.0",
"platform": "darwin",
"release": "25.5.0",
"arch": "arm64",
"cpu": "Apple M4 Pro",
"logicalCpus": 14,
"gcExposed": true
},
"config": {
"suite": "all",
"warmup": 3,
"samples": 9,
"queueCounts": [
10000,
50000,
100000
],
"progressCases": [
{
"items": 1000,
"updates": 10000
},
{
"items": 10000,
"updates": 5000
},
{
"items": 20000,
"updates": 5000
}
],
"hashCounts": [
10001,
25000
],
"dedupBatchSize": 2048,
"dedupConcurrency": 4,
"serverLatencyMs": 0,
"modeledFileBytes": 65536
},
"notes": {
"heap": "Median heap delta is indicative only; timing is the primary microbenchmark metric.",
"dedup": "The current >10k path is faster only because it is rejected and returns no owned hashes."
},
"suites": {
"queue": [
{
"chunkCount": 10000,
"current": {
"sampleCount": 9,
"medianMs": 0.9245830000000126,
"p95Ms": 1.8680839999999819,
"minMs": 0.25729200000000674,
"maxMs": 1.8680839999999819,
"medianHeapDeltaBytes": 292640,
"medianRssDeltaBytes": 0
},
"candidate": {
"sampleCount": 9,
"medianMs": 0.18579199999999219,
"p95Ms": 0.49079100000000153,
"minMs": 0.17525000000000546,
"maxMs": 0.49079100000000153,
"medianHeapDeltaBytes": 295520,
"medianRssDeltaBytes": 0
},
"speedup": 4.976441396831142,
"representative": {
"current": {
"checksum": 4052813061,
"chunkCount": 10000,
"totalBytes": 1474232320,
"batchCount": 175
},
"candidate": {
"checksum": 4052813061,
"chunkCount": 10000,
"totalBytes": 1474232320,
"batchCount": 175,
"compactions": 2
}
}
},
{
"chunkCount": 50000,
"current": {
"sampleCount": 9,
"medianMs": 476.60450000000037,
"p95Ms": 780.6920419999997,
"minMs": 303.71608300000025,
"maxMs": 780.6920419999997,
"medianHeapDeltaBytes": 1459600,
"medianRssDeltaBytes": 0
},
"candidate": {
"sampleCount": 9,
"medianMs": 2.605415999998513,
"p95Ms": 9.112084000000323,
"minMs": 1.348041999999623,
"maxMs": 9.112084000000323,
"medianHeapDeltaBytes": 1459608,
"medianRssDeltaBytes": 0
},
"speedup": 182.92836921254508,
"representative": {
"current": {
"checksum": 3209478661,
"chunkCount": 50000,
"totalBytes": 7372603392,
"batchCount": 871
},
"candidate": {
"checksum": 3209478661,
"chunkCount": 50000,
"totalBytes": 7372603392,
"batchCount": 871,
"compactions": 4
}
}
},
{
"chunkCount": 100000,
"current": {
"sampleCount": 9,
"medianMs": 3615.438249999992,
"p95Ms": 6469.931125000003,
"minMs": 1282.712916999997,
"maxMs": 6469.931125000003,
"medianHeapDeltaBytes": 68144,
"medianRssDeltaBytes": 622592
},
"candidate": {
"sampleCount": 9,
"medianMs": 3.6333750000048894,
"p95Ms": 5.698041999989073,
"minMs": 2.7038749999919673,
"maxMs": 5.698041999989073,
"medianHeapDeltaBytes": 854600,
"medianRssDeltaBytes": 983040
},
"speedup": 995.0633364282868,
"representative": {
"current": {
"checksum": 725464645,
"chunkCount": 100000,
"totalBytes": 14745501696,
"batchCount": 1741
},
"candidate": {
"checksum": 725464645,
"chunkCount": 100000,
"totalBytes": 14745501696,
"batchCount": 1741,
"compactions": 5
}
}
}
],
"progress": [
{
"items": 1000,
"updates": 10000,
"current": {
"sampleCount": 9,
"medianMs": 27.865125000011176,
"p95Ms": 108.79308299999684,
"minMs": 17.72166599999764,
"maxMs": 108.79308299999684,
"medianHeapDeltaBytes": 1540496,
"medianRssDeltaBytes": 16384
},
"candidate": {
"sampleCount": 9,
"medianMs": 0.04041699999652337,
"p95Ms": 8.611833000002662,
"minMs": 0.031541999996989034,
"maxMs": 8.611833000002662,
"medianHeapDeltaBytes": 24872,
"medianRssDeltaBytes": 0
},
"speedup": 689.4407057032463,
"representative": {
"current": {
"checksum": 220783770,
"lastPercent": 51,
"finalSum": 509.25390625
},
"candidate": {
"checksum": 220783770,
"lastPercent": 51,
"finalSum": 509.25390625
}
}
},
{
"items": 10000,
"updates": 5000,
"current": {
"sampleCount": 9,
"medianMs": 104.48600000000442,
"p95Ms": 187.45629200000258,
"minMs": 73.81195800000569,
"maxMs": 187.45629200000258,
"medianHeapDeltaBytes": 1456624,
"medianRssDeltaBytes": 0
},
"candidate": {
"sampleCount": 9,
"medianMs": 0.033750000002328306,
"p95Ms": 0.18004200000723358,
"minMs": 0.03200000000651926,
"maxMs": 0.18004200000723358,
"medianHeapDeltaBytes": 240872,
"medianRssDeltaBytes": 0
},
"speedup": 3095.8814812680375,
"representative": {
"current": {
"checksum": 74165188,
"lastPercent": 19,
"finalSum": 1915.6953125
},
"candidate": {
"checksum": 74165188,
"lastPercent": 19,
"finalSum": 1915.6953125
}
}
},
{
"items": 20000,
"updates": 5000,
"current": {
"sampleCount": 9,
"medianMs": 282.27433400000155,
"p95Ms": 465.90625,
"minMs": 188.45816700000432,
"maxMs": 465.90625,
"medianHeapDeltaBytes": 4189728,
"medianRssDeltaBytes": 0
},
"candidate": {
"sampleCount": 9,
"medianMs": 0.08487500000046566,
"p95Ms": 0.19566700000723358,
"minMs": 0.06799999999930151,
"maxMs": 0.19566700000723358,
"medianHeapDeltaBytes": 680872,
"medianRssDeltaBytes": 0
},
"speedup": 3325.7653490244816,
"representative": {
"current": {
"checksum": 47455232,
"lastPercent": 11,
"finalSum": 2175.87109375
},
"candidate": {
"checksum": 47455232,
"lastPercent": 11,
"finalSum": 2175.87109375
}
}
}
],
"dedup": [
{
"hashCount": 10001,
"current": {
"sampleCount": 9,
"medianMs": 4.849792000008165,
"p95Ms": 17.9151669999992,
"minMs": 1.8024589999986347,
"maxMs": 17.9151669999992,
"medianHeapDeltaBytes": 2372344,
"medianRssDeltaBytes": 671744
},
"candidate": {
"sampleCount": 9,
"medianMs": 12.786791999998968,
"p95Ms": 75.20012499998847,
"minMs": 7.695166999998037,
"maxMs": 75.20012499998847,
"medianHeapDeltaBytes": 5584440,
"medianRssDeltaBytes": 16384
},
"speedup": 0.3792813709653333,
"representative": {
"current": {
"checksum": 0,
"ownedCount": 0,
"contentBytesAvoided": 0,
"requests": 1,
"acceptedRequests": 0,
"rejectedRequests": 1,
"requestBytes": 670079,
"responseBytes": 27,
"maxBatchHashes": 10001
},
"candidate": {
"checksum": 25005000,
"ownedCount": 5001,
"contentBytesAvoided": 327745536,
"requests": 5,
"acceptedRequests": 5,
"rejectedRequests": 0,
"requestBytes": 670127,
"responseBytes": 335122,
"maxBatchHashes": 2048
}
}
},
{
"hashCount": 25000,
"current": {
"sampleCount": 9,
"medianMs": 5.98787500000617,
"p95Ms": 27.3851250000007,
"minMs": 3.5451669999893056,
"maxMs": 27.3851250000007,
"medianHeapDeltaBytes": 4067864,
"medianRssDeltaBytes": 1687552
},
"candidate": {
"sampleCount": 9,
"medianMs": 19.696374999999534,
"p95Ms": 56.47870900000271,
"minMs": 15.562999999994645,
"maxMs": 56.47870900000271,
"medianHeapDeltaBytes": 13599800,
"medianRssDeltaBytes": 16384
},
"speedup": 0.3040089864254875,
"representative": {
"current": {
"checksum": 0,
"ownedCount": 0,
"contentBytesAvoided": 0,
"requests": 1,
"acceptedRequests": 0,
"rejectedRequests": 1,
"requestBytes": 1675012,
"responseBytes": 27,
"maxBatchHashes": 25000
},
"candidate": {
"checksum": 156237500,
"ownedCount": 12500,
"contentBytesAvoided": 819200000,
"requests": 13,
"acceptedRequests": 13,
"rejectedRequests": 0,
"requestBytes": 1675156,
"responseBytes": 837643,
"maxBatchHashes": 2048
}
}
}
]
},
"blackhole": 0
}
@@ -0,0 +1,189 @@
{
"schema_version": 2,
"benchmark": "dedup_gc_phase1_manifest_batching",
"date": "2026-07-22",
"baseline_source": "src/infrastructure/services/dedup_service.rs::garbage_collect_with_grace phase 1",
"environment": {
"postgres_image": "postgres:18.2-alpine3.23",
"container": "oxicloud-postgres-1",
"database_isolation": "random throw-away database, dropped by runner trap",
"harness_profile": "release",
"transport_note": "SQLx used the container private IP because the sandbox could not reach the published host port. Statement-count reduction is transport-independent; medians are specific to this host path.",
"ordering": "candidate order rotated every sample; fixture reset and correctness validation excluded from timing"
},
"fixture": {
"batch_size": 500,
"chunks_per_manifest": 16,
"shared_chunk_percent": 50,
"shared_chunk_pool": 512,
"duplicate_control": "every 10th manifest repeats one chunk; accounting is one reference per distinct hash per manifest"
},
"rejected_atomic_cte_idle_gate": [
{
"orphan_manifests": 0,
"live_manifests": 10,
"samples": 31,
"current_median_ms": 1.950,
"cte_median_ms": 2.463,
"cte_regression_percent": 26.28,
"statements_current_to_cte": "1 -> 1"
},
{
"orphan_manifests": 0,
"live_manifests": 500,
"samples": 41,
"current_median_ms": 1.704,
"cte_median_ms": 2.468,
"cte_regression_percent": 44.84,
"statements_current_to_cte": "1 -> 1"
},
{
"orphan_manifests": 0,
"live_manifests": 5000,
"samples": 31,
"current_median_ms": 1.951,
"cte_median_ms": 2.256,
"cte_regression_percent": 15.59,
"statements_current_to_cte": "1 -> 1"
}
],
"accepted_hybrid": {
"status": "accepted_by_explicit_user_tradeoff",
"shape": "simple DELETE/RETURNING always; exact historical serial UPDATE for one manifest; Rust distinct-per-manifest aggregation plus one UPDATE FROM unnest for batches of two or more",
"aggregate_threshold": 2,
"thresholds_swept": [2, 4, 8, 32, 500],
"idle_and_single_no_regression_gate": [
{
"orphan_manifests": 0,
"live_manifests": 500,
"warmups": 5,
"samples": 31,
"current_elapsed_ms": [0.639, 0.611, 0.619, 2.360, 0.770, 0.850, 0.934, 0.985, 0.655, 0.791, 0.708, 0.727, 0.740, 0.674, 1.260, 0.881, 0.877, 0.738, 0.674, 0.753, 0.769, 0.686, 0.652, 0.661, 0.531, 0.876, 0.653, 0.668, 0.674, 0.739, 0.740],
"hybrid_elapsed_ms": [0.752, 0.602, 0.711, 1.061, 0.754, 0.868, 0.967, 0.815, 0.741, 0.777, 0.710, 0.869, 0.639, 0.547, 1.141, 1.206, 1.105, 0.692, 0.824, 0.794, 0.721, 0.656, 0.610, 0.632, 0.681, 0.726, 0.519, 0.623, 0.596, 0.679, 0.737],
"current_median_ms": 0.738,
"hybrid_median_ms": 0.726,
"median_speedup_x": 1.02,
"statements_current_to_hybrid": "1 -> 1",
"correctness": "PASS"
},
{
"orphan_manifests": 1,
"live_manifests": 499,
"warmups": 5,
"samples": 31,
"current_elapsed_ms": [5.058, 5.156, 4.205, 223.094, 4.718, 4.605, 3.509, 2.939, 4.250, 4.591, 5.255, 4.127, 5.163, 3.950, 6.076, 5.642, 4.428, 3.392, 4.246, 3.913, 4.708, 4.228, 3.927, 5.702, 4.062, 4.862, 4.540, 3.988, 3.854, 6.148, 4.436],
"hybrid_elapsed_ms": [3.713, 4.915, 4.106, 5.162, 5.328, 3.439, 4.279, 3.096, 4.479, 4.595, 5.153, 5.766, 3.427, 7.188, 4.423, 3.684, 3.561, 4.434, 3.777, 3.453, 4.016, 6.334, 4.455, 4.692, 3.840, 3.406, 3.860, 4.336, 4.252, 6.061, 3.809],
"current_median_ms": 4.436,
"hybrid_median_ms": 4.279,
"median_speedup_x": 1.04,
"statements_current_to_hybrid": "3 -> 3",
"correctness": "PASS"
}
],
"crossover_gate": [
{"orphan_manifests": 2, "samples": 9, "current_median_ms": 6.323, "hybrid_median_ms": 5.806, "median_speedup_x": 1.09, "statements_current_to_hybrid": "4 -> 3", "correctness": "PASS"},
{"orphan_manifests": 4, "samples": 9, "current_median_ms": 11.719, "hybrid_median_ms": 5.761, "median_speedup_x": 2.03, "statements_current_to_hybrid": "6 -> 3", "correctness": "PASS"},
{"orphan_manifests": 8, "samples": 9, "current_median_ms": 40.489, "hybrid_median_ms": 5.662, "median_speedup_x": 7.15, "statements_current_to_hybrid": "10 -> 3", "correctness": "PASS"},
{"orphan_manifests": 32, "samples": 9, "current_median_ms": 212.165, "hybrid_median_ms": 8.117, "median_speedup_x": 26.14, "statements_current_to_hybrid": "34 -> 3", "correctness": "PASS"}
],
"large_batch_gate": [
{
"orphan_manifests": 500,
"samples": 5,
"current_elapsed_ms": [907.975, 458.300, 1456.096, 1795.532, 1568.453],
"hybrid_elapsed_ms": [25.468, 18.753, 20.155, 191.159, 24.255],
"current_median_ms": 1456.096,
"hybrid_median_ms": 24.255,
"median_speedup_x": 60.03,
"statements_current_to_hybrid": "502 -> 3",
"correctness": "PASS"
},
{
"orphan_manifests": 1000,
"samples": 5,
"current_elapsed_ms": [4280.878, 3925.644, 3163.190, 1364.115, 1738.119],
"hybrid_elapsed_ms": [61.829, 310.179, 49.885, 51.440, 65.973],
"current_median_ms": 3163.190,
"hybrid_median_ms": 61.829,
"median_speedup_x": 51.16,
"statements_current_to_hybrid": "1003 -> 5",
"correctness": "PASS"
}
],
"fresh_process_max_rss_vs_serial": [
{
"orphan_manifests": 2,
"runs_per_mode": 5,
"serial_bytes": [7733248, 7684096, 7749632, 7766016, 7749632],
"hybrid_bytes": [7749632, 7798784, 7782400, 7733248, 7700480],
"serial_median_bytes": 7749632,
"hybrid_median_bytes": 7749632,
"hybrid_delta_bytes": 0
},
{
"orphan_manifests": 500,
"runs_per_mode": 5,
"serial_bytes": [8503296, 8404992, 8437760, 8519680, 8388608],
"hybrid_bytes": [9093120, 9109504, 9175040, 9175040, 9175040],
"serial_median_bytes": 8437760,
"hybrid_median_bytes": 9175040,
"hybrid_delta_bytes": 737280,
"hybrid_delta_kib": 720,
"hybrid_delta_percent": 8.74
},
{
"orphan_manifests": 1000,
"runs_per_mode": 5,
"serial_bytes": [8568832, 8585216, 8568832, 8503296, 8536064],
"hybrid_bytes": [9486336, 9650176, 9650176, 9601024, 9306112],
"serial_median_bytes": 8568832,
"hybrid_median_bytes": 9601024,
"hybrid_delta_bytes": 1032192,
"hybrid_delta_kib": 1008,
"hybrid_delta_percent": 12.05
}
],
"tradeoff": "explicitly accepted by the user: retain 60.03x/51.16x median speedups for +720 KiB/+1008 KiB max RSS at 500/1000 orphan manifests"
},
"rejected_borrowed_sqlx_bind": {
"candidate": "bind Vec<&str> borrowed from the returned manifest batch instead of cloning each unique hash into Vec<String>",
"latency_gate": [
{"orphan_manifests": 2, "samples": 15, "owned_median_ms": 4.843, "borrowed_median_ms": 4.800, "borrowed_delta_percent": 0.89},
{"orphan_manifests": 500, "samples": 15, "owned_median_ms": 24.709, "borrowed_median_ms": 27.459, "borrowed_regression_percent": 11.13},
{"orphan_manifests": 1000, "samples": 15, "owned_median_ms": 55.042, "borrowed_median_ms": 56.439, "borrowed_regression_percent": 2.54}
],
"fresh_process_max_rss_gate": [
{"orphan_manifests": 2, "runs_per_mode": 3, "owned_bytes": [7880704, 7798784, 7897088], "borrowed_bytes": [7700480, 7766016, 7864320], "owned_median_bytes": 7880704, "borrowed_median_bytes": 7766016, "borrowed_saves_bytes": 114688},
{"orphan_manifests": 500, "runs_per_mode": 3, "owned_bytes": [9224192, 9191424, 9224192], "borrowed_bytes": [9093120, 9043968, 9011200], "owned_median_bytes": 9224192, "borrowed_median_bytes": 9043968, "borrowed_saves_bytes": 180224},
{"orphan_manifests": 1000, "runs_per_mode": 3, "owned_bytes": [9912320, 9584640, 9797632], "borrowed_bytes": [9388032, 9469952, 9240576], "owned_median_bytes": 9797632, "borrowed_median_bytes": 9388032, "borrowed_saves_bytes": 409600}
],
"decision": "rejected; it saved 112-400 KiB max RSS but regressed median latency by 11.13% at 500 and 2.54% at 1000"
},
"rejected_sorted_rle": {
"candidate": "borrowed hash references sorted/deduplicated per manifest, then globally sorted and run-length counted",
"latency_vs_owned_hashmap": [
{"orphan_manifests": 2, "samples": 15, "owned_median_ms": 37.077, "sorted_median_ms": 61.889, "sorted_regression_percent": 66.93},
{"orphan_manifests": 500, "samples": 15, "owned_median_ms": 63.912, "sorted_median_ms": 64.707, "sorted_regression_percent": 1.24},
{"orphan_manifests": 1000, "samples": 15, "owned_median_ms": 151.758, "sorted_median_ms": 140.429, "sorted_improvement_percent": 7.47}
],
"fresh_process_max_rss_vs_serial": [
{"orphan_manifests": 2, "runs_per_mode": 5, "serial_median_bytes": 7766016, "sorted_median_bytes": 7782400, "sorted_delta_bytes": 16384},
{"orphan_manifests": 500, "runs_per_mode": 5, "serial_median_bytes": 8421376, "sorted_median_bytes": 8978432, "sorted_delta_bytes": 557056},
{"orphan_manifests": 1000, "runs_per_mode": 5, "serial_median_bytes": 8503296, "sorted_median_bytes": 9273344, "sorted_delta_bytes": 770048}
],
"bounded_followup": "exploratory only and interrupted after the user explicitly selected the faster threshold-2 HashMap implementation; never applied to production",
"decision": "rejected; it was not Pareto on latency and still raised max RSS"
},
"correctness_checks": [
"all collectible manifests removed",
"file-backed live manifests preserved",
"blob ref_count equals the distinct-per-manifest reference model",
"repeated chunk hashes within one manifest decrement once",
"no ref_count underflow",
"new zero-ref blobs receive orphaned_at",
"live referenced blobs keep orphaned_at NULL",
"statement counts equal the selected algorithm exactly"
],
"failure_semantics": "The accepted hybrid retains the historical separate DELETE then UPDATE failure semantics. A failure between them can leave a conservative high ref_count/leak; no transaction was added because BEGIN/COMMIT would require a separate latency gate.",
"decision": "accepted_by_explicit_user_tradeoff: keep owned-HashMap threshold 2; 60.03x/51.16x median speedups cost +720 KiB/+1008 KiB max RSS at 500/1000 manifests. Atomic-CTE, borrowed-bind, and sorted/RLE alternatives remain rejected."
}
@@ -0,0 +1,33 @@
{
"schemaVersion": 1,
"generatedAt": "2026-07-21",
"environment": {
"platform": "darwin",
"arch": "arm64",
"cpu": "Apple M4 Pro",
"postgres": "18.2 local Docker container"
},
"fixture": {
"blobs": 1000000,
"sampleSize": 100,
"hashShape": "two concatenated MD5 hex digests",
"middleSampleCount": 100,
"wraparoundSampleCount": 100
},
"orderByRandom": {
"samplesMs": [111.796, 103.906, 93.862, 88.090, 100.442],
"medianMs": 100.442
},
"indexedHashRing": {
"samplesMs": [0.474, 0.323, 0.376, 0.267, 0.491],
"medianMs": 0.376
},
"speedup": 267.13,
"statisticalReview": {
"orderedHashFailureRangePercent": 1,
"contiguousWindowDetectionProbabilityPercent": 1,
"independentSamplesDetectionProbabilityPercent": 63.4,
"reason": "A single random-pivot successor window is gap-biased and its 100 rows are correlated. It does not preserve ORDER BY random() detection power for localized or prefix/backend failures."
},
"decision": "rejected; production reverted despite 267.13x query speed because verification semantics regressed"
}
@@ -0,0 +1,76 @@
{
"schemaVersion": 1,
"generatedAt": "2026-07-21",
"benchmark": "run_migration_workset_materialization",
"baseline": "one ordered SQL stream collected into Vec before backend work",
"candidates": [
"keyset pages of 65536 rows, each page released after consumption",
"keyset pages of 262144 rows, each page released after consumption"
],
"environment": {
"clientPlatform": "macOS 26.5.2 arm64, Apple M4 Pro",
"postgres": "18.2-alpine3.23 in oxicloud-postgres-1",
"transport": "SQLx over the container private IP because the published localhost port refused connections",
"profile": "release",
"processIsolation": "one fresh client process per sample; connection and COUNT warm-up precede the timer"
},
"fixture": {
"rows": 1000000,
"rowShape": "64-byte lowercase hexadecimal hash plus bigint size",
"expectedChecksum": 4156242879243796640,
"order": "ORDER BY hash",
"measuredCompleteRounds": 5,
"plannedRounds": 7,
"executionOrder": [
["current", "paged65536", "paged262144"],
["paged262144", "paged65536", "current"],
["paged65536", "current", "paged262144"],
["current", "paged65536", "paged262144"],
["paged262144", "paged65536", "current"]
]
},
"results": {
"current": {
"elapsedMs": [644.398, 964.231, 261.508, 1175.821, 265.14],
"medianElapsedMs": 644.398,
"maxToMinElapsedRatio": 4.5,
"rssBytes": [106020864, 106070016, 106004480, 106053632, 106053632],
"medianRssBytes": 106053632,
"peakRows": 1000000
},
"paged65536": {
"elapsedMs": [1198.549, 4080.427, 1622.317, 2558.891, 1508.613],
"medianElapsedMs": 1622.317,
"elapsedRatioVsCurrent": 2.5176,
"medianElapsedRegressionPercent": 151.76,
"maxToMinElapsedRatio": 3.4,
"rssBytes": [18366464, 16236544, 16236544, 18350080, 18300928],
"medianRssBytes": 18300928,
"medianRssReductionPercent": 82.74,
"peakRows": 65536
},
"paged262144": {
"elapsedMs": [320.191, 1297.052, 2871.904, 2333.342, 1928.731],
"medianElapsedMs": 1928.731,
"elapsedRatioVsCurrent": 2.9931,
"medianElapsedRegressionPercent": 199.31,
"maxToMinElapsedRatio": 8.97,
"rssBytes": [60833792, 60866560, 58703872, 63012864, 58654720],
"medianRssBytes": 60833792,
"medianRssReductionPercent": 42.64,
"peakRows": 262144
}
},
"correctness": {
"allMeasuredSamplesReturnedRows": 1000000,
"allMeasuredSamplesReturnedChecksum": 4156242879243796640,
"orderedRowEquivalence": "PASS"
},
"invalidAttempts": [
"The first host-private-IP run stopped after four samples with PoolTimedOut and was discarded.",
"The recorded run stopped after five complete three-way rounds when the Docker bridge failed again; its complete rounds are retained because every mode is present in each round.",
"A final attempt compiled the harness inside a preinstalled Rust container sharing PostgreSQL's network namespace, but the build container exited before producing any benchmark sample."
],
"decision": "rejected; production unchanged",
"reason": "Both bounded-memory candidates reduced RSS, but neither passed the no-material-latency-regression gate. Production run_migration remains unchanged."
}
@@ -0,0 +1,179 @@
{
"schemaVersion": 1,
"generatedAt": "2026-07-21T20:30:26.794Z",
"decision": "evidence_only_superseded_by_focused_gate; exact output and all medians improved, but the one-file p95 was noisy and regressed, so acceptance relies on the later 41-sample focused gate",
"environment": {
"node": "v26.5.0",
"platform": "darwin",
"release": "25.5.0",
"arch": "arm64",
"cpu": "Apple M4 Pro",
"logicalCpus": 14,
"gcExposed": true
},
"config": {
"suite": "progress",
"warmup": 5,
"samples": 25,
"queueCounts": [
64,
256,
1024,
10000,
50000
],
"progressCases": [
{
"items": 1,
"updates": 100
},
{
"items": 10,
"updates": 500
},
{
"items": 100,
"updates": 5000
}
],
"hashCounts": [
1000,
10000,
10001,
25000
],
"dedupBatchSize": 10000,
"dedupConcurrency": 4,
"serverLatencyMs": 0,
"modeledFileBytes": 65536
},
"notes": {
"heap": "Median heap delta is indicative only; timing is the primary microbenchmark metric.",
"dedup": "The current >10k path is faster only because it is rejected and returns no owned hashes."
},
"suites": {
"progress": [
{
"items": 1,
"updates": 100,
"repetitions": 1000,
"normalizedMedianUsPerRun": {
"current": 1.069250000000011,
"candidate": 0.32845800000006875
},
"current": {
"sampleCount": 25,
"medianMs": 1.069250000000011,
"p95Ms": 2.1355839999999944,
"minMs": 0.47479199999997945,
"maxMs": 2.813957999999957,
"medianHeapDeltaBytes": 1768864,
"medianRssDeltaBytes": 0
},
"candidate": {
"sampleCount": 25,
"medianMs": 0.32845800000006875,
"p95Ms": 11.240291999999954,
"minMs": 0.2692909999999529,
"maxMs": 35.88008300000001,
"medianHeapDeltaBytes": 168848,
"medianRssDeltaBytes": 0
},
"speedup": 3.255362938335456,
"representative": {
"current": {
"checksum": 8562000,
"lastPercent": 22,
"finalSum": 215.8203125
},
"candidate": {
"checksum": 8562000,
"lastPercent": 22,
"finalSum": 215.8203125
}
}
},
{
"items": 10,
"updates": 500,
"repetitions": 200,
"normalizedMedianUsPerRun": {
"current": 17.718959999999697,
"candidate": 3.242289999999457
},
"current": {
"sampleCount": 25,
"medianMs": 3.5437919999999394,
"p95Ms": 15.97524999999996,
"minMs": 1.7652080000000296,
"maxMs": 239.03012499999977,
"medianHeapDeltaBytes": 1099512,
"medianRssDeltaBytes": 0
},
"candidate": {
"sampleCount": 25,
"medianMs": 0.6484579999998914,
"p95Ms": 3.759457999999995,
"minMs": 0.22216699999989942,
"maxMs": 35.765333000000055,
"medianHeapDeltaBytes": 77648,
"medianRssDeltaBytes": 0
},
"speedup": 5.464952240546856,
"representative": {
"current": {
"checksum": 27254400,
"lastPercent": 44,
"finalSum": 871.2890625
},
"candidate": {
"checksum": 27254400,
"lastPercent": 44,
"finalSum": 871.2890625
}
}
},
{
"items": 100,
"updates": 5000,
"repetitions": 20,
"normalizedMedianUsPerRun": {
"current": 6256.843750000007,
"candidate": 13.327049999998053
},
"current": {
"sampleCount": 25,
"medianMs": 125.13687500000015,
"p95Ms": 234.41116699999975,
"minMs": 33.03545800000029,
"maxMs": 246.10770900000034,
"medianHeapDeltaBytes": 1590568,
"medianRssDeltaBytes": 0
},
"candidate": {
"sampleCount": 25,
"medianMs": 0.26654099999996106,
"p95Ms": 2.754667000000154,
"minMs": 0.2102919999997539,
"maxMs": 4.791457999999693,
"medianHeapDeltaBytes": 51728,
"medianRssDeltaBytes": 0
},
"speedup": 469.48452583286786,
"representative": {
"current": {
"checksum": 240082660,
"lastPercent": 51,
"finalSum": 1024.8828125
},
"candidate": {
"checksum": 240082660,
"lastPercent": 51,
"finalSum": 1024.8828125
}
}
}
]
},
"blackhole": 0
}
@@ -0,0 +1,91 @@
{
"schemaVersion": 1,
"generatedAt": "2026-07-21T20:30:43.534Z",
"decision": "accepted; repeated tiny-case gate improved with identical output",
"environment": {
"node": "v26.5.0",
"platform": "darwin",
"release": "25.5.0",
"arch": "arm64",
"cpu": "Apple M4 Pro",
"logicalCpus": 14,
"gcExposed": true
},
"config": {
"suite": "progress",
"warmup": 7,
"samples": 41,
"queueCounts": [
64,
256,
1024,
10000,
50000
],
"progressCases": [
{
"items": 1,
"updates": 100
}
],
"hashCounts": [
1000,
10000,
10001,
25000
],
"dedupBatchSize": 10000,
"dedupConcurrency": 4,
"serverLatencyMs": 0,
"modeledFileBytes": 65536
},
"notes": {
"heap": "Median heap delta is indicative only; timing is the primary microbenchmark metric.",
"dedup": "The current >10k path is faster only because it is rejected and returns no owned hashes."
},
"suites": {
"progress": [
{
"items": 1,
"updates": 100,
"repetitions": 1000,
"normalizedMedianUsPerRun": {
"current": 0.7972500000000764,
"candidate": 0.28862500000002456
},
"current": {
"sampleCount": 41,
"medianMs": 0.7972500000000764,
"p95Ms": 14.158166000000165,
"minMs": 0.4542079999998805,
"maxMs": 34.321249999999964,
"medianHeapDeltaBytes": 1768864,
"medianRssDeltaBytes": 0
},
"candidate": {
"sampleCount": 41,
"medianMs": 0.28862500000002456,
"p95Ms": 6.337833000000046,
"minMs": 0.2605829999999969,
"maxMs": 20.904042000000004,
"medianHeapDeltaBytes": 168848,
"medianRssDeltaBytes": 0
},
"speedup": 2.7622347336509607,
"representative": {
"current": {
"checksum": 8562000,
"lastPercent": 22,
"finalSum": 215.8203125
},
"candidate": {
"checksum": 8562000,
"lastPercent": 22,
"finalSum": 215.8203125
}
}
}
]
},
"blackhole": 0
}
@@ -0,0 +1,188 @@
{
"schemaVersion": 1,
"generatedAt": "2026-07-21T20:30:20.429Z",
"decision": "superseded by queue-memory-process-node26-macos-arm64.json; cursor accepted only by explicit user trade-off after the isolated RSS gate",
"environment": {
"node": "v26.5.0",
"platform": "darwin",
"release": "25.5.0",
"arch": "arm64",
"cpu": "Apple M4 Pro",
"logicalCpus": 14,
"gcExposed": true
},
"config": {
"suite": "queue",
"warmup": 5,
"samples": 25,
"queueCounts": [
64,
256,
1024
],
"progressCases": [
{
"items": 1,
"updates": 100
},
{
"items": 10,
"updates": 500
},
{
"items": 100,
"updates": 5000
},
{
"items": 1000,
"updates": 10000
},
{
"items": 10000,
"updates": 5000
}
],
"hashCounts": [
1000,
10000,
10001,
25000
],
"dedupBatchSize": 10000,
"dedupConcurrency": 4,
"serverLatencyMs": 0,
"modeledFileBytes": 65536
},
"notes": {
"heap": "Median heap delta is indicative only; timing is the primary microbenchmark metric.",
"dedup": "The current >10k path is faster only because it is rejected and returns no owned hashes."
},
"suites": {
"queue": [
{
"chunkCount": 64,
"repetitions": 3125,
"normalizedMedianUsPerDrain": {
"current": 3.4471731200000066,
"candidate": 0.8570931200000632
},
"current": {
"sampleCount": 25,
"medianMs": 10.772416000000021,
"p95Ms": 106.93650000000002,
"minMs": 3.077792000000045,
"maxMs": 155.11179199999992,
"medianHeapDeltaBytes": 296368,
"medianRssDeltaBytes": 0
},
"candidate": {
"sampleCount": 25,
"medianMs": 2.6784160000001975,
"p95Ms": 14.533292000000074,
"minMs": 1.02737500000012,
"maxMs": 21.65000000000009,
"medianHeapDeltaBytes": 159376,
"medianRssDeltaBytes": 0
},
"speedup": 4.0219353528351185,
"representative": {
"current": {
"checksum": 2315114185,
"chunkCount": 200000,
"totalBytes": 29184000000,
"batchCount": 6250
},
"candidate": {
"checksum": 2315114185,
"chunkCount": 200000,
"totalBytes": 29184000000,
"batchCount": 6250
}
}
},
{
"chunkCount": 256,
"repetitions": 782,
"normalizedMedianUsPerDrain": {
"current": 8.675297953964206,
"candidate": 2.503888746802898
},
"current": {
"sampleCount": 25,
"medianMs": 6.78408300000001,
"p95Ms": 32.81195799999978,
"minMs": 4.367833000000246,
"maxMs": 164.17550000000028,
"medianHeapDeltaBytes": 1858520,
"medianRssDeltaBytes": 0
},
"candidate": {
"sampleCount": 25,
"medianMs": 1.9580409999998665,
"p95Ms": 5.698667000000114,
"minMs": 0.9418750000004366,
"maxMs": 47.76333300000033,
"medianHeapDeltaBytes": 1816160,
"medianRssDeltaBytes": 0
},
"speedup": 3.464729798814464,
"representative": {
"current": {
"checksum": 1196738502,
"chunkCount": 200192,
"totalBytes": 29365764096,
"batchCount": 3910
},
"candidate": {
"checksum": 1196738502,
"chunkCount": 200192,
"totalBytes": 29365764096,
"batchCount": 3910
}
}
},
{
"chunkCount": 1024,
"repetitions": 196,
"normalizedMedianUsPerDrain": {
"current": 52.38349999999813,
"candidate": 9.426867346937055
},
"current": {
"sampleCount": 25,
"medianMs": 10.267165999999634,
"p95Ms": 142.3090830000001,
"minMs": 4.935207999999875,
"maxMs": 207.7039160000004,
"medianHeapDeltaBytes": 1796184,
"medianRssDeltaBytes": 0
},
"candidate": {
"sampleCount": 25,
"medianMs": 1.8476659999996627,
"p95Ms": 13.679167000000234,
"minMs": 0.9290839999994205,
"maxMs": 14.767958999999792,
"medianHeapDeltaBytes": 1775256,
"medianRssDeltaBytes": 0
},
"speedup": 5.556830076432379,
"representative": {
"current": {
"checksum": 1444678356,
"chunkCount": 200704,
"totalBytes": 29543628800,
"batchCount": 3528
},
"candidate": {
"checksum": 1444678356,
"chunkCount": 200704,
"totalBytes": 29543628800,
"batchCount": 3528
}
}
}
]
},
"blackhole": 0
}
@@ -0,0 +1,693 @@
{
"schemaVersion": 1,
"generatedAt": "2026-07-21T21:43:54.899Z",
"environment": {
"node": "v26.5.0",
"platform": "darwin",
"arch": "arm64"
},
"fixture": {
"chunks": 100000,
"samples": 5,
"uploadBatchBytes": 8388608
},
"note": "Each row is a fresh process; maxRSS is process.resourceUsage().maxRSS. The ordered chunks table remains live through final GC.",
"decision": {
"status": "accepted_by_explicit_user_tradeoff",
"productionMode": "cursor-clear-4096",
"reason": "The candidate is not Pareto-superior: the user explicitly accepted the measured RSS cost in exchange for the CPU/wall-time reduction.",
"currentVsProduction": {
"prefilled": {
"wallSpeedup": 246.783,
"maxRssDeltaBytes": 458752,
"peakRssDeltaDeltaBytes": 131072,
"retainedRssDeltaDeltaBytes": 458752,
"retainedHeapDeltaDeltaBytes": -3080
},
"streamingAhead": {
"wallSpeedup": 37.137,
"maxRssDeltaBytes": 491520,
"peakRssDeltaDeltaBytes": 507904,
"retainedRssDeltaDeltaBytes": 1032192,
"retainedHeapDeltaDeltaBytes": -3576
},
"streamingBalanced": {
"wallSpeedup": 1.184,
"maxRssDeltaBytes": 114688,
"peakRssDeltaDeltaBytes": 163840,
"retainedRssDeltaDeltaBytes": 0,
"retainedHeapDeltaDeltaBytes": 3168
}
}
},
"results": [
{
"shape": "prefilled",
"mode": "current-shift",
"wallMedianMs": 3526.774,
"maxRssBytesMedian": 71516160,
"peakRssDeltaBytesMedian": 606208,
"retainedRssDeltaBytesMedian": 180224,
"retainedHeapDeltaBytesMedian": 265536,
"maxRssSamplesBytes": [
71335936,
71516160,
71974912,
71368704,
72220672
],
"peakRssDeltaSamplesBytes": [
557056,
81920,
606208,
622592,
622592
],
"compactions": 0
},
{
"shape": "prefilled",
"mode": "cursor-clear-1024",
"wallMedianMs": 11.252,
"maxRssBytesMedian": 71745536,
"peakRssDeltaBytesMedian": 606208,
"retainedRssDeltaBytesMedian": 475136,
"retainedHeapDeltaBytesMedian": 262240,
"maxRssSamplesBytes": [
71172096,
72105984,
71974912,
71745536,
71680000
],
"peakRssDeltaSamplesBytes": [
671744,
1015808,
540672,
606208,
540672
],
"compactions": 7
},
{
"shape": "prefilled",
"mode": "cursor-clear-4096",
"wallMedianMs": 14.291,
"maxRssBytesMedian": 71974912,
"peakRssDeltaBytesMedian": 737280,
"retainedRssDeltaBytesMedian": 638976,
"retainedHeapDeltaBytesMedian": 262456,
"maxRssSamplesBytes": [
71991296,
71516160,
70926336,
71974912,
72007680
],
"peakRssDeltaSamplesBytes": [
933888,
622592,
720896,
737280,
802816
],
"compactions": 5
},
{
"shape": "prefilled",
"mode": "cursor-clear-16384",
"wallMedianMs": 13.354,
"maxRssBytesMedian": 71794688,
"peakRssDeltaBytesMedian": 573440,
"retainedRssDeltaBytesMedian": 262144,
"retainedHeapDeltaBytesMedian": 262264,
"maxRssSamplesBytes": [
71794688,
72417280,
71909376,
71434240,
71794688
],
"peakRssDeltaSamplesBytes": [
573440,
720896,
524288,
573440,
638976
],
"compactions": 3
},
{
"shape": "prefilled",
"mode": "cursor-no-clear-4096",
"wallMedianMs": 22.188,
"maxRssBytesMedian": 71942144,
"peakRssDeltaBytesMedian": 737280,
"retainedRssDeltaBytesMedian": 589824,
"retainedHeapDeltaBytesMedian": 262432,
"maxRssSamplesBytes": [
71942144,
73351168,
71335936,
71647232,
72433664
],
"peakRssDeltaSamplesBytes": [
786432,
802816,
737280,
622592,
720896
],
"compactions": 5
},
{
"shape": "prefilled",
"mode": "cursor-splice-4096",
"wallMedianMs": 11.975,
"maxRssBytesMedian": 72417280,
"peakRssDeltaBytesMedian": 1589248,
"retainedRssDeltaBytesMedian": 1392640,
"retainedHeapDeltaBytesMedian": 262456,
"maxRssSamplesBytes": [
72646656,
72220672,
72269824,
72417280,
72679424
],
"peakRssDeltaSamplesBytes": [
1441792,
1605632,
1474560,
1589248,
1589248
],
"compactions": 5
},
{
"shape": "prefilled",
"mode": "cursor-splice-16384",
"wallMedianMs": 9.151,
"maxRssBytesMedian": 72286208,
"peakRssDeltaBytesMedian": 1441792,
"retainedRssDeltaBytesMedian": 1441792,
"retainedHeapDeltaBytesMedian": 263584,
"maxRssSamplesBytes": [
72138752,
75939840,
71516160,
72318976,
72286208
],
"peakRssDeltaSamplesBytes": [
1310720,
1474560,
1441792,
1441792,
1294336
],
"compactions": 3
},
{
"shape": "prefilled",
"mode": "cursor-slice-4096",
"wallMedianMs": 9.405,
"maxRssBytesMedian": 72548352,
"peakRssDeltaBytesMedian": 1540096,
"retainedRssDeltaBytesMedian": 1540096,
"retainedHeapDeltaBytesMedian": 262456,
"maxRssSamplesBytes": [
72187904,
72548352,
72744960,
72843264,
72286208
],
"peakRssDeltaSamplesBytes": [
1556480,
1540096,
1556480,
1523712,
1523712
],
"compactions": 5
},
{
"shape": "prefilled",
"mode": "cursor-reset-4096",
"wallMedianMs": 14.182,
"maxRssBytesMedian": 71729152,
"peakRssDeltaBytesMedian": 704512,
"retainedRssDeltaBytesMedian": 475136,
"retainedHeapDeltaBytesMedian": 261768,
"maxRssSamplesBytes": [
71778304,
71729152,
71696384,
71581696,
71761920
],
"peakRssDeltaSamplesBytes": [
999424,
638976,
737280,
704512,
655360
],
"compactions": 5
},
{
"shape": "streaming-ahead",
"mode": "current-shift",
"wallMedianMs": 616.473,
"maxRssBytesMedian": 74153984,
"peakRssDeltaBytesMedian": 3948544,
"retainedRssDeltaBytesMedian": 4145152,
"retainedHeapDeltaBytesMedian": 1066792,
"maxRssSamplesBytes": [
74219520,
76283904,
74153984,
73383936,
74006528
],
"peakRssDeltaSamplesBytes": [
3997696,
3964928,
3850240,
3948544,
3932160
],
"compactions": 0
},
{
"shape": "streaming-ahead",
"mode": "cursor-clear-1024",
"wallMedianMs": 12.093,
"maxRssBytesMedian": 74661888,
"peakRssDeltaBytesMedian": 4374528,
"retainedRssDeltaBytesMedian": 4915200,
"retainedHeapDeltaBytesMedian": 1063520,
"maxRssSamplesBytes": [
73924608,
74661888,
74235904,
74809344,
74727424
],
"peakRssDeltaSamplesBytes": [
4194304,
4374528,
4390912,
4308992,
4505600
],
"compactions": 7
},
{
"shape": "streaming-ahead",
"mode": "cursor-clear-4096",
"wallMedianMs": 16.6,
"maxRssBytesMedian": 74645504,
"peakRssDeltaBytesMedian": 4456448,
"retainedRssDeltaBytesMedian": 5177344,
"retainedHeapDeltaBytesMedian": 1063216,
"maxRssSamplesBytes": [
74645504,
74334208,
73891840,
74678272,
75120640
],
"peakRssDeltaSamplesBytes": [
4440064,
4505600,
4456448,
4407296,
4489216
],
"compactions": 5
},
{
"shape": "streaming-ahead",
"mode": "cursor-clear-16384",
"wallMedianMs": 19.843,
"maxRssBytesMedian": 74612736,
"peakRssDeltaBytesMedian": 4358144,
"retainedRssDeltaBytesMedian": 5242880,
"retainedHeapDeltaBytesMedian": 1063784,
"maxRssSamplesBytes": [
75186176,
74350592,
74760192,
74465280,
74612736
],
"peakRssDeltaSamplesBytes": [
4653056,
4390912,
4308992,
4325376,
4358144
],
"compactions": 3
},
{
"shape": "streaming-ahead",
"mode": "cursor-no-clear-4096",
"wallMedianMs": 16.406,
"maxRssBytesMedian": 74629120,
"peakRssDeltaBytesMedian": 4390912,
"retainedRssDeltaBytesMedian": 5423104,
"retainedHeapDeltaBytesMedian": 1063640,
"maxRssSamplesBytes": [
74530816,
74940416,
74629120,
74645504,
74383360
],
"peakRssDeltaSamplesBytes": [
4489216,
4489216,
4325376,
4374528,
4390912
],
"compactions": 5
},
{
"shape": "streaming-ahead",
"mode": "cursor-splice-4096",
"wallMedianMs": 12.952,
"maxRssBytesMedian": 75218944,
"peakRssDeltaBytesMedian": 5292032,
"retainedRssDeltaBytesMedian": 5718016,
"retainedHeapDeltaBytesMedian": 1063216,
"maxRssSamplesBytes": [
75087872,
75382784,
75218944,
75317248,
75038720
],
"peakRssDeltaSamplesBytes": [
5292032,
5210112,
5308416,
5242880,
5341184
],
"compactions": 5
},
{
"shape": "streaming-ahead",
"mode": "cursor-splice-16384",
"wallMedianMs": 10.851,
"maxRssBytesMedian": 75661312,
"peakRssDeltaBytesMedian": 5210112,
"retainedRssDeltaBytesMedian": 5914624,
"retainedHeapDeltaBytesMedian": 1063704,
"maxRssSamplesBytes": [
76627968,
75399168,
75661312,
75726848,
75022336
],
"peakRssDeltaSamplesBytes": [
5357568,
5210112,
5193728,
5193728,
5275648
],
"compactions": 3
},
{
"shape": "streaming-ahead",
"mode": "cursor-slice-4096",
"wallMedianMs": 11.689,
"maxRssBytesMedian": 75792384,
"peakRssDeltaBytesMedian": 5242880,
"retainedRssDeltaBytesMedian": 6111232,
"retainedHeapDeltaBytesMedian": 1064056,
"maxRssSamplesBytes": [
75792384,
75923456,
75644928,
75218944,
76185600
],
"peakRssDeltaSamplesBytes": [
5324800,
5242880,
5177344,
5242880,
5586944
],
"compactions": 5
},
{
"shape": "streaming-ahead",
"mode": "cursor-reset-4096",
"wallMedianMs": 15.48,
"maxRssBytesMedian": 75005952,
"peakRssDeltaBytesMedian": 4390912,
"retainedRssDeltaBytesMedian": 5095424,
"retainedHeapDeltaBytesMedian": 1062848,
"maxRssSamplesBytes": [
75005952,
75005952,
75448320,
74498048,
74743808
],
"peakRssDeltaSamplesBytes": [
4489216,
4325376,
4702208,
4390912,
4341760
],
"compactions": 5
},
{
"shape": "streaming-balanced",
"mode": "current-shift",
"wallMedianMs": 12.637,
"maxRssBytesMedian": 72941568,
"peakRssDeltaBytesMedian": 2752512,
"retainedRssDeltaBytesMedian": 3571712,
"retainedHeapDeltaBytesMedian": 1066272,
"maxRssSamplesBytes": [
72941568,
72941568,
72876032,
76644352,
73334784
],
"peakRssDeltaSamplesBytes": [
2752512,
2785280,
2736128,
2752512,
2834432
],
"compactions": 0
},
{
"shape": "streaming-balanced",
"mode": "cursor-clear-1024",
"wallMedianMs": 11.721,
"maxRssBytesMedian": 73302016,
"peakRssDeltaBytesMedian": 2932736,
"retainedRssDeltaBytesMedian": 3506176,
"retainedHeapDeltaBytesMedian": 1068736,
"maxRssSamplesBytes": [
74792960,
73662464,
73302016,
73187328,
73170944
],
"peakRssDeltaSamplesBytes": [
2818048,
2949120,
2899968,
2932736,
3047424
],
"compactions": 0
},
{
"shape": "streaming-balanced",
"mode": "cursor-clear-4096",
"wallMedianMs": 10.671,
"maxRssBytesMedian": 73056256,
"peakRssDeltaBytesMedian": 2916352,
"retainedRssDeltaBytesMedian": 3571712,
"retainedHeapDeltaBytesMedian": 1069440,
"maxRssSamplesBytes": [
73875456,
72695808,
73891840,
73056256,
72990720
],
"peakRssDeltaSamplesBytes": [
2850816,
2916352,
2932736,
2981888,
2834432
],
"compactions": 0
},
{
"shape": "streaming-balanced",
"mode": "cursor-clear-16384",
"wallMedianMs": 12.458,
"maxRssBytesMedian": 73498624,
"peakRssDeltaBytesMedian": 2998272,
"retainedRssDeltaBytesMedian": 3637248,
"retainedHeapDeltaBytesMedian": 1068720,
"maxRssSamplesBytes": [
73252864,
74465280,
73498624,
74334208,
72941568
],
"peakRssDeltaSamplesBytes": [
2981888,
3047424,
2998272,
3129344,
2736128
],
"compactions": 0
},
{
"shape": "streaming-balanced",
"mode": "cursor-no-clear-4096",
"wallMedianMs": 11.249,
"maxRssBytesMedian": 72744960,
"peakRssDeltaBytesMedian": 2916352,
"retainedRssDeltaBytesMedian": 3457024,
"retainedHeapDeltaBytesMedian": 1068272,
"maxRssSamplesBytes": [
73154560,
72417280,
73334784,
72744960,
72728576
],
"peakRssDeltaSamplesBytes": [
2932736,
2785280,
2850816,
2916352,
2916352
],
"compactions": 0
},
{
"shape": "streaming-balanced",
"mode": "cursor-splice-4096",
"wallMedianMs": 10.396,
"maxRssBytesMedian": 73007104,
"peakRssDeltaBytesMedian": 2932736,
"retainedRssDeltaBytesMedian": 3670016,
"retainedHeapDeltaBytesMedian": 1068080,
"maxRssSamplesBytes": [
73449472,
72810496,
73007104,
72679424,
73121792
],
"peakRssDeltaSamplesBytes": [
2981888,
2932736,
2834432,
2867200,
2932736
],
"compactions": 0
},
{
"shape": "streaming-balanced",
"mode": "cursor-splice-16384",
"wallMedianMs": 15.18,
"maxRssBytesMedian": 72974336,
"peakRssDeltaBytesMedian": 2965504,
"retainedRssDeltaBytesMedian": 3473408,
"retainedHeapDeltaBytesMedian": 1068248,
"maxRssSamplesBytes": [
72974336,
72925184,
73351168,
73334784,
72925184
],
"peakRssDeltaSamplesBytes": [
2998272,
2965504,
2834432,
2850816,
3063808
],
"compactions": 0
},
{
"shape": "streaming-balanced",
"mode": "cursor-slice-4096",
"wallMedianMs": 14.668,
"maxRssBytesMedian": 73400320,
"peakRssDeltaBytesMedian": 2965504,
"retainedRssDeltaBytesMedian": 3604480,
"retainedHeapDeltaBytesMedian": 1069208,
"maxRssSamplesBytes": [
74842112,
72531968,
73646080,
73400320,
73367552
],
"peakRssDeltaSamplesBytes": [
5406720,
3063808,
2916352,
2965504,
2883584
],
"compactions": 0
},
{
"shape": "streaming-balanced",
"mode": "cursor-reset-4096",
"wallMedianMs": 10.535,
"maxRssBytesMedian": 72941568,
"peakRssDeltaBytesMedian": 3014656,
"retainedRssDeltaBytesMedian": 3489792,
"retainedHeapDeltaBytesMedian": 1068896,
"maxRssSamplesBytes": [
72892416,
72941568,
72810496,
73515008,
73269248
],
"peakRssDeltaSamplesBytes": [
3031040,
3014656,
2719744,
3031040,
2916352
],
"compactions": 0
}
]
}
@@ -0,0 +1,124 @@
{
"date": "2026-07-21",
"status": "rejected_all_production_changes_rolled_back",
"environment": {
"host": "macOS arm64",
"database": "disposable PostgreSQL container databases",
"note": "Timing samples include visible host/container jitter; correctness and exact operation counts are the decisive gates."
},
"delta_loose_chunk_prefilter": {
"probe_source": "tools/perf-audit/rejected_delta_loose_hit_probe.rs",
"fixture": {
"frames": 400,
"frame_bytes": 262144,
"logical_bytes": 104857600
},
"current_path_measurements": [
{
"case": "seed",
"existing_before": 0,
"puts": 400,
"physical_put_bytes": 104857600,
"sync_hashes": 400,
"elapsed_ms": 854.548
},
{
"case": "all_hit",
"existing_before": 400,
"puts": 400,
"physical_put_bytes": 104857600,
"sync_hashes": 400,
"elapsed_ms": 685.03
},
{
"case": "all_miss",
"existing_before": 0,
"puts": 400,
"physical_put_bytes": 104857600,
"sync_hashes": 400,
"elapsed_ms": 1050.956
},
{
"case": "half_hit",
"existing_before": 200,
"puts": 400,
"physical_put_bytes": 104857600,
"sync_hashes": 400,
"elapsed_ms": 236.611
}
],
"result": "rejected",
"rejection_reasons": [
"The browser delta protocol already negotiates missing hashes, so all-miss is the normal receive path; a PostgreSQL prefilter would add queries and up to 8 MiB of request buffering there.",
"A metadata row does not prove that the backing object still exists. Skipping PUT from PostgreSQL state alone removes the current self-healing behavior for backend-missing objects.",
"No candidate established a Pareto improvement across the normal miss path, remote bytes, memory, and repair semantics."
]
},
"identical_overwrite_refcount_cte": {
"probe_source": "tools/perf-audit/rejected_refcount_overwrite_probe.rs",
"baseline_correctness": {
"legacy_iterations": 1000,
"initial_ref_count": 1,
"final_ref_count": 1001,
"elapsed_ms": 25534.071,
"different_hash_old_ref": null,
"different_hash_new_ref": 1,
"delete_gc_final_ref": null
},
"candidate_correctness_on_unambiguous_fixtures": {
"legacy_same_hash_1000_final_ref": 1,
"manifest_same_hash_100_final_manifest_ref": 1,
"manifest_same_hash_100_final_chunk_ref": 1,
"different_hash_ref_counts": "passed",
"delete_and_force_gc": "passed",
"missing_file_compensation": "passed",
"sql_error_compensation": "passed",
"blob_deletion_hooks": "passed"
},
"roundtrips_per_iteration": {
"legacy_same_hash": 3,
"manifest_same_hash": 2,
"alternating_different_hash": 8,
"candidate_changed_roundtrip_count": false
},
"interleaved_short_samples": {
"iterations": {
"same_hash": 200,
"manifest_same_hash": 100,
"alternating_different_hash": 50
},
"baseline": [
{
"same_p50_ms": 3.679,
"manifest_p50_ms": 1.544,
"different_p50_ms": 3.008
},
{
"same_p50_ms": 5.822,
"manifest_p50_ms": 7.668,
"different_p50_ms": 10.711
}
],
"candidate": [
{
"same_p50_ms": 3.7,
"manifest_p50_ms": 5.616,
"different_p50_ms": 7.565
},
{
"same_p50_ms": 2.156,
"manifest_p50_ms": 1.438,
"different_p50_ms": 3.804
}
],
"interpretation": "Large host/container jitter prevents a latency non-regression claim; the mixed-representation correctness failure independently rejects the candidate."
},
"result": "rejected",
"rejection_reasons": [
"storage.files stores only a content hash and cannot identify whether that file reference is owned by storage.blobs or storage.chunk_manifests when both rows coexist for the same hash.",
"In a mixed legacy-to-CDC transition the CTE can decrement the manifest when the displaced reference was legacy, causing undercount, or preserve the manifest and leak the shadowed legacy reference and bytes.",
"The candidate therefore cannot be made correct solely inside FileBlobWriteRepository; representation ownership must first be normalized or made explicit."
],
"remaining_baseline_issue": "A normal identical-content overwrite leaks the newly acquired reference (1 becomes N+1). This remains deliberately unfixed rather than replacing it with ambiguous undercount/data-loss risk."
}
}
@@ -0,0 +1,54 @@
{
"benchmark": "verify_integrity_phase1_and_full_method_simulation",
"date": "2026-07-21",
"decision": {
"status": "rejected",
"productionVariant": "superseded owned-key candidate: 256-occurrence windows, concurrency 16, unchanged serial path through 4 occurrences",
"reason": "This owned-key candidate increased scratch max RSS by 180224 bytes and was not accepted. It was superseded by the sorted borrowed-key concurrency-8 implementation documented in verify_integrity_sorted_c8_2026-07-22.json."
},
"concurrency": 16,
"occurrence_window": 256,
"serial_fast_path_max_occurrences": 4,
"local_simulated_metadata_latency_us": 250,
"local_simulated_hash_latency_ms": 1,
"remote_simulated_latency_ms": 4,
"acceptance_thresholds": {
"ordered_issues": "byte-for-byte equal",
"backend_calls": "candidate <= current",
"substantive_timing": "candidate strictly faster",
"unchanged_serial_fast_path": "candidate/current >= 0.95",
"sub_100ns_measurements": "candidate <= current + 20ns",
"rss": "candidate <= current unless the user explicitly authorizes a measured regression"
},
"rejected_zero_latency_before_fast_path": [
{ "scenario": "1_manifest_x_2", "current_ms": 0.000014, "candidate_ms": 0.000894, "speedup": 0.016 },
{ "scenario": "2_manifests_x_1", "current_ms": 0.000016, "candidate_ms": 0.001071, "speedup": 0.015 },
{ "scenario": "1_manifest_x_4", "current_ms": 0.000023, "candidate_ms": 0.001469, "speedup": 0.016 }
],
"timing_results": [
{ "scenario": "immediate_one_manifest_two", "phase1_ms": [0.000013, 0.000013], "phase1_speedup": 1.000, "full_ms": [0.000144, 0.000144], "full_speedup": 1.000, "phase1_calls": [2, 2], "full_calls": [4, 4], "issues_equal": true },
{ "scenario": "immediate_two_manifests_one", "phase1_ms": [0.000014, 0.000016], "phase1_speedup": 0.875, "full_ms": [0.000145, 0.000146], "full_speedup": 0.993, "phase1_calls": [2, 2], "full_calls": [4, 4], "issues_equal": true },
{ "scenario": "immediate_one_manifest_four", "phase1_ms": [0.000020, 0.000020], "phase1_speedup": 1.000, "full_ms": [0.000227, 0.000226], "full_speedup": 1.004, "phase1_calls": [4, 4], "full_calls": [8, 8], "issues_equal": true },
{ "scenario": "local_tiny_empty", "phase1_ms": [0.000004, 0.000004], "phase1_speedup": 1.000, "full_ms": [0.000054, 0.000054], "full_speedup": 1.000, "phase1_calls": [0, 0], "full_calls": [0, 0], "issues_equal": true },
{ "scenario": "local_tiny_single", "phase1_ms": [1.573850, 1.565981], "phase1_speedup": 1.005, "full_ms": [5.215304, 5.224075], "full_speedup": 0.998, "phase1_calls": [1, 1], "full_calls": [2, 2], "issues_equal": true },
{ "scenario": "local_small_unique", "phase1_ms": [6.173358, 6.062208], "phase1_speedup": 1.018, "full_ms": [9.635729, 9.577837], "full_speedup": 1.006, "phase1_calls": [4, 4], "full_calls": [8, 8], "issues_equal": true },
{ "scenario": "local_semantics", "phase1_ms": [19.824417, 1.293583], "phase1_speedup": 15.325, "full_ms": [23.969709, 5.060584], "full_speedup": 4.737, "phase1_calls": [12, 6], "full_calls": [16, 10], "issues_equal": true },
{ "scenario": "local_shared", "phase1_ms": [771.930083, 5.914542], "phase1_speedup": 130.514, "full_ms": [784.165500, 13.935208], "full_speedup": 56.272, "phase1_calls": [512, 64], "full_calls": [544, 96], "issues_equal": true },
{ "scenario": "local_unique", "phase1_ms": [417.543458, 26.467917], "phase1_speedup": 15.775, "full_ms": [488.088375, 95.696541], "full_speedup": 5.100, "phase1_calls": [256, 256], "full_calls": [512, 512], "issues_equal": true },
{ "scenario": "local_hash_dominated", "phase1_ms": [798.974041, 7.262542], "phase1_speedup": 110.013, "full_ms": [947.894292, 142.175417], "full_speedup": 6.667, "phase1_calls": [512, 64], "full_calls": [672, 224], "issues_equal": true },
{ "scenario": "remote_tiny_single", "phase1_ms": [5.946651, 5.825770], "phase1_speedup": 1.021, "full_ms": [12.171682, 12.221104], "full_speedup": 0.996, "phase1_calls": [1, 1], "full_calls": [2, 2], "issues_equal": true },
{ "scenario": "remote_shared", "phase1_ms": [1169.103458, 12.549250], "phase1_speedup": 93.161, "full_ms": [1180.397208, 24.700583], "full_speedup": 47.788, "phase1_calls": [192, 24], "full_calls": [216, 48], "issues_equal": true },
{ "scenario": "remote_unique", "phase1_ms": [777.041833, 48.517459], "phase1_speedup": 16.016, "full_ms": [830.103333, 97.427792], "full_speedup": 8.520, "phase1_calls": [128, 128], "full_calls": [256, 256], "issues_equal": true }
],
"remote_tiny_raw_interleaved_samples_ms": {
"phase_current": [5.972041, 5.818484, 5.462442, 5.435223, 5.665474, 5.987218, 5.200437, 6.051963, 6.210510, 5.726651, 5.959099, 6.149390, 5.495677, 6.679635, 5.627703, 6.144088, 6.113260, 6.298692, 6.135348, 5.891848, 5.987041, 6.247567, 5.896729, 5.898213, 6.311750, 5.817687, 5.981401, 6.121276, 5.881609, 5.471724, 5.346536],
"phase_candidate": [6.001317, 5.968807, 5.718093, 5.810250, 6.000500, 5.637484, 5.424822, 5.745713, 5.803015, 5.814833, 5.826723, 5.668151, 5.499484, 9.238000, 5.809541, 5.574656, 6.025552, 6.049541, 6.057848, 6.021921, 5.848974, 5.975885, 7.049984, 6.100453, 5.605041, 7.276510, 6.775093, 5.816354, 6.165192, 5.580307, 7.048598],
"full_current": [11.370567, 11.387697, 11.628140, 11.325437, 11.993604, 11.828640, 11.401380, 11.721067, 12.006802, 12.157614, 18.172244, 12.098177, 12.020255, 11.991437, 11.633375, 12.128099, 12.005609, 11.712333, 16.508307, 11.919135, 12.695625, 12.155364, 11.964682, 11.588708, 11.581765, 11.558296, 12.172546, 12.264661, 12.716224, 12.976911, 11.821093],
"full_candidate": [11.236448, 11.087390, 11.242302, 11.993781, 11.755302, 12.211015, 11.805994, 12.096088, 11.946072, 14.495333, 11.964203, 20.616036, 11.523067, 12.436895, 11.837380, 11.973791, 11.760260, 11.998291, 11.962328, 12.284317, 13.261562, 12.181573, 11.943026, 11.878151, 11.673031, 12.429109, 14.424937, 12.314994, 12.130489, 12.200453, 12.130453]
},
"rss_gate": {
"fixture": "1000 manifests, 250000 unique occurrences, separate processes",
"rejected_unbounded": { "current_max_rss_bytes": 34783232, "candidate_max_rss_bytes": 69681152, "decision": "rejected and rolled back" },
"windowed_owned_keys": { "current_max_rss_bytes": 34897920, "candidate_max_rss_bytes": 35078144, "delta_bytes": 180224, "delta_percent": 0.52, "decision": "rejected and superseded by the sorted borrowed-key concurrency-8 implementation" }
}
}
@@ -0,0 +1,122 @@
{
"benchmark": "verify_integrity_sorted_borrowed_c8",
"date": "2026-07-22",
"decision": {
"status": "accepted_by_explicit_user_tradeoff",
"productionVariant": "fetch_all + exact serial path through 4 occurrences + 256-occurrence sorted borrowed windows + concurrency 8",
"reason": "Exact issue order and backend-call gates passed. Real filesystem and remote full-method cases improved materially. After disclosure of a measured peak cost up to 112 KiB, the user explicitly reauthorized retaining the candidate; the final exact BoxFut RSS medians were +112 KiB phase 1 and +80 KiB full method."
},
"implementation": {
"keys": "sorted Vec<&str>",
"results": "parallel Vec<Option<u64>>",
"lookup": "binary search, at most 8 comparisons for a 256-occurrence window",
"scheduler": "bounded FuturesUnordered",
"manifest_concurrency": 8,
"phase_two_concurrency_unchanged": 16,
"occurrence_window": 256,
"serial_fast_path_max_occurrences": 4,
"manifest_query": "unchanged fetch_all"
},
"correctness": {
"ordered_issues_equal": true,
"candidate_backend_calls_not_greater": true,
"malformed_manifest_backend_calls": 0,
"repeated_occurrences_replayed": true,
"large_manifest_sliced": true,
"tiny_path_uses_identical_serial_code": true
},
"real_filesystem_boxfut_c8_31_samples": [
{
"scenario": "shared",
"phase_ms": {
"historical": 4.869042,
"sorted": 0.458167,
"speedup": 10.627221
},
"full_ms": {
"historical": 5.599625,
"sorted": 0.971125,
"speedup": 5.766122
},
"phase_calls": [512, 64],
"full_calls": [544, 96]
},
{
"scenario": "unique",
"phase_ms": {
"historical": 2.398167,
"sorted": 1.831541,
"speedup": 1.309371
},
"full_ms": {
"historical": 6.022667,
"sorted": 5.545917,
"speedup": 1.085964
},
"phase_calls": [256, 256],
"full_calls": [512, 512]
},
{
"scenario": "mixed_existing_and_missing_unique",
"phase_ms": {
"historical": 2.369208,
"sorted": 1.833333,
"speedup": 1.292296
},
"full_ms": {
"historical": 5.755125,
"sorted": 5.253833,
"speedup": 1.095415
},
"phase_calls": [256, 256],
"full_calls": [496, 496]
}
],
"remote_boxfut_c8": [
{
"scenario": "shared",
"phase_ms": [1122.720666, 17.170333],
"phase_speedup": 65.387239,
"full_ms": [1138.407208, 29.148208],
"full_speedup": 39.055821,
"phase_calls": [192, 24],
"full_calls": [216, 48]
},
{
"scenario": "unique",
"phase_ms": [769.160459, 96.641416],
"phase_speedup": 7.958911,
"full_ms": [824.404334, 144.857708],
"full_speedup": 5.691132,
"phase_calls": [128, 128],
"full_calls": [256, 256]
}
],
"rss_11_fresh_process_medians": {
"fixture": "1000 manifests, 250000 unique occurrences, BoxFut backend model",
"phase_one": {
"historical_bytes": 26771456,
"sorted_bytes": 26886144,
"delta_bytes": 114688,
"delta_kib": 112,
"delta_percent": 0.4284
},
"full_method": {
"historical_bytes": 26836992,
"sorted_bytes": 26918912,
"delta_bytes": 81920,
"delta_kib": 80,
"delta_percent": 0.3053
},
"requested_heap_scratch_bytes": {
"historical": 144,
"sorted": 9360
}
},
"tiny_gate": {
"scenarios": ["1x2", "2x1", "1x4"],
"implementation": "same serial loop for historical and candidate",
"calls_equal": true,
"issues_equal": true
}
}
@@ -0,0 +1,128 @@
{
"benchmark": "verify_integrity_sqlx_streaming",
"date": "2026-07-22",
"decision": {
"status": "rejected",
"reason": "The bounded producer/channel variant reduced RSS by 74.23% and accelerated phase 1, but the same-round full-method median was 4.17% slower than the historical implementation. No streaming code was applied to production."
},
"fixture": {
"database": "fresh disposable PostgreSQL database",
"manifest_rows": 1000,
"manifest_occurrences": 250000,
"blob_rows": 250000,
"query_count": {
"phase_one": 1,
"full_method": 2
},
"prefetch_rows": 16,
"normal_prefetch_occurrence_bound": 4000,
"window_occurrences": 256,
"large_manifest_occurrences": 1024,
"samples_per_mode": 7,
"fresh_processes": true,
"rotated_order": true
},
"semantic_gates": [
{
"scenario": "empty",
"rows": 0,
"phase_calls": [0, 0, 0, 0],
"full_calls": [0, 0, 0, 0],
"issues_equal": true
},
{
"scenario": "one",
"rows": 1,
"phase_calls": [1, 1, 1, 1],
"full_calls": [2, 2, 2, 2],
"issues_equal": true
},
{
"scenario": "four",
"rows": 1,
"phase_calls": [4, 4, 4, 4],
"full_calls": [8, 8, 8, 8],
"issues_equal": true
},
{
"scenario": "semantics_with_malformed",
"rows": 4,
"issues": 8,
"checksum": 1417964566409558305,
"phase_calls_historical_materialized_direct_prefetch": [6, 4, 4, 4],
"full_calls_historical_materialized_direct_prefetch": [10, 8, 8, 8],
"malformed_probe_suppressed": true,
"issues_equal_and_ordered": true
},
{
"scenario": "shared",
"phase_calls_historical_materialized_direct_prefetch": [512, 64, 64, 64],
"full_calls_historical_materialized_direct_prefetch": [544, 96, 96, 96],
"issues_equal": true
},
{
"scenario": "unique",
"phase_calls": [256, 256, 256, 256],
"full_calls": [512, 512, 512, 512],
"issues_equal": true
},
{
"scenario": "large_manifest_sliced",
"phase_calls": [1024, 1024, 1024, 1024],
"full_calls": [2048, 2048, 2048, 2048],
"issues_equal": true
}
],
"final_same_round_abc_medians": {
"historical": {
"phase_ms": 638.057167,
"full_ms": 1146.865750,
"max_rss_bytes": 32620544
},
"materialized_owned": {
"phase_ms": 754.104000,
"full_ms": 1507.712417,
"max_rss_bytes": 32751616
},
"streaming_prefetch": {
"phase_ms": 370.620500,
"full_ms": 1194.661583,
"max_rss_bytes": 8404992
},
"prefetch_vs_historical": {
"phase_speedup": 1.721592,
"full_speedup": 0.959992,
"full_regression_percent": 4.1675,
"rss_reduction_percent": 74.2341
},
"prefetch_vs_materialized_owned": {
"phase_speedup": 2.034707,
"full_speedup": 1.262041,
"rss_reduction_percent": 74.3372
}
},
"raw_final_abc_samples": {
"historical": {
"phase_ms": [638.057167, 302.385875, 473.900417, 774.089833, 632.479584, 1075.826334, 1435.878333],
"full_ms": [1146.865750, 630.661958, 1089.854458, 1794.876250, 885.336625, 1857.877417, 1657.854292],
"max_rss_bytes": [32669696, 32538624, 32620544, 32636928, 32620544, 32669696, 32604160]
},
"materialized_owned": {
"phase_ms": [299.143625, 704.092708, 657.428250, 1017.416708, 1391.611125, 754.104000, 1051.222917],
"full_ms": [774.324375, 1370.037708, 1230.500333, 1860.589583, 1635.081625, 1507.712417, 1900.343500],
"max_rss_bytes": [32833536, 32751616, 32899072, 32800768, 32555008, 32555008, 32718848]
},
"streaming_prefetch": {
"phase_ms": [276.988833, 370.693334, 1387.695584, 370.620500, 219.138375, 637.540250, 332.878083],
"full_ms": [581.776666, 870.599875, 1666.224584, 1194.661583, 923.753250, 2379.057125, 1565.068625],
"max_rss_bytes": [8339456, 8404992, 8617984, 8667136, 8552448, 8372224, 8290304]
}
},
"connection_lifecycle": {
"pool_max_connections": 1,
"held_during_nonempty_stream": true,
"released_before_phase_two": true,
"extra_queries": 0,
"temporary_database_removed": true
}
}