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

Bounded recipe definitions, owned evidence, and native GPU probe runs. More...

Classes

struct  DprMeasurementRequest
struct  DprMeasurementDisposition
struct  AdapterIdentity
 Native adapter identity. Missing optionals represent absent evidence. More...
struct  Dimensions
 Recipe dimensions in pixels and unitless dispatched work items. More...
struct  Tolerance
 Absolute and relative error limits in the recipe's numeric sample units. More...
struct  RecipeBounds
 Per-recipe caps for owned samples and artifact bytes. More...
struct  RecipeDefinition
 Borrowed process-lifetime definition of one deterministic recipe. More...
struct  PassResult
 One ordered semantic oracle result. More...
struct  Artifact
 Bounded artifact descriptor; payload bytes are owned by ArtifactPayload. More...
struct  ProbeResult
 Closed v1 metadata and verdict for one recipe execution. More...
struct  ArtifactPayload
 Owning artifact descriptor plus its exact payload bytes. More...
struct  RunOptions
 Options that bind one native recipe execution and its negative control. More...
struct  RecipeRun
 Owning recipe result and byte-exact artifact payloads. More...

Enumerations

enum class  Verdict { pass , fail , unavailable , unverified }
 Four-state recipe outcome that never folds missing evidence into success. More...
enum class  AdapterPolicy { hardware_required , hardware_preferred , any_supported }
 Minimum adapter class accepted by a recipe definition. More...
enum class  AdapterClass { hardware , software , null_adapter , unknown }
 Adapter class proven by native identity, never inferred from backend alone. More...
enum class  IdentityStatus { authentic , unverified , unavailable }
 Authenticity state for the optional native adapter identity fields. More...
enum class  ArtifactKind { json , image , numeric_samples , trace }
 Machine-readable content kind for a declared artifact. More...

Functions

std::optional< DprMeasurementRequest > parse_dpr_measurement_request (std::string_view json, std::string *error=nullptr)
 Parse the bounded runner request fields owned by the native producer.
DprMeasurementDisposition evaluate_dpr_measurement_readiness (const DprMeasurementRequest &request)
 Report current product-measurement readiness without inventing counters.
std::string to_json (const DprMeasurementDisposition &result, bool pretty=false)
 Serialize the cell receipt consumed by the strict Python adapter.
int run_dpr_measurement (const DprMeasurementRequest &request, const std::filesystem::path &request_path, const std::filesystem::path &receipt_path, const std::filesystem::path &producer_path, std::string *error=nullptr)
 Execute a real bounded measurement.
int run_dpr_first_frame_trial (const DprMeasurementRequest &request, const std::filesystem::path &output_path, const std::filesystem::path &producer_path, std::string *error=nullptr)
std::string_view to_string (Verdict value)
 Return the canonical lowercase schema spelling from static storage.
std::string_view to_string (AdapterPolicy value)
std::string_view to_string (AdapterClass value)
std::string_view to_string (IdentityStatus value)
std::string_view to_string (ArtifactKind value)
const RecipeDefinition * find_recipe (std::string_view id)
 Find a borrowed process-lifetime definition, or return null for an unknown ID.
bool is_recipe_callable (std::string_view id)
 Return whether this build can execute the named registered recipe.
std::span< const RecipeDefinition > recipes ()
 Return a borrowed span over the immutable process-lifetime recipe registry.
std::string_view recipe_catalog_json ()
 Return the configure-time embedded canonical catalog bytes.
std::optional< std::string > recipe_discovery_json (std::optional< std::string_view > recipe_id=std::nullopt, std::optional< std::string_view > symptom=std::nullopt)
 Project the canonical catalog as a discovery envelope for an optional filter.
bool validate (const ProbeResult &result, std::string *error=nullptr)
 Validate bounds, recipe identity, ordered pass aggregation, and artifacts.
std::string to_json (const ProbeResult &result, bool pretty=false)
 Serialize without implicitly validating the result.
std::optional< ProbeResult > from_json (std::string_view json, std::string *error=nullptr)
 Parse the exact closed v1 shape and validate it before returning a value.
