tensorfs 0.3.86__tar.gz → 0.3.87__tar.gz

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.

Potentially problematic release.


This version of tensorfs might be problematic. Click here for more details.

Files changed (203) hide show
  1. {tensorfs-0.3.86 → tensorfs-0.3.87}/Cargo.lock +3 -3
  2. {tensorfs-0.3.86 → tensorfs-0.3.87}/Cargo.toml +1 -1
  3. {tensorfs-0.3.86 → tensorfs-0.3.87}/PKG-INFO +1 -1
  4. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/providers.rs +4 -4
  5. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/source_artifact.rs +5 -3
  6. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/store.rs +1 -1
  7. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/transport/download.rs +184 -59
  8. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/transport/http_reuse_tests.rs +6 -6
  9. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/transport/mod.rs +2 -2
  10. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/transport/pull.rs +1 -0
  11. tensorfs-0.3.87/crates/tensorfs-core/src/transport/sources.rs +517 -0
  12. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/transport/tests.rs +9 -2
  13. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/source_download.rs +100 -52
  14. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/source_prefixes.rs +48 -28
  15. {tensorfs-0.3.86 → tensorfs-0.3.87}/pyproject.toml +1 -1
  16. tensorfs-0.3.86/crates/tensorfs-core/src/transport/prefix.rs +0 -1094
  17. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/Cargo.toml +0 -0
  18. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/build.rs +0 -0
  19. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/examples/h3-swiglu-layout.md +0 -0
  20. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/examples/optional-cache-backfill.md +0 -0
  21. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/examples/resident-conversion.md +0 -0
  22. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/examples/resident_conversion_profile.rs +0 -0
  23. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/asset_update.rs +0 -0
  24. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/b64.rs +0 -0
  25. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/bin/tfs/ckpt.rs +0 -0
  26. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/bin/tfs/conform.rs +0 -0
  27. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/bin/tfs/ensure.rs +0 -0
  28. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/bin/tfs/fetch.rs +0 -0
  29. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/bin/tfs/ingest.rs +0 -0
  30. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/bin/tfs/main.rs +0 -0
  31. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/bin/tfs/rd.rs +0 -0
  32. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/bin/tfs/repo.rs +0 -0
  33. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/bin/tfs/snap.rs +0 -0
  34. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/bin/tfs/watch.rs +0 -0
  35. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/cache_roots.rs +0 -0
  36. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/canon.rs +0 -0
  37. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/capability.rs +0 -0
  38. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/catalog/lock.rs +0 -0
  39. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/catalog.rs +0 -0
  40. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/cbor.rs +0 -0
  41. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/checkpoint.rs +0 -0
  42. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/checkpoint_root.rs +0 -0
  43. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/corpus.rs +0 -0
  44. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/derived/adoption.rs +0 -0
  45. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/derived/companion_tests.rs +0 -0
  46. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/derived/estimate.rs +0 -0
  47. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/derived/graft_tests.rs +0 -0
  48. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/derived/group_commit_tests.rs +0 -0
  49. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/derived/history_cost_tests.rs +0 -0
  50. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/derived/part_rows_tests.rs +0 -0
  51. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/derived/progress.rs +0 -0
  52. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/derived/resume_tests.rs +0 -0
  53. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/derived/retention.rs +0 -0
  54. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/derived/roots.rs +0 -0
  55. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/derived.rs +0 -0
  56. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/descriptors.rs +0 -0
  57. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/disk.rs +0 -0
  58. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/dtype.rs +0 -0
  59. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/durability.rs +0 -0
  60. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/ensure/admission.rs +0 -0
  61. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/ensure/flight.rs +0 -0
  62. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/ensure.rs +0 -0
  63. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/err.rs +0 -0
  64. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/fetch.rs +0 -0
  65. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/filesystem_identity.rs +0 -0
  66. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/fill.rs +0 -0
  67. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/fit.rs +0 -0
  68. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/gc.rs +0 -0
  69. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/header.rs +0 -0
  70. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/home.rs +0 -0
  71. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/ids.rs +0 -0
  72. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/ingest/carrier.rs +0 -0
  73. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/ingest/convert.rs +0 -0
  74. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/ingest/custody.rs +0 -0
  75. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/ingest/fingerprint.rs +0 -0
  76. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/ingest/gguf.rs +0 -0
  77. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/ingest/h3_lora.rs +0 -0
  78. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/ingest/journal.rs +0 -0
  79. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/ingest/mod.rs +0 -0
  80. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/ingest/narrow.rs +0 -0
  81. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/ingest/preflight.rs +0 -0
  82. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/ingest/routes/anima.routes.json +0 -0
  83. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/ingest/routes/anima.spec.json +0 -0
  84. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/ingest/routes/sdxl.routes.json +0 -0
  85. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/ingest/routes/sdxl.spec.json +0 -0
  86. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/ingest/routes.rs +0 -0
  87. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/ingest/source.rs +0 -0
  88. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/ingest/stamp.rs +0 -0
  89. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/ingest/transaction.rs +0 -0
  90. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/jcs.rs +0 -0
  91. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/keyed_roots.rs +0 -0
  92. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/lib.rs +0 -0
  93. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/limits.rs +0 -0
  94. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/machine.rs +0 -0
  95. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/manifest.rs +0 -0
  96. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/meta.rs +0 -0
  97. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/project.rs +0 -0
  98. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/read.rs +0 -0
  99. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/receipt.rs +0 -0
  100. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/reclaim.rs +0 -0
  101. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/registry.rs +0 -0
  102. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/relation.rs +0 -0
  103. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/repo_cache.rs +0 -0
  104. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/repository.rs +0 -0
  105. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/sha256.rs +0 -0
  106. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/spec.rs +0 -0
  107. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/staging.rs +0 -0
  108. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/stats.rs +0 -0
  109. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/storage.rs +0 -0
  110. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/transport/api.rs +0 -0
  111. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/transport/decisions.rs +0 -0
  112. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/transport/http.rs +0 -0
  113. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/transport/hub.rs +0 -0
  114. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/transport/ledger.rs +0 -0
  115. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/transport/memory.rs +0 -0
  116. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/transport/policy.rs +0 -0
  117. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/transport/push.rs +0 -0
  118. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/transport/tests/tail.rs +0 -0
  119. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/unsynced.rs +0 -0
  120. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/src/vectors.rs +0 -0
  121. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/additive_fields.rs +0 -0
  122. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/anima_hf_profile.rs +0 -0
  123. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/as_is.rs +0 -0
  124. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/catalog_owner_probe.c +0 -0
  125. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/checkpoint_roots.rs +0 -0
  126. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/civitai_anima.rs +0 -0
  127. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/civitai_sdxl_profile.rs +0 -0
  128. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/ensure.rs +0 -0
  129. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/fd_budget.rs +0 -0
  130. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/fd_headroom.rs +0 -0
  131. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/fetch_faults.rs +0 -0
  132. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/fetch_url_progress.rs +0 -0
  133. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/fit.rs +0 -0
  134. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/fixtures/repo_apply/blobs.jsonl +0 -0
  135. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/fixtures/repo_apply/expected_list.jsonl +0 -0
  136. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/fixtures/repo_apply/expected_repository.json +0 -0
  137. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/fixtures/repo_apply/expected_rows.jsonl +0 -0
  138. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/fixtures/repo_apply/header.cbor +0 -0
  139. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/fixtures/repo_apply/manifest.json +0 -0
  140. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/fixtures/repo_apply/mutation.json +0 -0
  141. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/foreign_json.rs +0 -0
  142. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/h3_lora.rs +0 -0
  143. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/h3_swiglu.rs +0 -0
  144. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/home.rs +0 -0
  145. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/hub_tls.rs +0 -0
  146. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/import_tree.rs +0 -0
  147. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/instrument_profiles.rs +0 -0
  148. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/keyed_roots.rs +0 -0
  149. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/liveness.rs +0 -0
  150. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/qwen_image21_profile.rs +0 -0
  151. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/read_plan.rs +0 -0
  152. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/reclaim.rs +0 -0
  153. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/reclaim_run.rs +0 -0
  154. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/repo_cache.rs +0 -0
  155. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/repo_store.rs +0 -0
  156. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/resident_admission.rs +0 -0
  157. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/routed_single_file.rs +0 -0
  158. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/sha256_backends.rs +0 -0
  159. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/sharded_cas.rs +0 -0
  160. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/source_artifacts.rs +0 -0
  161. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/source_plan.rs +0 -0
  162. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/source_preflight.rs +0 -0
  163. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/staging.rs +0 -0
  164. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/store_boundaries.rs +0 -0
  165. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/tensor_schema.rs +0 -0
  166. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/transfer_memory.rs +0 -0
  167. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/trust_index.rs +0 -0
  168. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/version.rs +0 -0
  169. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-core/tests/write_through.rs +0 -0
  170. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-plane/API.md +0 -0
  171. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-plane/Cargo.toml +0 -0
  172. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-plane/src/bin/g1_vmm.rs +0 -0
  173. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-plane/src/bin/g2_overlap.rs +0 -0
  174. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-plane/src/bin/gpu_bench/mod.rs +0 -0
  175. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-plane/src/cuda.rs +0 -0
  176. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-plane/src/cursor.rs +0 -0
  177. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-plane/src/device.rs +0 -0
  178. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-plane/src/host.rs +0 -0
  179. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-plane/src/io.rs +0 -0
  180. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-plane/src/layout.rs +0 -0
  181. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-plane/src/lib.rs +0 -0
  182. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-plane/src/plane.rs +0 -0
  183. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-plane/tests/common/mod.rs +0 -0
  184. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-plane/tests/gpu.rs +0 -0
  185. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-plane/tests/host_tier.rs +0 -0
  186. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-py/Cargo.toml +0 -0
  187. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-py/src/docs.rs +0 -0
  188. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-py/src/ensure.rs +0 -0
  189. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-py/src/errors.rs +0 -0
  190. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-py/src/ingest.rs +0 -0
  191. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-py/src/lib.rs +0 -0
  192. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-py/src/plane.rs +0 -0
  193. {tensorfs-0.3.86 → tensorfs-0.3.87}/crates/tensorfs-py/src/store.rs +0 -0
  194. {tensorfs-0.3.86 → tensorfs-0.3.87}/python/tensorfs/__init__.py +0 -0
  195. {tensorfs-0.3.86 → tensorfs-0.3.87}/python/tensorfs/_derived_channel.py +0 -0
  196. {tensorfs-0.3.86 → tensorfs-0.3.87}/python/tensorfs/_ext.pyi +0 -0
  197. {tensorfs-0.3.86 → tensorfs-0.3.87}/python/tensorfs/_source_channel.py +0 -0
  198. {tensorfs-0.3.86 → tensorfs-0.3.87}/python/tensorfs/_tensors.py +0 -0
  199. {tensorfs-0.3.86 → tensorfs-0.3.87}/python/tensorfs/derived.py +0 -0
  200. {tensorfs-0.3.86 → tensorfs-0.3.87}/python/tensorfs/errors.py +0 -0
  201. {tensorfs-0.3.86 → tensorfs-0.3.87}/python/tensorfs/plane.py +0 -0
  202. {tensorfs-0.3.86 → tensorfs-0.3.87}/python/tensorfs/plane.pyi +0 -0
  203. {tensorfs-0.3.86 → tensorfs-0.3.87}/python/tensorfs/py.typed +0 -0
