Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::tooling::gpu_health Namespace Reference

Bounded, typed evidence returned by Pulp GPU health diagnostics. More...

Classes

class  HealthProvider
 Blocking producer interface for the three independent GPU health probes. More...
struct  HealthProbeOptions
 Fault controls applied after real GPU work completes. More...
struct  ReferenceHost
struct  StartupBudget
 Versioned interpretation contract for startup measurements. More...
struct  StartupCorrelation
struct  StartupCapture
struct  StartupIdentity
struct  StartupTrial
struct  StartupMeasurements
struct  HealthReadResult
 Closed response returned by dev.pulp.gpu/health.read@1. More...
struct  AdapterIdentity
 Native adapter identity. Missing optional fields represent absent evidence. More...
struct  ProbeMeasurements
 Optional measurements produced by one probe. More...
struct  EvidenceEvent
 One globally ordered stage observation with a registered diagnostic code. More...
struct  ProbeEvidence
 Evidence and aggregate verdict for one independently executed probe. More...
struct  HealthResult
 Closed versioned aggregate returned by the GPU health diagnostic. More...

Enumerations

enum class  MeasurementStatus { complete , incomplete , unavailable , unverified }
enum class  MeasurementEndpoint { native_compositor_presentation , headless_capture_complete }
enum class  BudgetStatus { ratified , unratified }
enum class  CacheState { cold , warm }
enum class  CacheProvenance { unknown , fresh_process , explicit_cache_reset , same_process_editor_reopen }
enum class  VisibleState { prepared , fallback , unknown }
enum class  PipelineContribution { material , not_material , unattributed , unverified }
enum class  CausalAttribution { complete , incomplete , unavailable , unverified }
enum class  StartupDisposition { queue_b4 , queue_b4_investigation , no_change }
enum class  Verdict { pass , fail , unavailable , unverified }
 Four-state outcome that keeps missing or inconclusive evidence out of pass. More...
enum class  Stage {
  configuration , adapter , shader_compile , pipeline_create ,
  render , submit , readback , content ,
  compute , device_state
}
 Ordered semantic stage described by one EvidenceEvent. More...
enum class  AdapterClass { hardware , software , null_adapter , unknown }
 Adapter class proven by native identity, never inferred from backend alone. More...
enum class  HealthState {
  healthy , failed , unavailable , unverified ,
  lost
}
 Aggregate device state derived from required probe evidence. More...
enum class  IdentityStatus { authentic , unverified , unavailable }
 Authenticity state for the optional native adapter identity fields. More...

Functions

std::unique_ptr< HealthProvider > make_default_health_provider (HealthProbeOptions options={})
 Create the native blocking provider and transfer sole ownership to the caller.
HealthResult run_health_check (HealthProvider &provider, bool render_requested=true)
 Execute the requested probes serially and derive one closed HealthResult.
int exit_code (const HealthResult &result)
 Map pass to 0, fail to 1, and unavailable or unverified to 2.
std::string render_human (const HealthResult &result)
 Render an owning human-readable report; machine consumers use to_json().
std::string_view to_string (MeasurementStatus value)
std::string_view to_string (MeasurementEndpoint value)
std::string_view to_string (BudgetStatus value)
std::string_view to_string (CacheState value)
std::string_view to_string (CacheProvenance value)
std::string_view to_string (VisibleState value)
std::string_view to_string (PipelineContribution value)
std::string_view to_string (CausalAttribution value)
std::string_view to_string (StartupDisposition value)
bool validate (const HealthReadResult &result, std::string *error=nullptr)
 Validates bounds and cross-field claims that JSON Schema cannot express, including percentile derivation, capture integrity, instrumentation coverage, signature proof, diagnostic-code bindings, and final disposition evidence.
std::string to_json (const HealthReadResult &result, bool pretty=false)
constexpr bool is_known_evidence_code (std::string_view code)
std::string_view to_string (Verdict value)
 Return the canonical lowercase schema spelling from static storage.
std::string_view to_string (Stage value)
std::string_view to_string (AdapterClass value)
std::string_view to_string (HealthState value)
std::string_view to_string (IdentityStatus value)
std::optional< Verdict > verdict_from_string (std::string_view value)
 Parse an exact canonical enum spelling; unknown text returns std::nullopt.
std::optional< Stage > stage_from_string (std::string_view value)
std::optional< AdapterClass > adapter_class_from_string (std::string_view value)
std::optional< HealthState > health_state_from_string (std::string_view value)
std::optional< IdentityStatus > identity_status_from_string (std::string_view value)
bool validate (const HealthResult &result, std::string *error=nullptr)
 Validate bounds and cross-field relationships that JSON Schema cannot express.
std::string to_json (const HealthResult &result, bool pretty=false)
 Serialize one validated or diagnostic result to the closed v1 JSON shape.
std::optional< HealthResult > from_json (std::string_view json, std::string *error=nullptr)
 Parse only the v1 closed shape and apply validate() before returning a value.

Variables

