Phase 5 step 1
This commit is contained in:
@@ -0,0 +1,230 @@
|
||||
#include "RuntimeStateLayerModel.h"
|
||||
|
||||
const char* RuntimeStateLayerKindName(RuntimeStateLayerKind kind)
|
||||
{
|
||||
switch (kind)
|
||||
{
|
||||
case RuntimeStateLayerKind::BasePersisted:
|
||||
return "base persisted";
|
||||
case RuntimeStateLayerKind::CommittedLive:
|
||||
return "committed live";
|
||||
case RuntimeStateLayerKind::TransientAutomation:
|
||||
return "transient automation";
|
||||
case RuntimeStateLayerKind::RenderLocal:
|
||||
return "render local";
|
||||
case RuntimeStateLayerKind::HealthConfig:
|
||||
return "health/config";
|
||||
default:
|
||||
return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
int RuntimeStateLayerCompositionPrecedence(RuntimeStateLayerKind kind)
|
||||
{
|
||||
switch (kind)
|
||||
{
|
||||
case RuntimeStateLayerKind::BasePersisted:
|
||||
return 0;
|
||||
case RuntimeStateLayerKind::CommittedLive:
|
||||
return 1;
|
||||
case RuntimeStateLayerKind::TransientAutomation:
|
||||
return 2;
|
||||
case RuntimeStateLayerKind::RenderLocal:
|
||||
case RuntimeStateLayerKind::HealthConfig:
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
bool RuntimeStateLayerIsDurable(RuntimeStateLayerKind kind)
|
||||
{
|
||||
return kind == RuntimeStateLayerKind::BasePersisted;
|
||||
}
|
||||
|
||||
bool RuntimeStateLayerParticipatesInParameterComposition(RuntimeStateLayerKind kind)
|
||||
{
|
||||
return RuntimeStateLayerCompositionPrecedence(kind) >= 0;
|
||||
}
|
||||
|
||||
bool RuntimeStateLayerIsRenderLocal(RuntimeStateLayerKind kind)
|
||||
{
|
||||
return kind == RuntimeStateLayerKind::RenderLocal;
|
||||
}
|
||||
|
||||
RuntimeStateLayerKind ClassifyRuntimeStateField(RuntimeStateField field)
|
||||
{
|
||||
switch (field)
|
||||
{
|
||||
case RuntimeStateField::PersistedLayerStack:
|
||||
case RuntimeStateField::PersistedParameterValues:
|
||||
case RuntimeStateField::StackPresets:
|
||||
return RuntimeStateLayerKind::BasePersisted;
|
||||
case RuntimeStateField::CommittedSessionParameterValues:
|
||||
case RuntimeStateField::CommittedLayerBypass:
|
||||
case RuntimeStateField::RuntimeCompileReloadFlags:
|
||||
return RuntimeStateLayerKind::CommittedLive;
|
||||
case RuntimeStateField::TransientOscOverlay:
|
||||
case RuntimeStateField::TransientAutomationCommitState:
|
||||
return RuntimeStateLayerKind::TransientAutomation;
|
||||
case RuntimeStateField::RenderLocalTemporalHistory:
|
||||
case RuntimeStateField::RenderLocalFeedbackState:
|
||||
case RuntimeStateField::RenderLocalInputFrames:
|
||||
case RuntimeStateField::RenderLocalOutputFrames:
|
||||
return RuntimeStateLayerKind::RenderLocal;
|
||||
case RuntimeStateField::RuntimeConfiguration:
|
||||
case RuntimeStateField::HealthTelemetry:
|
||||
default:
|
||||
return RuntimeStateLayerKind::HealthConfig;
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<RuntimeStateLayerDescriptor> GetRuntimeStateLayerInventory()
|
||||
{
|
||||
return {
|
||||
{
|
||||
RuntimeStateLayerKind::BasePersisted,
|
||||
"Base persisted state",
|
||||
"RuntimeStore / LayerStackStore",
|
||||
"Survives restart",
|
||||
"Written to disk",
|
||||
"Default layer stack, shader selections, saved parameter values"
|
||||
},
|
||||
{
|
||||
RuntimeStateLayerKind::CommittedLive,
|
||||
"Committed live state",
|
||||
"RuntimeCoordinator, physically backed by RuntimeStore during migration",
|
||||
"Current running session",
|
||||
"May request persistence depending on mutation policy",
|
||||
"Operator/session truth until changed again"
|
||||
},
|
||||
{
|
||||
RuntimeStateLayerKind::TransientAutomation,
|
||||
"Transient automation overlay",
|
||||
"RuntimeLiveState / RuntimeServiceLiveBridge",
|
||||
"High-rate and short-lived",
|
||||
"Not persisted directly",
|
||||
"Temporary OSC/automation target applied over committed truth"
|
||||
},
|
||||
{
|
||||
RuntimeStateLayerKind::RenderLocal,
|
||||
"Render-local state",
|
||||
"RenderEngine",
|
||||
"Render-thread/resource lifetime",
|
||||
"Not persisted",
|
||||
"Temporal history, feedback, input/output queues, and GL-local caches"
|
||||
},
|
||||
{
|
||||
RuntimeStateLayerKind::HealthConfig,
|
||||
"Health/config state",
|
||||
"RuntimeConfigStore / HealthTelemetry",
|
||||
"Config survives restart; health is observational",
|
||||
"Config is file-backed; health is reported, not composed",
|
||||
"Does not participate in parameter composition"
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
std::vector<RuntimeStateFieldDescriptor> GetRuntimeStateFieldInventory()
|
||||
{
|
||||
return {
|
||||
{
|
||||
RuntimeStateField::PersistedLayerStack,
|
||||
ClassifyRuntimeStateField(RuntimeStateField::PersistedLayerStack),
|
||||
"persisted layer stack",
|
||||
"LayerStackStore",
|
||||
"Durable layer order, ids, shader selections, and bypass flags"
|
||||
},
|
||||
{
|
||||
RuntimeStateField::PersistedParameterValues,
|
||||
ClassifyRuntimeStateField(RuntimeStateField::PersistedParameterValues),
|
||||
"persisted parameter values",
|
||||
"LayerStackStore",
|
||||
"Saved parameter values used as the baseline for snapshots and presets"
|
||||
},
|
||||
{
|
||||
RuntimeStateField::StackPresets,
|
||||
ClassifyRuntimeStateField(RuntimeStateField::StackPresets),
|
||||
"stack presets",
|
||||
"RuntimeStore / LayerStackStore",
|
||||
"Durable preset files and preset serialization shape"
|
||||
},
|
||||
{
|
||||
RuntimeStateField::CommittedSessionParameterValues,
|
||||
ClassifyRuntimeStateField(RuntimeStateField::CommittedSessionParameterValues),
|
||||
"committed session parameter values",
|
||||
"RuntimeCoordinator policy, RuntimeStore backing during migration",
|
||||
"Operator/API truth after accepted mutations"
|
||||
},
|
||||
{
|
||||
RuntimeStateField::CommittedLayerBypass,
|
||||
ClassifyRuntimeStateField(RuntimeStateField::CommittedLayerBypass),
|
||||
"committed layer bypass",
|
||||
"RuntimeCoordinator policy, RuntimeStore backing during migration",
|
||||
"Current operator/API bypass state"
|
||||
},
|
||||
{
|
||||
RuntimeStateField::RuntimeCompileReloadFlags,
|
||||
ClassifyRuntimeStateField(RuntimeStateField::RuntimeCompileReloadFlags),
|
||||
"runtime compile/reload flags",
|
||||
"RuntimeCoordinator / RuntimeUpdateController",
|
||||
"Session coordination state used to request snapshot or render rebuild work"
|
||||
},
|
||||
{
|
||||
RuntimeStateField::TransientOscOverlay,
|
||||
ClassifyRuntimeStateField(RuntimeStateField::TransientOscOverlay),
|
||||
"transient OSC overlays",
|
||||
"RuntimeLiveState",
|
||||
"High-rate automation values applied above committed state"
|
||||
},
|
||||
{
|
||||
RuntimeStateField::TransientAutomationCommitState,
|
||||
ClassifyRuntimeStateField(RuntimeStateField::TransientAutomationCommitState),
|
||||
"transient automation commit state",
|
||||
"RuntimeLiveState / RuntimeServiceLiveBridge",
|
||||
"Generation and completion bookkeeping for settled overlay commits"
|
||||
},
|
||||
{
|
||||
RuntimeStateField::RenderLocalTemporalHistory,
|
||||
ClassifyRuntimeStateField(RuntimeStateField::RenderLocalTemporalHistory),
|
||||
"render-local temporal history",
|
||||
"RenderEngine",
|
||||
"GL/resource history that must stay out of parameter layering"
|
||||
},
|
||||
{
|
||||
RuntimeStateField::RenderLocalFeedbackState,
|
||||
ClassifyRuntimeStateField(RuntimeStateField::RenderLocalFeedbackState),
|
||||
"render-local feedback state",
|
||||
"RenderEngine",
|
||||
"Feedback buffers and ping-pong resources"
|
||||
},
|
||||
{
|
||||
RuntimeStateField::RenderLocalInputFrames,
|
||||
ClassifyRuntimeStateField(RuntimeStateField::RenderLocalInputFrames),
|
||||
"render-local input frames",
|
||||
"RenderEngine",
|
||||
"Latest accepted input frame payloads and upload staging"
|
||||
},
|
||||
{
|
||||
RuntimeStateField::RenderLocalOutputFrames,
|
||||
ClassifyRuntimeStateField(RuntimeStateField::RenderLocalOutputFrames),
|
||||
"render-local output frames",
|
||||
"RenderEngine",
|
||||
"Readback, packed output, screenshot, and preview staging"
|
||||
},
|
||||
{
|
||||
RuntimeStateField::RuntimeConfiguration,
|
||||
ClassifyRuntimeStateField(RuntimeStateField::RuntimeConfiguration),
|
||||
"runtime configuration",
|
||||
"RuntimeConfigStore",
|
||||
"File-backed config, not a live parameter layer"
|
||||
},
|
||||
{
|
||||
RuntimeStateField::HealthTelemetry,
|
||||
ClassifyRuntimeStateField(RuntimeStateField::HealthTelemetry),
|
||||
"health telemetry",
|
||||
"HealthTelemetry",
|
||||
"Operational observations, not source state for render values"
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
enum class RuntimeStateLayerKind
|
||||
{
|
||||
BasePersisted,
|
||||
CommittedLive,
|
||||
TransientAutomation,
|
||||
RenderLocal,
|
||||
HealthConfig
|
||||
};
|
||||
|
||||
enum class RuntimeStateField
|
||||
{
|
||||
PersistedLayerStack,
|
||||
PersistedParameterValues,
|
||||
StackPresets,
|
||||
CommittedSessionParameterValues,
|
||||
CommittedLayerBypass,
|
||||
RuntimeCompileReloadFlags,
|
||||
TransientOscOverlay,
|
||||
TransientAutomationCommitState,
|
||||
RenderLocalTemporalHistory,
|
||||
RenderLocalFeedbackState,
|
||||
RenderLocalInputFrames,
|
||||
RenderLocalOutputFrames,
|
||||
RuntimeConfiguration,
|
||||
HealthTelemetry
|
||||
};
|
||||
|
||||
struct RuntimeStateLayerDescriptor
|
||||
{
|
||||
RuntimeStateLayerKind kind = RuntimeStateLayerKind::BasePersisted;
|
||||
const char* name = "";
|
||||
const char* owner = "";
|
||||
const char* lifetime = "";
|
||||
const char* persistence = "";
|
||||
const char* renderRole = "";
|
||||
};
|
||||
|
||||
struct RuntimeStateFieldDescriptor
|
||||
{
|
||||
RuntimeStateField field = RuntimeStateField::PersistedLayerStack;
|
||||
RuntimeStateLayerKind layerKind = RuntimeStateLayerKind::BasePersisted;
|
||||
const char* name = "";
|
||||
const char* currentOwner = "";
|
||||
const char* notes = "";
|
||||
};
|
||||
|
||||
const char* RuntimeStateLayerKindName(RuntimeStateLayerKind kind);
|
||||
int RuntimeStateLayerCompositionPrecedence(RuntimeStateLayerKind kind);
|
||||
bool RuntimeStateLayerIsDurable(RuntimeStateLayerKind kind);
|
||||
bool RuntimeStateLayerParticipatesInParameterComposition(RuntimeStateLayerKind kind);
|
||||
bool RuntimeStateLayerIsRenderLocal(RuntimeStateLayerKind kind);
|
||||
|
||||
RuntimeStateLayerKind ClassifyRuntimeStateField(RuntimeStateField field);
|
||||
std::vector<RuntimeStateLayerDescriptor> GetRuntimeStateLayerInventory();
|
||||
std::vector<RuntimeStateFieldDescriptor> GetRuntimeStateFieldInventory();
|
||||
|
||||
Reference in New Issue
Block a user