unilab.utils.sim2sim¶
Cross-backend sim2sim contract snapshot and resolution.
Functions
|
Extract the contract fields from a resolved training config keyed by dotted path. |
|
Re-raise a tensor shape mismatch during checkpoint load as a sim2sim diagnostic. |
|
Validate a target play config against the source training contract. |
Exceptions
Raised when a target play config diverges from the source training contract. |
- exception unilab.utils.sim2sim.CrossBackendIncompatibleError[source]¶
Bases:
RuntimeErrorRaised when a target play config diverges from the source training contract.
- unilab.utils.sim2sim.extract_contract_snapshot(full_cfg)[source]¶
Extract the contract fields from a resolved training config keyed by dotted path.
- unilab.utils.sim2sim.resolve_sim2sim_config(source_run_dir, target_cfg, *, algo_name=None, strict=True)[source]¶
Validate a target play config against the source training contract.
Returns
Noneifsource_run_dirisNone(an explicit “no source run” play); otherwise returnstarget_cfgunchanged (never mutated). RaisesCrossBackendIncompatibleErrorunderstrictwhen any DENYLIST field differs, including asymmetric presence forENV_STRUCTURAL_DENYLISTpaths. A source run whose contract snapshot is missing, malformed, or uses keys outside the current schema fails closed with the same error regardless ofstrict.