constexpr std::string_view kHealthReadSchema = "pulp.gpu-health-read-result.v1"
constexpr std::uint32_t kHealthReadVersion = 1
constexpr std::size_t kMaximumStartupTrials = 64
constexpr std::size_t kMaximumReferenceHosts = 8
constexpr std::size_t kMaximumMissingTraceCategories = 16
constexpr std::string_view kSchemaV1 = "pulp.gpu-health-result.v1"
 Historical closed schema identity accepted when parsing stored v1 results.
constexpr std::uint32_t kVersionV1 = 1
constexpr std::string_view kSchema = "pulp.gpu-health-result.v2"
 Active schema identity emitted by new GPU-health runs.
constexpr std::uint32_t kVersion = 2
constexpr std::array kEvidenceCodes
 Canonical diagnostic-code registry shared by result v1/v2, CLI, MCP, and agents.

Detailed Description

Bounded, typed evidence returned by Pulp GPU health diagnostics.

Ownership and lifetime
Result objects own their strings, optionals, and vectors. Parsing returns an owning value. Views returned by to_string refer to static storage and must not be freed. Validation and serialization retain no references to inputs.
Threading and real-time safety
The value and serialization APIs provide no internal synchronization and may allocate. Use separate result objects on concurrent threads or synchronize shared access. Provider probes acquire GPU resources and block for submitted work, so every API in this namespace belongs on a control or worker thread, never an audio callback or another real-time thread.
Determinism and units
Event sequences are zero-based and contiguous across a result. Pixel and color fields are integer counts; fingerprints are opaque unsigned values. Optional measurements distinguish an absent observation from an observed false or zero. Serialization preserves each version's closed vocabulary.
Results, unavailable evidence, and errors
pass and fail mean requested work completed and was measured. unavailable means required work could not be acquired or executed, while unverified means the available evidence cannot support a claim. Neither is a pass. Validators and parsers return failure without throwing for malformed contract data and write a human diagnostic when an error output is supplied.

Enumeration Type Documentation

◆ AdapterClass

Adapter class proven by native identity, never inferred from backend alone.

Enumerator
hardware 
software 
null_adapter 
unknown 

◆ BudgetStatus

Enumerator
ratified 
unratified 

◆ CacheProvenance

Enumerator
unknown 
fresh_process 
explicit_cache_reset 
same_process_editor_reopen 

◆ CacheState

Enumerator
cold 
warm 

◆ CausalAttribution

Enumerator
complete 
incomplete 
unavailable 
unverified 

◆ HealthState

Aggregate device state derived from required probe evidence.

Enumerator
healthy 
failed 
unavailable 
unverified 
lost 

◆ IdentityStatus

Authenticity state for the optional native adapter identity fields.

Enumerator
authentic 
unverified 
unavailable 

◆ MeasurementEndpoint

Enumerator
native_compositor_presentation 
headless_capture_complete 

◆ MeasurementStatus

Enumerator
complete 
incomplete 
unavailable 
unverified 

◆ PipelineContribution

Enumerator
material 
not_material 
unattributed 
unverified 

◆ Stage

Ordered semantic stage described by one EvidenceEvent.

Enumerator
configuration 
adapter 
shader_compile 
pipeline_create 
render 
submit 
readback 
content 
compute 
device_state 

◆ StartupDisposition

Enumerator
queue_b4 
queue_b4_investigation 
no_change 

◆ Verdict

Four-state outcome that keeps missing or inconclusive evidence out of pass.

Enumerator
pass 

Requested work completed and satisfied its oracle.

fail 

Requested work completed and failed a measured assertion.

unavailable 

Requested evidence or execution capability was unavailable.

unverified 

Evidence exists but is insufficient to support a verdict.

◆ VisibleState

Enumerator
prepared 
fallback 
unknown 

Function Documentation

◆ adapter_class_from_string()

std::optional< AdapterClass > pulp::tooling::gpu_health::adapter_class_from_string ( std::string_view value)

◆ exit_code()

int pulp::tooling::gpu_health::exit_code ( const HealthResult & result)

Map pass to 0, fail to 1, and unavailable or unverified to 2.

◆ from_json()

std::optional< HealthResult > pulp::tooling::gpu_health::from_json ( std::string_view json,
std::string * error = nullptr )

Parse only the v1 closed shape and apply validate() before returning a value.

Unknown members, malformed values, and newer versions return std::nullopt. When non-null, error receives a human diagnostic on failure.

◆ health_state_from_string()

std::optional< HealthState > pulp::tooling::gpu_health::health_state_from_string ( std::string_view value)

◆ identity_status_from_string()

std::optional< IdentityStatus > pulp::tooling::gpu_health::identity_status_from_string ( std::string_view value)

◆ is_known_evidence_code()

bool pulp::tooling::gpu_health::is_known_evidence_code ( std::string_view code)
constexpr

◆ make_default_health_provider()

std::unique_ptr< HealthProvider > pulp::tooling::gpu_health::make_default_health_provider ( HealthProbeOptions options = {})

Create the native blocking provider and transfer sole ownership to the caller.

◆ render_human()

std::string pulp::tooling::gpu_health::render_human ( const HealthResult & result)

Render an owning human-readable report; machine consumers use to_json().

