tensorfs 0.3.83__tar.gz → 0.3.85__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 (207) hide show
  1. {tensorfs-0.3.83 → tensorfs-0.3.85}/Cargo.lock +49 -2
  2. tensorfs-0.3.85/Cargo.toml +7 -0
  3. {tensorfs-0.3.83 → tensorfs-0.3.85}/PKG-INFO +1 -1
  4. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/bin/tfs/ensure.rs +0 -1
  5. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/bin/tfs/fetch.rs +7 -21
  6. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/bin/tfs/main.rs +2 -3
  7. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/ensure.rs +0 -3
  8. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/gc.rs +2 -0
  9. tensorfs-0.3.85/crates/tensorfs-core/src/keyed_roots.rs +247 -0
  10. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/lib.rs +9 -2
  11. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/source_artifact.rs +47 -27
  12. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/store.rs +7 -0
  13. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/transport/decisions.rs +3 -3
  14. tensorfs-0.3.85/crates/tensorfs-core/src/transport/download.rs +908 -0
  15. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/transport/http.rs +13 -18
  16. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/transport/ledger.rs +23 -52
  17. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/transport/mod.rs +8 -11
  18. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/transport/pull.rs +52 -370
  19. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/transport/ranged.rs +82 -276
  20. tensorfs-0.3.85/crates/tensorfs-core/src/transport/tests/tail.rs +323 -0
  21. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/transport/tests.rs +6 -791
  22. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/ensure.rs +3 -2
  23. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/fd_budget.rs +11 -10
  24. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/fetch_faults.rs +19 -24
  25. tensorfs-0.3.85/crates/tensorfs-core/tests/keyed_roots.rs +185 -0
  26. tensorfs-0.3.85/crates/tensorfs-plane/API.md +267 -0
  27. tensorfs-0.3.85/crates/tensorfs-plane/Cargo.toml +13 -0
  28. tensorfs-0.3.85/crates/tensorfs-plane/src/bin/g1_vmm.rs +408 -0
  29. tensorfs-0.3.85/crates/tensorfs-plane/src/bin/g2_overlap.rs +237 -0
  30. tensorfs-0.3.85/crates/tensorfs-plane/src/bin/gpu_bench/mod.rs +781 -0
  31. tensorfs-0.3.85/crates/tensorfs-plane/src/cuda.rs +325 -0
  32. tensorfs-0.3.85/crates/tensorfs-plane/src/cursor.rs +571 -0
  33. tensorfs-0.3.85/crates/tensorfs-plane/src/device.rs +633 -0
  34. tensorfs-0.3.85/crates/tensorfs-plane/src/host.rs +279 -0
  35. tensorfs-0.3.85/crates/tensorfs-plane/src/io.rs +337 -0
  36. tensorfs-0.3.85/crates/tensorfs-plane/src/layout.rs +172 -0
  37. tensorfs-0.3.85/crates/tensorfs-plane/src/lib.rs +85 -0
  38. tensorfs-0.3.85/crates/tensorfs-plane/src/plane.rs +1851 -0
  39. tensorfs-0.3.85/crates/tensorfs-plane/tests/common/mod.rs +177 -0
  40. tensorfs-0.3.85/crates/tensorfs-plane/tests/gpu.rs +536 -0
  41. tensorfs-0.3.85/crates/tensorfs-plane/tests/host_tier.rs +227 -0
  42. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-py/Cargo.toml +1 -0
  43. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-py/src/ensure.rs +2 -1
  44. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-py/src/lib.rs +2 -0
  45. tensorfs-0.3.85/crates/tensorfs-py/src/plane.rs +760 -0
  46. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-py/src/store.rs +68 -1
  47. {tensorfs-0.3.83 → tensorfs-0.3.85}/pyproject.toml +1 -1
  48. {tensorfs-0.3.83 → tensorfs-0.3.85}/python/tensorfs/__init__.py +2 -2
  49. {tensorfs-0.3.83 → tensorfs-0.3.85}/python/tensorfs/_ext.pyi +18 -0
  50. tensorfs-0.3.85/python/tensorfs/plane.py +46 -0
  51. tensorfs-0.3.85/python/tensorfs/plane.pyi +293 -0
  52. tensorfs-0.3.83/Cargo.toml +0 -7
  53. tensorfs-0.3.83/crates/tensorfs-core/src/transport/pace.rs +0 -282
  54. tensorfs-0.3.83/crates/tensorfs-core/src/transport/speculate.rs +0 -649
  55. tensorfs-0.3.83/crates/tensorfs-core/src/transport/tests/tail.rs +0 -461
  56. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/Cargo.toml +0 -0
  57. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/build.rs +0 -0
  58. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/examples/h3-swiglu-layout.md +0 -0
  59. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/examples/optional-cache-backfill.md +0 -0
  60. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/examples/resident-conversion.md +0 -0
  61. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/examples/resident_conversion_profile.rs +0 -0
  62. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/asset_update.rs +0 -0
  63. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/b64.rs +0 -0
  64. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/bin/tfs/ckpt.rs +0 -0
  65. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/bin/tfs/conform.rs +0 -0
  66. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/bin/tfs/ingest.rs +0 -0
  67. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/bin/tfs/rd.rs +0 -0
  68. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/bin/tfs/repo.rs +0 -0
  69. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/bin/tfs/snap.rs +0 -0
  70. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/bin/tfs/watch.rs +0 -0
  71. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/cache_roots.rs +0 -0
  72. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/canon.rs +0 -0
  73. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/capability.rs +0 -0
  74. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/catalog/lock.rs +0 -0
  75. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/catalog.rs +0 -0
  76. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/cbor.rs +0 -0
  77. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/checkpoint.rs +0 -0
  78. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/checkpoint_root.rs +0 -0
  79. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/corpus.rs +0 -0
  80. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/derived/adoption.rs +0 -0
  81. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/derived/companion_tests.rs +0 -0
  82. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/derived/estimate.rs +0 -0
  83. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/derived/graft_tests.rs +0 -0
  84. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/derived/group_commit_tests.rs +0 -0
  85. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/derived/history_cost_tests.rs +0 -0
  86. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/derived/part_rows_tests.rs +0 -0
  87. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/derived/progress.rs +0 -0
  88. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/derived/resume_tests.rs +0 -0
  89. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/derived/retention.rs +0 -0
  90. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/derived/roots.rs +0 -0
  91. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/derived.rs +0 -0
  92. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/descriptors.rs +0 -0
  93. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/disk.rs +0 -0
  94. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/dtype.rs +0 -0
  95. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/durability.rs +0 -0
  96. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/ensure/admission.rs +0 -0
  97. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/ensure/flight.rs +0 -0
  98. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/err.rs +0 -0
  99. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/fetch.rs +0 -0
  100. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/filesystem_identity.rs +0 -0
  101. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/fill.rs +0 -0
  102. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/fit.rs +0 -0
  103. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/header.rs +0 -0
  104. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/home.rs +0 -0
  105. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/ids.rs +0 -0
  106. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/ingest/carrier.rs +0 -0
  107. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/ingest/convert.rs +0 -0
  108. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/ingest/custody.rs +0 -0
  109. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/ingest/fingerprint.rs +0 -0
  110. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/ingest/gguf.rs +0 -0
  111. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/ingest/h3_lora.rs +0 -0
  112. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/ingest/journal.rs +0 -0
  113. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/ingest/mod.rs +0 -0
  114. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/ingest/narrow.rs +0 -0
  115. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/ingest/preflight.rs +0 -0
  116. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/ingest/routes/anima.routes.json +0 -0
  117. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/ingest/routes/anima.spec.json +0 -0
  118. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/ingest/routes/sdxl.routes.json +0 -0
  119. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/ingest/routes/sdxl.spec.json +0 -0
  120. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/ingest/routes.rs +0 -0
  121. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/ingest/source.rs +0 -0
  122. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/ingest/stamp.rs +0 -0
  123. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/ingest/transaction.rs +0 -0
  124. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/jcs.rs +0 -0
  125. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/limits.rs +0 -0
  126. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/machine.rs +0 -0
  127. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/manifest.rs +0 -0
  128. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/meta.rs +0 -0
  129. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/project.rs +0 -0
  130. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/providers.rs +0 -0
  131. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/read.rs +0 -0
  132. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/receipt.rs +0 -0
  133. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/reclaim.rs +0 -0
  134. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/registry.rs +0 -0
  135. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/relation.rs +0 -0
  136. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/repo_cache.rs +0 -0
  137. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/repository.rs +0 -0
  138. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/sha256.rs +0 -0
  139. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/spec.rs +0 -0
  140. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/staging.rs +0 -0
  141. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/stats.rs +0 -0
  142. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/storage.rs +0 -0
  143. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/transport/api.rs +0 -0
  144. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/transport/http_reuse_tests.rs +0 -0
  145. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/transport/hub.rs +0 -0
  146. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/transport/memory.rs +0 -0
  147. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/transport/policy.rs +0 -0
  148. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/transport/prefix.rs +0 -0
  149. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/transport/push.rs +0 -0
  150. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/unsynced.rs +0 -0
  151. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/src/vectors.rs +0 -0
  152. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/additive_fields.rs +0 -0
  153. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/anima_hf_profile.rs +0 -0
  154. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/as_is.rs +0 -0
  155. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/catalog_owner_probe.c +0 -0
  156. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/checkpoint_roots.rs +0 -0
  157. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/civitai_anima.rs +0 -0
  158. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/civitai_sdxl_profile.rs +0 -0
  159. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/fd_headroom.rs +0 -0
  160. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/fetch_url_progress.rs +0 -0
  161. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/fit.rs +0 -0
  162. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/fixtures/repo_apply/blobs.jsonl +0 -0
  163. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/fixtures/repo_apply/expected_list.jsonl +0 -0
  164. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/fixtures/repo_apply/expected_repository.json +0 -0
  165. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/fixtures/repo_apply/expected_rows.jsonl +0 -0
  166. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/fixtures/repo_apply/header.cbor +0 -0
  167. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/fixtures/repo_apply/manifest.json +0 -0
  168. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/fixtures/repo_apply/mutation.json +0 -0
  169. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/foreign_json.rs +0 -0
  170. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/h3_lora.rs +0 -0
  171. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/h3_swiglu.rs +0 -0
  172. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/home.rs +0 -0
  173. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/hub_tls.rs +0 -0
  174. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/import_tree.rs +0 -0
  175. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/instrument_profiles.rs +0 -0
  176. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/liveness.rs +0 -0
  177. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/qwen_image21_profile.rs +0 -0
  178. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/read_plan.rs +0 -0
  179. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/reclaim.rs +0 -0
  180. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/reclaim_run.rs +0 -0
  181. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/repo_cache.rs +0 -0
  182. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/repo_store.rs +0 -0
  183. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/resident_admission.rs +0 -0
  184. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/routed_single_file.rs +0 -0
  185. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/sha256_backends.rs +0 -0
  186. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/sharded_cas.rs +0 -0
  187. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/source_artifacts.rs +0 -0
  188. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/source_download.rs +0 -0
  189. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/source_plan.rs +0 -0
  190. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/source_prefixes.rs +0 -0
  191. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/source_preflight.rs +0 -0
  192. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/staging.rs +0 -0
  193. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/store_boundaries.rs +0 -0
  194. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/tensor_schema.rs +0 -0
  195. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/transfer_memory.rs +0 -0
  196. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/trust_index.rs +0 -0
  197. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/version.rs +0 -0
  198. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-core/tests/write_through.rs +0 -0
  199. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-py/src/docs.rs +0 -0
  200. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-py/src/errors.rs +0 -0
  201. {tensorfs-0.3.83 → tensorfs-0.3.85}/crates/tensorfs-py/src/ingest.rs +0 -0
  202. {tensorfs-0.3.83 → tensorfs-0.3.85}/python/tensorfs/_derived_channel.py +0 -0
  203. {tensorfs-0.3.83 → tensorfs-0.3.85}/python/tensorfs/_source_channel.py +0 -0
  204. {tensorfs-0.3.83 → tensorfs-0.3.85}/python/tensorfs/_tensors.py +0 -0
  205. {tensorfs-0.3.83 → tensorfs-0.3.85}/python/tensorfs/derived.py +0 -0
  206. {tensorfs-0.3.83 → tensorfs-0.3.85}/python/tensorfs/errors.py +0 -0
  207. {tensorfs-0.3.83 → tensorfs-0.3.85}/python/tensorfs/py.typed +0 -0