@@ -449,7 +449,7 @@ checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
449
449
 
450
450
  [[package]]
451
451
  name = "tensorfs-core"
452
- version = "0.3.86"
452
+ version = "0.3.87"
453
453
  dependencies = [
454
454
  "fs2",
455
455
  "libc",
@@ -464,7 +464,7 @@ dependencies = [
464
464
 
465
465
  [[package]]
466
466
  name = "tensorfs-plane"
467
- version = "0.3.86"
467
+ version = "0.3.87"
468
468
  dependencies = [
469
469
  "libc",
470
470
  "libloading",
@@ -474,7 +474,7 @@ dependencies = [
474
474
 
475
475
  [[package]]
476
476
  name = "tensorfs-py"
477
- version = "0.3.86"
477
+ version = "0.3.87"
478
478
  dependencies = [
479
479
  "pyo3",
480
480
  "tensorfs-core",
@@ -3,5 +3,5 @@ resolver = "2"
3
3
  members = ["crates/tensorfs-core", "crates/tensorfs-plane", "crates/tensorfs-py"]
4
4
 
5
5
  [workspace.package]
6
- version = "0.3.86"
6
+ version = "0.3.87"
7
7
  edition = "2021"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tensorfs
3
- Version: 0.3.86
3
+ Version: 0.3.87
4
4
  Classifier: Programming Language :: Python :: 3
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Rust
@@ -847,7 +847,7 @@ pub fn materialize_selected_with_options(
847
847
  ledger = ledger.with_cancellation(cancellation.clone());
848
848
  }
849
849
  // Every member's liveness is published before any of their bytes move.
850
- let mut jobs: Vec<crate::transport::prefix::SourceJob> = vec![];
850
+ let mut jobs: Vec<crate::transport::sources::SourceJob> = vec![];
851
851
  let (mut seen, mut held_bytes) = (std::collections::BTreeSet::new(), 0);
852
852
  for member in &resolution.members {
853
853
  writer.hold_expected(&member.object)?;
@@ -859,12 +859,12 @@ pub fn materialize_selected_with_options(
859
859
  held_bytes += object.length;
860
860
  continue;
861
861
  }
862
- jobs.push(crate::transport::prefix::SourceJob {
862
+ jobs.push(crate::transport::sources::SourceJob {
863
863
  grant: DeliveryGrant::mint(&plan, object)?,
864
864
  url: member.url.clone(),
865
865
  });
866
866
  }
867
- let transferred = crate::transport::prefix::fetch_sources(
867
+ let transferred = crate::transport::sources::fetch_sources(
868
868
  store,
869
869
  owner,
870
870
  &jobs,
@@ -893,7 +893,7 @@ pub fn materialize_selected_with_options(
893
893
  });
894
894
  }
895
895
  plan.complete(store)?;
896
- crate::transport::prefix::discard_owner(store, owner)?;
896
+ crate::transport::sources::discard_owner(store, owner)?;
897
897
  let result = writer.finish(&tree)?;
898
898
  Ok((result, pulled))
899
899
  }
@@ -425,7 +425,7 @@ pub fn release(store: &Store, owner: &str) -> Result<()> {
425
425
  Err(e) if e.kind() != std::io::ErrorKind::NotFound => return Err(io(e)),
426
426
  _ => {}
427
427
  }
428
- crate::transport::prefix::discard_owner(store, owner)
428
+ crate::transport::sources::discard_owner(store, owner)
429
429
  }
430
430
 
431
431
  /// Mark a retained tree delivered: its bytes may now be evicted under disk pressure, oldest
@@ -546,7 +546,9 @@ pub fn adopt_partial(store: &Store, source: &str, owner: &str) -> Result<TreeRoo
546
546
  recipient.landed(&object)?;
547
547
  }
548
548
  }
549
- crate::transport::prefix::adopt_owner(store, source, owner, |object| recipient.landed(object))?;
549
+ crate::transport::sources::adopt_owner(store, source, owner, |object| {
550
+ recipient.landed(object)
551
+ })?;
550
552
  Ok(recipient.root.clone())
551
553
  }
552
554
 
@@ -695,5 +697,5 @@ pub fn release_retention(
695
697
  root.released = true;
696
698
  root.objects.clear();
697
699
  write(store, &root)?;
698
- crate::transport::prefix::discard_owner(store, owner)
700
+ crate::transport::sources::discard_owner(store, owner)
699
701
  }
@@ -785,7 +785,7 @@ impl Store {
785
785
  /// admission fits must see them.
786
786
  pub fn occupancy(&self) -> Result<u64> {
787
787
  let mut total: u64 = crate::staging::bytes(self)?
788
- .checked_add(crate::transport::prefix::bytes(self)?)
788
+ .checked_add(crate::transport::sources::bytes(self)?)
789
789
  .ok_or_else(|| Refusal {
790
790
  code: Code::ARITH_OVERFLOW,
791
791
  detail: "prefix occupancy overflow".into(),
@@ -12,9 +12,10 @@
12
12
  //! 2322, sasori, dietfried, chieri: a pull's last objects at 30-180 KB/s for minutes).
13
13
  //! Separate requests pay them side by side, and a late one is simply asked again.
14
14
  //!
15
- //! `fetch_ranged` is the same downloader for one object from a URL the caller holds (a
16
- //! HuggingFace or Civitai member). Such an origin may not answer ranges, so an object's
17
- //! first chunk goes alone: a 206 queues the rest, a 200 is the whole object.
15
+ //! `fetch_ranged` is the same downloader for one object from a URL the caller holds, and
16
+ //! `sources` for a selected source's members, kept on disk across processes. Such an
17
+ //! origin may not answer ranges, so an object's first chunk goes alone: a 206 queues the
18
+ //! rest, a 200 is the whole object. Where it redirects to is asked for the rest directly.
18
19
 
19
20
  use super::decisions;
20
21
  use super::ledger::{Attempt, Deadline, Ledger, STALL_FACTOR};
@@ -22,6 +23,7 @@ use super::pull::{
22
23
  open_object, shared_client, FetchObserver, Fetched, ObjectObserver, ObjectSource, ObjectUrls,
23
24
  Opened, WalkOutcome,
24
25
  };
26
+ use super::sources::{missing, Keep, Part};
25
27
  use super::STREAMS;
26
28
  use super::{CredentialProvider, SourcePolicy};
27
29
  use crate::err::{refuse, Code, Refusal, Result};
@@ -30,7 +32,7 @@ use crate::ids::ObjectRef;
30
32
  use crate::repo_cache::{BackfillBatch, CacheKind, CacheRead, CacheTrust};
31
33
  use crate::store::{Fault, Store, Verified, PUT_TEMP};
32
34
  use fs2::FileExt;
33
- use std::collections::{BTreeMap, VecDeque};
35
+ use std::collections::{BTreeMap, HashMap, VecDeque};
34
36
  use std::fs::{File, OpenOptions};
35
37
  use std::io::Read;
36
38
  use std::os::unix::fs::{FileExt as _, OpenOptionsExt};
@@ -57,23 +59,33 @@ const PIECE_BYTES: u64 = 1 << 20;
57
59
  /// first byte, and how fast its body then came.
58
60
  const PEERS: usize = 64;
59
61
 
60
- /// An object being downloaded: its temp file, and what is still out.
62
+ /// An object being downloaded: its file, and what is still out.
61
63
  struct Object {
62
- /// Its place in `plan.wanted`, which is how the URL supply names it.
64
+ /// Its place in `wanted`, which is how the URL supply names it.
63
65
  at: usize,
64
66
  grant: DeliveryGrant,
65
67
  cache: Option<(CacheKind, CacheTrust)>,
66
68
  path: PathBuf,
67
69
  file: File,
68
- /// Chunks not yet home.
70
+ /// A source download's kept file and record, in place of a temp file.
71
+ part: Option<Part>,
72
+ /// Pieces not yet home.
69
73
  left: AtomicUsize,
74
+ /// Chunks not yet asked for: an origin that may not range has not yet answered one.
75
+ rest: Mutex<Vec<(u64, u64)>>,
76
+ /// Each chunk not yet home, by its first byte: its end and the pieces still out.
77
+ units: Mutex<HashMap<u64, (u64, usize)>>,
78
+ /// Where the origin last redirected this object's URL, asked directly until refused.
79
+ delivery: Mutex<Option<String>>,
70
80
  /// Bytes requests wrote for it, bytes asked twice included.
71
81
  moved: AtomicU64,
72
82
  }
73
83
 
74
84
  impl Drop for Object {
75
85
  fn drop(&mut self) {
76
- let _ = std::fs::remove_file(&self.path);
86
+ if self.part.is_none() {
87
+ let _ = std::fs::remove_file(&self.path);
88
+ }
77
89
  }
78
90
  }
79
91
 
@@ -95,6 +107,8 @@ struct Chunk {
95
107
  fresh: bool,
96
108
  /// The object's only chunk so far: its origin has not yet shown that it answers ranges.
97
109
  lead: bool,
110
+ /// The chunk this is (a piece of): the range a source download records when it is home.
111
+ unit: (u64, u64),
98
112
  }
99
113
 
100
114
  impl Chunk {
@@ -182,6 +196,8 @@ pub(super) struct Download<'a> {
182
196
  pub ledger: &'a Ledger,
183
197
  pub on_object: Option<ObjectObserver<'a>>,
184
198
  pub backfill: Option<&'a BackfillBatch<'a>>,
199
+ /// A source download: objects kept on disk under their owner, resumable.
200
+ pub keep: Option<&'a Keep<'a>>,
185
201
  }
186
202
 
187
203
  struct Run<'a> {
@@ -391,7 +407,8 @@ impl Run<'_> {
391
407
  Destination::Staging => None,
392
408
  };
393
409
  let mut cache = None;
394
- if let (Some(kind), Some(mounted)) = (kind, job.store.repo_cache()) {
410
+ let mounted = job.store.repo_cache().filter(|_| job.keep.is_none());
411
+ if let (Some(kind), Some(mounted)) = (kind, mounted) {
395
412
  let mut trust = CacheTrust::Name;
396
413
  match mounted.admit(job.store, kind, wanted)? {
397
414
  CacheRead::Hit => {
@@ -413,7 +430,72 @@ impl Run<'_> {
413
430
  cache = Some((kind, trust));
414
431
  }
415
432
  let length = wanted.length;
416
- let path = job.store.root().join("tmp").join(format!(
433
+ let (path, file, part, chunks) = match job.keep {
434
+ Some(keep) => {
435
+ let part = Part::open(job.store, keep.owner, wanted, true)?;
436
+ let done = part.done();
437
+ keep.landed(part.covered() as i64);
438
+ let file = part.file.try_clone().map_err(|error| Refusal {
439
+ code: Code::IO_FAILED,
440
+ detail: format!("source download: {error}"),
441
+ })?;
442
+ (part.bytes(), file, Some(part), missing(&done, length))
443
+ }
444
+ None => {
445
+ let (path, file) = self.temp(length)?;
446
+ (path, file, None, vec![(0, length)])
447
+ }
448
+ };
449
+ let chunks: Vec<(u64, u64)> = chunks
450
+ .into_iter()
451
+ .flat_map(|(first, end)| {
452
+ (first..end)
453
+ .step_by(job.chunk as usize)
454
+ .map(move |at| (at, (at + job.chunk).min(end)))
455
+ })
456
+ .collect();
457
+ // An origin that may not range is asked for the first chunk alone.
458
+ let asked = if job.ranged { chunks.len() } else { 1 };
459
+ let object = Arc::new(Object {
460
+ at,
461
+ grant,
462
+ cache,
463
+ path,
464
+ file,
465
+ part,
466
+ left: AtomicUsize::new(chunks.len()),
467
+ rest: Mutex::new(chunks.iter().skip(asked).rev().copied().collect()),
468
+ units: Mutex::new(
469
+ chunks
470
+ .iter()
471
+ .map(|(first, end)| (*first, (*end, 1)))
472
+ .collect(),
473
+ ),
474
+ delivery: Mutex::new(None),
475
+ moved: AtomicU64::new(0),
476
+ });
477
+ let chunk = |(first, end)| Chunk {
478
+ object: Arc::clone(&object),
479
+ first,
480
+ end,
481
+ due: Instant::now(),
482
+ stated: false,
483
+ stale: None,
484
+ silent: 0,
485
+ fresh: true,
486
+ lead: !job.ranged,
487
+ unit: (first, end),
488
+ };
489
+ if chunks.is_empty() {
490
+ return Ok(vec![chunk((length, length))]);
491
+ }
492
+ Ok(chunks.into_iter().take(asked).map(chunk).collect())
493
+ }
494
+
495
+ /// A locked temp file of `length` bytes, under the Store's own temp name so its reaper
496
+ /// knows a live writer from an orphan.
497
+ fn temp(&self, length: u64) -> Result<(PathBuf, File)> {
498
+ let path = self.job.store.root().join("tmp").join(format!(
417
499
  "{PUT_TEMP}chunks-{}-{}",
418
500
  std::process::id(),
419
501
  crate::meta::now_nanos_unique()
@@ -432,7 +514,6 @@ impl Run<'_> {
432
514
  .mode(0o600)
433
515
  .open(&path)
434
516
  .map_err(|error| io("create", error))?;
435
- // The Store's own temp name and lock, so its reaper knows a live writer from an orphan.
436
517
  let sized = file
437
518
  .try_lock_exclusive()
438
519
  .and_then(|()| file.set_len(length));
@@ -440,59 +521,53 @@ impl Run<'_> {
440
521
  let _ = std::fs::remove_file(&path);
441
522
  return Err(io("size", error));
442
523
  }
443
- let firsts: Vec<u64> = (0..length).step_by(job.chunk as usize).collect();
444
- let object = Arc::new(Object {
445
- at,
446
- grant,
447
- cache,
448
- path,
449
- file,
450
- left: AtomicUsize::new(firsts.len()),
451
- moved: AtomicU64::new(0),
452
- });
453
- let chunk = |first, end| Chunk {
454
- object: Arc::clone(&object),
455
- first,
456
- end,
457
- due: Instant::now(),
458
- stated: false,
459
- stale: None,
460
- silent: 0,
461
- fresh: true,
462
- lead: !job.ranged,
463
- };
464
- if firsts.is_empty() {
465
- return Ok(vec![chunk(0, 0)]);
466
- }
467
- // An origin that may not range is asked for the first chunk alone.
468
- let asked = if job.ranged { firsts.len() } else { 1 };
469
- Ok(firsts
470
- .into_iter()
471
- .take(asked)
472
- .map(|first| chunk(first, (first + job.chunk).min(length)))
473
- .collect())
524
+ Ok((path, file))
474
525
  }
475
526
 
476
527
  /// The origin answered a range: the object's other chunks join the queue.
477
528
  fn rest(&self, lead: &Chunk) {
478
- let length = lead.object.grant.object.length;
529
+ let rest = std::mem::take(&mut *lead.object.rest.lock().unwrap());
479
530
  let mut state = self.state.lock().unwrap();
480
- for first in (lead.end..length).step_by(self.job.chunk as usize) {
531
+ for (first, end) in rest.into_iter().rev() {
481
532
  state.queue.push_back(Chunk {
482
533
  object: Arc::clone(&lead.object),
483
534
  first,
484
- end: (first + self.job.chunk).min(length),
535
+ end,
485
536
  due: Instant::now(),
486
537
  stated: false,
487
538
  stale: None,
488
539
  silent: 0,
489
540
  fresh: true,
490
541
  lead: false,
542
+ unit: (first, end),
491
543
  });
492
544
  }
493
545
  self.wake.notify_all();
494
546
  }
495
547
 
548
+ /// A piece is home. When it was its chunk's last, a source download records the chunk.
549
+ fn unit_home(&self, chunk: &Chunk) -> Result<()> {
550
+ let object = &chunk.object;
551
+ let mut units = object.units.lock().unwrap();
552
+ let Some((end, out)) = units.get_mut(&chunk.unit.0) else {
553
+ return Ok(());
554
+ };
555
+ *out -= 1;
556
+ if *out > 0 {
557
+ return Ok(());
558
+ }
559
+ let end = *end;
560
+ units.remove(&chunk.unit.0);
561
+ drop(units);
562
+ let (Some(part), Some(keep)) = (&object.part, self.job.keep) else {
563
+ return Ok(());
564
+ };
565
+ let before = part.covered();
566
+ part.record(chunk.unit.0, end, keep.fault)?;
567
+ keep.landed((part.covered() - before) as i64);
568
+ Ok(())
569
+ }
570
+
496
571
  /// One GET for a chunk, written at its offsets. Whatever ends it early, the bytes that
497
572
  /// landed stay and the rest goes back on the queue.
498
573
  fn request(&self, slot: usize, mut chunk: Chunk, buffer: &mut [u8]) -> Outcome {
@@ -503,9 +578,13 @@ impl Run<'_> {
503
578
  let stale = chunk.stale.take();
504
579
  let asked = self.began.elapsed();
505
580
  self.minting[slot].store(asked.as_millis() as u64 + 1, Ordering::Release);
506
- let url = job
507
- .urls
508
- .url_for_while(object.at, wanted, stale.is_some(), job.ledger);
581
+ let delivery = object.delivery.lock().unwrap().clone();
582
+ let url = match delivery.clone() {
583
+ Some(delivery) => Ok(delivery),
584
+ None => job
585
+ .urls
586
+ .url_for_while(object.at, wanted, stale.is_some(), job.ledger),
587
+ };
509
588
  self.minting[slot].store(0, Ordering::Release);
510
589
  if self.began.elapsed() - asked >= job.ledger.sample() {
511
590
  let now = self.began.elapsed().as_millis() as u64;
@@ -541,7 +620,7 @@ impl Run<'_> {
541
620
  seen: 0,
542
621
  });
543
622
  self.requests.fetch_add(1, Ordering::Relaxed);
544
- let ended = self.stream(&mut chunk, &url, &ledger, buffer);
623
+ let ended = self.stream(&mut chunk, &url, delivery.is_some(), &ledger, buffer);
545
624
  *self.flights[slot].lock().unwrap() = None;
546
625
  // What this ask added: a whole answer to a resumed range starts the object over.
547
626
  let moved = chunk.first.saturating_sub(asked.0);
@@ -558,6 +637,9 @@ impl Run<'_> {
558
637
  remember(&mut state.small, wait + body);
559
638
  }
560
639
  }
640
+ if let Err(refusal) = self.unit_home(&chunk) {
641
+ return Outcome::Fatal(named(refusal, &wanted.id()));
642
+ }
561
643
  if object.left.fetch_sub(1, Ordering::AcqRel) > 1 {
562
644
  return Outcome::Home;
563
645
  }
@@ -602,6 +684,9 @@ impl Run<'_> {
602
684
  while dropped && !chunk.lead && chunk.end - chunk.first > piece {
603
685
  let end = chunk.first + piece;
604
686
  object.left.fetch_add(1, Ordering::AcqRel);
687
+ if let Some((_, out)) = object.units.lock().unwrap().get_mut(&chunk.unit.0) {
688
+ *out += 1;
689
+ }
605
690
  again.push(Chunk {
606
691
  object: Arc::clone(&object),
607
692
  end,
@@ -623,6 +708,7 @@ impl Run<'_> {
623
708
  &self,
624
709
  chunk: &mut Chunk,
625
710
  url: &str,
711
+ delivered: bool,
626
712
  ledger: &Ledger,
627
713
  buffer: &mut [u8],
628
714
  ) -> std::result::Result<(), Ended> {
@@ -635,7 +721,8 @@ impl Run<'_> {
635
721
  "range".to_string(),
636
722
  format!("bytes={}-{}", chunk.first, chunk.end - 1),
637
723
  )];
638
- let response = match open_object(
724
+ let mut hops = Vec::new();
725
+ let opened = open_object(
639
726
  shared_client(),
640
727
  url,
641
728
  job.policy,
@@ -643,9 +730,24 @@ impl Run<'_> {
643
730
  job.deadline,
644
731
  ledger,
645
732
  if whole { &[] } else { &range },
646
- &mut |_, _| {},
647
- )? {
648
- Opened::Body(response) => response,
733
+ &mut |checked, _| hops.push(checked.url()),
734
+ )?;
735
+ // A redirect target that refuses is forgotten, and the object's URL asked again.
736
+ if delivered && !matches!(opened, Opened::Body(_) | Opened::Retryable(..)) {
737
+ *object.delivery.lock().unwrap() = None;
738
+ let answered = Refusal {
739
+ code: Code::TRANSFER_FAILED,
740
+ detail: "the origin's redirect target refused this ask".into(),
741
+ };
742
+ return Err(Ended::Retry(answered, Some(Duration::ZERO)));
743
+ }
744
+ let response = match opened {
745
+ Opened::Body(response) => {
746
+ if hops.len() > 1 {
747
+ *object.delivery.lock().unwrap() = hops.pop();
748
+ }
749
+ response
750
+ }
649
751
  Opened::Retryable(status, stated) => {
650
752
  let answered = Refusal {
651
753
  code: Code::TRANSFER_FAILED,
@@ -695,12 +797,17 @@ impl Run<'_> {
695
797
  // A range answered with the whole object: take it from its first byte. An origin
696
798
  // that does not range gives the object to this one request.
697
799
  (200, _) if chunk.lead || wanted.length <= job.chunk => {
698
- job.store.discarded(chunk.first);
699
- self.landed.fetch_sub(chunk.first, Ordering::Relaxed);
800
+ // What this chunk's earlier asks moved is moved again.
801
+ let again = chunk.first - chunk.unit.0;
802
+ job.store.discarded(again);
803
+ self.landed.fetch_sub(again, Ordering::Relaxed);
700
804
  chunk.first = 0;
701
805
  if chunk.lead {
702
806
  chunk.end = wanted.length;
807
+ chunk.unit = (0, wanted.length);
703
808
  object.left.store(1, Ordering::Release);
809
+ object.rest.lock().unwrap().clear();
810
+ *object.units.lock().unwrap() = HashMap::from([(0, (wanted.length, 1))]);
704
811
  }
705
812
  }
706
813
  (status, ranged) => {
@@ -751,6 +858,10 @@ impl Run<'_> {
751
858
  let job = self.job;
752
859
  let wanted = &object.grant.object;
753
860
  let moved = object.moved.load(Ordering::Relaxed);
861
+ let fault = job
862
+ .keep
863
+ .map_or(&Fault::default(), |keep| keep.fault)
864
+ .clone();
754
865
  let admitted = (|| {
755
866
  if job.store.flushes() {
756
867
  object.file.sync_all().map_err(|error| Refusal {
@@ -781,15 +892,28 @@ impl Run<'_> {
781
892
  if object.grant.destination == Destination::Staging {
782
893
  return crate::staging::adopt(job.store, verified).map(|_| ());
783
894
  }
784
- job.store
785
- .admit_verified(verified, &Fault::default(), None)
786
- .map(|_| ())
895
+ fault.hit("verified");
896
+ job.store.admit_verified(verified, &fault, None).map(|_| ())
787
897
  })();
788
- // Wrong bytes are the door's verdict on the origin: nothing is asked again.
898
+ // Wrong bytes are the door's verdict on the origin: nothing is asked again, and a
899
+ // kept download starts over the next time it is asked for.
789
900
  if let Err(refusal) = admitted {
790
901
  job.store.discarded(moved);
902
+ if let (Some(part), Some(keep), Code::OBJECT_ID_MISMATCH) =
903
+ (&object.part, job.keep, refusal.code)
904
+ {
905
+ keep.landed(-(part.covered() as i64));
906
+ if let Err(reset) = part.reset() {
907
+ return Outcome::Fatal(named(reset, &wanted.id()));
908
+ }
909
+ }
791
910
  return Outcome::Fatal(named(refusal, &wanted.id()));
792
911
  }
912
+ if let (Some(part), Some(keep)) = (&object.part, job.keep) {
913
+ fault.hit("admitted");
914
+ part.finished();
915
+ keep.landed((wanted.length - part.covered()) as i64);
916
+ }
793
917
  job.ledger.answered();
794
918
  self.fetched.fetch_add(1, Ordering::Relaxed);
795
919
  self.bytes_moved.fetch_add(moved, Ordering::Relaxed);
@@ -1056,6 +1180,7 @@ pub fn fetch_ranged(
1056
1180
  ledger,
1057
1181
  on_object: None,
1058
1182
  backfill: None,
1183
+ keep: None,
1059
1184
  }
1060
1185
  .run(ranged.streams.clamp(1, 64), observer)?;
1061
1186
  Ok(Fetched {
@@ -526,7 +526,7 @@ impl CredentialProvider for CloseRequests {
526
526
  }
527
527
 
528
528
  #[test]
529
- fn retained_source_redirect_ranges_reduce_connections_without_changing_asks_or_bytes() {
529
+ fn source_chunks_ask_the_redirect_target_on_one_connection() {
530
530
  use crate::{
531
531
  ids::ObjectRef,
532
532
  providers::{self, Provenance, Resolution, ResolvedMember},
@@ -608,15 +608,15 @@ fn retained_source_redirect_ranges_reduce_connections_without_changing_asks_or_b
608
608
  let elapsed = start.elapsed();
609
609
  assert_eq!(rows[0].transferred, bytes.len() as u64);
610
610
  assert!(store.record_valid(&object.sha256).is_ok());
611
- // One ask walks the redirect, one GET carries all eight checkpoints of the run,
612
- // and the drained redirect's socket serves the delivery hop.
613
- assert_eq!(origin.asks.lock().unwrap().len(), 2);
614
- assert_eq!(origin.count(), if close { 2 } else { 1 });
611
+ // One ask walks the redirect and the eight 1 MiB chunks ask its target directly,
612
+ // all on the drained redirect's socket unless each ask closes its own.
613
+ assert_eq!(origin.asks.lock().unwrap().len(), 9);
614
+ assert_eq!(origin.count(), if close { 9 } else { 1 });
615
615
  timings.push((close, elapsed.as_secs_f64(), origin.count()));
616
616
  drop(store);
617
617
  std::fs::remove_dir_all(root).unwrap();
618
618
  }
619
- println!("retained source 8MiB, one redirected ask, eight 1MiB checkpoints, 30ms connection setup: {timings:?}");
619
+ println!("source 8 MiB, one redirect, eight 1 MiB chunks, 30 ms connection setup: {timings:?}");
620
620
  }
621
621
 
622
622
  #[test]
@@ -39,9 +39,9 @@ mod hub;
39
39
  mod ledger;
40
40
  mod memory;
41
41
  mod policy;
42
- pub(crate) mod prefix;
43
42
  mod pull;
44
43
  mod push;
44
+ pub(crate) mod sources;
45
45
 
46
46
  #[cfg(test)]
47
47
  mod tests;
@@ -65,4 +65,4 @@ pub use pull::{
65
65
  };
66
66
  pub use push::{push_object, Pushed, UploadGrant, MAX_GRANT_BYTES, PUT_ATTEMPTS};
67
67
 
68
- pub use prefix::{SourceDownload, SourceProgress};
68
+ pub use sources::{SourceDownload, SourceProgress};
@@ -635,6 +635,7 @@ pub(super) fn fetch_wanted_bounded(
635
635
  ledger,
636
636
  on_object,
637
637
  backfill: backfill.as_ref(),
638
+ keep: None,
638
639
  }
639
640
  .run(streams, None)?;
640
641
  if let Some(backfill) = backfill {