1 vin.diagnostics.qh_runtime

vin.diagnostics.qh_runtime

Explicit acquisition and scorer setup for bounded Q_H diagnostics.

This module is the composition seam between persisted rollout/VIN sources and the pure diagnostic evidence builder. It admits exactly one configured chain, collates that complete causal chain, and constructs either a seeded untrained spatial scorer or a strictly verified inference bundle. It contains no Streamlit state and performs no forward pass during request loading or source fingerprinting.

1.1 Classes

Name Description
InferenceBundleScorerRequest Select a content-bound trained scorer through the strict bundle loader.
QhDiagnosticRequest Describe one reproducible, bounded Q_H diagnostic acquisition.
QhDiagnosticRuntime One admitted batch and scorer ready for a single evidence pass.
SeededSpatialScorerRequest Construct a deterministic, explicitly untrained spatial scorer.

1.1.1 InferenceBundleScorerRequest

vin.diagnostics.qh_runtime.InferenceBundleScorerRequest()

Select a content-bound trained scorer through the strict bundle loader.

1.1.1.1 Attributes

Name Description
kind Closed dispatch tag for verified trained-model evidence.
bundle_path Directory containing the immutable inference bundle.
schema_version Expected bundle schema; the loader verifies the on-disk manifest.
manifest_sha256 Expected canonical manifest digest bound into the bundle reference.
objective_profile Learning support contract expected by the selected dataset and bundle.

1.1.2 QhDiagnosticRequest

vin.diagnostics.qh_runtime.QhDiagnosticRequest()

Describe one reproducible, bounded Q_H diagnostic acquisition.

The dataset configuration owns all rollout-to-actor identity validation. chain_index chooses one complete chain after the configured split has been admitted; the runtime never truncates its state axis because that would alter the strictly causal history prefix.

1.1.2.1 Attributes

Name Description
paths Runtime-only path policy for portable source paths; omitted from exported recipes.
dataset Explicit validated rollout/VIN source configuration.
chain_index Zero-based chain index in the admitted dataset population.
requested_horizon Optional scalar query applied to every realized state; None uses factual remaining budget.
device Torch device syntax; runtime availability is admitted only on explicit execution.
scorer Seeded architecture-sanity scorer or strictly verified trained bundle.
selection Bounded display-copy selection shared by Streamlit and static export.

1.1.3 QhDiagnosticRuntime

vin.diagnostics.qh_runtime.QhDiagnosticRuntime(
    batch,
    scorer,
    scorer_config,
    requested_horizon,
    provenance,
)

One admitted batch and scorer ready for a single evidence pass.

1.1.3.1 Attributes

Name Description
batch One complete chain collated to B=1 on the requested device.
scorer Evaluation scorer; no forward pass has been performed by this module.
scorer_config Validated configuration describing scorer.
requested_horizon Optional Tensor["B S", int64] query, zero on padded states.
provenance Small immutable identity payload for the evidence snapshot.

1.1.4 SeededSpatialScorerRequest

vin.diagnostics.qh_runtime.SeededSpatialScorerRequest()

Construct a deterministic, explicitly untrained spatial scorer.

1.1.4.1 Attributes

Name Description
kind Closed dispatch tag for architecture-sanity evidence.
seed Torch initialization seed; this is model initialization, not learned evidence.
config Complete spatial-scorer configuration used to construct the untrained model.

1.2 Functions

Name Description
load_qh_diagnostic_request Load and validate a JSON request without constructing readers or models.
qh_source_identity Return a replacement-sensitive identity from bounded authoritative metadata.
run_qh_diagnostics Acquire once and delegate the single observational pass to the evidence owner.
setup_qh_diagnostic_runtime Validate one chain and construct the selected scorer without running it.

1.2.1 load_qh_diagnostic_request

vin.diagnostics.qh_runtime.load_qh_diagnostic_request(path, *, paths=None)

Load and validate a JSON request without constructing readers or models.

1.2.2 qh_source_identity

vin.diagnostics.qh_runtime.qh_source_identity(request)

Return a replacement-sensitive identity from bounded authoritative metadata.

Actor and rollout identity reuses the canonical dataset-generation owner, including its nonblocking special-entry handling. The serialized request separately preserves rollout order because it determines chain indexing. Inference-bundle identity remains bounded to manifest and state-file metadata; neither path traverses Zarr arrays or tensor payloads.

1.2.3 run_qh_diagnostics

vin.diagnostics.qh_runtime.run_qh_diagnostics(request)

Acquire once and delegate the single observational pass to the evidence owner.

1.2.4 setup_qh_diagnostic_runtime

vin.diagnostics.qh_runtime.setup_qh_diagnostic_runtime(request)

Validate one chain and construct the selected scorer without running it.

1.2.4.1 Raises

Name Type Description
ValueError If chain_index is outside the admitted dataset, or if the source, requested horizon, scorer configuration, or strict inference bundle is incompatible. Bundle failures are propagated without identity overrides or fallback state loading.
Back to top