diffpes.certify tests

Validation and regression tests for diffpes.certify.

Validate deterministic canonical scientific records.

The tests cover public behavior, differentiability, validation, and stable scientific identity in the supported certification regime.

class tests.test_diffpes.test_certify.test_canonical.TestCanonicalPytree[source]

Bases: object

Verify canonical_pytree().

The cases cover the public behavior in the supported certification regime.

See:

canonical_pytree()

test_record_is_stable() None[source]

Verify equal typed values produce identical canonical bytes.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

Encodes the same nested value twice and compares exact bytes.

Return type:

None

test_numpy_and_jax_arrays_have_identical_canonical_bytes() None[source]

Treat equal concrete NumPy and JAX arrays as one normalized content.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_array_canonicalization_retains_dtype_shape_and_complex_values() None[source]

Keep numerical layout semantics and canonical complex bytes distinct.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_canonical_record_is_stable_in_a_fresh_process() None[source]

Keep canonical content stable across independent Python processes.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_nonfinite_values_are_rejected(value: Any) None[source]

Exclude unstable NaN and infinity encodings from scientific records.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_canonical.TestCanonicalJson[source]

Bases: object

Verify canonical_json().

The cases cover the public behavior in the supported certification regime.

See:

canonical_json()

test_canonical_json_golden_record_and_mapping_order() None[source]

Pin typed scalars, NFC text, and deterministic mapping order.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_canonical_json_distinguishes_list_tuple_null_and_absent() None[source]

Retain meaning-bearing container and presence distinctions.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_canonical_text_normalizes_unicode_and_rejects_key_collision() None[source]

Normalize equivalent text while refusing ambiguous normalized keys.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_canonical.TestIterCanonicalPytreeChunks[source]

Bases: object

Verify iter_canonical_pytree_chunks().

The cases cover the public behavior in the supported certification regime.

See:

iter_canonical_pytree_chunks()

test_streamed_and_materialized_records_are_identical() None[source]

Make bounded chunks exactly reproduce the full canonical record.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_unsupported_values_and_invalid_chunk_size_are_rejected() None[source]

Keep the canonical vocabulary deliberately closed and bounded.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

Validate the stable pure-JAX certification-check registry.

The tests exercise explicit registration, exact lookup, and deterministic listing without treating registry bookkeeping as a physics result.

class tests.test_diffpes.test_certify.test_checks.TestRegisterCheck[source]

Bases: object

Verify register_check().

The cases cover the public behavior in the supported certification regime.

See:

register_check()

test_registered_check_is_resolved_exactly() None[source]

Verify lookup returns the registered pure JAX predicate.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

Registers one unique identity and evaluates the resolved callable on a scalar JAX input.

Return type:

None

class tests.test_diffpes.test_certify.test_checks.TestGetCheck[source]

Bases: object

Verify get_check().

The cases cover exact lookup and explicit failure for an unknown identity.

See:

get_check()

test_unknown_check_is_rejected() None[source]

Reject an unregistered stable check identity.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_checks.TestListChecks[source]

Bases: object

Verify list_checks().

The cases cover the deterministic order of process-local check identities.

See:

list_checks()

test_registered_checks_are_sorted() None[source]

List registered identities in deterministic lexical order.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

Validate non-security scientific-record checksums.

The tests cover public behavior, differentiability, validation, and stable scientific identity in the supported certification regime.

class tests.test_diffpes.test_certify.test_checksums.TestParseChecksum[source]

Bases: object

Verify parse_checksum().

The cases cover the public behavior in the supported certification regime.

See:

parse_checksum()

test_checksum_round_trip() None[source]

Verify a checksum round-trips through its explicit parser.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test checks algorithm, record kind, and fixed-width CRC32 text.

Return type:

None

test_invalid_checksum_record_is_rejected() None[source]

Refuse incomplete and hand-written checksum forms.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_checksums.TestChecksumChunks[source]

Bases: object

Verify checksum_chunks().

The cases cover the public behavior in the supported certification regime.

See:

checksum_chunks()

test_checksum_is_typed_versioned_and_streaming_stable() None[source]

Record bookkeeping context and remain invariant to chunk boundaries.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_invalid_record_kind_is_rejected(record_kind: Any) None[source]

