@ref0/git 0.20.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (379) hide show
  1. package/dist/access/private-refs.mjs +1 -1
  2. package/dist/auth/access-jwt.mjs +3 -3
  3. package/dist/auth/auth-namespace.d.mts +3 -3
  4. package/dist/auth/auth-namespace.mjs +3 -2
  5. package/dist/auth/auth.d.mts +3 -3
  6. package/dist/auth/auth.mjs +9 -8
  7. package/dist/auth/authorize.mjs +1 -1
  8. package/dist/auth/fences.d.mts +1 -1
  9. package/dist/auth/host-function.mjs +1 -1
  10. package/dist/auth/host-services.mjs +4 -6
  11. package/dist/auth/identify.d.mts +1 -1
  12. package/dist/auth/identify.mjs +6 -0
  13. package/dist/auth/token-cleanup.mjs +2 -2
  14. package/dist/auth/token-rows.mjs +6 -1
  15. package/dist/auth/token-text.mjs +1 -1
  16. package/dist/auth/tokens-base.d.mts +1 -1
  17. package/dist/auth/tokens.d.mts +1 -1
  18. package/dist/auth/tokens.mjs +1 -1
  19. package/dist/client/client.d.mts +15 -7
  20. package/dist/client/client.mjs +21 -12
  21. package/dist/client/git-http.mjs +1 -1
  22. package/dist/client/local.mjs +60 -24
  23. package/dist/client/negotiate.mjs +3 -3
  24. package/dist/client/push-upload.mjs +26 -10
  25. package/dist/client/remote.mjs +4 -3
  26. package/dist/client/run-remote-helper.d.mts +2 -2
  27. package/dist/client/run-remote-helper.mjs +6 -6
  28. package/dist/client/slice-push.d.mts +1 -1
  29. package/dist/client/transport.mjs +3 -3
  30. package/dist/contracts/blobs.d.mts +3 -3
  31. package/dist/contracts/blobs.mjs +1 -1
  32. package/dist/contracts/calls-spent.mjs +5 -33
  33. package/dist/contracts/client.d.mts +15 -14
  34. package/dist/contracts/commits.d.mts +4 -4
  35. package/dist/contracts/commits.mjs +1 -1
  36. package/dist/contracts/engine.d.mts +2 -2
  37. package/dist/contracts/events.d.mts +1 -1
  38. package/dist/contracts/events.mjs +1 -1
  39. package/dist/contracts/files.d.mts +4 -4
  40. package/dist/contracts/files.mjs +1 -1
  41. package/dist/contracts/forks.d.mts +4 -4
  42. package/dist/contracts/forks.mjs +1 -1
  43. package/dist/contracts/git-hooks.d.mts +1 -1
  44. package/dist/contracts/git.d.mts +9 -5
  45. package/dist/contracts/grants.d.mts +1 -1
  46. package/dist/contracts/merges.d.mts +1 -1
  47. package/dist/contracts/object-values.d.mts +1 -0
  48. package/dist/contracts/object-values.mjs +16 -1
  49. package/dist/contracts/objects.d.mts +30 -18
  50. package/dist/contracts/opaque.mjs +1 -1
  51. package/dist/contracts/operations.mjs +1 -1
  52. package/dist/contracts/queue.d.mts +208 -44
  53. package/dist/contracts/queue.mjs +5 -5
  54. package/dist/contracts/refs.d.mts +5 -5
  55. package/dist/contracts/refs.mjs +1 -1
  56. package/dist/contracts/remote.d.mts +3 -6
  57. package/dist/contracts/repos.d.mts +3 -3
  58. package/dist/contracts/repos.mjs +1 -1
  59. package/dist/contracts/result.d.mts +10 -7
  60. package/dist/contracts/result.mjs +8 -3
  61. package/dist/contracts/rules.d.mts +13 -12
  62. package/dist/contracts/server.d.mts +8 -10
  63. package/dist/contracts/services.d.mts +6 -9
  64. package/dist/contracts/services.mjs +1 -2
  65. package/dist/contracts/signin.d.mts +1 -1
  66. package/dist/contracts/store.d.mts +2 -2
  67. package/dist/contracts/sync.d.mts +63 -6
  68. package/dist/contracts/sync.mjs +3 -2
  69. package/dist/contracts/tags.d.mts +3 -3
  70. package/dist/contracts/tags.mjs +1 -1
  71. package/dist/contracts/tokens.d.mts +2 -2
  72. package/dist/contracts/tokens.mjs +1 -1
  73. package/dist/contracts/topics.d.mts +9 -9
  74. package/dist/contracts/trees.d.mts +4 -4
  75. package/dist/contracts/trees.mjs +1 -1
  76. package/dist/contracts/work.d.mts +4 -4
  77. package/dist/contracts/work.mjs +2 -2
  78. package/dist/core/access.d.mts +1 -1
  79. package/dist/core/ancestry.mjs +30 -34
  80. package/dist/core/{promise.mjs → call-groups.mjs} +7 -30
  81. package/dist/core/call-services.mjs +1 -1
  82. package/dist/core/events/deliver.d.mts +2 -2
  83. package/dist/core/events/deliver.mjs +3 -3
  84. package/dist/core/events/retired.mjs +1 -1
  85. package/dist/core/forks.mjs +5 -5
  86. package/dist/core/hooks/groups.mjs +2 -2
  87. package/dist/core/imports.mjs +101 -21
  88. package/dist/core/index-job.mjs +14 -9
  89. package/dist/core/index-lost.d.mts +1 -1
  90. package/dist/core/loose-tally.mjs +38 -15
  91. package/dist/core/merge-parts.d.mts +17 -4
  92. package/dist/core/merge-parts.mjs +7 -2
  93. package/dist/core/mirror-rows.mjs +31 -1
  94. package/dist/core/objects/blobs.mjs +8 -10
  95. package/dist/core/objects/files.mjs +20 -17
  96. package/dist/core/objects/objects-layer.mjs +1 -1
  97. package/dist/core/objects/peel.mjs +1 -7
  98. package/dist/core/objects/reading.mjs +19 -18
  99. package/dist/core/objects/tree-edits.mjs +1 -1
  100. package/dist/core/objects/trees.mjs +257 -58
  101. package/dist/core/objects/writing.mjs +3 -9
  102. package/dist/core/own-writes.mjs +1 -1
  103. package/dist/core/parts.d.mts +8 -1
  104. package/dist/core/parts.mjs +8 -4
  105. package/dist/core/purge.mjs +31 -18
  106. package/dist/core/push.d.mts +2 -2
  107. package/dist/core/push.mjs +145 -98
  108. package/dist/core/receipts.d.mts +2 -2
  109. package/dist/core/receipts.mjs +9 -2
  110. package/dist/core/ref-index-job.mjs +4 -4
  111. package/dist/core/ref-view.mjs +74 -31
  112. package/dist/core/refs.mjs +3 -3
  113. package/dist/core/repack.mjs +25 -30
  114. package/dist/core/repo-info.mjs +1 -1
  115. package/dist/core/repos.mjs +1 -1
  116. package/dist/core/rules/changes.mjs +18 -40
  117. package/dist/core/rules/check.mjs +6 -5
  118. package/dist/core/rules/commit-changes.mjs +114 -58
  119. package/dist/core/rules/context.d.mts +3 -3
  120. package/dist/core/rules/context.mjs +18 -14
  121. package/dist/core/rules/fetch.mjs +1 -1
  122. package/dist/core/rules/protect.mjs +30 -17
  123. package/dist/core/saved-caller-views.d.mts +1 -1
  124. package/dist/core/saved-caller-views.mjs +3 -3
  125. package/dist/core/saved-callers.d.mts +1 -1
  126. package/dist/core/saved-callers.mjs +1 -1
  127. package/dist/core/seam.d.mts +1 -2
  128. package/dist/core/view.d.mts +6 -3
  129. package/dist/core/view.mjs +11 -10
  130. package/dist/core/work.mjs +2 -2
  131. package/dist/engine/allotted-xdiff.mjs +3 -16
  132. package/dist/engine/combined.d.mts +3 -0
  133. package/dist/engine/combined.mjs +200 -185
  134. package/dist/engine/content.d.mts +2 -2
  135. package/dist/engine/content.mjs +1 -1
  136. package/dist/engine/merge.mjs +7 -9
  137. package/dist/engine/reads.d.mts +2 -2
  138. package/dist/engine/reads.mjs +22 -14
  139. package/dist/engine/xdiff.d.mts +1 -1
  140. package/dist/engine/xdiff.mjs +1 -1
  141. package/dist/event-streams/event-streams.d.mts +1 -1
  142. package/dist/event-streams/event-streams.mjs +1 -1
  143. package/dist/event-streams/stream.d.mts +2 -2
  144. package/dist/event-streams/stream.mjs +3 -3
  145. package/dist/extend.d.mts +2 -6
  146. package/dist/extend.mjs +1 -5
  147. package/dist/http/core-parts.mjs +83 -26
  148. package/dist/http/handler.mjs +54 -9
  149. package/dist/http/parts.d.mts +1 -0
  150. package/dist/http/push-upload-job.mjs +138 -24
  151. package/dist/http/push-uploads.mjs +2 -2
  152. package/dist/http/receive-pack.mjs +14 -53
  153. package/dist/http/request-snapshot.mjs +258 -0
  154. package/dist/http/upload-pack.mjs +23 -18
  155. package/dist/index.d.mts +29 -21
  156. package/dist/index.mjs +11 -2
  157. package/dist/lfs/base.d.mts +1 -1
  158. package/dist/lfs/copy.d.mts +49 -1
  159. package/dist/lfs/copy.mjs +135 -22
  160. package/dist/lfs/layer.d.mts +4 -3
  161. package/dist/lfs/layer.mjs +4 -5
  162. package/dist/lfs/locks.mjs +2 -2
  163. package/dist/lfs/objects.d.mts +1 -1
  164. package/dist/lfs/objects.mjs +3 -3
  165. package/dist/lfs/pointers.mjs +1 -1
  166. package/dist/lfs/rows.d.mts +1 -1
  167. package/dist/lfs/rows.mjs +11 -4
  168. package/dist/lfs/upkeep.mjs +40 -9
  169. package/dist/lfs/uploaded.mjs +1 -1
  170. package/dist/lfs/wire.mjs +1 -1
  171. package/dist/merges/merges.mjs +17 -2
  172. package/dist/protocol/bytes/buffers.d.mts +1 -1
  173. package/dist/protocol/bytes/buffers.mjs +1 -1
  174. package/dist/protocol/bytes/deflate.d.mts +1 -1
  175. package/dist/protocol/bytes/deflate.mjs +1 -1
  176. package/dist/protocol/bytes/inflate.d.mts +1 -1
  177. package/dist/protocol/bytes/inflate.mjs +1 -1
  178. package/dist/protocol/bytes/sha1.d.mts +1 -1
  179. package/dist/protocol/bytes/sha1.mjs +1 -1
  180. package/dist/protocol/diff/read.d.mts +2 -1
  181. package/dist/protocol/diff/read.mjs +102 -8
  182. package/dist/protocol/packs/graph.mjs +1 -1
  183. package/dist/protocol/packs/idx.d.mts +1 -1
  184. package/dist/protocol/packs/idx.mjs +1 -1
  185. package/dist/protocol/packs/parts.mjs +1 -1
  186. package/dist/protocol/packs/reader.d.mts +1 -1
  187. package/dist/protocol/packs/reader.mjs +1 -1
  188. package/dist/protocol/packs/write-error.d.mts +1 -1
  189. package/dist/protocol/packs/write-error.mjs +1 -1
  190. package/dist/protocol/packs/writer.mjs +3 -3
  191. package/dist/protocol/wire/advertisement.d.mts +1 -1
  192. package/dist/protocol/wire/advertisement.mjs +3 -2
  193. package/dist/protocol/wire/fetch.d.mts +1 -1
  194. package/dist/protocol/wire/fetch.mjs +1 -1
  195. package/dist/protocol/wire/lines.d.mts +9 -1
  196. package/dist/protocol/wire/lines.mjs +28 -1
  197. package/dist/protocol/wire/push-uploads.mjs +10 -7
  198. package/dist/protocol/wire/receive-pack.d.mts +1 -1
  199. package/dist/protocol/wire/receive-pack.mjs +1 -1
  200. package/dist/protocol/wire/report-status.d.mts +1 -1
  201. package/dist/protocol/wire/report-status.mjs +1 -1
  202. package/dist/protocol/wire/v2.d.mts +1 -1
  203. package/dist/protocol/wire/v2.mjs +1 -1
  204. package/dist/queue/advance.mjs +31 -24
  205. package/dist/queue/base.d.mts +5 -3
  206. package/dist/queue/calls.mjs +5 -5
  207. package/dist/queue/commit.mjs +1 -1
  208. package/dist/queue/host.d.mts +1 -1
  209. package/dist/queue/layer.d.mts +0 -1
  210. package/dist/queue/layer.mjs +9 -5
  211. package/dist/queue/schedule.mjs +1 -1
  212. package/dist/queue/search.mjs +1 -1
  213. package/dist/queue/state.mjs +1 -1
  214. package/dist/queue/trim.mjs +2 -2
  215. package/dist/rest/client.d.mts +1 -1
  216. package/dist/rest/client.mjs +6 -6
  217. package/dist/rest/errors.mjs +1 -1
  218. package/dist/rest/handler.mjs +2 -2
  219. package/dist/rest/handlers.mjs +16 -6
  220. package/dist/rest/layer.mjs +1 -1
  221. package/dist/rest/listen.mjs +2 -2
  222. package/dist/rest/refs.mjs +1 -1
  223. package/dist/server/edge.mjs +27 -3
  224. package/dist/server/git-layer.d.mts +1 -2
  225. package/dist/server/git-layer.mjs +4 -5
  226. package/dist/server/lifecycle.mjs +1 -1
  227. package/dist/server/registry.mjs +2 -8
  228. package/dist/server/server.mjs +62 -43
  229. package/dist/signin/context.d.mts +1 -1
  230. package/dist/signin/context.mjs +1 -1
  231. package/dist/signin/forms.mjs +1 -1
  232. package/dist/signin/grants.d.mts +2 -2
  233. package/dist/signin/grants.mjs +1 -1
  234. package/dist/signin/wire.mjs +1 -1
  235. package/dist/storage/allotted.mjs +4 -9
  236. package/dist/storage/batch-upkeep.mjs +31 -12
  237. package/dist/storage/batches.d.mts +2 -3
  238. package/dist/storage/batches.mjs +52 -49
  239. package/dist/storage/budget.mjs +23 -1
  240. package/dist/storage/calls.d.mts +1 -1
  241. package/dist/storage/calls.mjs +41 -43
  242. package/dist/storage/charged-cache.mjs +180 -0
  243. package/dist/storage/chunks.d.mts +3 -3
  244. package/dist/storage/chunks.mjs +121 -8
  245. package/dist/storage/counted-bucket.mjs +32 -10
  246. package/dist/storage/fetch-row-cache.d.mts +6 -0
  247. package/dist/storage/fetch-row-cache.mjs +211 -0
  248. package/dist/storage/fetch.d.mts +1 -0
  249. package/dist/storage/fetch.mjs +54 -242
  250. package/dist/storage/held-types.d.mts +0 -1
  251. package/dist/storage/held-types.mjs +13 -4
  252. package/dist/storage/host-bucket.mjs +9 -4
  253. package/dist/storage/index-bitmaps.mjs +340 -65
  254. package/dist/storage/index-build.d.mts +2 -3
  255. package/dist/storage/index-build.mjs +274 -56
  256. package/dist/storage/index-fetch.d.mts +3 -1
  257. package/dist/storage/index-fetch.mjs +60 -21
  258. package/dist/storage/index-graph.mjs +1 -1
  259. package/dist/storage/index-layers.mjs +55 -25
  260. package/dist/storage/index-reach.mjs +15 -22
  261. package/dist/storage/index-whole.d.mts +7 -0
  262. package/dist/storage/index-whole.mjs +145 -37
  263. package/dist/storage/largest-files.mjs +1 -7
  264. package/dist/storage/layout.mjs +17 -1
  265. package/dist/storage/lfs-pointers.mjs +1 -6
  266. package/dist/storage/link-join.mjs +55 -16
  267. package/dist/storage/list-source.d.mts +7 -0
  268. package/dist/storage/list-source.mjs +288 -0
  269. package/dist/storage/loose.d.mts +8 -8
  270. package/dist/storage/loose.mjs +157 -91
  271. package/dist/storage/memory-budget.mjs +226 -22
  272. package/dist/storage/merge-cut.mjs +9 -6
  273. package/dist/storage/merge-fence.mjs +1 -1
  274. package/dist/storage/merge-row.mjs +1 -1
  275. package/dist/storage/merge.d.mts +2 -3
  276. package/dist/storage/merge.mjs +2 -2
  277. package/dist/storage/object-rows.d.mts +3 -3
  278. package/dist/storage/object-rows.mjs +179 -38
  279. package/dist/storage/pack-order.mjs +97 -44
  280. package/dist/storage/pack-ranges.mjs +44 -16
  281. package/dist/storage/pack-reads.d.mts +5 -3
  282. package/dist/storage/pack-reads.mjs +236 -72
  283. package/dist/storage/pack-receive.d.mts +1 -2
  284. package/dist/storage/pack-receive.mjs +24 -18
  285. package/dist/storage/packs.d.mts +1 -1
  286. package/dist/storage/packs.mjs +477 -116
  287. package/dist/storage/placed-reads.mjs +33 -16
  288. package/dist/storage/prune-seen.mjs +1 -1
  289. package/dist/storage/prune-walk.mjs +1 -1
  290. package/dist/storage/prune.mjs +4 -31
  291. package/dist/storage/push-allotment.mjs +26 -14
  292. package/dist/storage/push-uploads.mjs +195 -57
  293. package/dist/storage/pushed-commits.mjs +20 -1
  294. package/dist/storage/quarantine.d.mts +2 -3
  295. package/dist/storage/range-cache.mjs +175 -40
  296. package/dist/storage/raw-ids.mjs +39 -10
  297. package/dist/storage/ready.d.mts +2 -3
  298. package/dist/storage/ready.mjs +114 -38
  299. package/dist/storage/receive-bounds.mjs +31 -9
  300. package/dist/storage/receive-cache.d.mts +7 -0
  301. package/dist/storage/receive-cache.mjs +147 -0
  302. package/dist/storage/receive-files.mjs +1 -1
  303. package/dist/storage/receive-links.mjs +1 -1
  304. package/dist/storage/receive-state.d.mts +2 -2
  305. package/dist/storage/receive-state.mjs +6 -8
  306. package/dist/storage/receive-steps.d.mts +20 -0
  307. package/dist/storage/receive-steps.mjs +298 -13
  308. package/dist/storage/repack-backlog.mjs +1 -6
  309. package/dist/storage/repack-contained.mjs +2 -2
  310. package/dist/storage/repack-job.mjs +1 -1
  311. package/dist/storage/repack.d.mts +2 -3
  312. package/dist/storage/repack.mjs +54 -9
  313. package/dist/storage/request-cache.mjs +57 -0
  314. package/dist/storage/roots.mjs +1 -24
  315. package/dist/storage/rows.d.mts +2 -2
  316. package/dist/storage/rows.mjs +1 -1
  317. package/dist/storage/runs.d.mts +2 -2
  318. package/dist/storage/runs.mjs +1 -1
  319. package/dist/storage/send-list.mjs +62 -25
  320. package/dist/storage/stream-whole.mjs +84 -63
  321. package/dist/storage/swap-walk.mjs +1 -1
  322. package/dist/storage/unpack.mjs +878 -450
  323. package/dist/storage/visible.mjs +110 -32
  324. package/dist/storage/walk.mjs +1 -0
  325. package/dist/storage/wants.mjs +22 -58
  326. package/dist/store/call-count.d.mts +2 -2
  327. package/dist/store/call-count.mjs +24 -11
  328. package/dist/store/catalogue.d.mts +1 -1
  329. package/dist/store/catalogue.mjs +19 -7
  330. package/dist/store/crossing.mjs +1 -7
  331. package/dist/store/cursor-seal.d.mts +1 -1
  332. package/dist/store/cursor-seal.mjs +1 -1
  333. package/dist/store/door.mjs +9 -4
  334. package/dist/store/errors.d.mts +2 -2
  335. package/dist/store/errors.mjs +107 -19
  336. package/dist/store/git-store.mjs +7 -2
  337. package/dist/store/job-try.mjs +90 -9
  338. package/dist/store/list-job.mjs +10 -34
  339. package/dist/store/outbox.d.mts +2 -2
  340. package/dist/store/outbox.mjs +2 -2
  341. package/dist/store/queue-jobs.mjs +6 -12
  342. package/dist/store/records.d.mts +2 -2
  343. package/dist/store/records.mjs +2 -2
  344. package/dist/store/ref-rows.d.mts +2 -2
  345. package/dist/store/ref-rows.mjs +2 -2
  346. package/dist/store/repo-record.d.mts +2 -2
  347. package/dist/store/repo-record.mjs +3 -3
  348. package/dist/store/request-snapshot.mjs +5 -0
  349. package/dist/store/reservations.mjs +2 -2
  350. package/dist/store/topic-jobs.mjs +5 -11
  351. package/dist/sync/bound.d.mts +3 -3
  352. package/dist/sync/bound.mjs +10 -7
  353. package/dist/sync/github.mjs +65 -67
  354. package/dist/sync/http.mjs +1 -1
  355. package/dist/sync/import.mjs +201 -66
  356. package/dist/sync/layer.d.mts +1 -1
  357. package/dist/sync/layer.mjs +6 -6
  358. package/dist/sync/lfs-batch.mjs +1 -1
  359. package/dist/sync/lfs-copy.mjs +175 -15
  360. package/dist/sync/mirror.mjs +5 -10
  361. package/dist/sync/said.mjs +1 -1
  362. package/dist/sync/step.mjs +268 -86
  363. package/dist/sync/tries.mjs +25 -6
  364. package/dist/sync.d.mts +2 -2
  365. package/dist/sync.mjs +2 -2
  366. package/dist/topics/advance.mjs +3 -3
  367. package/dist/topics/calls.mjs +1 -1
  368. package/dist/topics/layer.d.mts +15 -14
  369. package/dist/topics/members.mjs +1 -1
  370. package/dist/topics/topic.mjs +1 -1
  371. package/package.json +3 -13
  372. package/dist/auth/helpers.mjs +0 -17
  373. package/dist/auth.d.mts +0 -5
  374. package/dist/auth.mjs +0 -5
  375. package/dist/core/rules/commit-changes.d.mts +0 -12
  376. package/dist/effect.d.mts +0 -9
  377. package/dist/effect.mjs +0 -7
  378. package/dist/server/joined.d.mts +0 -70
  379. package/dist/server/joined.mjs +0 -41
