Time-Domain System Equivalent logoTime-Domain System EquivalentLinear dynamics, solved faster.Discuss Integration

Runtime Integration

A compact reference for the runtime-facing API surface.

Use this chapter as the Runtime lookup page when the real question is not "how does the step loop work?" but "which API family should I reach for first?" It is intentionally compact: a map into the Runtime APIs, not a replacement for the generated API Reference or the deeper lifecycle chapters.

Read this chapter first when you already know TDSE belongs in your host loop but do not yet know whether the next stop should be Builder, lifecycle, step execution, or the generated API reference.

Related Chapters

How This Runtime Part Is Split

The Runtime material stays split into short sections on purpose. Most customer teams do not read Runtime linearly; they jump to the contract surface that matches the host question in front of them.

If your question is...Read this chapter first
which API family do I needthis chapter
who owns the handle and how do I shut it downRuntime Lifecycle
what exact calls happen every accepted stepStep Execution
what happens under overlap, races, or teardown contentionConcurrency and Shutdown
how many models, threads, or GPU shares can I affordThreading and Scaling and Multi-Model Patterns
which backend is production-supportedRuntime Backend Support Matrix
what do I collect when Runtime failsRuntime Troubleshooting Runbook
how do I tune backend knobsRuntime Performance Tuning

Scope Boundary

This chapter covers Runtime APIs only:

  • core model lifecycle
  • runtime snapshots and diagnostics
  • trial/commit step execution
  • runtime-facing perf / ext controls that operate on tdse_model_t*
  • C++ wrappers for the same runtime-facing surface

It does not list Builder or Circuit SDK APIs. For those chapters, use Builder and Data Contracts and Circuit SDK.

Core Runtime Lifecycle APIs

APIFirst JobUse It WhenDetails Live In
tdse_model_create(...)create a runtime handle from pack bytesevery normal create pathRuntime Lifecycle
tdse_model_close(...)request a close without waiting for teardownyou need an immediate lifecycle answerRuntime Lifecycle
tdse_model_destroy(...)shut down with an explicit wait policynormal host-managed shutdownRuntime Lifecycle
tdse_model_release(...)perform terminal cleanup in finalizer-style pathsdestructor, guard, or finally cleanupRuntime Lifecycle
tdse_model_reset(...)clear committed state before intentional reuseyou are reusing a live handle on purposeRuntime Lifecycle

Runtime Version And Introspection APIs

APIFirst JobWhat It ReturnsNotes
tdse_version_string(...)get full version textfull semantic version stringstable runtime version text
tdse_version_major(...)get major versionsemantic version major componentinteger component
tdse_version_minor(...)get minor versionsemantic version minor componentinteger component
tdse_version_patch(...)get patch versionsemantic version patch componentinteger component
tdse_pack_inspect(...)inspect pack dimensions before createtdse_model_info_t decoded from pack bytesno runtime handle allocation
tdse_runtime_pack_inspect_summary(...)inspect pack metadata before createtdse_pack_summary_t with pack version and payload summarymetadata-only path

Runtime Snapshot And Diagnostics APIs

APIFirst JobWhat It ReturnsNotes
tdse_model_info(...)read static model metadatamodel dimensions and fixed propertiesout_info->struct_size must be set
tdse_model_state_info(...)read live execution statecurrent runtime stateout_state->struct_size must be set
tdse_model_last_error_info(...)read the last failure snapshotmost recent non-OK runtime result on the handlesticky until next failure or tdse_model_reset(...)
tdse_model_diagnostics_summary(...)read the stable compact support snapshotmodel info, current state, sticky last error, health, and compute-type summarypreferred first-response Runtime diagnostic record
tdse_model_diagnostics_payload(...)read one optional diagnostic domainone caller-initialized versioned CPU-route, numeric, memory, accelerator, CPU-execution, CPU-precision, or partition payloadrequest only the detail domain the caller consumes
tdse_model_diagnostics_query_many(...)read a consistent diagnostic bundleone summary plus multiple caller-owned versioned payloadspreferred when all outputs must represent one internal snapshot
tdse_model_health_info(...)read the current health snapshotinitialized tdse_model_health_info_toperational health without collecting the full diagnostic bundle
tdse_model_history_prefetch_info(...)inspect history-prefetch stateinitialized tdse_model_history_prefetch_info_treal-time latency and fallback triage
tdse_model_partition_diagnostics_json(...)export partition diagnosticscaller-sized JSON bufferuse a NULL/zero sizing call first
tdse_pack_error_token(...)decode create-time pack errorsreadable token for a pack-error codeuses tdse_model_create_diagnostics_t::pack_error_code
tdse_status_message(...)decode runtime status codesreadable text for a runtime status codestatus text only
tdse_status_error_category_v2(...) / tdse_status_stable_reason_v2(...)classify failures for automationstable category and reason tokensprefer the v2 classifiers in new integrations