Reject record labels that make the checksum format ambiguous.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_checksums.TestChecksumBytes[source]

Bases: object

Verify checksum_bytes().

The cases cover the public behavior in the supported certification regime.

See:

checksum_bytes()

test_record_kind_and_one_bit_change_checksum() None[source]

Detect accidental byte disagreement and distinguish record purposes.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_checksums.TestSemanticChecksum[source]

Bases: object

Verify semantic_checksum().

The cases cover the public behavior in the supported certification regime.

See:

semantic_checksum()

test_semantic_and_numerical_declarations_affect_identity() None[source]

Distinguish equal arrays with different units or precision contracts.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_checksums.TestChecksumPytree[source]

Bases: object

Verify checksum_pytree().

The cases cover the public behavior in the supported certification regime.

See:

checksum_pytree()

test_streaming_pytree_matches_equal_jax_values() None[source]

Produce stable normalized-content bookkeeping for equal carriers.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_checksums.TestArtifactRef[source]

Bases: object

Verify artifact_ref().

The cases cover the public behavior in the supported certification regime.

See:

artifact_ref()

test_artifact_ref_separates_byte_content_and_semantics(tmp_path: Any) None[source]

Record exact source bytes separately from parsed scientific meaning.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_checksums.TestChecksumFile[source]

Bases: object

Verify checksum_file().

The cases cover streaming identity for exact bytes in a local artifact.

See:

checksum_file()

test_file_checksum_matches_byte_checksum(tmp_path: Any) None[source]

Match the checksum of a file with the checksum of its exact bytes.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_checksums.TestResultChecksum[source]

Bases: object

Verify result_checksum().

The cases cover numerical settings that form part of result identity.

See:

result_checksum()

test_numerical_settings_change_result_identity() None[source]

Distinguish equal values produced with different precision settings.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

Validate semantic transformation contracts.

The tests cover public behavior, differentiability, validation, and stable scientific identity in the supported certification regime.

class tests.test_diffpes.test_certify.test_contracts.TestValidateComposition[source]

Bases: object

Verify validate_composition().

The cases cover the public behavior in the supported certification regime.

See:

validate_composition()

test_empty_composition_is_valid() None[source]

Verify an empty pipeline preserves its declared input semantics.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

Composes no transforms and checks the deterministic report directly.

Return type:

None

class tests.test_diffpes.test_certify.test_contracts.TestComposeTransformations[source]

Bases: object

Verify compose_transformations().

The cases cover the public behavior in the supported certification regime.

See:

compose_transformations()

test_composition_propagates_information_loss_and_invalidations() None[source]

Carry explicit semantics and all downstream losses conservatively.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_missing_requirement_is_reported_and_strict_composition_raises() None[source]

Refuse a transformation whose parent semantics do not satisfy it.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_contracts.TestValidateContract[source]

Bases: object

Verify validate_contract().

The cases cover the public behavior in the supported certification regime.

See:

validate_contract()

test_contradictory_contract_is_rejected() None[source]

Reject a property declared both preserved and destroyed.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_contract_identity_and_version_are_validated(identifier: Any, version: Any) None[source]

Require stable reverse-DNS identities and semantic versions.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

Validate JAX-native certification dependency analysis.

The tests cover public behavior, differentiability, validation, and stable scientific identity in the supported certification regime.

class tests.test_diffpes.test_certify.test_dependencies.TestDependencyMap[source]

Bases: object

Verify dependency_map().

The cases cover the public behavior in the supported certification regime.

See:

dependency_map()

test_dependency_map_distinguishes_disconnected_leaf() None[source]

Trace only leaves consumed by the output JAXPR.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_dependencies.TestLinearizedForward[source]

Bases: object

Verify linearized_forward().

The cases cover the public behavior in the supported certification regime.

See:

linearized_forward()

test_linearization_reuses_exact_jvp() None[source]

Retain the linear map of a cubic function.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_dependencies.TestInformationSpectrum[source]

Bases: object

Verify information_spectrum().

The cases cover the public behavior in the supported certification regime.

See:

information_spectrum()

test_information_spectrum_and_gradient() None[source]

