1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//! Trait surface for paradigm-specific partial bodies.
//!
//! `vernier-partial` owns the wire envelope (magic, version, CRC,
//! header) and the partition + rank-collision policy; each paradigm
//! crate owns its body type and its merge accumulator. The traits
//! here are the seam.
//!
//! Encode and decode are routed through [`crate::envelope::encode`]
//! and [`crate::envelope::with_validated_envelope`] respectively, both
//! of which take the body archive bytes as already-rkyv-archived
//! `&[u8]` so this crate never touches paradigm-specific rkyv
//! generics.
/// Paradigm discriminator carried in the wire envelope header.
///
/// Stable u8 values: load-bearing across the format-version boundary
/// because cross-paradigm partials are rejected by integer compare on
/// this byte (see [`crate::error::PartialFormatErrorKind::ParadigmMismatch`]).
/// Receiving rank's expectation of what a partial should look like.
/// Each paradigm builds one from its own (dataset, params, parity_mode,
/// evaluator config) and passes it to [`crate::envelope::with_validated_envelope`].
///
/// Validation is paradigm-agnostic byte compare except for
/// `shape_fingerprint`, where the receiver supplies its own values
/// and the four-slot interpretation is paradigm-specific (instance:
/// `(n_categories, n_area_ranges, n_images, retain_iou)`; semantic:
/// `(n_classes, 0, n_images, 0)`; panoptic: `(n_categories, 0,
/// n_images, things_stuff_split)`).
/// Marker trait declaring the paradigm a partial body type belongs to.
/// Each paradigm crate implements this on its `WirePartialBody` (or
/// equivalent) wire-form struct.
///
/// The trait does not carry rkyv bounds because each paradigm is
/// responsible for its own body archive — `vernier-partial` only
/// transports already-archived body bytes.