@@ -133,6 +133,16 @@ version = "0.2.189"
133
133
  source = "registry+https://github.com/rust-lang/crates.io-index"
134
134
  checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
135
135
 
136
+ [[package]]
137
+ name = "libloading"
138
+ version = "0.9.0"
139
+ source = "registry+https://github.com/rust-lang/crates.io-index"
140
+ checksum = "754ca22de805bb5744484a5b151a9e1a8e837d5dc232c2d7d8c2e3492edc8b60"
141
+ dependencies = [
142
+ "cfg-if",
143
+ "windows-link",
144
+ ]
145
+
136
146
  [[package]]
137
147
  name = "libsqlite3-sys"
138
148
  version = "0.30.1"
@@ -439,7 +449,7 @@ checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
439
449
 
440
450
  [[package]]
441
451
  name = "tensorfs-core"
442
- version = "0.3.83"
452
+ version = "0.3.85"
443
453
  dependencies = [
444
454
  "fs2",
445
455
  "libc",
@@ -452,12 +462,43 @@ dependencies = [
452
462
  "webpki-roots 0.26.11",
453
463
  ]
454
464
 
465
+ [[package]]
466
+ name = "tensorfs-plane"
467
+ version = "0.3.85"
468
+ dependencies = [
469
+ "libc",
470
+ "libloading",
471
+ "tensorfs-core",
472
+ "thiserror",
473
+ ]
474
+
455
475
  [[package]]
456
476
  name = "tensorfs-py"
457
- version = "0.3.83"
477
+ version = "0.3.85"
458
478
  dependencies = [
459
479
  "pyo3",
460
480
  "tensorfs-core",
481
+ "tensorfs-plane",
482
+ ]
483
+
484
+ [[package]]
485
+ name = "thiserror"
486
+ version = "2.0.21"
487
+ source = "registry+https://github.com/rust-lang/crates.io-index"
488
+ checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e"
489
+ dependencies = [
490
+ "thiserror-impl",
491
+ ]
492
+
493
+ [[package]]
494
+ name = "thiserror-impl"
495
+ version = "2.0.21"
496
+ source = "registry+https://github.com/rust-lang/crates.io-index"
497
+ checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524"
498
+ dependencies = [
499
+ "proc-macro2",
500
+ "quote",
501
+ "syn 3.0.4",
461
502
  ]
462
503
 
463
504
  [[package]]
@@ -549,6 +590,12 @@ version = "0.4.0"
549
590
  source = "registry+https://github.com/rust-lang/crates.io-index"
550
591
  checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
551
592
 
593
+ [[package]]
594
+ name = "windows-link"
595
+ version = "0.2.1"
596
+ source = "registry+https://github.com/rust-lang/crates.io-index"
597
+ checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
598
+
552
599
  [[package]]
553
600
  name = "windows-sys"
554
601
  version = "0.52.0"
@@ -0,0 +1,7 @@
1
+ [workspace]
2
+ resolver = "2"
3
+ members = ["crates/tensorfs-core", "crates/tensorfs-plane", "crates/tensorfs-py"]
4
+
5
+ [workspace.package]
6
+ version = "0.3.85"
7
+ edition = "2021"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tensorfs
3
- Version: 0.3.83
3
+ Version: 0.3.85
4
4
  Classifier: Programming Language :: Python :: 3
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Rust
@@ -124,7 +124,6 @@ pub fn cmd_ensure(root: &Path, refspec: &str, flags: &Flags) -> ExitCode {
124
124
  request.step = step;
125
125
  request.keep = &keep;
126
126
  request.streams = flag_num(flags, "streams", transport::PULL_STREAMS);
127
- request.streams_start = flag_num(flags, "streams-start", transport::STREAMS);
128
127
  request.sample_seconds = flag_num(flags, "sample-seconds", transport::SAMPLE_SECONDS);
129
128
  request.on_event = Some(&on_event);
130
129
  answer(ensure::ensure(&request))
@@ -276,7 +276,6 @@ fn pull_with_budget(
276
276
  request.lane = flag(flags, "lane").unwrap_or("");
277
277
  request.session = flag(flags, "session").unwrap_or("");
278
278
  request.streams = crate::flag_num(flags, "streams", transport::PULL_STREAMS);
279
- request.streams_start = crate::flag_num(flags, "streams-start", transport::STREAMS);
280
279
  request.deadline = deadline_of(flags);
281
280
  request.download_budget = budget;
282
281
  // THE WALK REPORTS WHILE IT WALKS.
@@ -319,32 +318,19 @@ fn pull_with_budget(
319
318
  quoted(&report.model), quoted(&report.manifest), quoted(&report.scope),
320
319
  report.cache_writes.bytes(), report.bytes_cached, report.bytes_total,
321
320
  );
322
- // What each stream level bought, so a slow pull says whether more streams helped
323
- // (one GET was the limit) or not (the link, disk or origin was).
324
- let levels: Vec<String> = report
325
- .levels
326
- .iter()
327
- .map(|level| {
328
- format!(
329
- "[{},{}]",
330
- level.streams,
331
- level.bytes_per_second.round() as u64
332
- )
333
- })
334
- .collect();
335
- // And what admitting them cost: a pull whose streams stop growing while its batches
336
- // take most of the wall time is held by the disk, not the link. `durability` says
337
- // which syncs the disk the Store lives on made it pay, and what an unclean shutdown
338
- // before this pull cost to repair.
321
+ // What the requests cost and what admitting them cost: a pull whose batches take most
322
+ // of the wall time is held by the disk, not the link. `durability` says which syncs the
323
+ // disk the Store lives on made it pay, and what an unclean shutdown before this pull
324
+ // cost to repair.
339
325
  let durability = &report.durability;
340
326
  eprintln!(
341
- "{{\"event\":\"pull.streams\",\"model\":{},\"seconds\":{:.3},\"bytes_moved\":{},\"streams\":{},\"levels\":[{}],\"backoffs\":{},\"admission\":{{\"objects\":{},\"batches\":{},\"seconds\":{:.3}}},\"durability\":{{\"class\":{},\"filesystem\":{},\"syncs\":{},\"sync_seconds\":{:.3},\"recovery\":{{\"rehashed\":{},\"removed\":{},\"seconds\":{:.3}}}}}}}",
327
+ "{{\"event\":\"pull.streams\",\"model\":{},\"seconds\":{:.3},\"bytes_moved\":{},\"streams\":{},\"requests\":{},\"restarts\":{},\"admission\":{{\"objects\":{},\"batches\":{},\"seconds\":{:.3}}},\"durability\":{{\"class\":{},\"filesystem\":{},\"syncs\":{},\"sync_seconds\":{:.3},\"recovery\":{{\"rehashed\":{},\"removed\":{},\"seconds\":{:.3}}}}}}}",
342
328
  quoted(&report.model),
343
329
  seconds,
344
330
  report.bytes_moved,
345
331
  report.streams,
346
- levels.join(","),
347
- report.backoffs,
332
+ report.requests,
333
+ report.restarts,
348
334
  after.admitted_objects - before.admitted_objects,
349
335
  after.admission_batches - before.admission_batches,
350
336
  (after.admission_nanos - before.admission_nanos) as f64 / 1e9,
@@ -42,10 +42,9 @@
42
42
  //! The ONE transport (tfs-048/tfs-049/tfs-050). The credential is `--credential-file` or
43
43
  //! TFS_CREDENTIAL (`bearer <token>`, `worker <id> <token>`, or empty for anonymous), never
44
44
  //! bare argv; a URL of `-` arrives on stdin. Flags: --hub <base> --lane --session --streams <n>
45
- //! --streams-start <n> --timeout <s> --allow-hosts a,b,.c --allow-local --max-redirects <n>
45
+ //! --timeout <s> --allow-hosts a,b,.c --allow-local --max-redirects <n>
46
46
  //! --ca-file <pem> (a private hub's CA, trusted beside the webpki set).
47
- //! `--streams` is the most objects in flight (default 128, memory-bounded); the walk starts
48
- //! at `--streams-start` (default 16) and doubles while measured goodput follows.
47
+ //! `--streams` is the most requests in flight (default 512, memory-bounded).
49
48
  //! `tfs fetch` reads and backfills the Store's bound repo cache between the local Store
50
49
  //! and the origin. It is bound by `tfs store ensure --repo-cache` and never by a flag here.
51
50
  //!
@@ -50,7 +50,6 @@ pub struct Request<'a> {
50
50
  pub keep: &'a [String],
51
51
  pub cancellation: Option<PullCancellation>,
52
52
  pub streams: usize,
53
- pub streams_start: usize,
54
53
  /// The transport ledger's resolution; configuration, never a verdict.
55
54
  pub sample_seconds: f64,
56
55
  pub on_event: Option<&'a (dyn Fn(&Event) + Sync)>,
@@ -75,7 +74,6 @@ impl<'a> Request<'a> {
75
74
  keep: &[],
76
75
  cancellation: None,
77
76
  streams: transport::PULL_STREAMS,
78
- streams_start: transport::STREAMS,
79
77
  sample_seconds: transport::SAMPLE_SECONDS,
80
78
  on_event: None,
81
79
  }
@@ -87,7 +85,6 @@ impl<'a> Request<'a> {
87
85
  pull.lane = self.lane;
88
86
  pull.cancellation = self.cancellation.clone();
89
87
  pull.streams = self.streams;
90
- pull.streams_start = self.streams_start;
91
88
  pull.sample_seconds = self.sample_seconds;
92
89
  pull
93
90
  }
@@ -141,6 +141,7 @@ pub fn session_holds(store: &Store) -> Result<(Vec<HeldKey>, Vec<String>)> {
141
141
  holds.extend(crate::source_artifact::held_objects(store)?);
142
142
  holds.extend(crate::checkpoint_root::held_objects(store)?);
143
143
  holds.extend(crate::ensure::held_objects(store)?);
144
+ holds.extend(crate::keyed_roots::held_objects(store)?);
144
145
  // A full snapshot obligation wins over a runtime-only pin of the same manifest.
145
146
  holds.sort_by(|left, right| {
146
147
  left.key
@@ -187,6 +188,7 @@ pub(crate) fn unretained_manifests(store: &Store, wanted: &[ObjectRef]) -> Resul
187
188
  let mut named = crate::derived::rooted_manifests(store)?;
188
189
  named.extend(manifests(crate::source_artifact::held_objects(store)?));
189
190
  named.extend(manifests(crate::checkpoint_root::held_objects(store)?));
191
+ named.extend(manifests(crate::keyed_roots::held_objects(store)?));
190
192
  Ok(named)
191
193
  };
192
194
  let everything =
@@ -0,0 +1,247 @@
1
+ //! Keyed cache roots: ordinary-file trees a caller names by (space, content key), lists by
2
+ //! creation time and drops without a tombstone. A root keeps its manifest closure live for
3
+ //! GC; when to drop one is the caller's policy.
4
+
5
+ use std::collections::BTreeMap;
6
+ use std::fs::{self, File, OpenOptions};
7
+ use std::io::{ErrorKind, Read, Write};
8
+ use std::os::unix::fs::OpenOptionsExt;
9
+ use std::path::PathBuf;
10
+
11
+ use fs2::FileExt;
12
+
13
+ use crate::canon::{Fields, Value};
14
+ use crate::catalog::WriterGuard;
15
+ use crate::err::{refuse, Code, Refusal, Result};
16
+ use crate::ids::{hex64, Doc, ObjectRef, Plain};
17
+ use crate::manifest::Manifest;
18
+ use crate::source_artifact::{import_member, import_paths};
19
+ use crate::storage::HeldKey;
20
+ use crate::store::{Fault, Store, O_NOFOLLOW};
21
+
22
+ #[derive(Clone, Debug, PartialEq, Eq)]
23
+ pub struct KeyedRoot {
24
+ pub space: String,
25
+ pub key: String,
26
+ pub manifest: ObjectRef,
27
+ /// Manifest length plus the length of each distinct member object.
28
+ pub bytes: u64,
29
+ pub created_unix_ms: u64,
30
+ /// The newest TensorFS that wrote this root.
31
+ pub tensorfs: Option<String>,
32
+ }
33
+
34
+ impl Plain for KeyedRoot {
35
+ const MAX_BYTES: usize = 4096;
36
+
37
+ fn from_value(value: &Value) -> Result<Self> {
38
+ let mut f = Fields::new("KeyedRoot", value)?;
39
+ let space = f.req_str("space")?.to_string();
40
+ let key = f.req_str("key")?.to_string();
41
+ let manifest = ObjectRef::from_value("keyed root manifest", f.req("manifest")?)?;
42
+ let bytes = f.req_uint("bytes")?;
43
+ let created_unix_ms = f.req_uint("created_unix_ms")?;
44
+ let tensorfs = f
45
+ .opt("tensorfs")
46
+ .map(|v| crate::canon::as_str("KeyedRoot", "tensorfs", v).map(str::to_string))
47
+ .transpose()?;
48
+ f.done_written_by(tensorfs.as_deref())?;
49
+ Ok(Self {
50
+ space,
51
+ key,
52
+ manifest,
53
+ bytes,
54
+ created_unix_ms,
55
+ tensorfs,
56
+ })
57
+ }
58
+
59
+ fn to_value(&self) -> Value {
60
+ let mut fields = vec![
61
+ ("space", Value::str(&self.space)),
62
+ ("key", Value::str(&self.key)),
63
+ ("manifest", self.manifest.to_value()),
64
+ ("bytes", Value::uint(self.bytes)),
65
+ ("created_unix_ms", Value::uint(self.created_unix_ms)),
66
+ ];
67
+ if let Some(tensorfs) = &self.tensorfs {
68
+ fields.push(("tensorfs", Value::str(tensorfs.clone())));
69
+ }
70
+ Value::obj(fields)
71
+ }
72
+ }
73
+
74
+ fn io(e: std::io::Error) -> Refusal {
75
+ Refusal {
76
+ code: Code::IO_FAILED,
77
+ detail: format!("keyed root: {e}"),
78
+ }
79
+ }
80
+
81
+ fn directory(store: &Store) -> PathBuf {
82
+ store.root().join("roots/keyed")
83
+ }
84
+
85
+ /// `[a-z0-9][a-z0-9._-]{0,63}`: one path component, never `.` or `..`.
86
+ fn space_dir(store: &Store, space: &str) -> Result<PathBuf> {
87
+ let b = space.as_bytes();
88
+ let ok = |c: &u8| c.is_ascii_lowercase() || c.is_ascii_digit();
89
+ if b.is_empty() || b.len() > 64 || !ok(&b[0]) || !b.iter().all(|c| ok(c) || b"._-".contains(c))
90
+ {
91
+ return refuse(
92
+ Code::KEY_GRAMMAR,
93
+ format!("keyed root space {space:?} must match [a-z0-9][a-z0-9._-]{{0,63}}"),
94
+ );
95
+ }
96
+ Ok(directory(store).join(space))
97
+ }
98
+
99
+ fn path(store: &Store, space: &str, key: &str) -> Result<PathBuf> {
100
+ hex64("keyed root key", key)?;
101
+ Ok(space_dir(store, space)?.join(format!("{key}.json")))
102
+ }
103
+
104
+ pub fn get(store: &Store, space: &str, key: &str) -> Result<Option<KeyedRoot>> {
105
+ let file = match OpenOptions::new()
106
+ .read(true)
107
+ .custom_flags(O_NOFOLLOW)
108
+ .open(path(store, space, key)?)
109
+ {
110
+ Ok(file) => file,
111
+ Err(e) if e.kind() == ErrorKind::NotFound => return Ok(None),
112
+ Err(e) => return Err(io(e)),
113
+ };
114
+ let mut bytes = Vec::new();
115
+ file.take(KeyedRoot::MAX_BYTES as u64 + 1)
116
+ .read_to_end(&mut bytes)
117
+ .map_err(io)?;
118
+ let root = KeyedRoot::parse(&bytes)?;
119
+ if root.space != space || root.key != key {
120
+ return refuse(
121
+ Code::CROSS_SUBJECT_REPLAY,
122
+ "keyed root path names another key",
123
+ );
124
+ }
125
+ Ok(Some(root))
126
+ }
127
+
128
+ /// Every root in `space`, oldest created first.
129
+ pub fn list(store: &Store, space: &str) -> Result<Vec<KeyedRoot>> {
130
+ let entries = match fs::read_dir(space_dir(store, space)?) {
131
+ Ok(entries) => entries,
132
+ Err(e) if e.kind() == ErrorKind::NotFound => return Ok(vec![]),
133
+ Err(e) => return Err(io(e)),
134
+ };
135
+ let mut roots = vec![];
136
+ for entry in entries {
137
+ let name = entry.map_err(io)?.file_name();
138
+ let Some(key) = (name.to_str())
139
+ .and_then(|n| n.strip_suffix(".json"))
140
+ .filter(|k| hex64("keyed root key", k).is_ok())
141
+ else {
142
+ continue;
143
+ };
144
+ // A root dropped since the directory was read is simply gone.
145
+ if let Some(root) = get(store, space, key)? {
146
+ roots.push(root);
147
+ }
148
+ }
149
+ roots.sort_by(|a, b| (a.created_unix_ms, &a.key).cmp(&(b.created_unix_ms, &b.key)));
150
+ Ok(roots)
151
+ }
152
+
153
+ /// Import an exact ordinary-file tree and root it at (space, key). The same tree again
154
+ /// returns the standing root unchanged; a different tree refuses `TRANSACTION_CONFLICT`.
155
+ pub fn put(
156
+ store: &Store,
157
+ space: &str,
158
+ key: &str,
159
+ tree: &Manifest,
160
+ files: &[(String, PathBuf)],
161
+ ) -> Result<KeyedRoot> {
162
+ let path = path(store, space, key)?;
163
+ let paths = import_paths(tree, files)?;
164
+ let manifest = tree.object_ref();
165
+ let _writer = WriterGuard::acquire(store.root())?;
166
+ let dir = path.parent().expect("root path has a space directory");
167
+ fs::create_dir_all(dir).map_err(io)?;
168
+ let lock = File::open(dir).map_err(io)?;
169
+ lock.lock_exclusive().map_err(io)?;
170
+ if let Some(root) = get(store, space, key)? {
171
+ if root.manifest != manifest {
172
+ return refuse(
173
+ Code::TRANSACTION_CONFLICT,
174
+ "keyed root already names another tree",
175
+ );
176
+ }
177
+ return Ok(root);
178
+ }
179
+ let mut members = BTreeMap::new();
180
+ for (member, entry) in tree.entries() {
181
+ let object = entry.blob();
182
+ import_member(store, object, paths[member.as_str()], &Fault::default())?;
183
+ members.insert(&object.sha256, object.length);
184
+ }
185
+ store.put_manifest(tree)?;
186
+ let root = KeyedRoot {
187
+ space: space.into(),
188
+ key: key.into(),
189
+ bytes: manifest.length + members.values().sum::<u64>(),
190
+ manifest,
191
+ created_unix_ms: (crate::meta::now_nanos_unique() / 1_000_000) as u64,
192
+ tensorfs: Some(crate::VERSION.into()),
193
+ };
194
+ let temporary = path.with_extension(format!("tmp-{}", crate::meta::now_nanos_unique()));
195
+ let result = (|| {
196
+ let mut file = OpenOptions::new()
197
+ .write(true)
198
+ .create_new(true)
199
+ .open(&temporary)
200
+ .map_err(io)?;
201
+ file.write_all(&root.canonical_bytes())
202
+ .and_then(|()| file.sync_all())
203
+ .map_err(io)?;
204
+ fs::rename(&temporary, &path).map_err(io)?;
205
+ crate::store::fsync_entry_dir(store.root(), dir)
206
+ })();
207
+ let _ = fs::remove_file(temporary);
208
+ result.map(|()| root)
209
+ }
210
+
211
+ /// Remove a root, leaving nothing behind; its bytes are garbage to the next GC.
212
+ pub fn remove(store: &Store, space: &str, key: &str) -> Result<bool> {
213
+ let path = path(store, space, key)?;
214
+ let _writer = WriterGuard::acquire(store.root())?;
215
+ match fs::remove_file(&path) {
216
+ Ok(()) => {
217
+ crate::store::fsync_entry_dir(store.root(), path.parent().unwrap()).map(|()| true)
218
+ }
219
+ Err(e) if e.kind() == ErrorKind::NotFound => Ok(false),
220
+ Err(e) => Err(io(e)),
221
+ }
222
+ }
223
+
224
+ /// Every live root's manifest; a manifest hold keeps its whole member closure.
225
+ pub(crate) fn held_objects(store: &Store) -> Result<Vec<HeldKey>> {
226
+ let spaces = match fs::read_dir(directory(store)) {
227
+ Ok(spaces) => spaces,
228
+ Err(e) if e.kind() == ErrorKind::NotFound => return Ok(vec![]),
229
+ Err(e) => return Err(io(e)),
230
+ };
231
+ let mut held = vec![];
232
+ for space in spaces {
233
+ let name = space.map_err(io)?.file_name();
234
+ let Some(space) = name.to_str().filter(|s| space_dir(store, s).is_ok()) else {
235
+ continue;
236
+ };
237
+ for root in list(store, space)? {
238
+ held.push(HeldKey {
239
+ key: crate::storage::manifest_key(&root.manifest.sha256)?,
240
+ kind: "manifest".into(),
241
+ length: root.manifest.length,
242
+ sha256: root.manifest.sha256,
243
+ });
244
+ }
245
+ }
246
+ Ok(held)
247
+ }
@@ -35,6 +35,7 @@ pub mod home;
35
35
  pub mod ids;
36
36
  pub mod ingest;
37
37
  pub mod jcs;
38
+ pub mod keyed_roots;
38
39
  pub mod limits;
39
40
  pub mod machine;
40
41
  pub mod manifest;
@@ -63,8 +64,14 @@ pub mod vectors;
63
64
  pub const VERSION: &str = env!("CARGO_PKG_VERSION");
64
65
 
65
66
  /// What callers may feature-detect by name instead of by version: `ensure`, ranged `get`
66
- /// under a lease, delivered-product marks, and the pressure pass.
67
- pub const CAPABILITIES: &[&str] = &["deliver/1", "ensure/1", "get-range/1", "pressure/1"];
67
+ /// under a lease, delivered-product marks, the pressure pass, and keyed cache roots.
68
+ pub const CAPABILITIES: &[&str] = &[
69
+ "deliver/1",
70
+ "ensure/1",
71
+ "get-range/1",
72
+ "keyed-roots/1",
73
+ "pressure/1",
74
+ ];
68
75
 
69
76
  /// Conservative identity of the actual native converter build, not its version label.
70
77
  pub const IMPLEMENTATION_SHA256: &str = env!("TENSORFS_IMPLEMENTATION_SHA256");
@@ -12,10 +12,11 @@ use crate::{
12
12
  };
13
13
  use fs2::FileExt;
14
14
  use std::{
15
+ collections::BTreeMap,
15
16
  fs::{self, File, OpenOptions},
16
17
  io::{Read, Write},
17
18
  os::unix::fs::OpenOptionsExt,
18
- path::PathBuf,
19
+ path::{Path, PathBuf},
19
20
  };
20
21
 
21
22
  #[derive(Debug, Clone, PartialEq, Eq)]
@@ -295,47 +296,66 @@ pub fn import_tree(
295
296
  fault: &Fault,
296
297
  ) -> Result<TreeRoot> {
297
298
  check_roster(owner, tree)?;
299
+ let paths = import_paths(tree, files)?;
300
+ let mut writer = Writer::open(store, owner, tree.object_ref())?;
301
+ if !writer.completed()? {
302
+ for (member, entry) in tree.entries() {
303
+ let object = entry.blob();
304
+ writer.hold_expected(object)?;
305
+ import_member(store, object, paths[member.as_str()], fault)?;
306
+ writer.landed(object)?;
307
+ }
308
+ }
309
+ writer.finish(tree)
310
+ }
311
+ /// The local path of every member of an ordinary-file tree, refusing an inexact roster.
312
+ pub(crate) fn import_paths<'a>(
313
+ tree: &Manifest,
314
+ files: &'a [(String, PathBuf)],
315
+ ) -> Result<BTreeMap<&'a str, &'a Path>> {
298
316
  if tree.header().is_some() {
299
317
  return refuse(Code::WRONG_TYPE, "import requires an ordinary-file tree");
300
318
  }
301
- let paths: std::collections::BTreeMap<_, _> = files.iter().map(|(k, v)| (k, v)).collect();
319
+ let paths: BTreeMap<_, _> = files
320
+ .iter()
321
+ .map(|(k, v)| (k.as_str(), v.as_path()))
322
+ .collect();
302
323
  if paths.len() != files.len()
303
324
  || paths.len() != tree.entries().len()
304
325
  || tree
305
326
  .entries()
306
327
  .iter()
307
- .any(|(member, _)| !paths.contains_key(member))
328
+ .any(|(member, _)| !paths.contains_key(member.as_str()))
308
329
  {
309
330
  return refuse(
310
331
  Code::TRANSACTION_CONFLICT,
311
332
  "import paths differ from the exact manifest roster",
312
333
  );
313
334
  }
314
- let mut writer = Writer::open(store, owner, tree.object_ref())?;
315
- if !writer.completed()? {
316
- for (member, entry) in tree.entries() {
317
- let object = entry.blob();
318
- writer.hold_expected(object)?;
319
- if !matches!(store.record_valid(&object.sha256), Ok(row) if row.length == object.length)
320
- {
321
- let path = paths[member];
322
- if !fs::symlink_metadata(path).map_err(io)?.is_file() {
323
- return refuse(Code::WRONG_TYPE, "import member must be a regular file");
324
- }
325
- let mut file = OpenOptions::new()
326
- .read(true)
327
- .custom_flags(crate::store::O_NOFOLLOW)
328
- .open(path)
329
- .map_err(io)?;
330
- if !file.metadata().map_err(io)?.is_file() {
331
- return refuse(Code::WRONG_TYPE, "import member must be a regular file");
332
- }
333
- store.put_stream(&mut file, Some(object), fault)?;
334
- }
335
- writer.landed(object)?;
336
- }
335
+ Ok(paths)
336
+ }
337
+ /// Admit one member's exact bytes from a regular file unless a verification record stands.
338
+ pub(crate) fn import_member(
339
+ store: &Store,
340
+ object: &ObjectRef,
341
+ path: &Path,
342
+ fault: &Fault,
343
+ ) -> Result<()> {
344
+ if matches!(store.record_valid(&object.sha256), Ok(row) if row.length == object.length) {
345
+ return Ok(());
337
346
  }
338
- writer.finish(tree)
347
+ if !fs::symlink_metadata(path).map_err(io)?.is_file() {
348
+ return refuse(Code::WRONG_TYPE, "import member must be a regular file");
349
+ }
350
+ let mut file = OpenOptions::new()
351
+ .read(true)
352
+ .custom_flags(crate::store::O_NOFOLLOW)
353
+ .open(path)
354
+ .map_err(io)?;
355
+ if !file.metadata().map_err(io)?.is_file() {
356
+ return refuse(Code::WRONG_TYPE, "import member must be a regular file");
357
+ }
358
+ store.put_stream(&mut file, Some(object), fault).map(|_| ())
339
359
  }
340
360
  /// Adopt only from a still-retained complete owner, before releasing the source owner.
341
361
  pub fn retain(store: &Store, source: &str, owner: &str) -> Result<TreeRoot> {
@@ -560,6 +560,13 @@ impl Store {
560
560
  }
561
561
  }
562
562
 
563
+ /// `bytes` already announced as moved were thrown away.
564
+ pub(crate) fn discarded(&self, bytes: u64) {
565
+ if let Some(sink) = &self.progress {
566
+ sink.discarded(bytes);
567
+ }
568
+ }
569
+
563
570
  /// The three authoritative namespaces identify a TensorFS store. Old mixed-object and
564
571
  /// state.json layouts are a prelaunch hardcut and never dual-read.
565
572
  pub fn open(root: &Path) -> Result<Store> {
@@ -1,6 +1,6 @@
1
- //! One line per transport decision (a hedge, a replacement, a win), appended to the
2
- //! Store's own bounded log so a slow tail is visible after the fact: run 2322 and sasori
3
- //! left nothing on disk to say whether a hedge fired. Never per chunk, never fatal.
1
+ //! One line per dropped request and one per pull, appended to the Store's own bounded log
2
+ //! so a slow tail is visible after the fact: run 2322 and sasori left nothing on disk to
3
+ //! say what the transport did. Never per chunk, never fatal.
4
4
  use crate::ids::ObjectRef;
5
5
  use crate::store::Store;
6
6
  use std::fs::{self, OpenOptions};