Recover and differentiate the singular value of x squared.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_zero_rank_uses_finite_condition_sentinel() None[source]

Represent a zero-information model with a finite condition value.

Zero marks the absence of an active information direction.

Notes

The constant model has a zero Jacobian at every input value.

Return type:

None

class tests.test_diffpes.test_certify.test_dependencies.TestSensitivityMap[source]

Bases: object

Verify sensitivity_map().

The cases cover the public behavior in the supported certification regime.

See:

sensitivity_map()

test_sensitivity_map_has_output_by_input_orientation() None[source]

Store output projections along rows and input probes in columns.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_dependencies.TestClearDependencyCache[source]

Bases: object

Verify clear_dependency_cache().

The case clears all structural entries and all counters.

See:

clear_dependency_cache()

test_clear_removes_entries_and_counters() None[source]

Clear the cache after one structural dependency analysis.

The cache must report no entries, hits, or misses after the clear.

Notes

The test computes one linear dependency map before it clears the cache.

Return type:

None

class tests.test_diffpes.test_certify.test_dependencies.TestDependencyCacheInfo[source]

Bases: object

Verify dependency_cache_info().

The case counts one cache hit for one repeated static model shape.

See:

dependency_cache_info()

test_static_model_shape_has_one_structural_miss() None[source]

Verify one structural miss across two map evaluations.

The repeated model ID, callable, shape, and dtype use one cache entry.

Notes

The test clears the cache and calls the same linear model two times.

Return type:

None

Validate differentiable certification evidence.

The tests cover public behavior, differentiability, validation, and stable scientific identity in the supported certification regime.

class tests.test_diffpes.test_certify.test_evidence.TestEvaluateClaim[source]

Bases: object

Verify evaluate_claim().

The cases cover the public behavior in the supported certification regime.

See:

evaluate_claim()

test_claim_retains_differentiable_margin() None[source]

Differentiate the tolerance margin beneath a Boolean claim.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_evidence.TestEvaluateDomain[source]

Bases: object

Verify evaluate_domain().

The cases cover the public behavior in the supported certification regime.

See:

evaluate_domain()

test_domain_reports_signed_margin() None[source]

Preserve distance to the validity boundary.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_evidence.TestEvaluateEvidence[source]

Bases: object

Verify evaluate_evidence().

The cases cover the public behavior in the supported certification regime.

See:

evaluate_evidence()

test_external_evidence_preserves_residual() None[source]

Record numerical comparison arrays without reducing them.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_evidence.TestDerivativeEvidence[source]

Bases: object

Verify derivative_evidence().

The cases cover the public behavior in the supported certification regime.

See:

derivative_evidence()

test_derivative_evidence_matches_quadratic() None[source]

Compare retained JVPs and VJPs against central differences.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_derivative_evidence_linearizes_once(monkeypatch: MonkeyPatch) None[source]

Reuse one nonlinear linearization for all information probes.

Central differences can rerun the model but cannot linearize it again.

Notes

The wrapper counts calls to the public JAX linearization primitive.

Return type:

None

Validate compiled JAX-native certified execution.

The tests cover public behavior, differentiability, validation, and stable scientific identity in the supported certification regime.

class tests.test_diffpes.test_certify.test_execution.TestVerifyCertificate[source]

Bases: object

Verify verify_certificate().

The cases cover the public behavior in the supported certification regime.

See:

verify_certificate()

test_compiled_quadratic_certificate() None[source]

Produce the correct value, JVP, dependency, and spectrum.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_one_sided_domain_claim_is_internally_consistent() None[source]

Verify a domain claim that uses a signed positive margin.

Domain claims mirror their predicate result instead of a symmetric test.

Notes

The positive-domain residual exceeds its zero comparison tolerance.

Return type:

None

test_changed_claim_residual_is_detected() None[source]

Detect a claim residual that disagrees with measured values.

The policy Boolean remains unchanged in this single-field mutation.

Notes

The test changes only the execution-identity claim residual.

Return type:

None

test_changed_policy_truth_table_is_detected() None[source]

Detect a changed policy vector while claim records stay identical.

Offline verification must compare the complete recomputed truth table.

Notes

The test changes only the stored achieved-level vector.

Return type:

None

