tensorfs 0.1.2__tar.gz → 0.2.0__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.
- {tensorfs-0.1.2 → tensorfs-0.2.0}/Cargo.lock +2 -2
- {tensorfs-0.1.2 → tensorfs-0.2.0}/Cargo.toml +1 -1
- {tensorfs-0.1.2 → tensorfs-0.2.0}/PKG-INFO +1 -1
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/bin/tfs/ckpt.rs +19 -38
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/bin/tfs/ingest.rs +23 -44
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/bin/tfs/layout.rs +3 -34
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/bin/tfs/main.rs +115 -112
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/bin/tfs/repo.rs +47 -259
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/bin/tfs/snap.rs +0 -10
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/canon.rs +1 -1
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/catalog.rs +97 -19
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/cbor.rs +15 -17
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/checkpoint.rs +8 -49
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/corpus.rs +18 -26
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/derived.rs +91 -309
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/fetch.rs +10 -14
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/fit.rs +11 -45
- tensorfs-0.2.0/crates/tensorfs-core/src/gc.rs +214 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/header.rs +84 -210
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/ids.rs +0 -32
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/ingest/fingerprint.rs +24 -21
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/ingest/mod.rs +7 -7
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/ingest/source.rs +19 -200
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/ingest/stamp.rs +18 -12
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/ingest/transaction.rs +3 -48
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/jcs.rs +2 -2
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/lib.rs +1 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/machine.rs +4 -36
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/repository.rs +14 -588
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/storage.rs +49 -306
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/store.rs +7 -126
- tensorfs-0.2.0/crates/tensorfs-core/tests/fixtures/repo_apply/expected_list.jsonl +1 -0
- tensorfs-0.2.0/crates/tensorfs-core/tests/fixtures/repo_apply/expected_repository.json +1 -0
- tensorfs-0.2.0/crates/tensorfs-core/tests/fixtures/repo_apply/expected_rows.jsonl +3 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/tests/grade.rs +7 -1
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/tests/repo_store.rs +32 -403
- tensorfs-0.2.0/crates/tensorfs-core/tests/tensor_schema.rs +70 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-py/src/docs.rs +2 -75
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-py/src/lib.rs +1 -5
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-py/src/store.rs +41 -65
- {tensorfs-0.1.2 → tensorfs-0.2.0}/pyproject.toml +1 -1
- {tensorfs-0.1.2 → tensorfs-0.2.0}/python/tensorfs/__init__.py +2 -10
- tensorfs-0.1.2/crates/tensorfs-core/tests/fixtures/repo_apply/evidence.json +0 -1
- tensorfs-0.1.2/crates/tensorfs-core/tests/fixtures/repo_apply/expected_list.jsonl +0 -1
- tensorfs-0.1.2/crates/tensorfs-core/tests/fixtures/repo_apply/expected_repository.json +0 -1
- tensorfs-0.1.2/crates/tensorfs-core/tests/fixtures/repo_apply/expected_rows.jsonl +0 -3
- tensorfs-0.1.2/crates/tensorfs-core/tests/topology_projection.rs +0 -378
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/Cargo.toml +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/b64.rs +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/bin/tfs/conform.rs +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/bin/tfs/fetch.rs +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/bin/tfs/rd.rs +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/bin/tfs/watch.rs +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/capability.rs +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/dtype.rs +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/err.rs +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/fill.rs +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/grade.rs +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/ingest/carrier.rs +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/ingest/convert.rs +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/ingest/gguf.rs +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/limits.rs +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/manifest.rs +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/meta.rs +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/project.rs +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/read.rs +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/receipt.rs +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/registry.rs +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/relation.rs +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/sha256.rs +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/spec.rs +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/src/vectors.rs +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/tests/fixtures/repo_apply/blobs.jsonl +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/tests/fixtures/repo_apply/header.cbor +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/tests/fixtures/repo_apply/manifest.json +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/tests/fixtures/repo_apply/mutation.json +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/tests/liveness.rs +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-core/tests/source_plan.rs +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-py/Cargo.toml +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/crates/tensorfs-py/src/errors.rs +0 -0
- {tensorfs-0.1.2 → tensorfs-0.2.0}/python/tensorfs/errors.py +0 -0
|
@@ -249,7 +249,7 @@ checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
|
|
|
249
249
|
|
|
250
250
|
[[package]]
|
|
251
251
|
name = "tensorfs-core"
|
|
252
|
-
version = "0.
|
|
252
|
+
version = "0.2.0"
|
|
253
253
|
dependencies = [
|
|
254
254
|
"fs2",
|
|
255
255
|
"minicbor",
|
|
@@ -258,7 +258,7 @@ dependencies = [
|
|
|
258
258
|
|
|
259
259
|
[[package]]
|
|
260
260
|
name = "tensorfs-py"
|
|
261
|
-
version = "0.
|
|
261
|
+
version = "0.2.0"
|
|
262
262
|
dependencies = [
|
|
263
263
|
"pyo3",
|
|
264
264
|
"tensorfs-core",
|
|
@@ -14,7 +14,7 @@ use std::time::Instant;
|
|
|
14
14
|
use tensorfs_core::checkpoint::{self as ck, build_manifest};
|
|
15
15
|
use tensorfs_core::dtype::Dtype;
|
|
16
16
|
use tensorfs_core::header::{Asset, Body, Closure, Header, Located, Part, Tensor};
|
|
17
|
-
use tensorfs_core::ids::
|
|
17
|
+
use tensorfs_core::ids::ObjectRef;
|
|
18
18
|
use tensorfs_core::limits;
|
|
19
19
|
use tensorfs_core::registry;
|
|
20
20
|
use tensorfs_core::relation::Carrier;
|
|
@@ -262,8 +262,7 @@ pub fn cmd_write(root: &Path, f: &Flags) -> ExitCode {
|
|
|
262
262
|
};
|
|
263
263
|
let items = plan(blocks, scale, encoding);
|
|
264
264
|
|
|
265
|
-
// The closure first
|
|
266
|
-
// header commits them BY REFERENCE.
|
|
265
|
+
// The encoding closure first. Construction configs are canonical bytes inside the header.
|
|
267
266
|
let mut aliases: Vec<&'static str> = items.iter().map(|i| i.alias).collect();
|
|
268
267
|
aliases.sort_unstable();
|
|
269
268
|
aliases.dedup();
|
|
@@ -278,28 +277,19 @@ pub fn cmd_write(root: &Path, f: &Flags) -> ExitCode {
|
|
|
278
277
|
|
|
279
278
|
// --no-configs is the TENSORS-ONLY shape: one header plus its closure, zero sibling
|
|
280
279
|
// assets. The manifest id derives once from the virtual tree.
|
|
281
|
-
let mut
|
|
280
|
+
let mut inline_configs = Vec::new();
|
|
282
281
|
let cfgs = if flag_on(f, "no-configs") {
|
|
283
282
|
Vec::new()
|
|
284
283
|
} else {
|
|
285
284
|
configs()
|
|
286
285
|
};
|
|
287
286
|
for (name, bytes) in cfgs {
|
|
288
|
-
|
|
289
|
-
&mut &bytes[..],
|
|
290
|
-
Some(&ObjectRef::of(bytes)),
|
|
291
|
-
&Default::default()
|
|
292
|
-
));
|
|
293
|
-
cfg_refs.push((
|
|
287
|
+
inline_configs.push((
|
|
294
288
|
name.to_string(),
|
|
295
|
-
|
|
296
|
-
sha256: put.obj.sha256,
|
|
297
|
-
length: put.obj.length,
|
|
298
|
-
media_type: "application/json".to_string(),
|
|
299
|
-
},
|
|
289
|
+
ok!(tensorfs_core::header::canonical_config("config", bytes)),
|
|
300
290
|
));
|
|
301
291
|
}
|
|
302
|
-
|
|
292
|
+
inline_configs.sort_by(|a, b| a.0.cmp(&b.0));
|
|
303
293
|
let asset_bytes = b"<pad>0</pad>\n<pad>1</pad>\n";
|
|
304
294
|
let asset_object = ok!(store.put_stream(
|
|
305
295
|
&mut &asset_bytes[..],
|
|
@@ -358,7 +348,7 @@ pub fn cmd_write(root: &Path, f: &Flags) -> ExitCode {
|
|
|
358
348
|
let write_s = t0.elapsed().as_secs_f64();
|
|
359
349
|
|
|
360
350
|
let header = Header {
|
|
361
|
-
configs:
|
|
351
|
+
configs: inline_configs,
|
|
362
352
|
assets,
|
|
363
353
|
encodings,
|
|
364
354
|
components: comps,
|
|
@@ -377,7 +367,7 @@ pub fn cmd_write(root: &Path, f: &Flags) -> ExitCode {
|
|
|
377
367
|
println!("checkpoint written to {}", root.display());
|
|
378
368
|
println!(" header_digest {}", href.id());
|
|
379
369
|
println!(" manifest_id {}", sref.id());
|
|
380
|
-
println!("
|
|
370
|
+
println!(" tensor_schema_digest {}", header.tensor_schema_digest());
|
|
381
371
|
println!(
|
|
382
372
|
" components {} tensors {} parts {} segments {} inline {}",
|
|
383
373
|
header.components.len(),
|
|
@@ -549,17 +539,8 @@ pub fn cmd_info(root: &Path, hex: &str) -> ExitCode {
|
|
|
549
539
|
let (store, href) = opened!(root, hex);
|
|
550
540
|
let header = ok!(ck::load_header(&store, &href));
|
|
551
541
|
println!("header {} ({} B)", href.id(), href.length);
|
|
552
|
-
let digests = ok!(ck::digests(&store, &header));
|
|
553
|
-
println!("topology_digest {}", digests.topology_digest);
|
|
554
|
-
println!("shape_digest {}", digests.shape_digest);
|
|
555
|
-
if let Some(config) = &digests.config_digest {
|
|
556
|
-
println!("config_digest {config}");
|
|
557
|
-
}
|
|
558
542
|
for (name, c) in &header.configs {
|
|
559
|
-
println!(
|
|
560
|
-
"config {name:<14} sha256:{} {} B {}",
|
|
561
|
-
c.sha256, c.length, c.media_type
|
|
562
|
-
);
|
|
543
|
+
println!("config {name:<14} {} inline B", c.len());
|
|
563
544
|
}
|
|
564
545
|
for r in &header.encodings {
|
|
565
546
|
println!("encoding {} (inlined)", r.object_id());
|
|
@@ -863,7 +844,7 @@ pub fn cmd_size(n: usize) -> ExitCode {
|
|
|
863
844
|
println!(
|
|
864
845
|
" encode {encode_ms:.1} ms strict parse {parse_ms:.1} ms validate {validate_ms:.1} ms"
|
|
865
846
|
);
|
|
866
|
-
println!("
|
|
847
|
+
println!(" tensor_schema_digest {}", parsed.tensor_schema_digest());
|
|
867
848
|
println!(" peak RSS {:.1} MiB", rss_kb("VmHWM") as f64 / 1024.0);
|
|
868
849
|
ExitCode::SUCCESS
|
|
869
850
|
}
|
|
@@ -879,10 +860,10 @@ mod tests {
|
|
|
879
860
|
use super::*;
|
|
880
861
|
|
|
881
862
|
static NEXT_ROOT: AtomicU64 = AtomicU64::new(0);
|
|
882
|
-
const
|
|
883
|
-
"sha256:
|
|
884
|
-
const
|
|
885
|
-
"sha256:
|
|
863
|
+
const SCALED_SCHEMA: &str =
|
|
864
|
+
"sha256:b4cce0c745fe5bb0535827572791c37195c982e21b5d5fe9b30a9b2446bc8ea2";
|
|
865
|
+
const FULL_SCHEMA: &str =
|
|
866
|
+
"sha256:61e69d1fcc565583e90560cf0282f42a18d3cc65462a6a17eee5f69c64b0a6ba";
|
|
886
867
|
const MIXED_BLOCK_ORDER: [&str; 5] = [
|
|
887
868
|
"blocks.0.attn1.to_q.weight",
|
|
888
869
|
"blocks.0.attn1.to_out.0.weight",
|
|
@@ -1017,7 +998,7 @@ mod tests {
|
|
|
1017
998
|
.iter()
|
|
1018
999
|
.all(|item| item.alias == "plain/1"));
|
|
1019
1000
|
let full_plain = plan(12, 1, PlanEncoding::Plain);
|
|
1020
|
-
let
|
|
1001
|
+
let schema = tensorfs_core::header::tensor_schema_value(full_plain.iter().map(|item| {
|
|
1021
1002
|
(
|
|
1022
1003
|
item.comp,
|
|
1023
1004
|
item.key.as_str(),
|
|
@@ -1026,8 +1007,8 @@ mod tests {
|
|
|
1026
1007
|
)
|
|
1027
1008
|
}));
|
|
1028
1009
|
assert_eq!(
|
|
1029
|
-
tensorfs_core::header::
|
|
1030
|
-
|
|
1010
|
+
tensorfs_core::header::tensor_schema_digest_of(&schema),
|
|
1011
|
+
FULL_SCHEMA
|
|
1031
1012
|
);
|
|
1032
1013
|
}
|
|
1033
1014
|
|
|
@@ -1063,7 +1044,7 @@ mod tests {
|
|
|
1063
1044
|
assert_eq!(ids, closure_ids);
|
|
1064
1045
|
assert!(ids.contains(®istry_seed("plain/1").spec.object_id()));
|
|
1065
1046
|
assert_eq!(component_keys(&header, "unet"), MIXED_BLOCK_ORDER);
|
|
1066
|
-
assert_eq!(header.
|
|
1047
|
+
assert_eq!(header.tensor_schema_digest(), SCALED_SCHEMA);
|
|
1067
1048
|
}
|
|
1068
1049
|
|
|
1069
1050
|
#[test]
|
|
@@ -1090,7 +1071,7 @@ mod tests {
|
|
|
1090
1071
|
.tensors()
|
|
1091
1072
|
.all(|(_, _, tensor)| tensor.parts.len() == 1 && tensor.parts[0].0 == "value"));
|
|
1092
1073
|
assert_eq!(component_keys(&header, "unet"), PLAIN_BLOCK_ORDER);
|
|
1093
|
-
assert_eq!(header.
|
|
1074
|
+
assert_eq!(header.tensor_schema_digest(), SCALED_SCHEMA);
|
|
1094
1075
|
assert_eq!(cmd_read(&root.0, &href.sha256, &flags), ExitCode::SUCCESS);
|
|
1095
1076
|
}
|
|
1096
1077
|
}
|
|
@@ -29,8 +29,8 @@ use tensorfs_core::canon::{self, as_arr, as_str, Fields, Value};
|
|
|
29
29
|
use tensorfs_core::checkpoint as ck;
|
|
30
30
|
use tensorfs_core::dtype::Dtype;
|
|
31
31
|
use tensorfs_core::err::Code;
|
|
32
|
-
use tensorfs_core::header::
|
|
33
|
-
use tensorfs_core::ids::{
|
|
32
|
+
use tensorfs_core::header::tensor_schema_digest_of;
|
|
33
|
+
use tensorfs_core::ids::{ObjectRef, Plain};
|
|
34
34
|
use tensorfs_core::ingest::carrier::{self, SourceHeader};
|
|
35
35
|
use tensorfs_core::ingest::convert::{self, Class, Effect, Rekey, Source, Target};
|
|
36
36
|
use tensorfs_core::ingest::fingerprint::{
|
|
@@ -42,7 +42,6 @@ use tensorfs_core::ingest::stamp::{self, Stamp};
|
|
|
42
42
|
use tensorfs_core::ingest::transaction::{self as tx};
|
|
43
43
|
use tensorfs_core::ingest::{Evidence, IngestProfile, IngestSubject, IngestVerificationReceipt};
|
|
44
44
|
use tensorfs_core::limits;
|
|
45
|
-
use tensorfs_core::manifest::{Draft, Entry};
|
|
46
45
|
use tensorfs_core::registry;
|
|
47
46
|
use tensorfs_core::store::{Progress, Store};
|
|
48
47
|
|
|
@@ -340,7 +339,7 @@ pub fn cmd_inspect(f: &Flags) -> ExitCode {
|
|
|
340
339
|
println!(" dtypes {}", dt.join(" · "));
|
|
341
340
|
println!(" declared {} B of tensor bytes", h.declared_bytes());
|
|
342
341
|
println!(" keyset {}", fp.keyset_digest);
|
|
343
|
-
println!("
|
|
342
|
+
println!(" tensor schema {}", fp.tensor_schema_digest);
|
|
344
343
|
println!(" source {}", source_core::source_digest(&h, &raw));
|
|
345
344
|
if !stamps.is_empty() {
|
|
346
345
|
for (k, v) in &stamps {
|
|
@@ -436,7 +435,7 @@ pub fn cmd_bank(dialect: &str, converter: &str, f: &Flags) -> ExitCode {
|
|
|
436
435
|
dialect: dialect.to_string(),
|
|
437
436
|
component: component.clone(),
|
|
438
437
|
converter: converter.to_string(),
|
|
439
|
-
|
|
438
|
+
tensor_schema_digest: fp.tensor_schema_digest.clone(),
|
|
440
439
|
logical_keys: fp.logical_keys as u64,
|
|
441
440
|
provenance: Provenance {
|
|
442
441
|
kind: REAL.to_string(),
|
|
@@ -454,7 +453,7 @@ pub fn cmd_bank(dialect: &str, converter: &str, f: &Flags) -> ExitCode {
|
|
|
454
453
|
});
|
|
455
454
|
println!(
|
|
456
455
|
"banked {component} {} {}",
|
|
457
|
-
fp.keyset_digest, fp.
|
|
456
|
+
fp.keyset_digest, fp.tensor_schema_digest
|
|
458
457
|
);
|
|
459
458
|
reviewed.push((component.clone(), fp.keyset_digest));
|
|
460
459
|
}
|
|
@@ -991,8 +990,8 @@ fn print_plan(p: &Prepared) {
|
|
|
991
990
|
Err(e) => println!("declared REFUSED {}: {}", e.code.as_str(), e.detail),
|
|
992
991
|
}
|
|
993
992
|
println!(
|
|
994
|
-
"
|
|
995
|
-
|
|
993
|
+
"tensor schema {}",
|
|
994
|
+
tensor_schema_digest_of(&source_core::plan_tensor_schema(pl))
|
|
996
995
|
);
|
|
997
996
|
println!(
|
|
998
997
|
"cost {} B of headers read, {} tensor bytes read",
|
|
@@ -1291,8 +1290,8 @@ pub fn cmd_worker(root: &Path, target: &str, f: &Flags) -> ExitCode {
|
|
|
1291
1290
|
// The root goes down FIRST. From this line on the session is reapable whatever happens.
|
|
1292
1291
|
let (mut ingest_root, _operation_writer) = ok!(tx::open_root(&store, &session, &tenant));
|
|
1293
1292
|
|
|
1294
|
-
// Configs
|
|
1295
|
-
let mut configs
|
|
1293
|
+
// Configs become canonical JSON bytes inside the CozyTensors header.
|
|
1294
|
+
let mut configs = Vec::new();
|
|
1296
1295
|
for (k, v) in f.iter() {
|
|
1297
1296
|
if k != "config" {
|
|
1298
1297
|
continue;
|
|
@@ -1311,19 +1310,9 @@ pub fn cmd_worker(root: &Path, target: &str, f: &Flags) -> ExitCode {
|
|
|
1311
1310
|
return ExitCode::FAILURE;
|
|
1312
1311
|
}
|
|
1313
1312
|
};
|
|
1314
|
-
let put = ok!(store.put_stream_held(
|
|
1315
|
-
&mut bytes.as_slice(),
|
|
1316
|
-
Some(&ObjectRef::of(&bytes)),
|
|
1317
|
-
&Default::default(),
|
|
1318
|
-
Some(&session),
|
|
1319
|
-
));
|
|
1320
1313
|
configs.push((
|
|
1321
1314
|
name.to_string(),
|
|
1322
|
-
|
|
1323
|
-
sha256: put.obj.sha256,
|
|
1324
|
-
length: put.obj.length,
|
|
1325
|
-
media_type: "application/json".to_string(),
|
|
1326
|
-
},
|
|
1315
|
+
ok!(tensorfs_core::header::canonical_config("config", &bytes)),
|
|
1327
1316
|
));
|
|
1328
1317
|
}
|
|
1329
1318
|
configs.sort_by(|a, b| a.0.cmp(&b.0));
|
|
@@ -1333,7 +1322,7 @@ pub fn cmd_worker(root: &Path, target: &str, f: &Flags) -> ExitCode {
|
|
|
1333
1322
|
let golden = ok!(source_core::golden_suite(p.conv));
|
|
1334
1323
|
println!("golden {golden} cases reassembled bit-for-bit");
|
|
1335
1324
|
|
|
1336
|
-
let predicted =
|
|
1325
|
+
let predicted = tensor_schema_digest_of(&source_core::plan_tensor_schema(&p.plan));
|
|
1337
1326
|
// Qualification fixtures are build data, not model-store objects.
|
|
1338
1327
|
for (_, seed) in &p.seeds {
|
|
1339
1328
|
if let Some(v) = &seed.vectors {
|
|
@@ -1348,11 +1337,11 @@ pub fn cmd_worker(root: &Path, target: &str, f: &Flags) -> ExitCode {
|
|
|
1348
1337
|
&configs,
|
|
1349
1338
|
&session,
|
|
1350
1339
|
));
|
|
1351
|
-
let got = out.header.
|
|
1340
|
+
let got = out.header.tensor_schema_digest();
|
|
1352
1341
|
if got != predicted {
|
|
1353
1342
|
eprintln!(
|
|
1354
|
-
"REFUSED TOPOLOGY_MISMATCH: the plan predicted {predicted} and
|
|
1355
|
-
header projects {got} — the preview and the run disagree"
|
|
1343
|
+
"REFUSED TOPOLOGY_MISMATCH: the plan predicted tensor schema {predicted} and \
|
|
1344
|
+
the written header projects {got} — the preview and the run disagree"
|
|
1356
1345
|
);
|
|
1357
1346
|
return ExitCode::FAILURE;
|
|
1358
1347
|
}
|
|
@@ -1401,7 +1390,7 @@ pub fn cmd_worker(root: &Path, target: &str, f: &Flags) -> ExitCode {
|
|
|
1401
1390
|
source_dialect: p.conv.dialect.to_string(),
|
|
1402
1391
|
converter_build: build.clone(),
|
|
1403
1392
|
converter_recipe: recipe.clone(),
|
|
1404
|
-
|
|
1393
|
+
expected_tensor_schema_digest: predicted.clone(),
|
|
1405
1394
|
allowed_encodings: {
|
|
1406
1395
|
let mut v: Vec<ObjectRef> = p.seeds.iter().map(|(_, s)| s.spec.object_ref()).collect();
|
|
1407
1396
|
v.sort_by(|a, b| a.sha256.cmp(&b.sha256));
|
|
@@ -1414,15 +1403,6 @@ pub fn cmd_worker(root: &Path, target: &str, f: &Flags) -> ExitCode {
|
|
|
1414
1403
|
ok!(profile.validate(®istry::platform_digests()));
|
|
1415
1404
|
let profile_ref = profile.object_ref();
|
|
1416
1405
|
|
|
1417
|
-
let mut manifest = Draft::of(&out.manifest);
|
|
1418
|
-
manifest.entries.push((
|
|
1419
|
-
"evidence/converter-recipe".to_string(),
|
|
1420
|
-
Entry::File(recipe.clone()),
|
|
1421
|
-
));
|
|
1422
|
-
manifest.entries.sort_by(|left, right| left.0.cmp(&right.0));
|
|
1423
|
-
out.manifest = ok!(manifest.seal());
|
|
1424
|
-
out.manifest_ref = ok!(store.put_manifest_held(&out.manifest, Some(&session))).obj;
|
|
1425
|
-
|
|
1426
1406
|
let subject = IngestSubject {
|
|
1427
1407
|
profile: profile_ref,
|
|
1428
1408
|
tenant: tenant.clone(),
|
|
@@ -1521,7 +1501,7 @@ pub fn cmd_worker(root: &Path, target: &str, f: &Flags) -> ExitCode {
|
|
|
1521
1501
|
println!("candidate header {}", out.header_ref.id());
|
|
1522
1502
|
println!("candidate manifest {}", out.manifest_ref.id());
|
|
1523
1503
|
println!("stamp {}", stamp_ref.id());
|
|
1524
|
-
println!("
|
|
1504
|
+
println!(" tensor schema {}", stamped.stamp.tensor_schema_digest);
|
|
1525
1505
|
println!(" candidates {}", stamped.stamp.candidate_set);
|
|
1526
1506
|
println!(" golden {}", stamped.stamp.golden);
|
|
1527
1507
|
println!("receipt {}", receipt_ref.id());
|
|
@@ -1685,7 +1665,7 @@ pub fn cmd_install(
|
|
|
1685
1665
|
let receipt = ok!(IngestVerificationReceipt::parse(&rb));
|
|
1686
1666
|
let subject = ok!(IngestSubject::parse(&sb));
|
|
1687
1667
|
let stamp_doc = ok!(Stamp::parse(&tb));
|
|
1688
|
-
let
|
|
1668
|
+
let _profile = ok!(IngestProfile::parse(&pb));
|
|
1689
1669
|
let snap = ok!(ck::load_manifest(&store, &receipt.manifest));
|
|
1690
1670
|
let header = ok!(ck::load_header(&store, &receipt.header));
|
|
1691
1671
|
let repo = ok!(tensorfs_core::repository::RepositoryName::new(org, name));
|
|
@@ -1704,12 +1684,9 @@ pub fn cmd_install(
|
|
|
1704
1684
|
manifest: &snap,
|
|
1705
1685
|
header: &header,
|
|
1706
1686
|
stamp: &stamp_doc,
|
|
1707
|
-
profile: &profile,
|
|
1708
1687
|
repo,
|
|
1709
1688
|
version,
|
|
1710
1689
|
lane,
|
|
1711
|
-
source_uri: flag(flags, "source-uri"),
|
|
1712
|
-
declared_license: flag(flags, "declared-license"),
|
|
1713
1690
|
observed_repository: flag(flags, "observed"),
|
|
1714
1691
|
},
|
|
1715
1692
|
));
|
|
@@ -1906,7 +1883,9 @@ pub fn cmd_restamp(root: &Path, session: &str, flags: &Flags) -> ExitCode {
|
|
|
1906
1883
|
let plant = flag(flags, "plant").unwrap_or("");
|
|
1907
1884
|
match plant {
|
|
1908
1885
|
"" => {}
|
|
1909
|
-
"
|
|
1886
|
+
"tensor-schema" => {
|
|
1887
|
+
profile.expected_tensor_schema_digest = tensorfs_core::ids::object_id(b"other")
|
|
1888
|
+
}
|
|
1910
1889
|
"candidate" => {
|
|
1911
1890
|
subject.candidates.pop();
|
|
1912
1891
|
}
|
|
@@ -1936,7 +1915,7 @@ pub fn cmd_restamp(root: &Path, session: &str, flags: &Flags) -> ExitCode {
|
|
|
1936
1915
|
// any of its contents are read. This plant proves that binding on its own.
|
|
1937
1916
|
"profile-bytes" => profile.max_tensors += 1,
|
|
1938
1917
|
"structure" => {
|
|
1939
|
-
// One tensor's logical shape moved: the header no longer projects the
|
|
1918
|
+
// One tensor's logical shape moved: the header no longer projects the tensor schema
|
|
1940
1919
|
// the profile pinned, and the manifest no longer describes what is in the store.
|
|
1941
1920
|
if let Some((_, ts)) = out.header.components.first_mut() {
|
|
1942
1921
|
if let Some((_, t)) = ts.first_mut() {
|
|
@@ -1957,7 +1936,7 @@ pub fn cmd_restamp(root: &Path, session: &str, flags: &Flags) -> ExitCode {
|
|
|
1957
1936
|
// `profile-bytes` plant is the one that deliberately does not, and proves the binding.
|
|
1958
1937
|
if matches!(
|
|
1959
1938
|
plant,
|
|
1960
|
-
"
|
|
1939
|
+
"tensor-schema" | "encoding" | "quota-tensors" | "quota-bytes"
|
|
1961
1940
|
) {
|
|
1962
1941
|
subject.profile = profile.object_ref();
|
|
1963
1942
|
}
|
|
@@ -1977,7 +1956,7 @@ pub fn cmd_restamp(root: &Path, session: &str, flags: &Flags) -> ExitCode {
|
|
|
1977
1956
|
}
|
|
1978
1957
|
));
|
|
1979
1958
|
println!("restamped {}", stamped.stamp.object_id());
|
|
1980
|
-
println!("
|
|
1959
|
+
println!(" tensor schema {}", stamped.stamp.tensor_schema_digest);
|
|
1981
1960
|
println!(" candidates {}", stamped.stamp.candidate_set);
|
|
1982
1961
|
println!("receipt {}", stamped.receipt.object_id());
|
|
1983
1962
|
if stamped.receipt.object_id() == receipt.object_id() {
|
|
@@ -77,8 +77,7 @@ pub fn cmd_topology(root: &Path, hex: &str, flags: &Flags) -> ExitCode {
|
|
|
77
77
|
emit(&code, flags);
|
|
78
78
|
println!("contract {}", code.contract);
|
|
79
79
|
println!("tensors {}", code.count());
|
|
80
|
-
println!("
|
|
81
|
-
println!("shape {}", code.shape_digest());
|
|
80
|
+
println!("tensor schema {}", code.tensor_schema_digest());
|
|
82
81
|
ExitCode::SUCCESS
|
|
83
82
|
}
|
|
84
83
|
|
|
@@ -170,16 +169,6 @@ pub fn cmd_fit(code_p: &Path, root: &Path, header_arg: &str, flags: &Flags) -> E
|
|
|
170
169
|
println!("fit {}", verdict.code());
|
|
171
170
|
println!("detail {}", verdict.text());
|
|
172
171
|
println!("custody {}", custody.name());
|
|
173
|
-
println!(
|
|
174
|
-
"shape code {} / checkpoint {} — {}",
|
|
175
|
-
&code.shape_digest()[7..19],
|
|
176
|
-
&header.shape_digest()[7..19],
|
|
177
|
-
if code.shape_digest() == header.shape_digest() {
|
|
178
|
-
"the fit index HITS"
|
|
179
|
-
} else {
|
|
180
|
-
"index miss; the answer is the walk above"
|
|
181
|
-
}
|
|
182
|
-
);
|
|
183
172
|
if let Fit::Ok { ignored, .. } = &verdict {
|
|
184
173
|
for key in ignored {
|
|
185
174
|
println!("ignored {key}");
|
|
@@ -404,7 +393,7 @@ pub fn cmd_import(rows_p: &Path, flags: &Flags) -> ExitCode {
|
|
|
404
393
|
println!(" logical REAL — keys/dtypes/shapes/roles off pinned upstream header bytes");
|
|
405
394
|
println!(" parts PLACEHOLDER object ids: no weight bytes transit this machine");
|
|
406
395
|
println!("header {}", ok!(header.object_id()));
|
|
407
|
-
println!("
|
|
396
|
+
println!("tensor schema {}", header.tensor_schema_digest());
|
|
408
397
|
println!("code {}", code.object_id());
|
|
409
398
|
for (id, s) in &closure.specs {
|
|
410
399
|
println!(
|
|
@@ -518,7 +507,7 @@ fn emit_bytes(bytes: &[u8], flags: &Flags) {
|
|
|
518
507
|
///
|
|
519
508
|
/// `--json` prints ONE object and nothing else -- the surface a program should read; the
|
|
520
509
|
/// human print below is for people. It is TOTAL: `satisfied`, `depth`, `details`,
|
|
521
|
-
/// `encodings
|
|
510
|
+
/// `encodings` and `report` are present on every answer.
|
|
522
511
|
/// `encodings` is the set the CHECKPOINT carries, and it is here because "these bytes can
|
|
523
512
|
/// be read" and "some card has a qualified implementation for them" are two independent
|
|
524
513
|
/// questions; the second is `tfs capability`, and a caller cannot ask it without knowing
|
|
@@ -572,26 +561,6 @@ pub fn cmd_check(code_p: &Path, header_p: &Path, flags: &Flags) -> ExitCode {
|
|
|
572
561
|
}
|
|
573
562
|
|
|
574
563
|
println!("custody {}", custody.name());
|
|
575
|
-
println!(
|
|
576
|
-
"topology required {} / present {} — {}",
|
|
577
|
-
&report.topology_required[7..19],
|
|
578
|
-
&report.topology_present[7..19],
|
|
579
|
-
if report.topology_required == report.topology_present {
|
|
580
|
-
"the fast-path index HITS (an index, never the decision)"
|
|
581
|
-
} else {
|
|
582
|
-
"index miss; the decision is the document comparison below"
|
|
583
|
-
}
|
|
584
|
-
);
|
|
585
|
-
println!(
|
|
586
|
-
"shape required {} / present {} — {}",
|
|
587
|
-
&report.shape_required[7..19],
|
|
588
|
-
&report.shape_present[7..19],
|
|
589
|
-
if report.shape_required == report.shape_present {
|
|
590
|
-
"same shapes, so any difference is dtype or encoding alone (a search bucket)"
|
|
591
|
-
} else {
|
|
592
|
-
"different shapes: a different model, not a different packaging"
|
|
593
|
-
}
|
|
594
|
-
);
|
|
595
564
|
if out.mismatches.is_empty() {
|
|
596
565
|
println!("verdict Satisfied");
|
|
597
566
|
} else {
|