std::string render_human (const ProbeResult &result)
 Render an owning human-readable report; machine consumers use to_json().
int exit_code (const ProbeResult &result)
 Map pass to 0, fail to 1, and unavailable or unverified to 2.
bool validate (const RecipeRun &run, std::string *error=nullptr)
 Validate result semantics and every descriptor/payload byte and digest binding.
RecipeRun run_renderer3d_recipe (const RunOptions &options={})
 Run the blocking deterministic Renderer3D/readback recipe.
RecipeRun run_gpu_compute_magnitude_recipe (const RunOptions &options={})
 Run the blocking deterministic GPU magnitude recipe and CPU oracle.
RecipeRun run_gpu_audio_stft_recipe (const RunOptions &options={})
 Run one blocking GPU STFT frame and its CPU oracle.
RecipeRun run_threejs_multi_pass_recipe (const RunOptions &options={}, std::optional< std::string > threejs_runtime_root=std::nullopt)
 Run the blocking deterministic multi-pass recipe through a Three.js runtime.

Variables

constexpr std::string_view kDprCellRequestSchema
constexpr std::string_view kDprCellReceiptSchema
constexpr std::string_view kSchema = "pulp.gpu-probe-result.v1"
 Closed JSON schema identity for ProbeResult.
constexpr std::uint32_t kVersion = 1
 Schema version serialized in ProbeResult::version.
constexpr std::uint32_t kMaxDimension = 4096
 Maximum width or height in pixels for a registered recipe.
constexpr std::uint64_t kMaxWorkItems = 1'048'576
 Maximum unitless work-item count for a registered recipe.
constexpr std::uint32_t kMaxNumericSamples = 4096
 Maximum number of numeric samples retained in one result.
constexpr std::uint32_t kMaxArtifacts = 16
 Maximum number of artifacts retained in one result.
constexpr std::uint64_t kMaxArtifactBytes = 16 * 1024 * 1024
 Maximum declared size in bytes for one artifact.
constexpr std::uint64_t kMaxTotalArtifactBytes = 64 * 1024 * 1024
 Maximum combined declared artifact size in bytes for one result.
constexpr std::array kRecipeIds

Detailed Description

Bounded recipe definitions, owned evidence, and native GPU probe runs.

Ownership and lifetime
Probe results and recipe runs own their strings, vectors, and artifact bytes. find_recipe pointers, recipes spans, and the string views inside each RecipeDefinition refer to a process-lifetime static registry and must not be freed or retained after module unload. Validators and serializers retain no references to caller-owned inputs.
Threading and real-time safety
Model, parsing, and serialization functions may allocate and provide no synchronization for shared objects. Native recipe functions acquire devices, submit work, wait for mapping/readback, and may access artifact runtimes. Run them on an offline control or worker thread, never an audio callback or another real-time thread.
Determinism and units
Recipes bind fixed sources, seeds, dimensions, ordered semantic passes, and independent oracles. Width and height are pixels, work_items and sample counts are unitless counts, artifact sizes are bytes, SHA-256 values are lowercase hexadecimal, and tolerances use the recipe's numeric sample units. GPU scheduling time is not inferred from these result fields.
Results, unavailable evidence, and errors
pass and fail mean the requested recipe executed and reached its oracle. unavailable means the device, feature, runtime, or other required evidence could not be acquired; unverified means the evidence cannot support a claim. Neither is a pass. Validation and parsing report human diagnostics through optional error outputs, while stable automation uses verdicts, registered pass codes, and process exit codes.

Enumeration Type Documentation

◆ AdapterClass

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

Enumerator
hardware 
software 
null_adapter 
unknown 

◆ AdapterPolicy

Minimum adapter class accepted by a recipe definition.

Enumerator
hardware_required 
hardware_preferred 
any_supported 

◆ ArtifactKind

Machine-readable content kind for a declared artifact.

Enumerator
json 
image 
numeric_samples 
trace 

◆ IdentityStatus