test_external_claim_must_match_attached_evidence() None[source]

Detect a self-consistent claim that changes attached evidence.

A claim cannot replace values from its named external evidence record.

Notes

The mutation changes every dependent claim field but leaves evidence intact.

Return type:

None

class tests.test_diffpes.test_certify.test_execution.TestCertifyForward[source]

Bases: object

Verify certify_forward().

The cases cover the public behavior in the supported certification regime.

See:

certify_forward()

test_gradient_through_result_and_information() None[source]

Differentiate both the observable and certificate evidence.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_vmap_certified_execution() None[source]

Batch complete certified executions with JAX VMAP.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_complex_output_keeps_both_real_coordinates() None[source]

Retain real and imaginary information from a complex output.

The local information singular value must equal the complex gain norm.

Notes

The analytic map multiplies one real input by 1 + 2j.

Return type:

None

test_zero_rank_certificate_round_trips(tmp_path: Path) None[source]

Persist a certificate for a constant zero-information model.

The finite zero condition sentinel must survive the JSON round trip.

Notes

The model output is constant and its information spectrum has rank zero.

Return type:

None

class tests.test_diffpes.test_certify.test_execution.TestPrepareCertification[source]

Bases: object

Verify prepare_certification().

The cases cover eager resolution of stable model and policy identities.

See:

prepare_certification()

test_context_binds_exact_model_identity() None[source]

Bind a registered model specification into a static context.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_execution.TestCertifyForwardChecked[source]

Bases: object

Verify certify_forward_checked().

The case returns a structured JAX error for a failed hard domain check.

See:

certify_forward_checked()

test_hard_domain_failure_is_structured() None[source]

Return a checkify error without Python branching in the kernel.

The error must name the hard check while the result stays available.

Notes

The test registers one hard check that has a negative margin.

Return type:

None

Validate stable human-readable certificate inspection.

The tests cover public behavior, differentiability, validation, and stable scientific identity in the supported certification regime.

class tests.test_diffpes.test_certify.test_inspect.TestSummarizeCertificate[source]

Bases: object

Verify summarize_certificate().

The cases cover the public behavior in the supported certification regime.

See:

summarize_certificate()

test_summary_identifies_model() None[source]

Verify summaries expose the permanent scientific model identity.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test builds the shared certificate fixture and searches its compact text.

Return type:

None

test_summary_answers_identity_provenance_claim_and_derivative_questions() None[source]

Verify summary answers identity provenance claim and derivative questions.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_inspect.TestExplainClaim[source]

Bases: object

Verify explain_claim().

The cases cover the public behavior in the supported certification regime.

See:

explain_claim()

test_explain_claim_reports_bounded_numerical_evidence() None[source]

Verify explain claim reports bounded numerical evidence.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_explain_claim_rejects_missing_id() None[source]

Verify explain claim rejects missing id.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_inspect.TestDiffCertificates[source]

Bases: object

Verify diff_certificates().

The cases cover the public behavior in the supported certification regime.

See:

diff_certificates()

test_diff_categorizes_environment_audit_and_scientific_changes() None[source]

Verify diff categorizes environment audit and scientific changes.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_diff_identical_certificate_has_clear_summary() None[source]

Verify diff identical certificate has clear summary.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

Validate built-in certified model registration.

The tests cover public behavior, differentiability, validation, and stable scientific identity in the supported certification regime.

class tests.test_diffpes.test_certify.test_models.TestTbRadialModelSpec[source]

Bases: object

Verify tb_radial_model_spec().

The cases cover the public behavior in the supported certification regime.

See:

tb_radial_model_spec()

test_radial_model_spec_names_physics_and_gradients() None[source]

Declare assumptions, conventions, domains, and traced paths.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_models.TestRegisterBuiltinModels[source]

Bases: object

Verify register_builtin_models().

The cases cover the public behavior in the supported certification regime.

See:

register_builtin_models()

test_builtin_registration_is_idempotent() None[source]

Register each built-in identity exactly once.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_models.TestExecuteTbRadial[source]

Bases: object

Verify execute_tb_radial().

The cases cover the public behavior in the supported certification regime.

See:

execute_tb_radial()

test_radial_model_certifies_end_to_end() None[source]