Step Execution APIs

Use this table to find the right step API quickly. For the full trial/commit model, sequencing rules, and caller buffer contracts, switch to Step Execution.

APIFirst JobTypical OutputDetails Live In
tdse_step_begin(...)start or re-enter a trial stepnoneStep Execution
tdse_step_op(...)read the instantaneous operatordense block Np x Np or Nq x NpStep Execution
tdse_step_hr_v2(...)read delayed-history contribution with capacity checkingvector length Nq; required count is always reportedStep Execution
tdse_step_ir_v2(...)read independent-response contribution with capacity checkingvector length Nq; required count is always reportedStep Execution
tdse_step_commit_v2(...)advance committed history with an explicit Np countnoneStep Execution
tdse_step_dr_v2(...)read committed direct response with capacity checkingvector length Nq; required count is always reportedStep Execution

The unsuffixed tdse_step_hr, tdse_step_ir, tdse_step_commit, and tdse_step_dr functions remain ABI-compatible entry points, but they cannot validate caller buffer capacity. New C integrations and language bindings should use the _v2 functions.

Execution Policy And Resource APIs

Runtime separates a requested execution policy from the concrete resources available to a model:

API familyFirst jobNotes
tdse_execution_policy_init(...)initialize policy defaultsset policy before the first successful tdse_step_begin(...)
tdse_execution_resource_set_init(...) and resource helpersdescribe CPU, GPU, FPGA, or remote-GPU resourcesresource discovery does not imply entitlement or qualification
tdse_model_set_execution_policy(...) / tdse_model_get_execution_policy(...)set or inspect a model policypre-step configuration
tdse_model_set_execution_resources(...) / tdse_model_get_execution_resources(...)bind or inspect resourcesGPU and FPGA binding invokes the corresponding Add-on authorization
tdse_model_clear_execution_resources(...)return to policy-driven selectionpre-step configuration

Use Backend Selection and Performance for availability and qualification. Use Product Authorization for entitlement combinations.

Runtime-Facing Perf And Ext APIs

perf APIs

APIFirst JobNotes
tdse_backend_registry_count(...) / tdse_backend_registry_get(...)enumerate available backendscapability discovery
tdse_backend_set(...)choose a backend before steppingpre-step only
tdse_backend_get_active(...)inspect the active backendreads last effective backend on the model
tdse_backend_apply_plan(...)apply a JSON backend planpre-step only
tdse_backend_qualification_query(...)query qualification evidence for one backendcapability, authorization, and qualification are separate facts
tdse_cuda_backend_set_config(...) / tdse_cuda_backend_get_config(...)set or inspect CUDA optionssetter is pre-step only
tdse_compute_precision_set(...) / tdse_compute_precision_get(...)set or inspect CPU history precisionsetter is pre-step only
tdse_local_threads_set(...) / tdse_local_threads_get(...)set or inspect local CPU thread overridesetter is pre-step only
tdse_backend_id_name(...) / tdse_backend_id_from_name(...)map backend ids and namestoken lookup helpers
tdse_perf_get_build_features_json(...)export build/runtime feature flagspass out_json = NULL to query required bytes

ext APIs

APIFirst JobNotes
tdse_ext_context_create(...) / tdse_ext_context_destroy(...)own extension state explicitlykeep alive while borrowed by models
tdse_ext_context_set_log_callback(...)register a structured log sinkcontext-local setting
tdse_ext_context_set_log_level(...) / tdse_ext_context_get_log_level(...)set or inspect log thresholdcontext-local setting
tdse_ext_context_log_emit(...)emit a structured log recordintegration helper
tdse_ext_context_set_deterministic_mode(...) / tdse_ext_context_get_deterministic_mode(...)control reproducibility modecontext-local setting
tdse_ext_context_set_runtime_guard_config_v2(...) / tdse_ext_context_get_runtime_guard_config(...)validate, set, or inspect runtime guard behaviorwarnings only; no numerical change
tdse_ext_context_get_runtime_guard_metrics(...) / tdse_ext_context_reset_runtime_guard_metrics(...)inspect or clear guard metricsmetrics snapshot helpers
tdse_status_message(...) / tdse_ext_pack_error_name(...)decode unified status and pack errorsreadable token helpers