@@ -1,6 +1,6 @@
1
1
  import { gitError } from "../contracts/result.mjs";
2
2
  import { Sha1 } from "../protocol/bytes/sha1.mjs";
3
- import { bucketDo, bucketReading, readWhole } from "./calls.mjs";
3
+ import { bucketDo, bucketReading, bucketTry, readWhole } from "./calls.mjs";
4
4
  import { bitmapOf, bitmapWords, ewahExtent, ewahOf, mostDirty, orEwah } from "./ewah.mjs";
5
5
  import "./link-join.mjs";
6
6
  import { uploadPartBytes } from "./budget.mjs";
@@ -74,11 +74,15 @@ const noRootPositions = /* @__PURE__ */ new Set();
74
74
  */
75
75
  const edgesFileOf = (key, first, positions, links, targets, roots = noRootPositions) => {
76
76
  const sources = links.sources;
77
- const kept = (source, at, from) => targets[at] !== void 0 && targets[at] !== 4294967295 && !(roots.has(links.positionOf(source)) && links.mayLack(source, at - from));
77
+ const hasRoots = roots.size > 0;
78
+ const targetCount = targets.length;
78
79
  let count = 0;
79
80
  for (let source = 0; source < sources; source += 1) {
80
- const [from, to] = links.linksOf(source);
81
- for (let at = from; at < to; at += 1) if (kept(source, at, from)) count += 1;
81
+ const from = links.linkStart(source);
82
+ const to = links.linkEnd(source);
83
+ if (!(hasRoots && roots.has(links.positionOf(source)))) {
84
+ for (let at = from; at < to; at += 1) if (at < targetCount && targets[at] !== 4294967295) count += 1;
85
+ } else for (let at = from; at < to; at += 1) if (at < targetCount && targets[at] !== 4294967295 && !links.mayLack(source, at - from)) count += 1;
82
86
  }
83
87
  const bytes = new Uint8Array(edgesHeaderBytes + sources * 8 + 4 + count * 4);
84
88
  const view = new DataView(bytes.buffer);
@@ -91,16 +95,37 @@ const edgesFileOf = (key, first, positions, links, targets, roots = noRootPositi
91
95
  const starts = edgesHeaderBytes + sources * 4;
92
96
  const ends = starts + (sources + 1) * 4;
93
97
  let link = 0;
94
- for (let source = 0; source < sources; source += 1) {
98
+ if (count === links.size) for (let source = 0; source < sources; source += 1) {
95
99
  view.setUint32(edgesHeaderBytes + source * 4, links.positionOf(source));
96
100
  view.setUint32(starts + source * 4, link);
97
- const [from, to] = links.linksOf(source);
101
+ const from = links.linkStart(source);
102
+ const to = links.linkEnd(source);
98
103
  for (let at = from; at < to; at += 1) {
99
- if (!kept(source, at, from)) continue;
100
104
  view.setUint32(ends + link * 4, targets[at] ?? 4294967295);
101
105
  link += 1;
102
106
  }
103
107
  }
108
+ else for (let source = 0; source < sources; source += 1) {
109
+ const position = links.positionOf(source);
110
+ view.setUint32(edgesHeaderBytes + source * 4, position);
111
+ view.setUint32(starts + source * 4, link);
112
+ const from = links.linkStart(source);
113
+ const to = links.linkEnd(source);
114
+ if (!(hasRoots && roots.has(position))) for (let at = from; at < to; at += 1) {
115
+ if (at >= targetCount) continue;
116
+ const target = targets[at] ?? 4294967295;
117
+ if (target === 4294967295) continue;
118
+ view.setUint32(ends + link * 4, target);
119
+ link += 1;
120
+ }
121
+ else for (let at = from; at < to; at += 1) {
122
+ if (at >= targetCount) continue;
123
+ const target = targets[at] ?? 4294967295;
124
+ if (target === 4294967295 || links.mayLack(source, at - from)) continue;
125
+ view.setUint32(ends + link * 4, target);
126
+ link += 1;
127
+ }
128
+ }
104
129
  view.setUint32(starts + sources * 4, link);
105
130
  return {
106
131
  slice: {
@@ -287,6 +312,225 @@ const partBytesMost = uploadPartBytes;
287
312
  /** A bitmap's entry in a part: its position, its number and its EWAH's bytes. */
288
313
  const partEntryBytes = 12;
289
314
  /**
315
+ * Preferred byte budget for earlier bitmaps-part footer tables held at once by `PriorParts` in a
316
+ * multi-part whole build: each entry takes 16 bytes (12-byte footer entry plus 4-byte offset), so
317
+ * 1 MiB holds about 65,000 entries (~40 full 8 MiB parts). `room` is
318
+ * `min(totalFooters, max(priorFootersMost, largestFooter))`, so `room` can exceed 1 MiB up to the
319
+ * single largest part's footer (strictly below `partBytesMost`, 8 MiB, since each entry needs 12
320
+ * footer bytes plus at least 4 payload bytes, bounding `n <= floor((8 MiB - 4) / 16)` and
321
+ * `16n + 4 < 8 MiB`), and is always charged alongside `priorLookupBytes` before allocation.
322
+ */
323
+ const priorFootersMost = 1048576;
324
+ /** Bytes `PriorParts` holds for one part's footer table: raw entries + count, plus prefix offsets. */
325
+ const priorFooterBytes = (count) => count * 16 + 4;
326
+ /**
327
+ * Bytes `PriorParts` holds for its sorted position lookup (`Uint32Array` positions and order
328
+ * indices, 8 bytes per completed bitmap) plus cumulative part counts (`Uint32Array`, 4 bytes per
329
+ * earlier part). For 2,157 bitmaps across 2 parts that is ~17 KiB; even if all 1,000,000 objects
330
+ * in a 1,000,000-object repo were chosen across 128 parts, it is 8,000,512 bytes (~7.63 MiB),
331
+ * computed and charged before allocation and released on exit.
332
+ */
333
+ const priorLookupBytes = (parts, bitmaps) => bitmaps * 8 + parts * 4;
334
+ /** Memory reservation `PriorParts` needs before construction: lookup tables plus footer LRU room. */
335
+ const priorPartsRoom = (parts, most) => {
336
+ if (parts.length === 0) return {
337
+ lookup: 0,
338
+ footers: 0,
339
+ total: 0
340
+ };
341
+ let bitmaps = 0;
342
+ let totalFooters = 0;
343
+ let largestFooter = 0;
344
+ for (const part of parts) {
345
+ bitmaps += part.count;
346
+ const footerSize = priorFooterBytes(part.count);
347
+ totalFooters += footerSize;
348
+ largestFooter = Math.max(largestFooter, footerSize);
349
+ }
350
+ const lookup = priorLookupBytes(parts.length, bitmaps);
351
+ const footers = Math.min(totalFooters, Math.max(most, largestFooter));
352
+ return {
353
+ lookup,
354
+ footers,
355
+ total: lookup + footers
356
+ };
357
+ };
358
+ /** Sorts parallel `keys` and `values` ascending by `keys` in place with O(1) extra space. */
359
+ const sortPairs = (keys, values) => {
360
+ const length = keys.length;
361
+ const swap = (a, b) => {
362
+ const key = keys[a] ?? 0;
363
+ keys[a] = keys[b] ?? 0;
364
+ keys[b] = key;
365
+ const value = values[a] ?? 0;
366
+ values[a] = values[b] ?? 0;
367
+ values[b] = value;
368
+ };
369
+ const siftDown = (start, end) => {
370
+ let root = start;
371
+ while (root * 2 + 1 < end) {
372
+ const left = root * 2 + 1;
373
+ const right = left + 1;
374
+ let largest = root;
375
+ if ((keys[left] ?? 0) > (keys[largest] ?? 0)) largest = left;
376
+ if (right < end && (keys[right] ?? 0) > (keys[largest] ?? 0)) largest = right;
377
+ if (largest === root) return;
378
+ swap(root, largest);
379
+ root = largest;
380
+ }
381
+ };
382
+ for (let start = Math.floor(length / 2) - 1; start >= 0; start -= 1) siftDown(start, length);
383
+ for (let end = length - 1; end > 0; end -= 1) {
384
+ swap(0, end);
385
+ siftDown(0, end);
386
+ }
387
+ };
388
+ /**
389
+ * Reads bitmaps written by earlier parts of a multi-part whole build on demand, holding at most
390
+ * `room` bytes of part footer tables in LRU order (`room` can exceed `most`, up to the single
391
+ * largest part's footer, strictly below `partBytesMost`) and `lookupBytes` of typed lookup tables.
392
+ * Each part's footer is read once per cache residency (one size lookup plus one suffix range read;
393
+ * eviction permits rereads) and each needed bitmap takes one small range read, avoiding a full
394
+ * graph re-walk through all edges files on every later part.
395
+ */
396
+ var PriorParts = class {
397
+ #bucket;
398
+ #parts;
399
+ #positions;
400
+ #orderIndices;
401
+ #partEnds;
402
+ #held = /* @__PURE__ */ new Map();
403
+ #bytes = 0;
404
+ /** The bytes held by the typed position lookup and cumulative part-count arrays. */
405
+ lookupBytes;
406
+ /** The most bytes of footer tables it holds at once (may exceed `most`, up to largest footer). */
407
+ room;
408
+ /** Part footers read, for tests to count. */
409
+ footerReads = 0;
410
+ /** Individual bitmaps range-read from earlier parts, for tests to count. */
411
+ bitmapReads = 0;
412
+ constructor(bucket, parts, order, most) {
413
+ this.#bucket = bucket;
414
+ this.#parts = parts;
415
+ const plan = priorPartsRoom(parts, most);
416
+ this.lookupBytes = plan.lookup;
417
+ this.room = plan.footers;
418
+ this.#partEnds = new Uint32Array(parts.length);
419
+ let at = 0;
420
+ for (const [partNumber, part] of parts.entries()) {
421
+ at += part.count;
422
+ this.#partEnds[partNumber] = at;
423
+ }
424
+ const count = Math.min(at, order.length);
425
+ this.#positions = new Uint32Array(count);
426
+ this.#orderIndices = new Uint32Array(count);
427
+ for (let ord = 0; ord < count; ord += 1) {
428
+ this.#positions[ord] = order[ord]?.position ?? 0;
429
+ this.#orderIndices[ord] = ord;
430
+ }
431
+ sortPairs(this.#positions, this.#orderIndices);
432
+ }
433
+ /** The bytes of footer tables held now, for tests to check against `room`. */
434
+ get held() {
435
+ return this.#bytes;
436
+ }
437
+ #orderIndexOf(position) {
438
+ let low = 0;
439
+ let high = this.#positions.length - 1;
440
+ while (low <= high) {
441
+ const mid = low + high >>> 1;
442
+ const value = this.#positions[mid] ?? 0;
443
+ if (value === position) return this.#orderIndices[mid] ?? 0;
444
+ if (value < position) low = mid + 1;
445
+ else high = mid - 1;
446
+ }
447
+ return -1;
448
+ }
449
+ #locate(position) {
450
+ const ord = this.#orderIndexOf(position);
451
+ if (ord === -1) return void 0;
452
+ let low = 0;
453
+ let high = this.#partEnds.length - 1;
454
+ while (low < high) {
455
+ const mid = low + high >>> 1;
456
+ if ((this.#partEnds[mid] ?? 0) <= ord) low = mid + 1;
457
+ else high = mid;
458
+ }
459
+ const start = low === 0 ? 0 : this.#partEnds[low - 1] ?? 0;
460
+ return {
461
+ part: low,
462
+ index: ord - start
463
+ };
464
+ }
465
+ has(position) {
466
+ return this.#orderIndexOf(position) !== -1;
467
+ }
468
+ read(position) {
469
+ return Effect.suspend(() => {
470
+ const location = this.#locate(position);
471
+ const part = location === void 0 ? void 0 : this.#parts[location.part];
472
+ if (location === void 0 || part === void 0) return Effect.fail(lost(`No prior part holds bitmap position ${position}`));
473
+ return Effect.flatMap(this.#footerOf(location.part, part), (footer) => {
474
+ const entry = location.index * partEntryBytes;
475
+ const storedPosition = footer.view.getUint32(entry);
476
+ if (storedPosition !== position) return Effect.fail(lost(`${part.key}'s entry ${location.index} is position ${storedPosition}, not ${position}`));
477
+ const length = footer.view.getUint32(entry + 8);
478
+ const offset = footer.offsets[location.index] ?? 0;
479
+ return Effect.map(readExactly(this.#bucket, part.key, offset, length), (raw) => {
480
+ this.bitmapReads += 1;
481
+ const ewah = new Uint32Array(length / 4);
482
+ const rawView = new DataView(raw.buffer, raw.byteOffset, raw.byteLength);
483
+ for (let word = 0; word < ewah.length; word += 1) ewah[word] = rawView.getUint32(word * 4);
484
+ return ewah;
485
+ });
486
+ });
487
+ });
488
+ }
489
+ #footerOf(partNumber, part) {
490
+ return Effect.suspend(() => {
491
+ const cached = this.#held.get(partNumber);
492
+ if (cached !== void 0) {
493
+ this.#held.delete(partNumber);
494
+ this.#held.set(partNumber, cached);
495
+ return Effect.succeed(cached);
496
+ }
497
+ const needed = priorFooterBytes(part.count);
498
+ for (const [heldPart, kept] of this.#held) {
499
+ if (this.#bytes + needed <= this.room) break;
500
+ this.#held.delete(heldPart);
501
+ this.#bytes -= kept.bytes;
502
+ }
503
+ const rawFooterBytes = part.count * partEntryBytes + 4;
504
+ return Effect.flatMap(storedSize(this.#bucket, part.key), (size) => {
505
+ if (size === void 0 || size < rawFooterBytes) return Effect.fail(lost(`${part.key} is missing or cut short`));
506
+ return Effect.flatMap(readExactly(this.#bucket, part.key, size - rawFooterBytes, rawFooterBytes), (bytes) => {
507
+ const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
508
+ const count = view.getUint32(bytes.byteLength - 4);
509
+ if (count !== part.count) return Effect.fail(lost(`${part.key} holds ${count} bitmaps, not ${part.count}`));
510
+ const offsets = new Uint32Array(count);
511
+ let offset = 0;
512
+ for (let at = 0; at < count; at += 1) {
513
+ const length = view.getUint32(at * partEntryBytes + 8);
514
+ if (length % 4 !== 0) return Effect.fail(lost(`${part.key}'s bitmap ${at} has unaligned length`));
515
+ offsets[at] = offset;
516
+ offset += length;
517
+ }
518
+ if (offset !== size - rawFooterBytes) return Effect.fail(lost(`${part.key}'s entries don't fill its bytes`));
519
+ this.footerReads += 1;
520
+ const footer = {
521
+ view,
522
+ offsets,
523
+ bytes: needed
524
+ };
525
+ this.#held.set(partNumber, footer);
526
+ this.#bytes += needed;
527
+ return Effect.succeed(footer);
528
+ });
529
+ });
530
+ });
531
+ }
532
+ };
533
+ /**
290
534
  * One try's part of a whole build's bitmaps, held until it's put: each bitmap's EWAH words,
291
535
  * big-endian, as a `.bitmaps` holds them, then each one's position, number and length, then
292
536
  * their count. At most `most` bytes.
@@ -446,6 +690,15 @@ const bitmapsPut = /* @__PURE__ */ Effect.fnUntraced(function* (bucket, key, pos
446
690
  };
447
691
  });
448
692
  /**
693
+ * What `writeBitmaps` grows its allotment by before walking: the walk's buffers (`walkBytes`),
694
+ * the bitmaps it keeps in `made` (`kept`), the streaming put buffer when writing `.bitmaps`
695
+ * directly (not a part), and the layer-below arrays when updating.
696
+ */
697
+ const bitmapsWalkBytes = (positions, kept, options) => {
698
+ const words = bitmapWords(positions);
699
+ return walkBytes(positions) + kept + (options?.part === true ? 0 : Math.min(bitmapsMostBytes(positions, options?.count ?? 0), uploadPartBytes)) + (options?.below === true ? words * 12 : 0);
700
+ };
701
+ /**
449
702
  * A bitmap for each of `input.chosen`, oldest first, each the set of positions its object
450
703
  * reaches: forward sweeps over the positions, each taking the links of every set position not
451
704
  * yet taken, until one sets nothing behind it. A position with a bitmap already made is ORed
@@ -455,13 +708,16 @@ const bitmapsPut = /* @__PURE__ */ Effect.fnUntraced(function* (bucket, key, pos
455
708
  * bucket as they're made, the table after them.
456
709
  */
457
710
  const writeBitmaps = /* @__PURE__ */ Effect.fnUntraced(function* (input) {
458
- const { edges, positions, below, part } = input;
711
+ const { edges, positions, below, part, prior } = input;
459
712
  const words = bitmapWords(positions);
460
713
  const order = bitmapOrder(input.chosen);
461
714
  const count = order.length;
462
- const atMost = bitmapsMostBytes(positions, count);
463
- const held = walkBytes(positions) + input.kept + (part === void 0 ? Math.min(atMost, uploadPartBytes) : 0) + (below === void 0 ? 0 : words * 12);
464
- yield* input.allotment.grow(held);
715
+ const held = input.walkReserved === true ? 0 : bitmapsWalkBytes(positions, input.kept, {
716
+ part: part !== void 0,
717
+ below: below !== void 0,
718
+ count
719
+ });
720
+ if (held > 0) yield* input.allotment.grow(held);
465
721
  const put = part === void 0 ? yield* bitmapsPut(input.bucket, input.key, positions, count) : void 0;
466
722
  const reached = new Uint32Array(words);
467
723
  const taken = new Uint32Array(words);
@@ -476,6 +732,21 @@ const writeBitmaps = /* @__PURE__ */ Effect.fnUntraced(function* (input) {
476
732
  let madeBytes = 0;
477
733
  let again = false;
478
734
  let word = 0;
735
+ const keepMade = (position, ewah) => {
736
+ if (ewah.byteLength > input.kept) return;
737
+ const existing = made.get(position);
738
+ if (existing !== void 0) {
739
+ made.delete(position);
740
+ madeBytes -= existing.byteLength;
741
+ }
742
+ made.set(position, ewah);
743
+ madeBytes += ewah.byteLength;
744
+ for (const [keptPosition, kept] of made) {
745
+ if (madeBytes <= input.kept) break;
746
+ made.delete(keptPosition);
747
+ madeBytes -= kept.byteLength;
748
+ }
749
+ };
479
750
  const reach = (target) => {
480
751
  const at = target >>> 5;
481
752
  const bit = 1 << (target & 31);
@@ -502,8 +773,15 @@ const writeBitmaps = /* @__PURE__ */ Effect.fnUntraced(function* (input) {
502
773
  const closed = yield* below.ready(position);
503
774
  if (closed === void 0) waiting[word] = (waiting[word] ?? 0) | 1 << bit;
504
775
  else for (const into of closing) orInto(closed, into);
505
- } else if (stored !== void 0) for (const into of closing) orEwah(stored, into);
506
- else if (!edges.links(position, reach)) {
776
+ } else if (stored !== void 0) {
777
+ made.delete(position);
778
+ made.set(position, stored);
779
+ for (const into of closing) orEwah(stored, into);
780
+ } else if (position !== chosen.position && prior?.has(position) === true) {
781
+ const ewah = yield* prior.read(position);
782
+ for (const into of closing) if (!orEwah(ewah, into)) return yield* Effect.fail(lost(`The prior bitmap at ${position} is unreadable`));
783
+ keepMade(position, ewah);
784
+ } else if (!edges.links(position, reach)) {
507
785
  yield* edges.load;
508
786
  continue;
509
787
  }
@@ -536,26 +814,20 @@ const writeBitmaps = /* @__PURE__ */ Effect.fnUntraced(function* (input) {
536
814
  }
537
815
  if (!closedAll) {
538
816
  if (put !== void 0) yield* put.abort;
539
- input.allotment.shrink(held);
817
+ if (held > 0) input.allotment.shrink(held);
540
818
  return;
541
819
  }
542
820
  const ewah = ewahOf(reached);
543
821
  if (put === void 0) part?.into.add(chosen.position, chosen.number, ewah);
544
822
  else yield* put.add(chosen.position, chosen.number, ewah);
545
- made.set(chosen.position, ewah);
546
- madeBytes += ewah.byteLength;
547
- for (const [position, kept] of made) {
548
- if (madeBytes <= input.kept) break;
549
- made.delete(position);
550
- madeBytes -= kept.byteLength;
551
- }
823
+ keepMade(chosen.position, ewah);
552
824
  }
553
825
  const written = put === void 0 ? {
554
826
  count: part?.into.count ?? 0,
555
827
  table: 0,
556
828
  bytes: 0
557
829
  } : yield* put.finish;
558
- input.allotment.shrink(held);
830
+ if (held > 0) input.allotment.shrink(held);
559
831
  return written;
560
832
  }, Effect.scoped);
561
833
  /** How many bytes of a layer's `.bitmaps` a merge reads as one range, an entry past it alone. */
@@ -649,12 +921,20 @@ const runsOf = (entries, mostBytes = Number.POSITIVE_INFINITY) => {
649
921
  const runsMost = (table, count, mostBytes = Number.POSITIVE_INFINITY) => Math.min(count, 1 + Math.floor(table / runGapBytes) + (mostBytes === Number.POSITIVE_INFINITY ? 0 : Math.floor(2 * table / mostBytes)));
650
922
  /** The `.bitmaps` at `key`, of `positions` and `count` bitmaps, its table at `table`. */
651
923
  const openBitmaps = /* @__PURE__ */ Effect.fnUntraced(function* (bucket, key, written) {
652
- const head = yield* readExactly(bucket, key, 0, 16);
653
- const view = new DataView(head.buffer, head.byteOffset, head.byteLength);
654
- if (bitmapsMagic.some((byte, at) => head[at] !== byte) || view.getUint32(4) !== 1 || view.getUint32(8) !== written.positions || view.getUint32(12) !== written.count) return yield* Effect.fail(lost(`${key} isn't the ${written.count} bitmaps of ${written.positions}`));
655
- if (written.table < 16) return yield* Effect.fail(lost(`${key}'s table at ${written.table} is inside its header`));
656
- const table = yield* readExactly(bucket, key, written.table, written.count * 20);
657
- yield* readExactly(bucket, key, written.table + written.count * 20, 20);
924
+ const checkHead = (head) => {
925
+ const view = new DataView(head.buffer, head.byteOffset, head.byteLength);
926
+ return bitmapsMagic.some((byte, at) => head[at] !== byte) || view.getUint32(4) !== 1 || view.getUint32(8) !== written.positions || view.getUint32(12) !== written.count ? Effect.fail(lost(`${key} isn't the ${written.count} bitmaps of ${written.positions}`)) : Effect.void;
927
+ };
928
+ if (written.table < 16) {
929
+ yield* checkHead(yield* readExactly(bucket, key, 0, 16));
930
+ return yield* Effect.fail(lost(`${key}'s table at ${written.table} is inside its header`));
931
+ }
932
+ const [head, table] = yield* Effect.all([
933
+ readExactly(bucket, key, 0, 16),
934
+ readExactly(bucket, key, written.table, written.count * 20),
935
+ readExactly(bucket, key, written.table + written.count * 20, 20)
936
+ ], { concurrency: "unbounded" });
937
+ yield* checkHead(head);
658
938
  const fields = wordsOf(table, 0, written.count * 5);
659
939
  const entries = Array.from({ length: written.count }, (_, at) => ({
660
940
  position: fields[at * 5] ?? 0,
@@ -698,48 +978,43 @@ const openBitmaps = /* @__PURE__ */ Effect.fnUntraced(function* (bucket, key, wr
698
978
  offset: from,
699
979
  length: last.offset + last.length - from
700
980
  };
701
- return bucketReading(bucket, key, range, async (body) => {
702
- if (body === void 0) return lost(`${key} is missing its bytes from ${from}`);
703
- const reader = body.getReader();
981
+ return bucketReading(bucket, key, range, Effect.fnUntraced(function* (reader) {
982
+ if (reader === void 0) return lost(`${key} is missing its bytes from ${from}`);
704
983
  let at = from;
705
984
  let next = 0;
706
985
  let held;
707
- try {
708
- for (let read = await reader.read(); !read.done; read = await reader.read()) {
709
- const chunk = read.value;
710
- let offset = 0;
711
- while (offset < chunk.length) {
712
- const entry = run[next];
713
- if (entry === void 0) return void 0;
714
- if (at < entry.offset) {
715
- const skip = Math.min(entry.offset - at, chunk.length - offset);
716
- at += skip;
717
- offset += skip;
718
- continue;
719
- }
720
- const taken = at - entry.offset;
721
- const length = Math.min(entry.length - taken, chunk.length - offset);
722
- const whole = taken === 0 && length === entry.length;
723
- if (!whole) {
724
- held ??= new Uint8Array(entry.length);
725
- held.set(chunk.subarray(offset, offset + length), taken);
726
- }
727
- at += length;
728
- offset += length;
729
- if (at < entry.offset + entry.length) continue;
730
- const bytes = whole ? chunk.subarray(offset - length, offset) : held;
731
- held = void 0;
732
- next += 1;
733
- const ewah = bytes === void 0 ? void 0 : wordsOf(bytes, 0, entry.length / 4);
734
- if (ewah === void 0 || !fits(ewah)) return unread(entry);
735
- orEwah(ewah, into);
986
+ for (let read = yield* bucketTry(() => reader.read()); !read.done; read = yield* bucketTry(() => reader.read())) {
987
+ const chunk = read.value;
988
+ let offset = 0;
989
+ while (offset < chunk.length) {
990
+ const entry = run[next];
991
+ if (entry === void 0) return void 0;
992
+ if (at < entry.offset) {
993
+ const skip = Math.min(entry.offset - at, chunk.length - offset);
994
+ at += skip;
995
+ offset += skip;
996
+ continue;
736
997
  }
998
+ const taken = at - entry.offset;
999
+ const length = Math.min(entry.length - taken, chunk.length - offset);
1000
+ const whole = taken === 0 && length === entry.length;
1001
+ if (!whole) {
1002
+ held ??= new Uint8Array(entry.length);
1003
+ held.set(chunk.subarray(offset, offset + length), taken);
1004
+ }
1005
+ at += length;
1006
+ offset += length;
1007
+ if (at < entry.offset + entry.length) continue;
1008
+ const bytes = whole ? chunk.subarray(offset - length, offset) : held;
1009
+ held = void 0;
1010
+ next += 1;
1011
+ const ewah = bytes === void 0 ? void 0 : wordsOf(bytes, 0, entry.length / 4);
1012
+ if (ewah === void 0 || !fits(ewah)) return unread(entry);
1013
+ orEwah(ewah, into);
737
1014
  }
738
- return run[next] === void 0 ? void 0 : lost(`${key} is missing its bytes from ${at}`);
739
- } finally {
740
- await reader.cancel();
741
1015
  }
742
- });
1016
+ return run[next] === void 0 ? void 0 : lost(`${key} is missing its bytes from ${at}`);
1017
+ }));
743
1018
  };
744
1019
  const orEntries = Effect.fnUntraced(function* (entries, into, atOnce) {
745
1020
  if (into.length < words) return yield* Effect.fail(lost(`${key}'s bitmaps are past what they're ORed into`));
@@ -796,4 +1071,4 @@ const storedBitmaps = /* @__PURE__ */ Effect.fnUntraced(function* (bucket, key,
796
1071
  bytes: size
797
1072
  };
798
1073
  });
799
- export { BitmapsPart, EdgeFiles, bitmapOrder, bitmapsMostBytes, bitmapsPut, copyBitmaps, copyHeldBytes, copyRunBytes, eachBitmapBytes, edgesBytesOf, edgesFileOf, ewahMostWords, isKeepUnclosed, isMergeIncomplete, keepUnclosed, mergeIncomplete, noBase, noNumber, openBitmaps, orderKey, partBitmaps, partBytesMost, runGapBytes, runsMost, storedBitmaps, storedSize, walkBytes, writeBitmaps };
1074
+ export { BitmapsPart, EdgeFiles, PriorParts, bitmapOrder, bitmapsMostBytes, bitmapsPut, bitmapsWalkBytes, copyBitmaps, copyHeldBytes, copyRunBytes, eachBitmapBytes, edgesBytesOf, edgesFileOf, ewahMostWords, isKeepUnclosed, isMergeIncomplete, keepUnclosed, mergeIncomplete, noBase, noNumber, openBitmaps, orderKey, partBitmaps, partBytesMost, priorFooterBytes, priorFootersMost, priorLookupBytes, priorPartsRoom, runGapBytes, runsMost, storedBitmaps, storedSize, walkBytes, writeBitmaps };
@@ -2,7 +2,6 @@ import "../contracts/result.mjs";
2
2
  import "./index-bitmaps.mjs";
3
3
  import "../contracts/ids.mjs";
4
4
  import "../contracts/objects.mjs";
5
- import "../contracts/services.mjs";
6
5
  import "../contracts/store.mjs";
7
6
  import "../protocol/objects/commit.mjs";
8
7
  import "../store/call-count.mjs";
@@ -12,8 +11,8 @@ import "./index-layers.mjs";
12
11
  import "./layout.mjs";
13
12
  import "./memory-budget.mjs";
14
13
  import "./pack-order.mjs";
14
+ import { Moment, Row } from "@ref0/infra";
15
+ import "effect/Schema";
15
16
  import "effect/Effect";
16
17
  import "effect/Option";
17
- import "effect/Schema";
18
- import { Moment, Row } from "@ref0/infra";
19
18
  import "effect/Scope";