tensorfs 0.3.85__tar.gz → 0.3.86__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.
- {tensorfs-0.3.85 → tensorfs-0.3.86}/Cargo.lock +3 -3
- {tensorfs-0.3.85 → tensorfs-0.3.86}/Cargo.toml +1 -1
- {tensorfs-0.3.85 → tensorfs-0.3.86}/PKG-INFO +1 -1
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/bin/tfs/fetch.rs +17 -52
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/bin/tfs/main.rs +1 -2
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/fetch.rs +2 -4
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/providers.rs +2 -4
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/staging.rs +7 -1
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/transport/download.rs +183 -26
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/transport/http.rs +101 -92
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/transport/mod.rs +6 -7
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/transport/policy.rs +15 -6
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/transport/pull.rs +11 -292
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/transport/tests.rs +313 -660
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/fetch_url_progress.rs +6 -29
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/transfer_memory.rs +3 -2
- {tensorfs-0.3.85 → tensorfs-0.3.86}/pyproject.toml +1 -1
- tensorfs-0.3.85/crates/tensorfs-core/src/transport/ranged.rs +0 -1079
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/Cargo.toml +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/build.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/examples/h3-swiglu-layout.md +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/examples/optional-cache-backfill.md +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/examples/resident-conversion.md +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/examples/resident_conversion_profile.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/asset_update.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/b64.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/bin/tfs/ckpt.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/bin/tfs/conform.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/bin/tfs/ensure.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/bin/tfs/ingest.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/bin/tfs/rd.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/bin/tfs/repo.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/bin/tfs/snap.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/bin/tfs/watch.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/cache_roots.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/canon.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/capability.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/catalog/lock.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/catalog.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/cbor.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/checkpoint.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/checkpoint_root.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/corpus.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/derived/adoption.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/derived/companion_tests.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/derived/estimate.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/derived/graft_tests.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/derived/group_commit_tests.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/derived/history_cost_tests.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/derived/part_rows_tests.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/derived/progress.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/derived/resume_tests.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/derived/retention.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/derived/roots.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/derived.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/descriptors.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/disk.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/dtype.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/durability.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/ensure/admission.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/ensure/flight.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/ensure.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/err.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/filesystem_identity.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/fill.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/fit.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/gc.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/header.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/home.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/ids.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/ingest/carrier.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/ingest/convert.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/ingest/custody.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/ingest/fingerprint.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/ingest/gguf.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/ingest/h3_lora.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/ingest/journal.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/ingest/mod.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/ingest/narrow.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/ingest/preflight.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/ingest/routes/anima.routes.json +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/ingest/routes/anima.spec.json +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/ingest/routes/sdxl.routes.json +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/ingest/routes/sdxl.spec.json +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/ingest/routes.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/ingest/source.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/ingest/stamp.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/ingest/transaction.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/jcs.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/keyed_roots.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/lib.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/limits.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/machine.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/manifest.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/meta.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/project.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/read.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/receipt.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/reclaim.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/registry.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/relation.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/repo_cache.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/repository.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/sha256.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/source_artifact.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/spec.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/stats.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/storage.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/store.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/transport/api.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/transport/decisions.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/transport/http_reuse_tests.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/transport/hub.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/transport/ledger.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/transport/memory.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/transport/prefix.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/transport/push.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/transport/tests/tail.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/unsynced.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/src/vectors.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/additive_fields.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/anima_hf_profile.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/as_is.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/catalog_owner_probe.c +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/checkpoint_roots.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/civitai_anima.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/civitai_sdxl_profile.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/ensure.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/fd_budget.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/fd_headroom.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/fetch_faults.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/fit.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/fixtures/repo_apply/blobs.jsonl +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/fixtures/repo_apply/expected_list.jsonl +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/fixtures/repo_apply/expected_repository.json +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/fixtures/repo_apply/expected_rows.jsonl +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/fixtures/repo_apply/header.cbor +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/fixtures/repo_apply/manifest.json +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/fixtures/repo_apply/mutation.json +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/foreign_json.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/h3_lora.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/h3_swiglu.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/home.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/hub_tls.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/import_tree.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/instrument_profiles.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/keyed_roots.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/liveness.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/qwen_image21_profile.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/read_plan.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/reclaim.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/reclaim_run.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/repo_cache.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/repo_store.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/resident_admission.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/routed_single_file.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/sha256_backends.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/sharded_cas.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/source_artifacts.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/source_download.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/source_plan.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/source_prefixes.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/source_preflight.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/staging.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/store_boundaries.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/tensor_schema.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/trust_index.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/version.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-core/tests/write_through.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-plane/API.md +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-plane/Cargo.toml +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-plane/src/bin/g1_vmm.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-plane/src/bin/g2_overlap.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-plane/src/bin/gpu_bench/mod.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-plane/src/cuda.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-plane/src/cursor.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-plane/src/device.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-plane/src/host.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-plane/src/io.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-plane/src/layout.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-plane/src/lib.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-plane/src/plane.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-plane/tests/common/mod.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-plane/tests/gpu.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-plane/tests/host_tier.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-py/Cargo.toml +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-py/src/docs.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-py/src/ensure.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-py/src/errors.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-py/src/ingest.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-py/src/lib.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-py/src/plane.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/crates/tensorfs-py/src/store.rs +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/python/tensorfs/__init__.py +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/python/tensorfs/_derived_channel.py +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/python/tensorfs/_ext.pyi +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/python/tensorfs/_source_channel.py +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/python/tensorfs/_tensors.py +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/python/tensorfs/derived.py +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/python/tensorfs/errors.py +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/python/tensorfs/plane.py +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/python/tensorfs/plane.pyi +0 -0
- {tensorfs-0.3.85 → tensorfs-0.3.86}/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.
|
|
452
|
+
version = "0.3.86"
|
|
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.
|
|
467
|
+
version = "0.3.86"
|
|
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.
|
|
477
|
+
version = "0.3.86"
|
|
478
478
|
dependencies = [
|
|
479
479
|
"pyo3",
|
|
480
480
|
"tensorfs-core",
|
|
@@ -430,29 +430,14 @@ fn sample_gap() -> std::time::Duration {
|
|
|
430
430
|
/// which stream it arrived on. `fetch url`'s result is `held|admitted <id>` and
|
|
431
431
|
/// `transferred <n> B`, and nothing printed here can be mistaken for either.
|
|
432
432
|
///
|
|
433
|
-
///
|
|
434
|
-
/// verbs. `
|
|
435
|
-
///
|
|
436
|
-
/// structurally zero and are not printed; `origin_objects` goes to one only when the object
|
|
437
|
-
/// is admitted:
|
|
433
|
+
/// One event, and the counter names are `pull.progress`'s so that one consumer reads both
|
|
434
|
+
/// verbs. `origin_bytes` is what is home so far; it goes back if an origin that does not
|
|
435
|
+
/// range starts the object over. `origin_objects` goes to one when the object is admitted:
|
|
438
436
|
///
|
|
439
|
-
/// {"event":"fetch.progress","origin_bytes":N,"origin_objects":0|1
|
|
440
|
-
/// {"event":"fetch.delivery","attempt":A,"host":"h","http_status":S}
|
|
441
|
-
///
|
|
442
|
-
/// `attempt` is on the progress event because a re-ask RESTARTS `origin_bytes` at zero —
|
|
443
|
-
/// `fetch url` has no mid-object resume, so those bytes are not in the store and a
|
|
444
|
-
/// consumer must be able to see the count go back rather than believe a total this fetch
|
|
445
|
-
/// cannot deliver.
|
|
446
|
-
///
|
|
447
|
-
/// `fetch.delivery` is one per redirect hop per ask, and it is the half that makes a
|
|
448
|
-
/// degradation attributable at all. The URL is a bearer capability and never appears; the
|
|
449
|
-
/// HOST is not, and neither is the status. Without them a 429 retry storm and a slow link
|
|
450
|
-
/// produce the same byte curve afterwards, which is exactly why the H3 pod's 70 -> 6 MB/s
|
|
451
|
-
/// could not be attributed to anything.
|
|
437
|
+
/// {"event":"fetch.progress","origin_bytes":N,"origin_objects":0|1}
|
|
452
438
|
struct Reporter {
|
|
453
439
|
moved: u64,
|
|
454
440
|
reported: u64,
|
|
455
|
-
attempt: u32,
|
|
456
441
|
/// The byte delta between records. `--progress-bytes` states it, because resolution is
|
|
457
442
|
/// configuration and nothing here is a verdict; production states nothing and gets
|
|
458
443
|
/// SAMPLE_BYTES.
|
|
@@ -466,7 +451,6 @@ impl Reporter {
|
|
|
466
451
|
Reporter {
|
|
467
452
|
moved: 0,
|
|
468
453
|
reported: 0,
|
|
469
|
-
attempt: 0,
|
|
470
454
|
every: every.max(1),
|
|
471
455
|
gap: sample_gap(),
|
|
472
456
|
last: std::time::Instant::now(),
|
|
@@ -485,34 +469,16 @@ impl Reporter {
|
|
|
485
469
|
fn announce(&mut self, admitted: u64) {
|
|
486
470
|
self.reported = self.moved;
|
|
487
471
|
let event = format!(
|
|
488
|
-
"{{\"event\":\"fetch.progress\",\"origin_bytes\":{},\"origin_objects\":{}
|
|
489
|
-
self.moved, admitted
|
|
472
|
+
"{{\"event\":\"fetch.progress\",\"origin_bytes\":{},\"origin_objects\":{}}}",
|
|
473
|
+
self.moved, admitted
|
|
490
474
|
);
|
|
491
475
|
self.say(&event);
|
|
492
476
|
}
|
|
493
477
|
}
|
|
494
478
|
|
|
495
479
|
impl transport::FetchObserver for Reporter {
|
|
496
|
-
fn hop(&mut self, attempt: u32, host: &str, status: u16) {
|
|
497
|
-
self.attempt = attempt;
|
|
498
|
-
// The host reaches the channel as JSON, so it reaches it quoted. It comes from the
|
|
499
|
-
// policy check that already refused anything but a hostname, and this is the belt
|
|
500
|
-
// that keeps a malformed one from being a malformed EVENT.
|
|
501
|
-
let host: String = host
|
|
502
|
-
.chars()
|
|
503
|
-
.filter(|c| c.is_ascii_alphanumeric() || matches!(c, '.' | '-' | '_' | ':'))
|
|
504
|
-
.take(253)
|
|
505
|
-
.collect();
|
|
506
|
-
let event = format!(
|
|
507
|
-
"{{\"event\":\"fetch.delivery\",\"attempt\":{attempt},\"host\":\"{host}\",\"http_status\":{status}}}"
|
|
508
|
-
);
|
|
509
|
-
self.say(&event);
|
|
510
|
-
}
|
|
511
|
-
|
|
512
480
|
fn moved(&mut self, total: u64) {
|
|
513
|
-
// A
|
|
514
|
-
// bytes are not in the store, and a reader that watched them climb must watch them
|
|
515
|
-
// go back rather than believe a total this fetch cannot deliver.
|
|
481
|
+
// A count that goes back is reported at once: those bytes are not on this machine.
|
|
516
482
|
let due = total < self.moved
|
|
517
483
|
|| total.saturating_sub(self.reported) >= self.every
|
|
518
484
|
|| self.last.elapsed() >= self.gap;
|
|
@@ -524,14 +490,13 @@ impl transport::FetchObserver for Reporter {
|
|
|
524
490
|
}
|
|
525
491
|
|
|
526
492
|
/// `tfs fetch url <root> <sha256> <length> <url|-> [--progress] [--streams N] [--part-mib N]`
|
|
527
|
-
/// — plan-of-one, then the
|
|
528
|
-
///
|
|
529
|
-
///
|
|
493
|
+
/// — plan-of-one, then the pull's downloader. A held object answers `held` and moves
|
|
494
|
+
/// nothing. A url of `-` reads the real URL as one line on stdin: a capability URL can
|
|
495
|
+
/// embed a signature, and argv is world-readable in /proc.
|
|
530
496
|
///
|
|
531
|
-
/// `--streams` is how many
|
|
532
|
-
///
|
|
533
|
-
///
|
|
534
|
-
/// whatever these say.
|
|
497
|
+
/// `--streams` is how many ranged requests of THIS object are in flight and `--part-mib`
|
|
498
|
+
/// one request's size. An origin that will not answer a range gives the object to one
|
|
499
|
+
/// request whatever these say.
|
|
535
500
|
///
|
|
536
501
|
/// `--progress` opens the observation channel above. Without it this command says nothing
|
|
537
502
|
/// until it is finished, which for a 5 GiB shard is ten to fifteen minutes of silence a
|
|
@@ -570,7 +535,7 @@ fn object_of(what: &str, id: &str, length: &str) -> Result<ObjectRef, ExitCode>
|
|
|
570
535
|
|
|
571
536
|
fn ranged_of(flags: &Flags) -> transport::Ranged {
|
|
572
537
|
transport::Ranged {
|
|
573
|
-
streams: crate::flag_num(flags, "streams", transport::
|
|
538
|
+
streams: crate::flag_num(flags, "streams", transport::STREAMS),
|
|
574
539
|
part: crate::flag_num::<u64>(flags, "part-mib", transport::PART_BYTES >> 20) << 20,
|
|
575
540
|
}
|
|
576
541
|
}
|
|
@@ -688,7 +653,7 @@ pub fn cmd_url(root: &Path, id: &str, length: &str, url: &str, flags: &Flags) ->
|
|
|
688
653
|
reporter.moved = fetched.transferred;
|
|
689
654
|
reporter.announce(1);
|
|
690
655
|
}
|
|
691
|
-
println!("admitted {}", fetched.
|
|
656
|
+
println!("admitted {}", fetched.object.id());
|
|
692
657
|
println!("transferred {} B", fetched.transferred);
|
|
693
658
|
ExitCode::SUCCESS
|
|
694
659
|
}
|
|
@@ -765,8 +730,8 @@ pub fn cmd_staging_fetch(
|
|
|
765
730
|
reporter.moved = fetched.transferred;
|
|
766
731
|
reporter.announce(1);
|
|
767
732
|
}
|
|
768
|
-
let path = ok!(staging::path(&store, &fetched.
|
|
769
|
-
println!("staged {}", fetched.
|
|
733
|
+
let path = ok!(staging::path(&store, &fetched.object.sha256));
|
|
734
|
+
println!("staged {}", fetched.object.id());
|
|
770
735
|
println!("path {}", path.display());
|
|
771
736
|
println!("transferred {} B", fetched.transferred);
|
|
772
737
|
ExitCode::SUCCESS
|
|
@@ -64,8 +64,7 @@
|
|
|
64
64
|
//! tfs fetch url <root> <sha256> <length> <url|-> [--progress] [--streams N]
|
|
65
65
|
//! one granted object, in parallel ranges
|
|
66
66
|
//! --progress opens the same STDERR event channel `tfs fetch` reports on, while
|
|
67
|
-
//! the bytes move: {"event":"fetch.progress","origin_bytes":N,...} per sample
|
|
68
|
-
//! and {"event":"fetch.delivery","host":..,"http_status":..} per redirect hop,
|
|
67
|
+
//! the bytes move: {"event":"fetch.progress","origin_bytes":N,...} per sample,
|
|
69
68
|
//! so a supervisor can tell slow from wedged without a clock. stdout stays the
|
|
70
69
|
//! result. --progress-bytes <n> is that channel's resolution, never a verdict
|
|
71
70
|
//!
|
|
@@ -413,10 +413,8 @@ pub struct DeliveryGrant {
|
|
|
413
413
|
/// Where the bytes this grant authorizes come to rest.
|
|
414
414
|
///
|
|
415
415
|
/// The grant already carried this bit — it was `manifest: bool` — so a third destination is
|
|
416
|
-
/// the existing shape rather than a new concept
|
|
417
|
-
///
|
|
418
|
-
/// reader)` does not move, so byte-range resume works on the staging path for free and
|
|
419
|
-
/// cannot drift from the CAS path.
|
|
416
|
+
/// the existing shape rather than a new concept: the downloader commits a hashed temp file
|
|
417
|
+
/// where the grant says, so the staging path shares the CAS path's transport.
|
|
420
418
|
///
|
|
421
419
|
/// `Blob` and `Manifest` are store objects. `Staging` is not: it is a foreign source
|
|
422
420
|
/// carrier the store will read once and throw away, and it has no catalog record, no census
|
|
@@ -547,10 +547,8 @@ pub fn pull(
|
|
|
547
547
|
for (member, object) in &pinned {
|
|
548
548
|
if plan.wants(&object.sha256) {
|
|
549
549
|
let grant = DeliveryGrant::mint(&plan, object)?;
|
|
550
|
-
//
|
|
551
|
-
//
|
|
552
|
-
// stream. `fetch_ranged` falls back to exactly the single-stream call this
|
|
553
|
-
// replaced whenever the origin will not answer a range.
|
|
550
|
+
// A source member is whatever the uploader pushed, up to gigabytes: it is
|
|
551
|
+
// asked for as parallel ranges, or whole if the origin will not range.
|
|
554
552
|
let fetched = fetch_ranged(
|
|
555
553
|
store,
|
|
556
554
|
&grant,
|
|
@@ -181,8 +181,14 @@ pub fn staged(store: &Store, want: &ObjectRef) -> Result<Option<PathBuf>> {
|
|
|
181
181
|
/// URL that serves the wrong bytes cannot poison this area — it can only fail, leaving
|
|
182
182
|
/// nothing staged and no temp behind.
|
|
183
183
|
pub fn stage<R: Read>(store: &Store, r: &mut R, want: &ObjectRef) -> Result<Carrier> {
|
|
184
|
-
|
|
184
|
+
ensure(store)?;
|
|
185
185
|
let verified = store.stream_verified(r, Some(want), &Fault::default(), STAGE_TEMP)?;
|
|
186
|
+
adopt(store, verified)
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/// Link a temp file already hashed to its id to `staging/<hex>`, and drop the temp.
|
|
190
|
+
pub(crate) fn adopt(store: &Store, verified: crate::store::Verified) -> Result<Carrier> {
|
|
191
|
+
let dir = ensure(store)?;
|
|
186
192
|
let destination = dir.join(&verified.sha256);
|
|
187
193
|
// 0444 for the same reason an object is: the converter reads it and nothing writes it
|
|
188
194
|
// again. A carrier is removed by unlink, which a read-only mode does not prevent.
|
|
@@ -11,19 +11,26 @@
|
|
|
11
11
|
//! second and sometimes a minute. One GET for the object pays every delay in a row (runs
|
|
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
|
+
//!
|
|
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.
|
|
14
18
|
|
|
15
19
|
use super::decisions;
|
|
16
20
|
use super::ledger::{Attempt, Deadline, Ledger, STALL_FACTOR};
|
|
17
21
|
use super::pull::{
|
|
18
|
-
open_object, shared_client,
|
|
22
|
+
open_object, shared_client, FetchObserver, Fetched, ObjectObserver, ObjectSource, ObjectUrls,
|
|
23
|
+
Opened, WalkOutcome,
|
|
19
24
|
};
|
|
25
|
+
use super::STREAMS;
|
|
20
26
|
use super::{CredentialProvider, SourcePolicy};
|
|
21
27
|
use crate::err::{refuse, Code, Refusal, Result};
|
|
22
|
-
use crate::fetch::{DeliveryGrant, Destination
|
|
28
|
+
use crate::fetch::{DeliveryGrant, Destination};
|
|
29
|
+
use crate::ids::ObjectRef;
|
|
23
30
|
use crate::repo_cache::{BackfillBatch, CacheKind, CacheRead, CacheTrust};
|
|
24
31
|
use crate::store::{Fault, Store, Verified, PUT_TEMP};
|
|
25
32
|
use fs2::FileExt;
|
|
26
|
-
use std::collections::VecDeque;
|
|
33
|
+
use std::collections::{BTreeMap, VecDeque};
|
|
27
34
|
use std::fs::{File, OpenOptions};
|
|
28
35
|
use std::io::Read;
|
|
29
36
|
use std::os::unix::fs::{FileExt as _, OpenOptionsExt};
|
|
@@ -36,8 +43,14 @@ use std::time::{Duration, Instant};
|
|
|
36
43
|
/// what whole 64 MiB GETs move (1.1-1.3 GB/s); 1 MiB chunks move half.
|
|
37
44
|
pub const CHUNK_BYTES: u64 = 8 << 20;
|
|
38
45
|
|
|
39
|
-
///
|
|
40
|
-
///
|
|
46
|
+
/// One request's bytes from a source origin. Larger, because every ask walks the origin's
|
|
47
|
+
/// redirect again (0.41 s against HuggingFace, and its resolve endpoint is rate-limited).
|
|
48
|
+
pub const PART_BYTES: u64 = 64 << 20;
|
|
49
|
+
|
|
50
|
+
/// A dropped request's unfinished range is cut into pieces, an eighth of a chunk each and
|
|
51
|
+
/// never under this: a slow object answers small asks side by side, and a chunk asked again
|
|
52
|
+
/// whole would pay its slow MiBs in a row. Also the least a request must carry for its body
|
|
53
|
+
/// rate to be compared with its peers'.
|
|
41
54
|
const PIECE_BYTES: u64 = 1 << 20;
|
|
42
55
|
|
|
43
56
|
/// Completed first asks a running request is compared with: how long each waited for its
|
|
@@ -80,6 +93,8 @@ struct Chunk {
|
|
|
80
93
|
silent: u32,
|
|
81
94
|
/// Never dropped or failed: a first ask, whose rate is what peers are compared with.
|
|
82
95
|
fresh: bool,
|
|
96
|
+
/// The object's only chunk so far: its origin has not yet shown that it answers ranges.
|
|
97
|
+
lead: bool,
|
|
83
98
|
}
|
|
84
99
|
|
|
85
100
|
impl Chunk {
|
|
@@ -122,8 +137,11 @@ enum Ended {
|
|
|
122
137
|
impl From<Refusal> for Ended {
|
|
123
138
|
fn from(refusal: Refusal) -> Ended {
|
|
124
139
|
match refusal.code {
|
|
125
|
-
// A connection that failed, stalled or was dropped,
|
|
126
|
-
|
|
140
|
+
// A connection that failed, stalled or was dropped, a name the resolver did not
|
|
141
|
+
// answer, and a full descriptor table.
|
|
142
|
+
Code::TRANSFER_FAILED | Code::HUB_UNREACHABLE | Code::FD_HEADROOM => {
|
|
143
|
+
Ended::Retry(refusal, None)
|
|
144
|
+
}
|
|
127
145
|
_ => Ended::Fatal(refusal),
|
|
128
146
|
}
|
|
129
147
|
}
|
|
@@ -151,8 +169,13 @@ struct State {
|
|
|
151
169
|
|
|
152
170
|
pub(super) struct Download<'a> {
|
|
153
171
|
pub store: &'a Store,
|
|
154
|
-
pub
|
|
172
|
+
pub wanted: &'a [ObjectRef],
|
|
173
|
+
/// The door's grant for one wanted object.
|
|
174
|
+
pub grant: &'a (dyn Fn(&ObjectRef) -> Result<DeliveryGrant> + Sync),
|
|
155
175
|
pub urls: &'a dyn ObjectUrls,
|
|
176
|
+
/// One request's bytes, and whether the origin is known to answer ranges.
|
|
177
|
+
pub chunk: u64,
|
|
178
|
+
pub ranged: bool,
|
|
156
179
|
pub policy: &'a SourcePolicy,
|
|
157
180
|
pub credential: &'a dyn CredentialProvider,
|
|
158
181
|
pub deadline: Deadline,
|
|
@@ -186,14 +209,18 @@ struct Run<'a> {
|
|
|
186
209
|
}
|
|
187
210
|
|
|
188
211
|
impl Download<'_> {
|
|
189
|
-
/// Download `
|
|
190
|
-
|
|
212
|
+
/// Download `wanted` with `streams` requests in flight. `observer` hears the bytes home
|
|
213
|
+
/// so far, on this thread.
|
|
214
|
+
pub fn run(
|
|
215
|
+
&self,
|
|
216
|
+
streams: usize,
|
|
217
|
+
mut observer: Option<&mut dyn FetchObserver>,
|
|
218
|
+
) -> Result<WalkOutcome> {
|
|
191
219
|
let began = Instant::now();
|
|
192
220
|
let chunks: usize = self
|
|
193
|
-
.plan
|
|
194
221
|
.wanted
|
|
195
222
|
.iter()
|
|
196
|
-
.map(|object| object.length.div_ceil(
|
|
223
|
+
.map(|object| object.length.div_ceil(self.chunk).max(1) as usize)
|
|
197
224
|
.sum();
|
|
198
225
|
let streams = streams.min(chunks).max(1);
|
|
199
226
|
let run = Run {
|
|
@@ -218,8 +245,11 @@ impl Download<'_> {
|
|
|
218
245
|
let run = &run;
|
|
219
246
|
scope.spawn(move || run.work(slot));
|
|
220
247
|
}
|
|
221
|
-
run.watch();
|
|
248
|
+
run.watch(&mut observer);
|
|
222
249
|
});
|
|
250
|
+
if let Some(observer) = observer.as_mut() {
|
|
251
|
+
observer.moved(run.landed.load(Ordering::Relaxed));
|
|
252
|
+
}
|
|
223
253
|
let failure = run.state.lock().unwrap().failure.take();
|
|
224
254
|
let outcome = WalkOutcome {
|
|
225
255
|
fetched: run.fetched.load(Ordering::Relaxed),
|
|
@@ -233,7 +263,11 @@ impl Download<'_> {
|
|
|
233
263
|
decisions::record(
|
|
234
264
|
self.store,
|
|
235
265
|
"walk",
|
|
236
|
-
&format!(
|
|
266
|
+
&format!(
|
|
267
|
+
"{} {}",
|
|
268
|
+
self.wanted.len(),
|
|
269
|
+
self.wanted.iter().map(|object| object.length).sum::<u64>()
|
|
270
|
+
),
|
|
237
271
|
&format!(
|
|
238
272
|
"fetched={} cached={} moved={} seconds={:.1} streams={streams} requests={} \
|
|
239
273
|
restarts={} outcome={}",
|
|
@@ -279,7 +313,7 @@ impl Run<'_> {
|
|
|
279
313
|
/// The next chunk that is due. With none, the next object is opened and its chunks
|
|
280
314
|
/// queued; with nothing left to open, the worker waits for one to come due or back.
|
|
281
315
|
fn take(&self) -> Option<Chunk> {
|
|
282
|
-
let wanted =
|
|
316
|
+
let wanted = self.job.wanted;
|
|
283
317
|
let mut state = self.state.lock().unwrap();
|
|
284
318
|
loop {
|
|
285
319
|
if state.failure.is_some() {
|
|
@@ -349,8 +383,8 @@ impl Run<'_> {
|
|
|
349
383
|
/// and cut into chunks.
|
|
350
384
|
fn open(&self, at: usize) -> Result<Vec<Chunk>> {
|
|
351
385
|
let job = self.job;
|
|
352
|
-
let wanted = &job.
|
|
353
|
-
let grant =
|
|
386
|
+
let wanted = &job.wanted[at];
|
|
387
|
+
let grant = (job.grant)(wanted)?;
|
|
354
388
|
let kind = match grant.destination {
|
|
355
389
|
Destination::Manifest => Some(CacheKind::Manifest),
|
|
356
390
|
Destination::Blob => Some(CacheKind::Blob),
|
|
@@ -406,7 +440,7 @@ impl Run<'_> {
|
|
|
406
440
|
let _ = std::fs::remove_file(&path);
|
|
407
441
|
return Err(io("size", error));
|
|
408
442
|
}
|
|
409
|
-
let firsts: Vec<u64> = (0..length).step_by(
|
|
443
|
+
let firsts: Vec<u64> = (0..length).step_by(job.chunk as usize).collect();
|
|
410
444
|
let object = Arc::new(Object {
|
|
411
445
|
at,
|
|
412
446
|
grant,
|
|
@@ -425,16 +459,40 @@ impl Run<'_> {
|
|
|
425
459
|
stale: None,
|
|
426
460
|
silent: 0,
|
|
427
461
|
fresh: true,
|
|
462
|
+
lead: !job.ranged,
|
|
428
463
|
};
|
|
429
464
|
if firsts.is_empty() {
|
|
430
465
|
return Ok(vec![chunk(0, 0)]);
|
|
431
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 };
|
|
432
469
|
Ok(firsts
|
|
433
470
|
.into_iter()
|
|
434
|
-
.
|
|
471
|
+
.take(asked)
|
|
472
|
+
.map(|first| chunk(first, (first + job.chunk).min(length)))
|
|
435
473
|
.collect())
|
|
436
474
|
}
|
|
437
475
|
|
|
476
|
+
/// The origin answered a range: the object's other chunks join the queue.
|
|
477
|
+
fn rest(&self, lead: &Chunk) {
|
|
478
|
+
let length = lead.object.grant.object.length;
|
|
479
|
+
let mut state = self.state.lock().unwrap();
|
|
480
|
+
for first in (lead.end..length).step_by(self.job.chunk as usize) {
|
|
481
|
+
state.queue.push_back(Chunk {
|
|
482
|
+
object: Arc::clone(&lead.object),
|
|
483
|
+
first,
|
|
484
|
+
end: (first + self.job.chunk).min(length),
|
|
485
|
+
due: Instant::now(),
|
|
486
|
+
stated: false,
|
|
487
|
+
stale: None,
|
|
488
|
+
silent: 0,
|
|
489
|
+
fresh: true,
|
|
490
|
+
lead: false,
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
self.wake.notify_all();
|
|
494
|
+
}
|
|
495
|
+
|
|
438
496
|
/// One GET for a chunk, written at its offsets. Whatever ends it early, the bytes that
|
|
439
497
|
/// landed stay and the rest goes back on the queue.
|
|
440
498
|
fn request(&self, slot: usize, mut chunk: Chunk, buffer: &mut [u8]) -> Outcome {
|
|
@@ -540,8 +598,9 @@ impl Run<'_> {
|
|
|
540
598
|
self.state.lock().unwrap().last = Some(named(refusal, &wanted.id()));
|
|
541
599
|
// A dropped request's unfinished range goes back as pieces, asked side by side.
|
|
542
600
|
let mut again = Vec::new();
|
|
543
|
-
|
|
544
|
-
|
|
601
|
+
let piece = (job.chunk / 8).max(PIECE_BYTES);
|
|
602
|
+
while dropped && !chunk.lead && chunk.end - chunk.first > piece {
|
|
603
|
+
let end = chunk.first + piece;
|
|
545
604
|
object.left.fetch_add(1, Ordering::AcqRel);
|
|
546
605
|
again.push(Chunk {
|
|
547
606
|
object: Arc::clone(&object),
|
|
@@ -609,15 +668,40 @@ impl Run<'_> {
|
|
|
609
668
|
Opened::Refused(refusal) => return Err(Ended::Fatal(refusal)),
|
|
610
669
|
};
|
|
611
670
|
// A ranged ask must be answered with that range of this object.
|
|
612
|
-
let ranged =
|
|
671
|
+
let ranged = content_range(response.header("content-range"));
|
|
672
|
+
// An object of another length than the plan declares is a fact no ask changes.
|
|
673
|
+
let stated = match response.status {
|
|
674
|
+
206 => ranged.map(|(_, _, total)| total),
|
|
675
|
+
_ => response
|
|
676
|
+
.header("content-length")
|
|
677
|
+
.and_then(|length| length.trim().parse().ok()),
|
|
678
|
+
};
|
|
679
|
+
if let Some(total) = stated.filter(|total| *total != wanted.length) {
|
|
680
|
+
return Err(Ended::Fatal(Refusal {
|
|
681
|
+
code: Code::LENGTH_MISMATCH,
|
|
682
|
+
detail: format!(
|
|
683
|
+
"the plan declares {} B and the origin says {total} B",
|
|
684
|
+
wanted.length
|
|
685
|
+
),
|
|
686
|
+
}));
|
|
687
|
+
}
|
|
613
688
|
match (response.status, ranged) {
|
|
614
|
-
(206, Some((first, _,
|
|
689
|
+
(206, Some((first, _, _))) if first == chunk.first => {
|
|
690
|
+
if std::mem::take(&mut chunk.lead) {
|
|
691
|
+
self.rest(chunk);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
615
694
|
(200, _) if whole => {}
|
|
616
|
-
// A
|
|
617
|
-
|
|
695
|
+
// A range answered with the whole object: take it from its first byte. An origin
|
|
696
|
+
// that does not range gives the object to this one request.
|
|
697
|
+
(200, _) if chunk.lead || wanted.length <= job.chunk => {
|
|
618
698
|
job.store.discarded(chunk.first);
|
|
619
699
|
self.landed.fetch_sub(chunk.first, Ordering::Relaxed);
|
|
620
700
|
chunk.first = 0;
|
|
701
|
+
if chunk.lead {
|
|
702
|
+
chunk.end = wanted.length;
|
|
703
|
+
object.left.store(1, Ordering::Release);
|
|
704
|
+
}
|
|
621
705
|
}
|
|
622
706
|
(status, ranged) => {
|
|
623
707
|
return Err(Ended::Fatal(Refusal {
|
|
@@ -694,6 +778,9 @@ impl Run<'_> {
|
|
|
694
778
|
sha256,
|
|
695
779
|
length: wanted.length,
|
|
696
780
|
};
|
|
781
|
+
if object.grant.destination == Destination::Staging {
|
|
782
|
+
return crate::staging::adopt(job.store, verified).map(|_| ());
|
|
783
|
+
}
|
|
697
784
|
job.store
|
|
698
785
|
.admit_verified(verified, &Fault::default(), None)
|
|
699
786
|
.map(|_| ())
|
|
@@ -719,7 +806,7 @@ impl Run<'_> {
|
|
|
719
806
|
/// The one rule, five times a sample: a request that has waited far longer for its first
|
|
720
807
|
/// byte than its peers did, or whose body runs far slower than theirs, is dropped. And
|
|
721
808
|
/// the pull's own end: nothing new has landed for twice its measured patience.
|
|
722
|
-
fn watch(&self) {
|
|
809
|
+
fn watch(&self, observer: &mut Option<&mut dyn FetchObserver>) {
|
|
723
810
|
let job = self.job;
|
|
724
811
|
let sample = self.tick();
|
|
725
812
|
// The most bytes ever home, and when that last grew while requests were being asked.
|
|
@@ -730,6 +817,12 @@ impl Run<'_> {
|
|
|
730
817
|
return;
|
|
731
818
|
}
|
|
732
819
|
state = self.over.wait_timeout(state, sample).unwrap().0;
|
|
820
|
+
if let Some(observer) = observer.as_mut() {
|
|
821
|
+
// Told outside the lock: an observer may be slow, and workers must not wait.
|
|
822
|
+
drop(state);
|
|
823
|
+
observer.moved(self.landed.load(Ordering::Relaxed));
|
|
824
|
+
state = self.state.lock().unwrap();
|
|
825
|
+
}
|
|
733
826
|
if state.done || state.failure.is_some() {
|
|
734
827
|
return;
|
|
735
828
|
}
|
|
@@ -906,3 +999,67 @@ fn named(refusal: Refusal, id: &str) -> Refusal {
|
|
|
906
999
|
..refusal
|
|
907
1000
|
}
|
|
908
1001
|
}
|
|
1002
|
+
|
|
1003
|
+
/// `bytes <first>-<last>/<total>`; a `*` total is no answer.
|
|
1004
|
+
pub(super) fn content_range(header: Option<&str>) -> Option<(u64, u64, u64)> {
|
|
1005
|
+
let (range, total) = header?.trim().strip_prefix("bytes ")?.split_once('/')?;
|
|
1006
|
+
let (first, last) = range.split_once('-')?;
|
|
1007
|
+
Some((
|
|
1008
|
+
first.trim().parse().ok()?,
|
|
1009
|
+
last.trim().parse().ok()?,
|
|
1010
|
+
total.trim().parse().ok()?,
|
|
1011
|
+
))
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
/// How one source object is asked for: requests in flight, and one request's bytes.
|
|
1015
|
+
#[derive(Debug, Clone, Copy)]
|
|
1016
|
+
pub struct Ranged {
|
|
1017
|
+
pub streams: usize,
|
|
1018
|
+
pub part: u64,
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
impl Default for Ranged {
|
|
1022
|
+
fn default() -> Ranged {
|
|
1023
|
+
Ranged {
|
|
1024
|
+
streams: STREAMS,
|
|
1025
|
+
part: PART_BYTES,
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
/// One granted object from a URL the caller holds, through the pull's downloader. Nothing
|
|
1031
|
+
/// re-authorizes the URL: an origin that refuses it ends the fetch. A fetch that fails
|
|
1032
|
+
/// stops `ledger` with it.
|
|
1033
|
+
#[allow(clippy::too_many_arguments)]
|
|
1034
|
+
pub fn fetch_ranged(
|
|
1035
|
+
store: &Store,
|
|
1036
|
+
grant: &DeliveryGrant,
|
|
1037
|
+
url: &str,
|
|
1038
|
+
policy: &SourcePolicy,
|
|
1039
|
+
credential: &dyn CredentialProvider,
|
|
1040
|
+
deadline: Deadline,
|
|
1041
|
+
ledger: &Ledger,
|
|
1042
|
+
ranged: Ranged,
|
|
1043
|
+
observer: Option<&mut dyn FetchObserver>,
|
|
1044
|
+
) -> Result<Fetched> {
|
|
1045
|
+
let urls = BTreeMap::from([(grant.object.sha256.clone(), url.to_string())]);
|
|
1046
|
+
let outcome = Download {
|
|
1047
|
+
store,
|
|
1048
|
+
wanted: std::slice::from_ref(&grant.object),
|
|
1049
|
+
grant: &|_| Ok(grant.clone()),
|
|
1050
|
+
urls: &urls,
|
|
1051
|
+
chunk: ranged.part.clamp(1 << 20, 1 << 30),
|
|
1052
|
+
ranged: false,
|
|
1053
|
+
policy,
|
|
1054
|
+
credential,
|
|
1055
|
+
deadline,
|
|
1056
|
+
ledger,
|
|
1057
|
+
on_object: None,
|
|
1058
|
+
backfill: None,
|
|
1059
|
+
}
|
|
1060
|
+
.run(ranged.streams.clamp(1, 64), observer)?;
|
|
1061
|
+
Ok(Fetched {
|
|
1062
|
+
object: grant.object.clone(),
|
|
1063
|
+
transferred: outcome.bytes_moved,
|
|
1064
|
+
})
|
|
1065
|
+
}
|