C++ Wrapper Equivalents

C++ APIRuntime SurfaceNotes
tdse::Model::fromMemory(...)tdse_model_create(...)request-scoped create diagnostics overload available
tdse::Model::empty() / operator bool()wrapper state onlyuse after move, close, destroy, or release to gate business calls
tdse::Model::info()tdse_model_info(...)returns tdse_model_info_t
tdse::Model::stateInfo()tdse_model_state_info(...)returns tdse_model_state_info_t
tdse::Model::lastErrorInfo()tdse_model_last_error_info(...)sticky failure snapshot
tdse::Model::diagnosticsSummary() / tryDiagnosticsSummary()tdse_model_diagnostics_summary(...)stable compact Runtime support snapshot
tdse::Model::diagnosticsPayload() / tryDiagnosticsPayload()tdse_model_diagnostics_payload(...)one caller-selected versioned detail payload
tdse::Model::diagnosticsQueryMany() / tryDiagnosticsQueryMany()tdse_model_diagnostics_query_many(...)one consistent summary plus payload set
tdse::Model::destroy(options)tdse_model_destroy(...)canonical bounded destroy
tdse::Model::release()tdse_model_release(...)finalizer cleanup
tdse::Model::beginStep() / stepOp() / stepHr() / stepIr() / commit() / stepDr()runtime step APIsstepOp() defaults to Np x Np; full=true selects Nq x Np; wrapper enforces Np / Nq buffer sizes
tdse::perf::backendCount() / backendGet()backend registry APIsC++ registry enumeration
tdse::perf::setBackend() / activeBackend() / applyPlan()backend routing APIsruntime-facing perf control
tdse::perf::setCudaConfig() / getCudaConfig()CUDA config APIsper-model CUDA options
tdse::perf::setComputePrecision() / getComputePrecision()precision APIsCPU history precision
tdse::perf::setLocalThreads() / getLocalThreads()local thread APIslocal CPU thread override
tdse::perf::getBuildFeaturesJson(...)tdse_perf_get_build_features_json(...)returns JSON through std::string
tdse::ext::setLogCallback() / setLogLevel() / logLevel()ext logging APIslogging wrapper coverage
tdse::ext::setDeterministicMode() / deterministicMode()deterministic-mode APIsglobal runtime toggle
tdse::ext::setRuntimeGuardConfig() / runtimeGuardConfig() / runtimeGuardMetrics() / resetRuntimeGuardMetrics()runtime guard APIsstable-guard wrapper coverage
tdse::ext::statusMessage() / packErrorName()status helper APIsreadable status and token helpers
SituationRecommended API
create a modeltdse_model_create(...)
check runtime versiontdse_version_string(...)
inspect static shapetdse_model_info(...)
inspect live statetdse_model_state_info(...)
inspect last runtime failuretdse_model_last_error_info(...)
collect first-response runtime diagnosticstdse_model_diagnostics_summary(...); use tdse_model_diagnostics_query_many(...) when detail payloads must share the same snapshot
compute trial output termstdse_step_begin(...), tdse_step_op(...), tdse_step_hr_v2(...), tdse_step_ir_v2(...)
advance committed statetdse_step_commit_v2(...)
inspect committed direct responsetdse_step_dr_v2(...)
bind CPU, GPU, FPGA, or remote resourcestdse_model_set_execution_resources(...)
evaluate or integrate product entitlementsProduct Authorization
choose backend before steppingtdse_backend_set(...) or tdse_backend_apply_plan(...)
inspect available backend capabilitiestdse_backend_registry_count/get
decide if a backend is production-supportedRuntime Backend Support Matrix
collect an incident bundleRuntime Troubleshooting Runbook
tune AUTO, CPU, CUDA, or FPGA knobsRuntime Performance Tuning
query build/runtime feature flagstdse_perf_get_build_features_json(...)
normal host shutdowntdse_model_destroy(...)
terminal cleanup pathtdse_model_release(...)

Quick Memory Aid

If you remember only three runtime ideas, remember these:

  1. create is request-scoped and diagnostic-rich
  2. commit is the only state-advancing step call
  3. perf setters are pre-step only; after the first successful begin, configuration is frozen