tauopt.engine.provenance#
Suggestion provenance: enough identity to re-derive any served suggestion.
The identity triple: engine_version (release tag), engine_sha (canonical), deps_fingerprint – torch/BoTorch minor bumps move numerics, so a SHA alone under-specifies bit-repro.
Module Contents#
Classes#
Wall-clock split of the suggest step: GP hyperparameter-fit vs acquisition-optimization seconds, accumulated across every rung attempted in the ask. Measurement only, never identity – absent (None) when no rung recorded either phase (random/sobol), and never part of any canonical form, hash, or seed (P8: provenance is not canonicalized state). |
|
The center-in-bootstrap decision (the three-branch table): which
branch classified and what the stream did – |
|
One refused duplicate-intent request: the request’s identity plus the boundary’s typed reason. Field domains are closed so a malformed record dies at construction (fail-loud, never fail-open). Audit only, never identity – never part of any canonical form, hash, or seed. |
|
One queue-selection decision:
horizon + source, progress, temperature, queue size, eligible count,
selected rank, distance, fork label. |
|
The dedup boundary’s per-ask audit record: collision count, repair path, and statuses in provenance (P6). Present on every dedup-flagged ask, zeros included, so receipts can verify the boundary actually ran; absent flag-off. Audit only, never identity – never part of any canonical form, hash, or seed (P8: provenance is not canonicalized state). |
|
One fitted tensor’s exact identity: dtype + shape +
a blake2b digest over the dtype-tagged raw little-endian bytes –
payload-exact (float32 vs float64, signed zeros, and NaN payloads all
distinguish; deliberately NOT normalized – a replica-side sign or dtype
flip is exactly the computation divergence this digest exists to catch).
|
|
One COMPLETED GP hyperparameter fit (internal-state
transparency): the fitted (MLL-optimized) leaf tensors by
parameter name, the model class, the training-set geometry, and whether a
fixed noise variance entered ( |
|
One rung attempt’s acquisition work shape (work
counters): the EFFECTIVE optimizer knobs at the point of use – post any
bundle override, so the executed work shape is receipt-visible
on its own (the config alone does not show effective values)
– plus the acq optimizer family and the requested q.
|
|
One retry of a GP strategy’s suggest attempt (the rung-level
conditioning controller): emitted when retry attempt |
|
One armed attempt’s finite-filter receipt (the armed
finite-filtering ic_generator, 0.3.2): raw q-batch rows drawn, rows
surviving the whole-row |
|
Duplicate-x aggregation at fit assembly: raw scored rows in vs aggregated group rows out, plus the canonical-key version that defined sameness. Raw observations remain untouched in state – aggregation is a fit transform; this record is how a receipt shows it ran. Audit only, never identity – never part of any canonical form, hash, or seed (P8). |
|
One FAILED rung attempt’s verbatim evidence, kept so a never-fail
ladder descent (P6) preserves each failed rung’s own error rather than
discarding or clobbering it. One record per failed rung,
in ladder order; later rungs never overwrite earlier ones. |
|
The per-suggestion receipt: the identity triple (engine_version,
engine_sha, deps_fingerprint) plus strategy, config_hash, policy, and the
resolved seed – together with the recorded experiment state, enough to
re-derive and verify the served suggestion (P4; the receipt alone
identifies the run, it does not carry the state).
|
Functions#
Installed TauOpt release tag (the identity triple’s version leg); “0.0.0+uninstalled” when the distribution is absent. Cached per process. |
|
Canonical engine identity. Resolution: TAUOPT_ENGINE_SHA (set by release/service
builds) -> the |
|
Dependency fingerprint. TAUOPT_DEPS_FINGERPRINT (service images stamp blake2b(uv.lock) at build) -> fingerprint of the installed versions of the numerics-relevant dists (local/dev runs). The cache keys on the declared value. |
API#
- class tauopt.engine.provenance.ProvenanceTimings(/, **data: Any)#
Bases:
pydantic.BaseModelWall-clock split of the suggest step: GP hyperparameter-fit vs acquisition-optimization seconds, accumulated across every rung attempted in the ask. Measurement only, never identity – absent (None) when no rung recorded either phase (random/sobol), and never part of any canonical form, hash, or seed (P8: provenance is not canonicalized state).
Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
‘ConfigDict(…)’
- class tauopt.engine.provenance.CenterRecord(/, **data: Any)#
Bases:
pydantic.BaseModelThe center-in-bootstrap decision (the three-branch table): which branch classified and what the stream did –
skip(branch 1, reasonill_defined|infeasible|observed|pending),shifted_stream(branch 2),emitted_slot0/slot0_consumed(branch 3). A branch-1 observed/pending record is an EMISSION skip: on a center-capable space the engaged stream form (shift / walk law) continues unchanged. Field domains are closed (Literal) so a malformed record dies at construction, outside the never-fail net – fail-loud, never fail-open. Audit only, never identity – never part of any canonical form, hash, or seed (P8: provenance is not canonicalized state).Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
‘ConfigDict(…)’
- class tauopt.engine.provenance.IntentRefusal(/, **data: Any)#
Bases:
pydantic.BaseModelOne refused duplicate-intent request: the request’s identity plus the boundary’s typed reason. Field domains are closed so a malformed record dies at construction (fail-loud, never fail-open). Audit only, never identity – never part of any canonical form, hash, or seed.
Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
‘ConfigDict(…)’
- class tauopt.engine.provenance.QueueSlotRecord(/, **data: Any)#
Bases:
pydantic.BaseModelOne queue-selection decision: horizon + source, progress, temperature, queue size, eligible count, selected rank, distance, fork label.
origincloses the decision domain:selected(temperature draw),argmax_t0(the literal T=0 branch – no draw),repair(no eligible entry; the owner repair path filled the slot – no draw),pass_through(a rung without queue capability answered; exempt by construction, recorded).uis the drawn uniform (re-derivable from the fork label – audit convenience);non_finite_scoresRETAINS the slot’s non-finite-score entries as canonical score strings (“nan”/”inf”/”-inf”, generation order; their rows are never decoded: coordinates of a poisoned endpoint prove nothing) withnon_finite_count= its length. Rank and u are None exactly when no selection event occurred (repair / pass_through);distanceis the fixed pipeline stage’s d_hat of the selected entry and is PRESENT on every selection event (selected AND argmax_t0 – lambda=0 and T=0 zero its weight, never the statistic), None on repair/pass_through. Audit only, never identity – never part of any canonical form, hash, or seed (P8: provenance is not canonicalized state).Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
‘ConfigDict(…)’
- class tauopt.engine.provenance.DedupRecord(/, **data: Any)#
Bases:
pydantic.BaseModelThe dedup boundary’s per-ask audit record: collision count, repair path, and statuses in provenance (P6). Present on every dedup-flagged ask, zeros included, so receipts can verify the boundary actually ran; absent flag-off. Audit only, never identity – never part of any canonical form, hash, or seed (P8: provenance is not canonicalized state).
Counter semantics:
collision_countcounts refused PROPOSALS – a slot’s natural candidate, a re-optimize result, or a boundary-caught strategy draft (boundary_collisionsis that last subset, a strategy-bug signal, since repair should have prevented them). Queue-walk examinations are NOT proposals and are deliberately uncounted.boundary_invalidcounts drafts the boundary dropped for failing key computation or validation – distinct from collisions by construction.per_draft_originnames each returned draft’s producer (a ladder rung,exhaust_enum, orintent_grant).uniqueness_statusand the four slot counters mirror the AskResult so every RECEIPT is self-contained (the ask surface does not cross the driver).Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
‘ConfigDict(…)’
- intent_refusals: tuple[tauopt.engine.provenance.IntentRefusal, ...]#
()
- class tauopt.engine.provenance.TensorStat(/, **data: Any)#
Bases:
pydantic.BaseModelOne fitted tensor’s exact identity: dtype + shape + a blake2b digest over the dtype-tagged raw little-endian bytes – payload-exact (float32 vs float64, signed zeros, and NaN payloads all distinguish; deliberately NOT normalized – a replica-side sign or dtype flip is exactly the computation divergence this digest exists to catch).
valuecarries the number verbatim when the tensor is scalar AND finite (a non-finite scalar stays digest-only: receipts must never carry a non-finite float – the reader rejects NaN/Infinity as corruption, and identity still resolves from the digest). Audit only, never identity for any hash or seed (P8).Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
‘ConfigDict(…)’
- class tauopt.engine.provenance.GpFitRecord(/, **data: Any)#
Bases:
pydantic.BaseModelOne COMPLETED GP hyperparameter fit (internal-state transparency): the fitted (MLL-optimized) leaf tensors by parameter name, the model class, the training-set geometry, and whether a fixed noise variance entered (
yvar_provided).fit_maxiteris the L-BFGS iteration cap when one applied (themixed_cappedbundle) – None means fit-to-convergence. Emitted at the single fit seam (make_and_fit_gp), so every fit is recorded: failed rungs’ fits, gp_nehvi components, and mll_impute stage-1 fits included. The construct- only fixed-label GP never fits and is deliberately NOT recorded (its parameters are documented literals, deterministic in (d, labels)).Distinguishes “same bytes by synchronization” from “same computation”: two replicas serving identical suggestions with different fitted state now disagree receipt-visibly. Audit only, never identity for any engine hash or seed (P8: provenance is not canonicalized state) – but CANONICAL in bench receipts, where cross-replica EQUALITY is the obligation (zero-mismatch; exposure without agreement passes nothing).
Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
‘ConfigDict(…)’
- params: dict[str, tauopt.engine.provenance.TensorStat]#
None
- class tauopt.engine.provenance.WorkRecord(/, **data: Any)#
Bases:
pydantic.BaseModelOne rung attempt’s acquisition work shape (work counters): the EFFECTIVE optimizer knobs at the point of use – post any bundle override, so the executed work shape is receipt-visible on its own (the config alone does not show effective values) – plus the acq optimizer family and the requested q.
n_pendingcounts open suggestions entering as constant-liar/pending conditioning. Audit only, never identity for any hash or seed (P8).Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
‘ConfigDict(…)’
- class tauopt.engine.provenance.ConditioningEvent(/, **data: Any)#
Bases:
pydantic.BaseModelOne retry of a GP strategy’s suggest attempt (the rung-level conditioning controller): emitted when retry attempt
attempt(1..3 – an acq-class arming retry, when it fires, precedes up tomax_retriesfloor escalations) STARTS, carrying the standardized-variance floor it runs at and the PRIOR attempt’s typed exception.stageis the phase the prior attempt last entered (fit | fantasy | acq).armedis True on retries that run with the armed finite-filtering ic_generator installed (gp_nehvi’s acq-stage cure): the arming retry keepsfloor_stdUNCHANGED – a variance floor cannot remove non-finite values the acquisition itself produces at its raw samples, so the cure filters them at initialization instead – recorded as the f0-resolved value at attempt 0 or the standing floor_k thereafter; later typed-set escalations while armed stay armed (sticky). Additive, default False: pre-cure receipts keep exact bytes. Audit only, never identity – never part of any canonical form, hash, or seed (P8: provenance is not canonicalized state).Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
‘ConfigDict(…)’
- class tauopt.engine.provenance.AcqInitFilterRecord(/, **data: Any)#
Bases:
pydantic.BaseModelOne armed attempt’s finite-filter receipt (the armed finite-filtering ic_generator, 0.3.2): raw q-batch rows drawn, rows surviving the whole-row
isfinitefilter (NaN and +/-inf both drop; row = one q-batch, joint acq is one scalar per q-tuple – deliberately NOT member-exclusion), the support verdict, the restarts actually installed, and the RAW-BASE POSTCONDITION verdict at the returned candidates.postconditionis a receipt, never an absence-of-error inference; on zero support it is"nonfinite"BY LAW – the empty survivor set’s vacuousisfinite(empty).all() == Truemust never read finite (the validator below is that law’s tooth). Audit only, never identity – never part of any canonical form, hash, or seed (P8).Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
‘ConfigDict(…)’
- class tauopt.engine.provenance.AggregationRecord(/, **data: Any)#
Bases:
pydantic.BaseModelDuplicate-x aggregation at fit assembly: raw scored rows in vs aggregated group rows out, plus the canonical-key version that defined sameness. Raw observations remain untouched in state – aggregation is a fit transform; this record is how a receipt shows it ran. Audit only, never identity – never part of any canonical form, hash, or seed (P8).
Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
‘ConfigDict(…)’
- class tauopt.engine.provenance.FallbackAttempt(/, **data: Any)#
Bases:
pydantic.BaseModelOne FAILED rung attempt’s verbatim evidence, kept so a never-fail ladder descent (P6) preserves each failed rung’s own error rather than discarding or clobbering it. One record per failed rung, in ladder order; later rungs never overwrite earlier ones.
stageis the phase the rung last entered (None when it died before any GP phase – e.g. config validation).conditioning_attemptsare the conditioning- controller retries the rung burned before failing. The*_deltacounters are the rung’s own contribution to the ask-level fits/work/acq_events records up to the failure point. Audit only, never identity (P8).Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
‘ConfigDict(…)’
- conditioning_attempts: tuple[tauopt.engine.provenance.ConditioningEvent, ...]#
()
- class tauopt.engine.provenance.EngineProvenance(/, **data: Any)#
Bases:
pydantic.BaseModelThe per-suggestion receipt: the identity triple (engine_version, engine_sha, deps_fingerprint) plus strategy, config_hash, policy, and the resolved seed – together with the recorded experiment state, enough to re-derive and verify the served suggestion (P4; the receipt alone identifies the run, it does not carry the state).
fallback_fromnames the originally routed strategy when a never-fail ladder descent answered instead (P6), None when the intended rung answered. Everything fromtimingsdown is an audit record, absent (None) unless its subsystem ran (drop-at-absent keeps older receipts byte-exact); audit records never enter any canonical form, hash, or seed (P8: provenance is not canonicalized state).Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
‘ConfigDict(…)’
- timings: tauopt.engine.provenance.ProvenanceTimings | None#
None
- center: tauopt.engine.provenance.CenterRecord | None#
None
- dedup: tauopt.engine.provenance.DedupRecord | None#
None
- selection: tuple[tauopt.engine.provenance.QueueSlotRecord, ...] | None#
None
- fits: tuple[tauopt.engine.provenance.GpFitRecord, ...] | None#
None
- work: tuple[tauopt.engine.provenance.WorkRecord, ...] | None#
None
- aggregation: tauopt.engine.provenance.AggregationRecord | None#
None
- conditioning_events: tuple[tauopt.engine.provenance.ConditioningEvent, ...] | None#
None
- acq_init_filters: tuple[tauopt.engine.provenance.AcqInitFilterRecord, ...] | None#
None
- fallback_attempts: tuple[tauopt.engine.provenance.FallbackAttempt, ...] | None#
None
- tauopt.engine.provenance.engine_version() str#
Installed TauOpt release tag (the identity triple’s version leg); “0.0.0+uninstalled” when the distribution is absent. Cached per process.
- tauopt.engine.provenance.engine_sha() str#
Canonical engine identity. Resolution: TAUOPT_ENGINE_SHA (set by release/service builds) -> the
tauopt._build_infomodule hatch_build.py stamps into every wheel and sdist at build time -> git HEAD when this file sits inside a checkout of the engine repository (a source checkout or an editable install) -> “unknown”. The cache keys on the declared value: env set/change/unset inside one process is honored; the stamp and git legs still memoize.