Run the built-in radial ARPES model through compiled certification.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

Validate cumulative scientific-certification policies.

The tests cover public behavior, differentiability, validation, and stable scientific identity in the supported certification regime.

class tests.test_diffpes.test_certify.test_policy.TestAchievedLevels[source]

Bases: object

Verify achieved_levels().

The cases cover the public behavior in the supported certification regime.

See:

achieved_levels()

test_exploratory_reaches_identified_and_validated() None[source]

Achieve the two exploratory levels from required claims.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_policy.TestEvaluatePolicy[source]

Bases: object

Verify evaluate_policy().

The cases cover the public behavior in the supported certification regime.

See:

evaluate_policy()

test_failed_lower_level_blocks_higher_levels() None[source]

Make cumulative outcomes false above a failed identity claim.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

Validate provenance DAG validation and information propagation.

The tests cover public behavior, differentiability, validation, and stable scientific identity in the supported certification regime.

class tests.test_diffpes.test_certify.test_provenance.TestValidateProvenance[source]

Bases: object

Verify validate_provenance().

The cases cover the public behavior in the supported certification regime.

See:

validate_provenance()

test_empty_graph_is_valid() None[source]

Verify an empty declared graph has no structural errors.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test builds and independently validates the minimal graph.

Return type:

None

test_generated_acyclic_graphs_validate() None[source]

Validate generated DAGs independently of their supplied record order.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_provenance.TestEffectiveInformation[source]

Bases: object

Verify effective_information().

The cases cover the public behavior in the supported certification regime.

See:

effective_information()

test_dag_is_topological_and_propagates_losses_and_claims() None[source]

Propagate inherited loss and claim invalidation to terminal results.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_source_record_and_multiple_outputs_are_supported() None[source]

Allow explicit source nodes and one transformation with several outputs.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_provenance.TestBuildProvenance[source]

Bases: object

Verify build_provenance().

The cases cover the public behavior in the supported certification regime.

See:

build_provenance()

test_cycle_is_rejected_and_remains_inspectable_in_nonstrict_mode() None[source]

Detect a multi-step cycle without hanging topological analysis.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_missing_parent_and_multiple_producer_are_rejected() None[source]

Require every non-source parent and every output producer to be unique.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_unused_external_input_is_rejected() None[source]

Expose declared required inputs that no transformation consumes.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_provenance.TestLineage[source]

Bases: object

Verify lineage().

The cases cover the public behavior in the supported certification regime.

See:

lineage()

test_unknown_node_inspection_is_rejected() None[source]

Avoid silently returning empty state for a misspelled artifact ID.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_provenance.TestInvalidatedClaims[source]

Bases: object

Verify invalidated_claims().

The cases cover sorted claim invalidation at a derived result node.

See:

invalidated_claims()

test_node_reports_inherited_invalidated_claims() None[source]

Return all claim identities invalidated along the node lineage.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

Validate deterministic immutable certification registries.

The tests cover public behavior, differentiability, validation, and stable scientific identity in the supported certification regime.

class tests.test_diffpes.test_certify.test_registry.TestValidateRegistry[source]

Bases: object

Verify validate_registry().

The cases cover the public behavior in the supported certification regime.

See:

validate_registry()

test_snapshot_is_structurally_valid() None[source]

Verify a snapshot satisfies ordering and checksum invariants.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

Recomputes validation against the current process-local registry.

Return type:

None

test_registry_report_recomputes_structural_consistency() None[source]

Report a stable checksum and successful internal validation.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_registry.TestRegistrySnapshot[source]

Bases: object

Verify registry_snapshot().

The cases cover the public behavior in the supported certification regime.

See:

registry_snapshot()

test_models_are_sorted_and_resolved_independent_of_registration_order() None[source]

Expose deterministic immutable snapshots after reverse-order inserts.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_registry.TestRegisterModel[source]

Bases: object

Verify register_model().

The cases cover the public behavior in the supported certification regime.

See:

register_model()

test_duplicate_model_identity_is_rejected_even_for_same_spec() None[source]

Prevent import order from replacing an existing scientific identity.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

test_invalid_model_identity_is_rejected(model_id: Any, model_version: Any) None[source]