Authenticity state for the optional native adapter identity fields.

Enumerator
authentic 
unverified 
unavailable 

◆ Verdict

Four-state recipe outcome that never folds missing evidence into success.

Enumerator
pass 

Work completed and every semantic oracle passed.

fail 

Work completed and at least one measured oracle failed.

unavailable 

Required execution capability or evidence was unavailable.

unverified 

Evidence exists but is insufficient for a measured claim.

Function Documentation

◆ evaluate_dpr_measurement_readiness()

DprMeasurementDisposition pulp::tooling::gpu_probe::evaluate_dpr_measurement_readiness ( const DprMeasurementRequest & request)

Report current product-measurement readiness without inventing counters.

◆ exit_code()

int pulp::tooling::gpu_probe::exit_code ( const ProbeResult & result)

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

◆ find_recipe()

const RecipeDefinition * pulp::tooling::gpu_probe::find_recipe ( std::string_view id)

Find a borrowed process-lifetime definition, or return null for an unknown ID.

◆ from_json()

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

Parse the exact closed v1 shape and validate it before returning a value.

◆ is_recipe_callable()

bool pulp::tooling::gpu_probe::is_recipe_callable ( std::string_view id)

Return whether this build can execute the named registered recipe.

◆ parse_dpr_measurement_request()

std::optional< DprMeasurementRequest > pulp::tooling::gpu_probe::parse_dpr_measurement_request ( std::string_view json,
std::string * error = nullptr )

Parse the bounded runner request fields owned by the native producer.

◆ recipe_catalog_json()

std::string_view pulp::tooling::gpu_probe::recipe_catalog_json ( )

Return the configure-time embedded canonical catalog bytes.

◆ recipe_discovery_json()

std::optional< std::string > pulp::tooling::gpu_probe::recipe_discovery_json ( std::optional< std::string_view > recipe_id = std::nullopt,
std::optional< std::string_view > symptom = std::nullopt )

Project the canonical catalog as a discovery envelope for an optional filter.

recipe_id selects one exact recipe (the show shape); symptom selects every matching recipe (the filtered list shape). With neither filter, all canonical rows remain visible. The filters are mutually exclusive and an unknown value returns nullopt. Each row's callable bit reflects this model's configured GPU, Scene3D, and Three.js execution capabilities.

◆ recipes()

std::span< const RecipeDefinition > pulp::tooling::gpu_probe::recipes ( )

Return a borrowed span over the immutable process-lifetime recipe registry.

◆ render_human()

std::string pulp::tooling::gpu_probe::render_human ( const ProbeResult & result)

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

◆ run_dpr_first_frame_trial()

int pulp::tooling::gpu_probe::run_dpr_first_frame_trial ( const DprMeasurementRequest & request,
const std::filesystem::path & output_path,
const std::filesystem::path & producer_path,
std::string * error = nullptr )

◆ run_dpr_measurement()

int pulp::tooling::gpu_probe::run_dpr_measurement ( const DprMeasurementRequest & request,
const std::filesystem::path & request_path,
const std::filesystem::path & receipt_path,
const std::filesystem::path & producer_path,
std::string * error = nullptr )

Execute a real bounded measurement.

Returns the receipt exit code (0 pass, 1 measured failure, 3 incomplete) and always writes a receipt.

◆ run_gpu_audio_stft_recipe()

RecipeRun pulp::tooling::gpu_probe::run_gpu_audio_stft_recipe ( const RunOptions & options = {})

Run one blocking GPU STFT frame and its CPU oracle.

This diagnostic owns no audio device or Processor and runs only from an offline tool or worker thread, never an audio callback.

◆ run_gpu_compute_magnitude_recipe()

RecipeRun pulp::tooling::gpu_probe::run_gpu_compute_magnitude_recipe ( const RunOptions & options = {})

Run the blocking deterministic GPU magnitude recipe and CPU oracle.

◆ run_renderer3d_recipe()

RecipeRun pulp::tooling::gpu_probe::run_renderer3d_recipe ( const RunOptions & options = {})

