Migrating from v0.6.x to v0.7¶
v0.7.0a1 is a breaking semantic alpha. The central change is that a single
numeric payload and bottom_mask no longer serve as the source of truth for
semantic bottom, floating faults, observation state, representation validity,
ambiguity, or operational rejection.
Required code changes¶
- Replace
zeroproof.*imports withzeroproofml.*. Compatibility imports warn, remain available through0.8.x, and may be removed in1.0.0. If an environment may contain anotherzeroproofdistribution, callzeroproofml.require_compatibility_namespace()before relying on the old name; it raises when import precedence selects a foreign package. - Use
zeroproofml.scm.sign4for pure real SCM sign. Keep hysteretic routing inprojective.orientationand complex unit phase inprojective.phase; neither changes the algebraic sign result. - At strict boundaries, call
typed_strict_inferenceortyped_strict_inference_tensorand inspect named axes/masks. The legacy projection is deliberately lossy and emits a deprecation warning. - Treat an observed floating
0.0asMachineZeroEvent.ZERO, not proof of an exact denominator zero. Only an exact expression or certificate may produceExactZeroEvidence.PROVEN_ZERO. - Normalize
(P,Q)withnormalize_projective. The canonical gauge uses overflow-safe max scaling, unit L2 norm, and deterministic Q-positive orientation.(0,0)isREPRESENTATION_FAULT. For a vector numerator and one shared denominator, declare the tuple axis withcoordinate_axis=-1; omitted axes retain elementwise scalar-pair behavior. Put the same axis inStrictDecodePolicy, where it is hashed into bundle identity, and pass it tosoft_coverage_loss. Supported shared-denominator models declare their axis forTrainingConfig(projective_coordinate_axis="model"). Custom schema-v3 tuple exporters must additionally declareprojective_denominator_contract="shared_denominator_by_construction_v1"; an axis declaration alone is refused because it cannot become a runtime ONNX equality guard. The exported graph additionally maps any runtime denominator disagreement to a typed representation fault and rejection. - Recalibrate every v0.6 raw-
|Q|threshold. Old thresholds cannot be transferred to the normalized denominator score. Passnumerator=Pto the retained margin/separation helpers on maintained 0.7 paths, and feed the adaptive sampler canonical scores in[0,1]. - Include
resolved_semantic_identity().to_dict()in new checkpoints and artifacts. Resume rejects changes in profile, gauge, decoder, zero, status, or refinement identity. - Pass
SemanticTargetLabelenum members tolift_semantic_targets; v0.7 no longer accepts raw string compatibility labels. - Keep typed projective coordinates real. Complex tensors now fail before float64 promotion instead of silently discarding their imaginary component.
- Treat
SemanticResult.finite(...)as asserted input construction. Floating computation paths use computed constructors and carryResultOriginplus hash-boundExecutionEvidence. Do not copy an operand's bare execution label onto a new result. - Freeze a working
ResultTensorwithfreeze_evidence()before durable serialization, monitoring, reporting, or external handoff. - Pass vector masks only by keyword. Positional mask forms have been removed
from both canonical and compatibility namespaces and now raise
TypeError.
Before and after¶
# v0.6 compatibility result: information is merged
decoded, masked = legacy_decode(...)
# v0.7 typed result: axes remain independent
from zeroproofml.inference import typed_strict_inference
result = typed_strict_inference(3.0, 2.0)
assert result.payload == 1.5
assert result.operational.value == "accept"
A finite result may be censored or rejected while retaining its payload and
algebraic sign. A numerical fault has NO_CORE; it never becomes semantic
bottom. Exact bottom has a present core category but no fake numeric payload.
Bundle and checkpoint compatibility¶
- Bundle schemas v1 and v2 are legacy ONNX contracts. Their explicit reader is retained, but they are never assigned v0.7 semantic identity.
- Bundle schema v3 requires all semantic policy hashes and a fixed-width output
for each result axis.
export_bundle(...)emits this typed ABI by default, embeds the complete decoder policy under its identity hash, records theonnxruntime-cpurefinement profile, and hashes the orderedCPUExecutionProvideroptions contract. The Python loader reconstructsResultTensorand refuses provider/order/options mismatch or unrecorded session options. Other providers and runtimes remain unqualified. - Scalar result schema v2 serializes origin plus complete execution evidence.
Strict
from_dictrejects schema v1; usefrom_legacy_dictexplicitly, which producesDESERIALIZED_LEGACYwithout synthesized qualification. Tensor evidence uses canonicalResultTensorSnapshotserialization. - Checkpoint schema v4 carries semantic identity, strict resume/component
identity, named profile, and required RNG/sampler state. Legacy checkpoints
are labelled
legacy-unqualified; they cannot silently qualify as v0.7 claim-bearing artifacts. - Untrusted checkpoint entry points require PyTorch 2.10.0 or newer and fail closed below that floor. The warned trusted loader is only for artifacts whose producer and custody are trusted.
validate_bundle_descriptor(...)is strict by default. Legacy inspection requires the explicitly named legacy reader/flag and returns unverified status rather than silently accepting missing integrity metadata.
Downstream migration checklist¶
- [ ] canonical imports use
zeroproofml.*; - [ ] bottom, fault, invalid observation, rejection, and representation fault have separate handling;
- [ ] exact-zero evidence is sourced from an exact expression/certificate;
- [ ] projective thresholds are recalibrated under the v1 canonical gauge;
- [ ] resume and artifact loaders verify semantic hashes;
- [ ] legacy bundle support is explicitly labelled;
- [ ] deployment claims remain disabled until the required runtime is qualified.
- [ ] working result tensors are frozen before durable evidence boundaries;
- [ ] checkpoint callers select an explicit named resume profile and meet its preconditions;
- [ ] old result/checkpoint records use explicit unqualified compatibility readers.