Enforce permanent reverse-DNS IDs and semantic model versions.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_registry.TestRegisterTransformation[source]

Bases: object

Verify register_transformation().

The cases cover the public behavior in the supported certification regime.

See:

register_transformation()

test_transformation_registry_is_sorted_and_rejects_duplicates() None[source]

Apply the same append-only identity rule to semantic contracts.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_registry.TestGetModel[source]

Bases: object

Verify get_model().

The cases cover the public behavior in the supported certification regime.

See:

get_model()

test_unknown_registry_entries_raise_key_error() None[source]

Require an exact scientific identity and version on lookup.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_registry.TestGetTransformation[source]

Bases: object

Verify get_transformation().

The cases cover exact lookup of a registered semantic contract.

See:

get_transformation()

test_registered_contract_is_resolved_exactly() None[source]

Resolve one transformation by its permanent identity and version.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_registry.TestListModels[source]

Bases: object

Verify list_models().

The cases cover stable ordering without exposing executor callables.

See:

list_models()

test_model_specs_are_sorted() None[source]

Return model specifications in permanent identity order.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_registry.TestListRegisteredModels[source]

Bases: object

Verify list_registered_models().

The cases cover stable ordering of model specifications and executors.

See:

list_registered_models()

test_registered_bindings_are_sorted() None[source]

Return complete registered bindings in permanent identity order.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_registry.TestListTransformations[source]

Bases: object

Verify list_transformations().

The cases cover stable ordering of transformation contracts.

See:

list_transformations()

test_contracts_are_sorted() None[source]

Return transformation contracts in permanent identity order.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_registry.TestFreezeRegistry[source]

Bases: object

Verify freeze_registry().

The case isolates the process-global freeze operation in a child process.

See:

freeze_registry()

test_freeze_rejects_later_registration() None[source]

Reject registry mutation after an application freezes its snapshot.

The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.

Notes

The test compares the result with explicit numerical or structural assertions.

Return type:

None

class tests.test_diffpes.test_certify.test_registry.TestRegisterHandshake[source]

Bases: object

Verify register_handshake().

The case registers one owner without importing its scientific modules.

See:

register_handshake()

test_registers_one_exact_owner() None[source]

Register one unique owner handshake in process-local state.

The next registry snapshot must contain the same immutable record.

Notes

The test uses an empty requirement set and a unique owner suffix.

Return type:

None

class tests.test_diffpes.test_certify.test_registry.TestListHandshakes[source]

Bases: object

Verify list_handshakes().

The case checks deterministic owner ordering after registration.

See:

list_handshakes()

test_returns_owner_sorted_records() None[source]

Return all handshake declarations in sorted owner order.

Registry insertion order must not change the returned order.

Notes

The test compares the owner sequence with its sorted copy.

Return type:

None

class tests.test_diffpes.test_certify.test_registry.TestValidateHandshake[source]

Bases: object

Verify validate_handshake().

The case validates model, convention, and evidence references explicitly.

See:

validate_handshake()

test_reports_missing_then_complete_references() None[source]

Report missing evidence and then complete the same handshake.

The same declaration must become complete when evidence becomes available.

Notes

The test registers one model and supplies its external evidence later.

Return type:

None

test_plan03_handshake_is_green_with_declared_evidence() None[source]

Verify the built-in Plan 03 handshake with exact evidence IDs.

The registered transformation contracts and supplied evidence must suffice.

Notes

The test reads evidence IDs from the packaged handshake declaration.

Return type:

None

class tests.test_diffpes.test_certify.test_registry.TestRegistryManifest[source]

Bases: object

Verify registry_manifest().

The case reads the packaged manifest without process-local mutation.

See:

registry_manifest()

test_manifest_has_versioned_builtins() None[source]

Read the schema and the radial model from package resources.

The manifest must contain explicit versions for stable identities.

Notes

The test checks explicit stable identities, not registry insertion order.

Return type:

None

class tests.test_diffpes.test_certify.test_registry.TestRenderModelCard[source]

Bases: object

Verify render_model_card().

The case renders Markdown only from the registered model specification.

See:

render_model_card()

test_card_contains_exact_model_identity() None[source]