Run the blocking deterministic Renderer3D/readback recipe.

◆ run_threejs_multi_pass_recipe()

RecipeRun pulp::tooling::gpu_probe::run_threejs_multi_pass_recipe ( const RunOptions & options = {},
std::optional< std::string > threejs_runtime_root = std::nullopt )

Run the blocking deterministic multi-pass recipe through a Three.js runtime.

threejs_runtime_root is borrowed for the call. An explicit root supports installed CLI dispatch; absence selects the configured pinned runtime. A missing or unusable runtime produces unavailable, not an empty pass.

◆ to_json() [1/2]

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

Serialize the cell receipt consumed by the strict Python adapter.

◆ to_json() [2/2]

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

Serialize without implicitly validating the result.

◆ to_string() [1/5]

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

◆ to_string() [2/5]

std::string_view pulp::tooling::gpu_probe::to_string ( AdapterPolicy value)

◆ to_string() [3/5]

std::string_view pulp::tooling::gpu_probe::to_string ( ArtifactKind value)

◆ to_string() [4/5]

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

◆ to_string() [5/5]

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

Return the canonical lowercase schema spelling from static storage.

◆ validate() [1/2]

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

Validate bounds, recipe identity, ordered pass aggregation, and artifacts.

On failure, error receives a human diagnostic when non-null. The text is not a stable machine-readable error code.

◆ validate() [2/2]

bool pulp::tooling::gpu_probe::validate ( const RecipeRun & run,
std::string * error = nullptr )

Validate result semantics and every descriptor/payload byte and digest binding.

Variable Documentation

◆ kDprCellReceiptSchema

std::string_view pulp::tooling::gpu_probe::kDprCellReceiptSchema
inlineconstexpr
Initial value:
=
"pulp.gpu-dpr-cell-receipt.v1"

◆ kDprCellRequestSchema

std::string_view pulp::tooling::gpu_probe::kDprCellRequestSchema
inlineconstexpr
Initial value:
=
"pulp.gpu-dpr-cell-request.v1"

◆ kMaxArtifactBytes

std::uint64_t pulp::tooling::gpu_probe::kMaxArtifactBytes = 16 * 1024 * 1024
inlineconstexpr

Maximum declared size in bytes for one artifact.

◆ kMaxArtifacts

std::uint32_t pulp::tooling::gpu_probe::kMaxArtifacts = 16
inlineconstexpr

Maximum number of artifacts retained in one result.

◆ kMaxDimension

std::uint32_t pulp::tooling::gpu_probe::kMaxDimension = 4096
inlineconstexpr

Maximum width or height in pixels for a registered recipe.

◆ kMaxNumericSamples

std::uint32_t pulp::tooling::gpu_probe::kMaxNumericSamples = 4096
inlineconstexpr

Maximum number of numeric samples retained in one result.

◆ kMaxTotalArtifactBytes

std::uint64_t pulp::tooling::gpu_probe::kMaxTotalArtifactBytes = 64 * 1024 * 1024
inlineconstexpr

Maximum combined declared artifact size in bytes for one result.

◆ kMaxWorkItems

std::uint64_t pulp::tooling::gpu_probe::kMaxWorkItems = 1'048'576
inlineconstexpr

Maximum unitless work-item count for a registered recipe.

◆ kRecipeIds

std::array pulp::tooling::gpu_probe::kRecipeIds
inlineconstexpr
Initial value:
{
std::string_view{"renderer3d.hardcoded-cube.v1"},
std::string_view{"gpu-compute.magnitude.v1"},
std::string_view{"gpu-audio.stft.v1"},
std::string_view{"threejs.multi-pass.v1"},
}

◆ kSchema

std::string_view pulp::tooling::gpu_probe::kSchema = "pulp.gpu-probe-result.v1"
inlineconstexpr

Closed JSON schema identity for ProbeResult.

◆ kVersion

std::uint32_t pulp::tooling::gpu_probe::kVersion = 1
inlineconstexpr

Schema version serialized in ProbeResult::version.