main
1// The product: one cell per (parameter value × operation) the harness can build a fixture for.
2// Heaps are not an axis here. The driver runs every selected cell twice (default heap, then 128 MiB).
3// `bytes` and `entries` are the fixture sizes the CI filter reads. A cell over 16 MiB or 65_536 entries,
4// or one marked nightly, waits for `npm run sweep -- --full`.
5import { DEFAULT_LIMITS, LIMIT_OBJECT_OVERHEAD, WORKER_LIMITS } from '../../src/limits.js';
6import { boundaryValues } from './boundary.mjs';
8const MiB = 1024 * 1024;
9export const CI_BYTES = 16 * MiB;
10export const CI_ENTRIES = 65536;
12// ply-web's pack budget, swept as an override so the wire edge is a cell and not a guess.
13export const PLY_WEB_PACK = Object.freeze({
14 maxPackBytes: 32 * MiB,
15 maxObjectSize: 16 * MiB,
16 maxInflatedTotal: 64 * MiB,
17 maxHarvestBytes: 8 * MiB,
18 maxDeltaResult: 16 * MiB,
19});
21const ok = Object.freeze({ status: 'ok' });
22const refused = (code, extra = {}) => Object.freeze({ status: 'refused', code, ...extra });
24/**
25 * @typedef {object} Cell
26 * @property {string} id
27 * @property {string} param Limits key this cell probes
28 * @property {string} op
29 * @property {number} [bytes]
30 * @property {number} [entries]
31 * @property {boolean} [nightly] excluded from --ci even when bytes and entries are small
32 * @property {boolean} [writes]
33 * @property {string} [repo]
34 * @property {string} [path]
35 * @property {string} [ref]
36 * @property {string} [from]
37 * @property {number} [limit]
38 * @property {string} [find]
39 * @property {string} [replace]
40 * @property {number} [nfiles]
41 * @property {number} [size]
42 * @property {string} [pack] pack id under the fixture packs/ dir; the driver fills the path
43 * @property {Record<string, number>} [limits]
44 * @property {{ status: string, code?: string, got?: number, max?: number, what?: string }} [expect]
45 * @property {string} [expectFrom] driver fills `expect` (and sometimes `limits`) from the git oracle
46 * @property {number} [history] commits in the log fixture, for the readLog oracle
47 * @property {'workerd'} [runtime] run once inside workerd (test/workerd/worker.mjs) instead of on the two node heaps
48 * @property {string} [shim] shim.mjs mode the request goes through (v0, v1, delay-<ms>, stall-<ms>, frame-<L>)
49 * @property {number} [holdMs] readFile: the consumer holds the stream's first chunk this long before reading on (heldTimeoutMs, #273)
50 * @property {number} [capDelta] the cap is the oracle's measurement plus this (expectFrom objects, delta-result, harvest)
51 * @property {number} [haveCount] haves for a fetchPack cell: this many ancestors of main
52 * @property {number} [wantCount] wants for a fetchPack cell: main and this many minus one of its ancestors
53 * @property {number} [deepen]
54 * @property {boolean} [done]
55 * @property {string} [filter]
56 * @property {string} [local] pushRepo's source repository (a fixture)
57 * @property {Record<string, unknown>} [spec] pushRepo's spec
58 * @property {string} [store] fetchThin's local object store (a fixture)
59 * @property {string} [onto] rebase target
60 * @property {number} [rebased] commits git must count from main to the rebased branch
61 * @property {boolean} [thin] the push must have sent a delta against the remote's objects
62 * @property {number} [timeoutMs] this cell's own kill timer, in place of SWEEP_TIMEOUT_MS
63 */
65/** @param {number} limit @param {(n: number) => boolean} [keep] */
66function around(limit, keep = () => true) {
67 return boundaryValues(limit).filter(n => n > 0 && keep(n));
68}
70/** @type {Cell[]} */
71function build() {
72 /** @type {Cell[]} */
73 const cells = [];
74 const add = (/** @type {Cell} */ cell) => cells.push(cell);
76 // ---- maxPackBytes: incompressible blob. The wire cap is the one readFile enforces; maxObjectSize does not.
77 // Expectation comes from the pack git actually writes for that blob (fixtures record its size): band 1 is that
78 // pack, so a blob a few KiB under the cap can still refuse. Guessing from the blob length misses the framing.
79 const packCap = DEFAULT_LIMITS.maxPackBytes;
80 for (const S of boundaryValues(packCap)) {
81 add({
82 id: `pack.readFile.${S}`, param: 'maxPackBytes', op: 'readFile', repo: `blob-${S}`, path: 'big.bin',
83 bytes: S, entries: 2, expectFrom: 'wire',
84 });
85 }
86 // The check itself, at a 1 MiB cap, so CI crosses the cap without a 128 MiB blob.
87 const smallCap = MiB;
88 for (const S of [0, 1, smallCap - 8192, smallCap - 1, smallCap, smallCap + 1]) {
89 add({
90 id: `pack.readFile.cap1MiB.${S}`, param: 'maxPackBytes', op: 'readFile', repo: `blob-${S}`, path: 'big.bin',
91 bytes: S, entries: 2, limits: { maxPackBytes: smallCap }, expectFrom: 'wire',
92 });
93 }
94 for (const S of [1, MiB, 16 * MiB]) {
95 add({ id: `pack.listTree.sibling.${S}`, param: 'maxPackBytes', op: 'listTree', repo: `blob-${S}`, path: '', bytes: S, entries: 2, expect: ok });
96 add({ id: `pack.readFile.sibling.${S}`, param: 'maxPackBytes', op: 'readFile', repo: `blob-${S}`, path: 'small.txt', bytes: S, entries: 2, expect: ok });
97 }
98 // ply-web's 32 MiB wire. The edges are the largest incompressible blobs that still fit (report: −16 KiB … −4 KiB).
99 for (const S of [32 * MiB - 16384, 32 * MiB - 8192, 32 * MiB - 8191, 32 * MiB - 4096, 32 * MiB, 32 * MiB + 1]) {
100 add({
101 id: `pack.readFile.plyweb.${S}`, param: 'maxPackBytes', op: 'readFile', repo: `blob-${S}`, path: 'big.bin',
102 bytes: S, entries: 2, limits: { ...PLY_WEB_PACK }, nightly: S > CI_BYTES, expectFrom: 'wire',
103 });
104 }
106 // ---- maxTreeEntries ----
107 for (const E of boundaryValues(DEFAULT_LIMITS.maxTreeEntries)) {
108 add({
109 id: `tree.listTree.${E}`, param: 'maxTreeEntries', op: 'listTree', repo: `tree-${E}`, path: '',
110 bytes: E, entries: E, expect: E > DEFAULT_LIMITS.maxTreeEntries ? refused('limit_exceeded', { what: 'tree entries' }) : ok,
111 });
112 }
113 // maxObjectSize on a fetched tree: the declared size is refused where the pack's object header is read (#156), before
114 // a body byte; exactly the cap is allowed. tree-65536's tree is 65,536 entries of 36 bytes (`100644 eNNNNNNN\0` + id).
115 const tree65536 = 65536 * 36;
116 for (const [name, cap] of [['at', tree65536], ['under', tree65536 - 1]]) {
117 add({
118 id: `tree.object.listTree.65536.${name}`, param: 'maxObjectSize', op: 'listTree', repo: 'tree-65536', path: '',
119 bytes: tree65536, entries: 65536, limits: { maxObjectSize: cap },
120 expect: cap < tree65536 ? refused('limit_exceeded', { what: 'pack object size', got: tree65536, max: cap }) : ok,
121 });
122 }
123 for (const E of [1, 65536, 200000, 200001]) {
124 if (E === 0) continue;
125 const name = `e${String(E - 1).padStart(7, '0')}`;
126 add({
127 id: `tree.readFile.${E}`, param: 'maxTreeEntries', op: 'readFile', repo: `tree-${E}`, path: name,
128 bytes: 1, entries: E, expect: E > DEFAULT_LIMITS.maxTreeEntries ? refused('limit_exceeded', { what: 'tree entries' }) : ok,
129 });
130 }
132 // ---- maxPathDepth, maxPathComponent ----
133 for (const D of around(DEFAULT_LIMITS.maxPathDepth)) {
134 const path = D === 1 ? 'f.txt' : `${Array(D - 1).fill('d').join('/')}/f.txt`;
135 add({
136 id: `depth.path.${D}`, param: 'maxPathDepth', op: 'readFile', repo: `depth-${D}`, path,
137 bytes: 5, entries: D, expect: D > DEFAULT_LIMITS.maxPathDepth ? refused('bad_request', { what: 'path' }) : ok,
138 });
139 }
140 for (const L of around(DEFAULT_LIMITS.maxPathComponent)) {
141 add({
142 id: `depth.component.${L}`, param: 'maxPathComponent', op: 'readFile', repo: `comp-${L}`, path: 'a'.repeat(L),
143 bytes: 1, entries: 1, expect: L > DEFAULT_LIMITS.maxPathComponent ? refused('bad_request', { what: 'path' }) : ok,
144 });
145 }
147 // ---- maxMergeDepth: readLog's limit is bad_request past the cap; the search is limit_exceeded (merge-base). ----
148 const depthCap = DEFAULT_LIMITS.maxMergeDepth;
149 const logLimits = boundaryValues(depthCap).filter(L => L === 0 || L === 1 || L >= 512 || L === depthCap - 1 || L === depthCap || L === depthCap + 1 || L === depthCap * 2);
150 const logHistories = [1, depthCap, depthCap * 2];
151 for (const N of logHistories) {
152 for (const L of logLimits) {
153 if (N === 1 && L > 2 && L < depthCap) continue;
154 if (N === depthCap && L > 2 && L < depthCap - 1 && L !== 512) continue;
155 add({
156 id: `depth.readLog.n${N}.l${L}`, param: 'maxMergeDepth', op: 'readLog', repo: `log-${N}`, limit: L, history: N,
157 bytes: N * 8, entries: N,
158 expect: L < 1 || L > depthCap ? refused('bad_request', { what: 'limit' }) : ok,
159 });
160 }
161 }
162 // Distance K commits past the common base on each side. Desired: past the cap, the error's `got` is the next
163 // doubling step (cap * 2), not the cap itself. main reports the cap for both (ratchet).
164 for (const K of around(depthCap)) {
165 if (K > 2 && K < 512) continue;
166 add({
167 id: `depth.mergebase.k${K}`, param: 'maxMergeDepth', op: 'merge', repo: `mb-${K}`, from: 'refs/heads/feat', writes: true,
168 bytes: K * 16, entries: K * 2 + 1,
169 expect: K > depthCap ? refused('limit_exceeded', { what: 'merge-base search depth', got: depthCap * 2, max: depthCap }) : ok,
170 });
171 }
173 // ---- maxRefs. Desired: HEAD does not count, so N == maxRefs is accepted. main counts HEAD (ratchet). ----
174 for (const N of around(DEFAULT_LIMITS.maxRefs)) {
175 add({
176 id: `refs.lsRefs.${N}`, param: 'maxRefs', op: 'lsRefs', repo: `refs-${N}`,
177 bytes: N * 40, entries: N,
178 expect: N > DEFAULT_LIMITS.maxRefs ? refused('limit_exceeded', { what: 'ls-refs lines' }) : ok,
179 });
180 }
181 for (const N of [1, DEFAULT_LIMITS.maxRefs]) {
182 add({
183 id: `refs.readFile.${N}`, param: 'maxRefs', op: 'readFile', repo: `refs-${N}`, path: 'f.txt', ref: 'main',
184 bytes: 2, entries: N, expect: ok,
185 });
186 }
187 // The byte cap, overridden: the default is the pack wire cap and a small listing never reaches it.
188 for (const max of [0, 1]) {
189 add({
190 id: `refs.bytes.${max}`, param: 'maxLsRefsBytes', op: 'lsRefs', repo: 'refs-1',
191 bytes: 200, entries: 1, limits: { maxLsRefsBytes: max },
192 expect: refused('limit_exceeded', { what: 'ls-refs bytes' }),
193 });
194 }
195 add({
196 id: 'refs.bytes.room', param: 'maxLsRefsBytes', op: 'lsRefs', repo: 'refs-1',
197 bytes: 200, entries: 1, limits: { maxLsRefsBytes: MiB }, expect: ok,
198 });
200 // ---- maxMergeBlobBytes. Exactly the cap is allowed (`>`), one byte over is a merge_conflict. ----
201 const blobCap = DEFAULT_LIMITS.maxMergeBlobBytes;
202 const mergeSizes = boundaryValues(blobCap).filter(S => S >= 1024 || S === blobCap - 1 || S === blobCap || S === blobCap + 1 || S === blobCap * 2);
203 for (const S of mergeSizes) {
204 add({
205 id: `merge.blob.${S}`, param: 'maxMergeBlobBytes', op: 'merge', repo: `mblob-${S}`, from: 'refs/heads/feat', writes: true,
206 bytes: S, entries: 1,
207 expect: S > blobCap ? refused('merge_conflict') : ok,
208 });
209 }
211 // ---- maxMergeWork. The 1024-byte file above merges (git merges it); its line merge needs some diff steps, so a
212 // budget of none is a merge_conflict, and each preset's budget is ample for three lines. ----
213 for (const [name, work, expect] of /** @type {const} */ ([
214 ['zero', 0, refused('merge_conflict')],
215 ['worker', WORKER_LIMITS.maxMergeWork, ok],
216 ['default', DEFAULT_LIMITS.maxMergeWork, ok],
217 ])) {
218 add({
219 id: `merge.work.${name}`, param: 'maxMergeWork', op: 'merge', repo: 'mblob-1024', from: 'refs/heads/feat', writes: true,
220 bytes: 1024, entries: 1, limits: { maxMergeWork: work }, expect,
221 });
222 }
224 // ---- maxObjectSize via pushTree. Exactly the cap is allowed. ----
225 const objCap = DEFAULT_LIMITS.maxObjectSize;
226 for (const S of [0, 1, 1023, 1024, 1025]) {
227 add({
228 id: `push.object.cap1KiB.${S}`, param: 'maxObjectSize', op: 'pushTree', repo: 'push-empty', writes: true,
229 nfiles: 1, size: S, bytes: S, entries: 1, limits: { maxObjectSize: 1024 },
230 expect: S > 1024 ? refused('limit_exceeded', { what: 'object size' }) : ok,
231 });
232 }
233 for (const S of [MiB, 16 * MiB, objCap, objCap + 1]) {
234 add({
235 id: `push.object.${S}`, param: 'maxObjectSize', op: 'pushTree', repo: 'push-empty', writes: true,
236 nfiles: 1, size: S, bytes: S, entries: 1,
237 expect: S > objCap ? refused('limit_exceeded', { what: 'object size' }) : ok,
238 });
239 }
240 // The sum of the file bytes plus LIMIT_OBJECT_OVERHEAD per file, refused in fileEntries before the blobs are hashed.
241 // 3 × 48 MiB is 144 MiB, past the cap. 100000 × 8 is 800 KB of payload, but 300 MB once each file pays its
242 // overhead: refused, where counting payload only ran a 128 MiB heap out of memory (#142).
243 const pushCap = DEFAULT_LIMITS.maxPushBytes;
244 for (const [n, s] of [[1, MiB], [1, 16 * MiB], [10000, 64], [3, 48 * MiB], [100000, 8]]) {
245 const total = n * (s + LIMIT_OBJECT_OVERHEAD);
246 add({
247 id: `push.total.${n}x${s}`, param: 'maxPushBytes', op: 'pushTree', repo: 'push-empty', writes: true,
248 nfiles: n, size: s, bytes: total, entries: n,
249 expect: total > pushCap ? refused('limit_exceeded', { what: 'push bytes' }) : (s > objCap ? refused('limit_exceeded', { what: 'object size' }) : ok),
250 });
251 }
253 // ---- WORKER_LIMITS (src/limits.ts), the preset for a 128 MiB isolate. Every cell runs at 128 MiB too: each one
254 // refuses or succeeds, none runs out of memory. The wire edge is the plyweb cells above (the same 32 MiB).
255 const worker = { ...WORKER_LIMITS };
256 const wPush = WORKER_LIMITS.maxPushBytes;
257 for (const [n, s] of [[1, 16 * MiB], [10000, 64], [100000, 8]]) {
258 const total = n * (s + LIMIT_OBJECT_OVERHEAD);
259 add({
260 id: `worker.push.total.${n}x${s}`, param: 'maxPushBytes', op: 'pushTree', repo: 'push-empty', writes: true,
261 nfiles: n, size: s, bytes: n * s, entries: n, limits: worker,
262 expect: total > wPush ? refused('limit_exceeded', { what: 'push bytes' }) : ok,
263 });
264 }
265 add({
266 id: 'worker.push.object.16777217', param: 'maxObjectSize', op: 'pushTree', repo: 'push-empty', writes: true,
267 nfiles: 1, size: 16 * MiB + 1, bytes: 16 * MiB + 1, entries: 1, nightly: true, limits: worker,
268 expect: refused('limit_exceeded', { what: 'object size' }),
269 });
270 for (const E of [WORKER_LIMITS.maxTreeEntries, WORKER_LIMITS.maxTreeEntries + 1]) {
271 add({
272 id: `worker.tree.listTree.${E}`, param: 'maxTreeEntries', op: 'listTree', repo: `tree-${E}`, path: '',
273 bytes: E, entries: E, limits: worker,
274 expect: E > WORKER_LIMITS.maxTreeEntries ? refused('limit_exceeded', { what: 'tree entries' }) : ok,
275 });
276 }
277 // Many tiny objects: git index-pack accepts each pack (the fixture runs it); ply charges the overhead per object and
278 // refuses past the budget, typed, where git accepts. The driver fills the expectation from verify-pack's count and sum.
279 for (const [id, limits] of [['tiny-90000', undefined], ['tiny-20000', worker], ['tiny-90000', worker]]) {
280 add({
281 id: `${limits ? 'worker.' : ''}inflate.${id}`, param: 'maxInflatedTotal', op: 'pack', pack: id,
282 bytes: Number(id.slice('tiny-'.length)) * 8, entries: Number(id.slice('tiny-'.length)), nightly: true, limits, expectFrom: 'charged',
283 });
284 }
286 // ---- editFile, through and past an object. The edit streams; these cells record the RSS, they do not invent a cap. ----
287 for (const S of [MiB, 16 * MiB, objCap - 128, objCap + 128]) {
288 add({
289 id: `edit.file.${S}`, param: 'maxObjectSize', op: 'editFile', repo: `edit-${S}`, path: 'e.txt', writes: true,
290 find: 'NEEDLE', replace: 'NEEDLX', bytes: S, entries: 1, expect: ok,
291 });
292 }
294 // ---- maxDeltaChain. Short chains in CI; the depth-299 pack (the L ≥ 262 override) is nightly.
295 // pack-objects --depth=65 on this 80-version file chains to about 61, still under the cap. Depth 80 is the
296 // first request whose verify-pack chain passes 64, so CI actually crosses the limit. Expectation uses that
297 // measured chain, not the requested depth.
298 for (const D of [0, 1, 63, 64, 65, 80]) {
299 for (const kind of ['ofs', 'ref']) {
300 add({
301 id: `delta.${kind}.d${D}`, param: 'maxDeltaChain', op: 'pack', pack: `d${D}-${kind}`,
302 bytes: 80 * 2048, entries: 80, expectFrom: 'chain',
303 });
304 }
305 }
306 for (const D of [128, 256, 299]) {
307 for (const kind of ['ofs', 'ref']) {
308 add({
309 id: `delta.${kind}.d${D}`, param: 'maxDeltaChain', op: 'pack', pack: `long-d${D}-${kind}`,
310 bytes: 32 * MiB, entries: 300, nightly: true, expectFrom: 'chain',
311 });
312 }
313 }
314 // The chain git actually produced, against an overridden cap. expectFrom 'chain-limit' compares that chain to `limit`.
315 add({
316 id: 'delta.limit.64.d80-ofs', param: 'maxDeltaChain', op: 'pack', pack: 'd80-ofs',
317 bytes: 80 * 2048, entries: 80, limits: { maxDeltaChain: 64 }, expectFrom: 'chain-limit',
318 });
319 add({
320 id: 'delta.limit.80.d80-ofs', param: 'maxDeltaChain', op: 'pack', pack: 'd80-ofs',
321 bytes: 80 * 2048, entries: 80, limits: { maxDeltaChain: 80 }, expectFrom: 'chain-limit',
322 });
323 add({
324 id: 'delta.limit.long.d299-ofs', param: 'maxDeltaChain', op: 'pack', pack: 'long-d299-ofs',
325 bytes: 32 * MiB, entries: 300, nightly: true, limits: { maxDeltaChain: 262 }, expectFrom: 'chain-limit',
326 });
328 // ---- maxInflatedTotal, on a tiny pack, at the sum, one under, and zero. The driver fills the sum. ----
329 add({ id: 'inflate.at', param: 'maxInflatedTotal', op: 'pack', pack: 'inflate', bytes: 8192, entries: 8, expectFrom: 'inflated-at' });
330 add({ id: 'inflate.under', param: 'maxInflatedTotal', op: 'pack', pack: 'inflate', bytes: 8192, entries: 8, expectFrom: 'inflated-under' });
331 add({ id: 'inflate.zero', param: 'maxInflatedTotal', op: 'pack', pack: 'inflate', bytes: 8192, entries: 8, limits: { maxInflatedTotal: 0 }, expect: refused('limit_exceeded', { what: 'pack inflated bytes' }) });
333 // ---- maxResolveWork: resolvePackRange of the chain git packed (d1-ofs: 80 revisions of a 2 KiB file, every delta one
334 // deep). The two cells differ in this key alone; maxInflatedTotal is 0 in both because the bound applied is never
335 // below it. A ceiling of 0 refuses the first delta read back (a delta inflates at least one byte); the default ceiling
336 // (2 GiB) is four orders of magnitude past everything this pack declares.
337 add({ id: 'resolve.work.default', param: 'maxResolveWork', op: 'resolveRange', pack: 'd1-ofs', bytes: 80 * 2048, entries: 80, limits: { maxInflatedTotal: 0, maxResolveWork: DEFAULT_LIMITS.maxResolveWork }, expect: ok });
338 add({ id: 'resolve.work.zero', param: 'maxResolveWork', op: 'resolveRange', pack: 'd1-ofs', bytes: 80 * 2048, entries: 80, limits: { maxInflatedTotal: 0, maxResolveWork: 0 }, expect: refused('limit_exceeded', { what: 'resolve work bytes' }) });
340 pass2(add);
341 // ---- Every key, parsed where it enters (#156 parseLimits). A value that bounds nothing is refused when the client
342 // is made, before any request, whichever operation would read it: lsRefs reads only maxRefs and maxLsRefsBytes, and
343 // every key's cell is still refused there (the lazy read refused only the key the operation reached). A key left out
344 // is the default: every other cell passes only the keys it sets (cell.mjs passes the record as written).
345 // null is refused on every key (#271): derived maxResolveWork is the key left out.
346 for (const key of Object.keys(DEFAULT_LIMITS)) {
347 for (const [name, value] of [['negative', -1], ['null', null]]) {
348 add({ id: `parse.${key}.${name}`, param: key, op: 'lsRefs', repo: 'refs-1', bytes: 200, entries: 1, limits: { [key]: value }, expect: refused('bad_request', { what: key }) });
349 }
350 }
351 add({ id: 'parse.none', param: 'maxRefs', op: 'lsRefs', repo: 'refs-1', bytes: 200, entries: 1, limits: {}, expect: ok });
352 return cells;
353}
355// ---- The second pass (#144): the limits the first left `later`, and the wire: thin packs, protocol v0/v1, pkt-line
356// lengths, capabilities, the request timer, and workerd. Override caps put a boundary in CI; the default boundary is
357// a cell too wherever the fixture is affordable (nightly when it is not).
358/** @param {(cell: Cell) => void} add */
359function pass2(add) {
360 const near = /** @type {const} */ ([['under', -1], ['at', 0], ['over', 1]]);
362 // ---- maxPackObjects. parsePack refuses on the header's count, before the first object is inflated. The driver sets
363 // the cap from verify-pack's object count (`capDelta` from it), so git's own count is the boundary.
364 for (const [name, d] of near) {
365 add({ id: `objects.pack.tiny-1000.cap-${name}`, param: 'maxPackObjects', op: 'pack', pack: 'tiny-1000', bytes: 8000, entries: 1003, capDelta: d, expectFrom: 'objects' });
366 }
367 // At the default 100 000: tiny-N holds N blobs, one tree per 1000 of them, the root tree and the commit, so
368 // N = 99 897, 99 898, 99 899 are 99 999, 100 000 and 100 001 objects. The byte budget is raised so the count is
369 // the cap that decides (at the default budget the overhead charge refuses first, #142).
370 for (const n of [99897, 99898, 99899]) {
371 add({ id: `objects.pack.tiny-${n}`, param: 'maxPackObjects', op: 'pack', pack: `tiny-${n}`, bytes: n * 8, entries: n, nightly: true, limits: { maxInflatedTotal: 1024 * MiB }, expectFrom: 'objects' });
372 }
373 // pushTree counts files against the same cap, before any blob is hashed.
374 for (const n of [99, 100, 101]) {
375 add({
376 id: `objects.push.cap100.${n}`, param: 'maxPackObjects', op: 'pushTree', repo: 'push-empty', writes: true,
377 nfiles: n, size: 8, bytes: n * 8, entries: n, limits: { maxPackObjects: 100 },
378 expect: n > 100 ? refused('limit_exceeded', { what: 'files', got: 101, max: 100 }) : ok,
379 });
380 }
381 for (const n of [100000, 100001]) {
382 add({
383 id: `objects.push.${n}`, param: 'maxPackObjects', op: 'pushTree', repo: 'push-empty', writes: true,
384 nfiles: n, size: 8, bytes: n * 8, entries: n, nightly: true, limits: { maxPushBytes: 1024 * MiB },
385 expect: n > DEFAULT_LIMITS.maxPackObjects ? refused('limit_exceeded', { what: 'files' }) : ok,
386 });
387 }
389 // ---- maxSectionLines. git's upload-pack is the oracle: the driver sends it the same wants, haves and deepen and
390 // counts the lines of each section it answers with (`expectFrom: 'sections'`). acknowledgments: one ACK per common
391 // have, then `ready`; shallow-info: one line per wanted commit at the deepen boundary.
392 const sectionCap = DEFAULT_LIMITS.maxSectionLines;
393 for (const h of [6, 7, 8]) {
394 add({ id: `section.acks.cap8.h${h}`, param: 'maxSectionLines', op: 'fetchPack', repo: 'log-1024', haveCount: h, done: false, bytes: 1024 * 8, entries: 1024, limits: { maxSectionLines: 8 }, expectFrom: 'sections' });
395 }
396 for (const h of [sectionCap - 2, sectionCap - 1, sectionCap]) {
397 // CI keeps the pair that crosses the cap; the line below them is nightly (CI time budget)
398 add({ id: `section.acks.h${h}`, param: 'maxSectionLines', op: 'fetchPack', repo: 'log-1024', haveCount: h, done: false, bytes: 1024 * 8, entries: 1024, nightly: h < sectionCap - 1, expectFrom: 'sections' });
399 }
400 for (const k of [7, 8, 9]) {
401 add({ id: `section.shallow.cap8.k${k}`, param: 'maxSectionLines', op: 'fetchPack', repo: 'log-1024', wantCount: k, deepen: 1, filter: 'tree:0', bytes: 1024 * 8, entries: 1024, limits: { maxSectionLines: 8 }, expectFrom: 'sections' });
402 }
403 for (const k of [sectionCap - 1, sectionCap, sectionCap + 1]) {
404 add({ id: `section.shallow.k${k}`, param: 'maxSectionLines', op: 'fetchPack', repo: 'log-1024', wantCount: k, deepen: 1, filter: 'tree:0', bytes: 1024 * 8, entries: 1024, nightly: k < sectionCap, expectFrom: 'sections' });
405 }
407 // ---- maxReportLines. pushRepo of every branch of branches-N to an empty repository: N commands, and receive-pack
408 // answers one unpack line and one status per ref (N + 1 lines). The cap admits at least that many lines for the
409 // commands sent (push.ts reportLineCap), so an honest report never trips it: a push of 8 under a cap of 8 lands.
410 // git's refs after the push are the oracle (they must equal the local ones).
411 for (const n of [6, 7, 8]) {
412 add({
413 id: `report.cap8.n${n}`, param: 'maxReportLines', op: 'pushRepo', repo: 'empty', local: `branches-${n}`, spec: { all: true }, writes: true,
414 bytes: n * 64, entries: n, limits: { maxReportLines: 8 }, nightly: n === 6,
415 expect: ok,
416 });
417 }
418 // maxRefs allows as many commands as maxReportLines allows lines, and a report is one line more than its commands (#144).
419 add({
420 id: 'report.refs8.n8', param: 'maxReportLines', op: 'pushRepo', repo: 'empty', local: 'branches-8', spec: { all: true }, writes: true,
421 bytes: 8 * 64, entries: 8, limits: { maxRefs: 8, maxReportLines: 8 }, expect: ok,
422 });
423 // ---- maxReportReasonBytes, maxReportProgressBytes. Neither can refuse a push: they bound what is kept of the answer
424 // (a reason's bytes, band 2's decoding), not whether the report is read. So the boundary is 0, and a push under it
425 // lands as it does at the default: git's refs after the push are the oracle.
426 for (const key of ['maxReportReasonBytes', 'maxReportProgressBytes']) {
427 add({
428 id: `report.${key}.zero`, param: key, op: 'pushRepo', repo: 'empty', local: 'branches-8', spec: { all: true }, writes: true,
429 bytes: 8 * 64, entries: 8, limits: { [key]: 0 }, expect: ok,
430 });
431 }
432 // The default cap equals maxRefs, so the largest push maxRefs allows (10 000 commands) has 10 001 report lines.
433 const refCap = DEFAULT_LIMITS.maxRefs;
434 for (const n of [refCap - 1, refCap, refCap + 1]) {
435 add({
436 id: `report.n${n}`, param: 'maxReportLines', op: 'pushRepo', repo: 'empty', local: `branches-${n}`, spec: { all: true }, writes: true,
437 bytes: n * 64, entries: n, nightly: true,
438 expect: n > refCap ? refused('limit_exceeded', { what: 'local refs' }) : ok,
439 });
440 }
442 // ---- maxCommitParents. One octopus commit with N parents (git writes and walks any number). readLog parses it.
443 for (const cap of [8, 9, 10]) {
444 add({
445 id: `parents.octo-9.cap${cap}`, param: 'maxCommitParents', op: 'readLog', repo: 'octo-9', limit: 1, history: 1,
446 bytes: 9 * 64, entries: 10, limits: { maxCommitParents: cap },
447 expect: 9 > cap ? refused('limit_exceeded', { what: 'commit parents', got: 9, max: cap }) : ok,
448 });
449 }
450 const parentCap = DEFAULT_LIMITS.maxCommitParents;
451 for (const n of [parentCap, parentCap + 1]) {
452 add({
453 id: `parents.octo-${n}`, param: 'maxCommitParents', op: 'readLog', repo: `octo-${n}`, limit: 1, history: 1,
454 bytes: n * 64, entries: n + 1,
455 expect: n > parentCap ? refused('limit_exceeded', { what: 'commit parents', got: n, max: parentCap }) : ok,
456 });
457 }
459 // ---- maxRebaseCommits. rebaseBranch of feat (K commits) onto main (K commits) in mb-K. git's rev-list on the copy
460 // is the oracle: K commits from main to feat, and main an ancestor of feat.
461 for (const k of [7, 8, 9]) {
462 add({
463 id: `rebase.cap8.k${k}`, param: 'maxRebaseCommits', op: 'rebase', repo: `mb-${k}`, ref: 'refs/heads/feat', onto: 'refs/heads/main', writes: true,
464 bytes: k * 16, entries: k * 2 + 1, limits: { maxRebaseCommits: 8 }, rebased: k, nightly: k === 7,
465 expect: k > 8 ? refused('limit_exceeded', { what: 'rebase chain', got: 9, max: 8 }) : ok,
466 });
467 }
468 // At the defaults the merge-base search (maxMergeDepth 1024) refuses a branch long before the rebase cap (10 000):
469 // k = 1025 is refused by the search. The cap's own boundary needs a deeper search, so those cells raise it (nightly).
470 for (const k of [DEFAULT_LIMITS.maxMergeDepth, DEFAULT_LIMITS.maxMergeDepth + 1]) {
471 add({
472 id: `rebase.k${k}`, param: 'maxRebaseCommits', op: 'rebase', repo: `mb-${k}`, ref: 'refs/heads/feat', onto: 'refs/heads/main', writes: true,
473 // replaying 1024 commits is ~30 s (7 s of CPU; the rest is one tree fetch per commit), so the success is nightly
474 bytes: k * 16, entries: k * 2 + 1, rebased: k, nightly: k <= DEFAULT_LIMITS.maxMergeDepth,
475 expect: k > DEFAULT_LIMITS.maxMergeDepth ? refused('limit_exceeded', { what: 'merge-base search depth' }) : ok,
476 });
477 }
478 const rebaseCap = DEFAULT_LIMITS.maxRebaseCommits;
479 for (const k of [rebaseCap, rebaseCap + 1]) {
480 add({
481 id: `rebase.deep.k${k}`, param: 'maxRebaseCommits', op: 'rebase', repo: `mb-${k}`, ref: 'refs/heads/feat', onto: 'refs/heads/main', writes: true,
482 // replaying 10 000 commits takes about 200 s on a loaded 4-core machine: past the default cell timeout
483 bytes: k * 16, entries: k * 2 + 1, nightly: true, limits: { maxMergeDepth: 16384 }, rebased: k, timeoutMs: 900_000,
484 expect: k > rebaseCap ? refused('limit_exceeded', { what: 'rebase chain', got: k, max: rebaseCap }) : ok,
485 });
486 }
488 // ---- maxDeltaResult. The largest object git stored as a delta in the pack (fixtures read its size with cat-file)
489 // is the boundary; the cap is set around it (`capDelta`).
490 for (const [name, d] of near) {
491 add({ id: `delta.result.d1-ofs.cap-${name}`, param: 'maxDeltaResult', op: 'pack', pack: 'd1-ofs', bytes: 80 * 2048, entries: 80, capDelta: d, expectFrom: 'delta-result' });
492 add({ id: `delta.result.d64-ref.cap-${name}`, param: 'maxDeltaResult', op: 'pack', pack: 'd64-ref', bytes: 80 * 2048, entries: 80, capDelta: d, expectFrom: 'delta-result' });
493 }
495 // ---- maxHarvestBytes. A server without filters answers readLog's tree:0 with the whole window; ply keeps its
496 // commits and trees up to the cap and drops the rest silently (a later want fetches again). Every cap is ok and
497 // agrees with git; the boundary is the sum git reports for the repository's commits and trees (`capDelta`).
498 for (const max of [0, 1]) {
499 add({ id: `harvest.readLog.${max}`, param: 'maxHarvestBytes', op: 'readLog', repo: 'cap-nofilter--log-64', limit: 64, history: 64, bytes: 64 * 8, entries: 64, limits: { maxHarvestBytes: max }, expect: ok });
500 }
501 for (const [name, d] of near) {
502 add({ id: `harvest.readLog.cap-${name}`, param: 'maxHarvestBytes', op: 'readLog', repo: 'cap-nofilter--log-64', limit: 64, history: 64, bytes: 64 * 8, entries: 64, capDelta: d, nightly: d !== 0, expectFrom: 'harvest' });
503 }
504 add({ id: 'harvest.readLog.default', param: 'maxHarvestBytes', op: 'readLog', repo: 'cap-nofilter--log-64', limit: 64, history: 64, bytes: 64 * 8, entries: 64, expect: ok });
506 // ---- the exchange timers (#255), through the slow-server shim (shim.mjs). requestTimeoutMs is an opt-in total: a
507 // cap of 1 s in CI covers the whole exchange, a stalled body included. firstByteTimeoutMs bounds a slow server (delay)
508 // and idleTimeoutMs a stalled body (stall): 1 s caps in CI, each with the server well inside and well past it, and the
509 // 60 s defaults nightly.
510 const timeout = refused('timeout');
511 for (const [mode, ms, expect] of [['delay', 200, ok], ['delay', 2500, timeout], ['stall', 200, ok], ['stall', 2500, timeout]]) {
512 add({ id: `timeout.cap1000.lsRefs.${mode}-${ms}`, param: 'requestTimeoutMs', op: 'lsRefs', repo: 'refs-1', shim: `${mode}-${ms}`, bytes: 200, entries: 1, limits: { requestTimeoutMs: 1000 }, expect });
513 }
514 add({ id: 'timeout.cap1000.readFile.stall-2500', param: 'requestTimeoutMs', op: 'readFile', repo: 'blob-1048576', path: 'big.bin', shim: 'stall-2500', bytes: MiB, entries: 2, limits: { requestTimeoutMs: 1000 }, expect: timeout });
515 for (const [ms, expect] of [[200, ok], [2500, timeout]]) {
516 add({ id: `timeout.firstbyte1000.lsRefs.delay-${ms}`, param: 'firstByteTimeoutMs', op: 'lsRefs', repo: 'refs-1', shim: `delay-${ms}`, bytes: 200, entries: 1, limits: { firstByteTimeoutMs: 1000 }, expect });
517 add({ id: `timeout.idle1000.lsRefs.stall-${ms}`, param: 'idleTimeoutMs', op: 'lsRefs', repo: 'refs-1', shim: `stall-${ms}`, bytes: 200, entries: 1, limits: { idleTimeoutMs: 1000 }, expect });
518 }
519 // heldTimeoutMs (#273): the consumer, not the server, holds the first chunk of a 1 MiB blob (holdMs), through the
520 // shim (delay-0, a pass-through): held well inside a 1 s cap is read whole, held well past it is cut as timeout.
521 for (const [ms, expect] of [[200, ok], [2500, refused('timeout', { what: 'heldTimeoutMs' })]]) {
522 add({ id: `timeout.held1000.readFile.hold-${ms}`, param: 'heldTimeoutMs', op: 'readFile', repo: 'blob-1048576', path: 'big.bin', shim: 'delay-0', holdMs: ms, bytes: MiB, entries: 2, limits: { heldTimeoutMs: 1000 }, expect });
523 }
524 add({ id: 'timeout.idle1000.readFile.stall-2500', param: 'idleTimeoutMs', op: 'readFile', repo: 'blob-1048576', path: 'big.bin', shim: 'stall-2500', bytes: MiB, entries: 2, limits: { idleTimeoutMs: 1000 }, expect: timeout });
525 const fCap = DEFAULT_LIMITS.firstByteTimeoutMs, iCap = DEFAULT_LIMITS.idleTimeoutMs;
526 for (const [ms, expect] of [[fCap - 5000, ok], [fCap + 5000, timeout]]) {
527 add({ id: `timeout.lsRefs.delay-${ms}`, param: 'firstByteTimeoutMs', op: 'lsRefs', repo: 'refs-1', shim: `delay-${ms}`, bytes: 200, entries: 1, nightly: true, expect });
528 }
529 for (const [ms, expect] of [[iCap - 5000, ok], [iCap + 5000, timeout]]) {
530 add({ id: `timeout.lsRefs.stall-${ms}`, param: 'idleTimeoutMs', op: 'lsRefs', repo: 'refs-1', shim: `stall-${ms}`, bytes: 200, entries: 1, nightly: true, expect });
531 }
533 // ---- protocol v0 / v1: the server answers without v2 (the shim drops or downgrades Git-Protocol), so upload-pack
534 // reads ply's `command=ls-refs` as a v0 request and answers nothing at all. ply speaks v2 only: the desired answer is
535 // a typed refusal that says so (the empty answer sends ply to the advertisement, whose first line is not `version 2`:
536 // `unsupported`, what 'protocol version'), not a misread advertisement. pushTree reads the ref through ls-refs first,
537 // so it is refused the same way before receive-pack (which has no v2) is reached.
538 const notV2 = refused('unsupported', { what: 'protocol version' });
539 for (const v of ['v0', 'v1']) {
540 add({ id: `proto.${v}.lsRefs`, param: 'maxRefs', op: 'lsRefs', repo: 'refs-1', shim: v, bytes: 200, entries: 1, expect: notV2 });
541 add({ id: `proto.${v}.readFile`, param: 'maxPackBytes', op: 'readFile', repo: 'blob-1024', path: 'big.bin', shim: v, bytes: 1024, entries: 2, expect: notV2 });
542 add({ id: `proto.${v}.pushTree`, param: 'maxPushBytes', op: 'pushTree', repo: 'push-empty', shim: v, writes: true, nfiles: 1, size: 64, bytes: 64, entries: 1, expect: notV2 });
543 }
545 // ---- pkt-line length. The shim re-frames the packfile section so every band-1 pkt-line is L bytes long; git's own
546 // client through the same URL is the oracle (gitprotocol-common: 4 + data, at most 65520). `expectFrom: 'git-clone'`.
547 // gitprotocol-common caps a pkt-line at 65520 bytes; git's client (2.4x) reads past that and refuses a total of 65524
548 // (its buffer is LARGE_PACKET_MAX with room for a NUL). The documented 65520 / 65521 and git's measured 65523 / 65524
549 // are all cells: ply has to agree with the client, not with the document.
550 for (const L of [4096, 65519, 65520, 65521, 65522, 65523, 65524, 65525, 65535]) {
551 add({ id: `pktline.frame-${L}.readFile`, param: 'maxPackBytes', op: 'readFile', repo: 'blob-65536', path: 'big.bin', shim: `frame-${L}`, bytes: 65536, entries: 2, nightly: [4096, 65519, 65522].includes(L), expectFrom: 'git-clone' });
552 }
553 // The smallest frames on a 1 KiB blob in CI (1000 frames). On 16, 32 and 64 KiB (nightly) the time per byte is the
554 // cost of a frame: one byte per frame is 65 536 frames.
555 for (const L of [4, 5, 6, 7]) {
556 add({ id: `pktline.frame-${L}.readFile.1024`, param: 'maxPackBytes', op: 'readFile', repo: 'blob-1024', path: 'big.bin', shim: `frame-${L}`, bytes: 1024, entries: 2, expectFrom: 'git-clone' });
557 }
558 for (const S of [16384, 32768, 65536]) {
559 add({ id: `pktline.frame-6.readFile.${S}`, param: 'maxPackBytes', op: 'readFile', repo: `blob-${S}`, path: 'big.bin', shim: 'frame-6', bytes: S, entries: 2, nightly: true, expectFrom: 'git-clone' });
560 }
562 // ---- capabilities: a server with one of ply's features turned off. Content checked against git when ply answers.
563 add({ id: 'caps.nofilter.readFile', param: 'maxPackBytes', op: 'readFile', repo: 'cap-nofilter--blob-1024', path: 'big.bin', bytes: 1024, entries: 2, expect: ok });
564 add({ id: 'caps.nofilter.listTree', param: 'maxTreeEntries', op: 'listTree', repo: 'cap-nofilter--depth-8', path: 'd/d/d', bytes: 64, entries: 8, expect: ok });
565 add({ id: 'caps.nofilter.merge', param: 'maxMergeDepth', op: 'merge', repo: 'cap-nofilter--mb-8', from: 'refs/heads/feat', writes: true, bytes: 128, entries: 17, expect: ok });
566 add({ id: 'caps.nosha.readFile', param: 'maxPathDepth', op: 'readFile', repo: 'cap-nosha--depth-8', path: 'd/d/d/d/d/d/d/f.txt', bytes: 64, entries: 8, expect: ok });
567 add({ id: 'caps.reachable.readFile', param: 'maxPathDepth', op: 'readFile', repo: 'cap-reachable--depth-8', path: 'd/d/d/d/d/d/d/f.txt', bytes: 64, entries: 8, expect: ok });
568 // receive-pack disabled: http-backend answers the POST 403 at its status line, and its advertisement 403 too, so receive-pack never ran: 'auth', never 'ambiguous'
569 add({ id: 'caps.nopush.pushTree', param: 'maxPushBytes', op: 'pushTree', repo: 'cap-nopush--push-empty', writes: true, nfiles: 1, size: 64, bytes: 64, entries: 1, expect: refused('auth') });
571 // ---- thin packs. Push: the remote has v1, the local repository v1 and v2; a thin push sends v2's blob as a
572 // REF_DELTA against v1's, which git's receive-pack completes (index-pack --fix-thin). Fetch: the server deltas
573 // against the haves and ply resolves the external bases from the local store. The oracle is git: refs equal after
574 // the push and fsck clean; the fetched objects are exactly `git rev-list --objects v2 ^v1`.
575 for (const thin of [true, false]) {
576 add({ id: `thin.push.${thin ? 'thin' : 'full'}`, param: 'maxPushBytes', op: 'pushRepo', repo: 'thin-remote', local: 'thin-local', spec: { refspecs: ['main'], thin }, writes: true, bytes: 64 * 1024, entries: 2, thin, expect: ok });
577 }
578 add({ id: 'thin.fetch.external', param: 'maxDeltaChain', op: 'fetchThin', repo: 'thin-local', store: 'thin-remote', bytes: 64 * 1024, entries: 2, expectFrom: 'thin' });
579 // The bases are not in the store: the pack cannot be completed, and that is a typed refusal, not a crash.
580 add({ id: 'thin.fetch.missing-base', param: 'maxDeltaChain', op: 'fetchThin', repo: 'thin-local', store: 'empty', bytes: 64 * 1024, entries: 2, expectFrom: 'thin-missing', expect: refused('pack_corrupt') });
582 // ---- workerd. The same operations inside the Workers runtime (test/workerd), one fresh workerd process per cell;
583 // its peak RSS and CPU are the isolate's cost. The cells mirror node cells above, so the two runtimes can be read
584 // side by side in the report.
585 const wd = { runtime: 'workerd' };
586 add({ ...wd, id: 'workerd.readFile.16777216', param: 'maxPackBytes', op: 'readFile', repo: 'blob-16777216', path: 'big.bin', bytes: 16 * MiB, entries: 2, expectFrom: 'wire' });
587 add({ ...wd, id: 'workerd.readFile.cap1MiB.1048577', param: 'maxPackBytes', op: 'readFile', repo: 'blob-1048577', path: 'big.bin', bytes: MiB + 1, entries: 2, limits: { maxPackBytes: MiB }, expectFrom: 'wire' });
588 add({ ...wd, id: 'workerd.listTree.65536', param: 'maxTreeEntries', op: 'listTree', repo: 'tree-65536', path: '', bytes: 65536, entries: 65536, expect: ok });
589 add({ ...wd, id: 'workerd.worker.listTree.32769', param: 'maxTreeEntries', op: 'listTree', repo: `tree-${WORKER_LIMITS.maxTreeEntries + 1}`, path: '', bytes: 32769, entries: 32769, limits: worker(), expect: refused('limit_exceeded', { what: 'tree entries' }) });
590 add({ ...wd, id: 'workerd.lsRefs.10000', param: 'maxRefs', op: 'lsRefs', repo: 'refs-10000', bytes: 400000, entries: 10000, expect: ok });
591 add({ ...wd, id: 'workerd.lsRefs.10001', param: 'maxRefs', op: 'lsRefs', repo: 'refs-10001', bytes: 400040, entries: 10001, expect: refused('limit_exceeded', { what: 'ls-refs lines' }) });
592 add({ ...wd, id: 'workerd.push.object.16777216', param: 'maxObjectSize', op: 'pushTree', repo: 'push-empty', writes: true, nfiles: 1, size: 16 * MiB, bytes: 16 * MiB, entries: 1, limits: worker(), expect: ok });
593 add({ ...wd, id: 'workerd.push.total.10000x64', param: 'maxPushBytes', op: 'pushTree', repo: 'push-empty', writes: true, nfiles: 10000, size: 64, bytes: 640000, entries: 10000, limits: worker(), expect: ok });
594 add({ ...wd, id: 'workerd.timeout.cap1000.stall-2500', param: 'requestTimeoutMs', op: 'lsRefs', repo: 'refs-1', shim: 'stall-2500', bytes: 200, entries: 1, limits: { requestTimeoutMs: 1000 }, expect: refused('timeout') });
595 add({ ...wd, id: 'workerd.section.shallow.k1001', param: 'maxSectionLines', op: 'fetchPack', repo: 'log-1024', wantCount: 1001, deepen: 1, filter: 'tree:0', bytes: 1024 * 8, entries: 1024, expectFrom: 'sections' });
596 add({ ...wd, id: 'workerd.parents.octo-10001', param: 'maxCommitParents', op: 'readLog', repo: 'octo-10001', limit: 1, history: 1, bytes: 10001 * 64, entries: 10002, expect: refused('limit_exceeded', { what: 'commit parents' }) });
597 add({ ...wd, id: 'workerd.readFile.64MiB', param: 'maxObjectSize', op: 'readFile', repo: `blob-${DEFAULT_LIMITS.maxObjectSize}`, path: 'big.bin', bytes: DEFAULT_LIMITS.maxObjectSize, entries: 2, expectFrom: 'wire' });
598}
600const worker = () => ({ ...WORKER_LIMITS });
602const CELLS = build();
604export function allCells() {
605 return CELLS;
606}
608/** @param {Cell} cell */
609export function isCi(cell) {
610 if (cell.nightly) return false;
611 return (cell.bytes ?? 0) <= CI_BYTES && (cell.entries ?? 0) <= CI_ENTRIES;
612}
614/**
615 * @param {{ ci?: boolean, full?: boolean, filter?: string | null }} opts
616 * @returns {Cell[]}
617 */
618export function selectCells({ ci = false, full = false, filter = null } = {}) {
619 return CELLS.filter(cell => {
620 if (filter && !cell.id.includes(filter)) return false;
621 if (ci && !isCi(cell)) return false;
622 if (!ci && !full && !isCi(cell)) return false;
623 return true;
624 });
625}
Diagnostics4 git calls · 230 ms
CallStatusSizeTime0230 ms
discover200152 B3 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=2 git.response.bytes=152 git.server.agent=gitty/1.0 git.server.object_format=sha1 git.server.caps=agent ls-refs fetch object-format git.server.fetch=shallow filter sideband-all git.protocol.version=2 git.pkt.frames=8 git.pkt.data=6 git.pkt.flush=2 git.pkt.delim=0 git.pkt.bytes=152 git.pkt.payload.max=34
ls-refs200145 B · hit3 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=3 git.response.bytes=145 git.response.cache=HIT git.response.duration_ms=3 git.protocol.version=2 git.pkt.frames=3 git.pkt.data=2 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=145 git.pkt.payload.max=76 git.ls_refs.count=2 git.ls_refs.head=refs/heads/main
fetchblob:none · deepen 1020038 KiB · hit2 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=225 git.response.bytes=38434 git.response.cache=HIT git.response.duration_ms=2 git.fetch.filter=blob:none git.fetch.filter.requested=tree:0 git.fetch.filter.fallback=blob:none git.fetch.filter.learned=false git.fetch.wants=19912563f540228593df0c489082e5e2508e21e4 git.fetch.haves.count=0 git.fetch.deepen=10 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=6 git.pkt.data=4 git.pkt.flush=1 git.pkt.delim=1 git.pkt.bytes=38434 git.pkt.payload.max=38339 git.sideband.band1.bytes=38338 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=63 git.pack.bytes=38338 git.pack.ofs_delta=0 git.pack.ref_delta=8 git.pack.chain.max=8 git.pack.trailer=0bc36ab7adf82d3109177f11f1ea93f1ce071f77 git.pack.full=55Open pack map
fetch20011 KiB225 ms
git.upload-pack fetch http.response.status_code=200 git.response.bytes=11175 git.response.cache=MISS git.response.duration_ms=225 git.fetch.wants=38c28eb356299b540fed16619382673d100797be git.fetch.haves.count=0 git.fetch.deepen=0 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=3 git.pkt.data=2 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=11175 git.pkt.payload.max=11154 git.sideband.band1.bytes=11153 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0
Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.
- Remote
- https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/ply.git
- Ref
- refs/heads/main
- Commit
- 19912563f540228593df0c489082e5e2508e21e4
- cf-ray
- a5e30954ea8215db
- Request
- fe35db62…
- Protocol
- v2 · sha1
- Agent
- gitty/1.0
- Filter
- advertised
- Fetch
- shallow filter sideband-all
- Capabilities
- agent ls-refs fetch object-format