Render the exact model ID and version in the card header.

The generated text must identify the registered radial model.

Notes

The test uses the packaged radial model specification.

Return type:

None

class tests.test_diffpes.test_certify.test_registry.TestPackagedModelCard[source]

Bases: object

Verify packaged_model_card().

The case reads the generated radial model card from package resources.

See:

packaged_model_card()

test_packaged_card_matches_registry_render() None[source]

Compare the packaged card with a fresh registry-based rendering.

The complete Markdown outputs must match without manual fields.

Notes

The test registers the built-ins and compares the full Markdown text.

Return type:

None

class tests.test_diffpes.test_certify.test_registry.TestValidateRegistryManifest[source]

Bases: object

Verify validate_registry_manifest().

The case checks every packaged entry and generated model card for drift.

See:

validate_registry_manifest()

test_builtin_registry_has_no_packaged_drift() None[source]

Find no missing built-in entry or changed generated model card.

The validator must return an empty tuple after built-in registration.

Notes

The test registers all built-ins before it validates the package files.

Return type:

None

Validate resolver-backed reproduction of certified forward results.

The tests run a registered closed-form square model. They compare the rerun with a separately resolved result artifact.

class tests.test_diffpes.test_certify.test_reproduction.TestReproduceForward[source]

Bases: object

Verify reproduce_forward().

The cases compare a registered square model with resolved output arrays.

See:

reproduce_forward()

test_exact_rerun_reports_reproduction() None[source]

Report success for an exact rerun of the registered square model.

The maximum absolute error must equal zero.

Notes

The test resolves input 2 and expected output 4 as float64 arrays.

Return type:

None

test_changed_expected_result_reports_failure() None[source]

Report failure when the resolved result differs from the rerun.

The maximum absolute error must equal the analytic difference.

Notes

The test compares the analytic square value 4 with the stored value 5.

Return type:

None

test_large_result_uses_combined_tolerance() None[source]

Verify relative agreement for a large result with absolute error.

The combined tolerance must accept an error above the absolute term.

Notes

The test compares 1,000,000 with 1,000,000.5 at tolerance 1e-6.

Return type:

None

Validate artifact resolution and external evidence checks.

The tests compare normalized and byte content with explicit CRC32 identities. They also check missing artifacts and changed content.

class tests.test_diffpes.test_certify.test_resolvers.TestMappingArtifactResolver[source]

Bases: object

Verify mapping_artifact_resolver().

The cases cover exact lookup of normalized in-memory artifacts.

See:

mapping_artifact_resolver()

test_mapping_resolves_exact_artifact_id() None[source]

Resolve the normalized value through its exact artifact ID.

The resolver must return the array that the exact ID selects.

Notes

The test creates one array and compares the resolved array exactly.

Return type:

None

class tests.test_diffpes.test_certify.test_resolvers.TestFilesystemArtifactResolver[source]

Bases: object

Verify filesystem_artifact_resolver().

The case covers exact byte resolution from a local locator.

See:

filesystem_artifact_resolver()

test_filesystem_resolves_and_checks_exact_bytes(tmp_path: Path) None[source]

Resolve one file and validate its byte and content identities.

The resolver must return the four bytes without a conversion.

Notes

The test writes four bytes and checks both independent CRC32 fields.

Return type:

None

class tests.test_diffpes.test_certify.test_resolvers.TestResolveArtifact[source]

Bases: object

Verify resolve_artifact().

The case rejects changed normalized content at the I/O boundary.

See:

resolve_artifact()

test_changed_content_is_rejected() None[source]

Reject a value that differs from the referenced normalized value.

The content CRC32 must detect the changed numerical array.

Notes

The test resolves a different scalar under the same artifact ID.

Return type:

None

test_declared_byte_identity_requires_source_bytes() None[source]

Reject a resolver that omits bytes for a declared byte identity.

The content value alone cannot verify the separately recorded bytes.

Notes

The mapping resolver intentionally returns no exact source bytes.

Return type:

None

class tests.test_diffpes.test_certify.test_resolvers.TestVerifyEvidence[source]

Bases: object

Verify verify_evidence().

The cases combine artifact resolution with the recorded tolerance.

See:

verify_evidence()

