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

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 Adapter Circuit APIs. For those chapters, use Builder and Data Contracts and Adapter Circuit.

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_pack_inspect_ex(...)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_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

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(...)read delayed-history contributionvector length NqStep Execution
tdse_step_ir(...)read independent-response contributionvector length NqStep Execution
tdse_step_commit(...)advance committed historynoneStep Execution
tdse_step_dr(...)read committed direct responsevector length NqStep Execution

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_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_set_log_callback(...)register a structured log sinkglobal setting
tdse_ext_set_log_level(...) / tdse_ext_get_log_level(...)set or inspect log thresholdglobal setting
tdse_ext_log_emit(...)emit a structured log recordintegration helper
tdse_ext_set_deterministic_mode(...) / tdse_ext_get_deterministic_mode(...)control reproducibility modeglobal setting
tdse_ext_set_runtime_guard_config(...) / tdse_ext_get_runtime_guard_config(...)control runtime guard behaviorwarnings only; no numerical change
tdse_ext_get_runtime_guard_metrics(...) / tdse_ext_reset_runtime_guard_metrics(...)inspect or clear guard metricsmetrics snapshot helpers
tdse_ext_update_runtime_guard_metrics(...)update guard metricspublic for completeness, mainly runtime-internal
tdse_ext_status_from_runtime(...) / tdse_ext_status_from_builder(...) / tdse_ext_status_from_circuit_ac(...)normalize module-local status codesstatus mapping helpers
tdse_ext_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::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() / statusFromRuntime(...) / statusFromBuilder(...) / statusFromCircuitAc(...)status mapping 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(...)
compute trial output termstdse_step_begin/op/hr/ir
advance committed statetdse_step_commit(...)
inspect committed direct responsetdse_step_dr(...)
choose backend before steppingtdse_backend_set(...) or tdse_backend_apply_plan(...)
inspect available backend capabilitiestdse_backend_registry_count/get
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