◆ run_health_check()

HealthResult pulp::tooling::gpu_health::run_health_check ( HealthProvider & provider,
bool render_requested = true )

Execute the requested probes serially and derive one closed HealthResult.

provider is borrowed for the duration of the call. When render_requested is false, the function performs no device acquisition or GPU work and returns unverified; it never promotes inventory to pass.

◆ stage_from_string()

std::optional< Stage > pulp::tooling::gpu_health::stage_from_string ( std::string_view value)

◆ to_json() [1/2]

std::string pulp::tooling::gpu_health::to_json ( const HealthReadResult & result,
bool pretty = false )

◆ to_json() [2/2]

std::string pulp::tooling::gpu_health::to_json ( const HealthResult & result,
bool pretty = false )

Serialize one validated or diagnostic result to the closed v1 JSON shape.

Serialization does not implicitly call validate().

◆ to_string() [1/14]

std::string_view pulp::tooling::gpu_health::to_string ( AdapterClass value)

◆ to_string() [2/14]

std::string_view pulp::tooling::gpu_health::to_string ( BudgetStatus value)

◆ to_string() [3/14]

std::string_view pulp::tooling::gpu_health::to_string ( CacheProvenance value)

◆ to_string() [4/14]

std::string_view pulp::tooling::gpu_health::to_string ( CacheState value)

◆ to_string() [5/14]

std::string_view pulp::tooling::gpu_health::to_string ( CausalAttribution value)

◆ to_string() [6/14]

std::string_view pulp::tooling::gpu_health::to_string ( HealthState value)

◆ to_string() [7/14]

std::string_view pulp::tooling::gpu_health::to_string ( IdentityStatus value)

◆ to_string() [8/14]

std::string_view pulp::tooling::gpu_health::to_string ( MeasurementEndpoint value)

◆ to_string() [9/14]

std::string_view pulp::tooling::gpu_health::to_string ( MeasurementStatus value)

◆ to_string() [10/14]

std::string_view pulp::tooling::gpu_health::to_string ( PipelineContribution value)

◆ to_string() [11/14]

std::string_view pulp::tooling::gpu_health::to_string ( Stage value)

◆ to_string() [12/14]

std::string_view pulp::tooling::gpu_health::to_string ( StartupDisposition value)

◆ to_string() [13/14]

std::string_view pulp::tooling::gpu_health::to_string ( Verdict value)

Return the canonical lowercase schema spelling from static storage.

◆ to_string() [14/14]

std::string_view pulp::tooling::gpu_health::to_string ( VisibleState value)

◆ validate() [1/2]

bool pulp::tooling::gpu_health::validate ( const HealthReadResult & result,
std::string * error = nullptr )

Validates bounds and cross-field claims that JSON Schema cannot express, including percentile derivation, capture integrity, instrumentation coverage, signature proof, diagnostic-code bindings, and final disposition evidence.

Missing trace categories never masquerade as event loss.

◆ validate() [2/2]

bool pulp::tooling::gpu_health::validate ( const HealthResult & result,
std::string * error = nullptr )

Validate bounds and cross-field relationships that JSON Schema cannot express.

The function retains no input references. On failure, error receives a human diagnostic when non-null; callers must not treat that text as a stable machine-readable error code.

◆ verdict_from_string()

std::optional< Verdict > pulp::tooling::gpu_health::verdict_from_string ( std::string_view value)

Parse an exact canonical enum spelling; unknown text returns std::nullopt.

Variable Documentation

◆ kEvidenceCodes

std::array pulp::tooling::gpu_health::kEvidenceCodes
inlineconstexpr

Canonical diagnostic-code registry shared by result v1/v2, CLI, MCP, and agents.

◆ kHealthReadSchema

std::string_view pulp::tooling::gpu_health::kHealthReadSchema = "pulp.gpu-health-read-result.v1"
inlineconstexpr

◆ kHealthReadVersion

std::uint32_t pulp::tooling::gpu_health::kHealthReadVersion = 1
inlineconstexpr

◆ kMaximumMissingTraceCategories

std::size_t pulp::tooling::gpu_health::kMaximumMissingTraceCategories = 16
inlineconstexpr

◆ kMaximumReferenceHosts

std::size_t pulp::tooling::gpu_health::kMaximumReferenceHosts = 8
inlineconstexpr

◆ kMaximumStartupTrials

std::size_t pulp::tooling::gpu_health::kMaximumStartupTrials = 64
inlineconstexpr

◆ kSchema

std::string_view pulp::tooling::gpu_health::kSchema = "pulp.gpu-health-result.v2"
inlineconstexpr

Active schema identity emitted by new GPU-health runs.

◆ kSchemaV1

std::string_view pulp::tooling::gpu_health::kSchemaV1 = "pulp.gpu-health-result.v1"
inlineconstexpr

Historical closed schema identity accepted when parsing stored v1 results.

◆ kVersion

std::uint32_t pulp::tooling::gpu_health::kVersion = 2
inlineconstexpr

◆ kVersionV1

std::uint32_t pulp::tooling::gpu_health::kVersionV1 = 1
inlineconstexpr