test_evidence_requires_resolved_compatible_artifacts() None[source]

Pass evidence only when its artifact resolves and its residual fits.

The report must keep all three Boolean outcomes true.

Notes

The test uses a zero residual and one matching normalized artifact.

Return type:

None

test_inconsistent_recorded_residual_fails() None[source]

Reject evidence whose residual disagrees with its stored values.

Artifact resolution must not hide an inconsistent numerical record.

Notes

The recorded residual is zero although the measured difference is one.

Return type:

None

Measure independent certification identity and resource behavior.

The tests isolate process identity, streaming memory, and orchestration time. They are calibration fixtures and do not claim the full-cube release limits.

class tests.test_diffpes.test_certify.test_scalability.TestCertificateProcessFixture[source]

Bases: object

Measure canonical certificate identity in an independent process.

The case compares the same scientific certificate across process limits.

test_identity_matches_child_process() None[source]

Compute the same canonical identity in a fresh Python process.

Process initialization must not change the scientific identity.

Notes

The child imports the shared deterministic certificate fixture.

Return type:

None

class tests.test_diffpes.test_certify.test_scalability.TestChecksumMemoryFixture[source]

Bases: object

Measure bounded allocation during streamed CRC32 computation.

The case streams 1 GiB through one reusable 1 MiB memory view.

test_stream_does_not_retain_all_chunks() None[source]

Keep added allocation below ten percent of one streamed chunk.

The checksum operation must not accumulate the 1 GiB logical stream.

Notes

The test starts allocation tracing after it creates the source chunk.

Return type:

None

class tests.test_diffpes.test_certify.test_scalability.TestCertificationOverheadFixture[source]

Bases: object

Measure model runtime and certification orchestration separately.

The case records warm CPU timings for a closed-form scalar model.

test_records_separate_warm_timings(record_property: Any) None[source]

Record finite model and certification durations independently.

The two properties must keep model time separate from orchestration time.

Notes

The fixture excludes compilation by warming both calls before timing.

Return type:

None

Validate bounded policy waivers at explicit UTC times.

The tests cover active, expired, malformed, and duplicate waiver records. They confirm that a waiver never changes a failed claim to passed.

class tests.test_diffpes.test_certify.test_waivers.TestValidateWaiver[source]

Bases: object

Verify validate_waiver().

The cases distinguish valid structure from an active UTC interval.

See:

validate_waiver()

test_active_interval_is_valid() None[source]

Accept an evaluation time inside the half-open waiver interval.

The report must mark the waiver as valid and active.

Notes

The selected time is one day after issue and one day before expiry.

Return type:

None

test_expired_interval_is_inactive() None[source]

Reject an evaluation time at the exclusive expiry boundary.

The report must keep valid structure and mark inactive scope.

Notes

The selected time equals the absolute UTC expiry time.

Return type:

None

class tests.test_diffpes.test_certify.test_waivers.TestValidateWaivers[source]

Bases: object

Verify validate_waivers().

The case rejects duplicate waiver identities before policy evaluation.

See:

validate_waivers()

test_duplicate_waiver_id_is_rejected() None[source]

Reject two waiver records with the same permanent identity.

Duplicate records must raise a static validation error.

Notes

The test supplies the same immutable waiver object twice.

Return type:

None

class tests.test_diffpes.test_certify.test_waivers.TestRequireActiveWaivers[source]

Bases: object

Verify require_active_waivers().

The cases enforce active UTC scope and preserve failed claim outcomes.

See:

require_active_waivers()

test_expired_waiver_is_rejected() None[source]

Raise an error when a waiver has expired before execution.

The eager boundary must not accept inactive review scope.

Notes

The test selects a time one day after the recorded expiry.

Return type:

None

test_waiver_does_not_pass_failed_claim() None[source]

Keep a failed claim false when a policy contains a waiver.

The waiver must not change the numerical outcome of the claim.

Notes

The test evaluates one failed required claim under research policy.

Return type:

None

test_waiver_policy_must_match_selected_policy() None[source]

Reject a waiver that belongs to a different policy.

Policy evaluation must not apply a research waiver to publication.

Notes

The helper creates a research-policy waiver for this mismatch case.

Return type:

None