---
title: Deterministic Dynamic Execution
url: https://www.emergentmind.com/topics/deterministic-dynamic-execution
type: topic
---

# Deterministic Dynamic Execution

Deterministic Dynamic Execution (DDE) is a scheduling paradigm introduced to guarantee timing-anomaly-free execution for dynamic scheduling of multi-typed directed acyclic graph (DAG) tasks on heterogeneous platforms. By enforcing deterministic constraints on resource allocation and task execution order, DDE eliminates the pitfalls of conventional dynamic schedulers, notably timing anomalies that complicate or invalidate standard worst-case response time (WCRT) analyses. DDE achieves both safety and tightness in WCRT estimation through a single offline simulation, with minimal overhead and favorable empirical properties even on large-scale heterogeneous systems [2601.20445].

## 1. System and Task Model

DDE is formulated for heterogeneous platforms comprising multiple processing unit types (e.g., CPUs, GPUs), each possibly with several identical instances. Let $\mathrm{PUT}$ denote the set of processing-unit types, and $\mathrm{resNum}(res)$ the instance count for type $res \in \mathrm{PUT}$.

The task model consists of a multi-typed DAG $G=(V,E,M,\Gamma)$:
- $V$: tasks; $E \subseteq V \times V$: precedence constraints.
- $M: V \to 2^{\mathrm{PUT}} \setminus \emptyset$: eligible resource types for each task.
- $\Gamma: V \times \mathrm{PUT} \to \mathbb{I}_{>0} \times \mathbb{I}_{>0}$ giving for $(v, res)$
  $$
  \Gamma(v, res) = [\mathrm{BCET}(v, res),\ \mathrm{WCET}(v, res)]
  $$
  where BCET/WCET denote best/worst-case execution times, capturing workload- and resource-dependent variability.

For task $v_i$:
- $s_i$: start time; $f_i$: finish time; $RT(i) = f_i - s_\mathrm{src}$ (relative to the DAG source).
- System response: $RT(v_\mathrm{sink})$.

Let $\mathbb{S}$ be the set of all feasible schedules respecting precedence and resource constraints. Then the system WCRT is:
$$
\mathrm{WCRT} = \max_{\mathcal{S} \in \mathbb{S}} RT_\mathcal{S}(v_\mathrm{sink})
\approx RT(v_\mathrm{sink}) \,\, \text{when all tasks use WCETs}
$$

## 2. Timing Anomalies in Dynamic Scheduling

A timing anomaly (TA) refers to the counterintuitive phenomenon where a locally accelerated event (e.g., a task finishes early at BCET) can increase the global WCRT relative to the all-WCET simulation bound. This undermines the validity of conventional WCRT analyses and frequently forces unsafe or overly pessimistic estimation procedures.

The paper defines a strict timing anomaly precisely. Consider two system states $c_1, c_2$ in the execution-progress domain (see below), with $c_1(t) \sqsubset_P c_2(t)$ for all tasks $t$ in some $\mathbb{S} \subseteq \mathbb{T}$, and for all future evolution, allocated execution times in $c_1$ are at least those in $c_2$. A strict timing anomaly is exhibited if, after $n$ transitions, $upd^n(c_1) \not\sqsubseteq_C upd^n(c_2)$, i.e., the “faster” state falls behind due to dynamically shifting resource contention or precedence scheduling.

An explicit example demonstrates this: an early completion on a GPU causes downstream loss of parallelism, making a critical task await resource availability longer, prolonging the overall response beyond the offline bound [2601.20445].

## 3. Deterministic Dynamic Execution Algorithm

### 3.1 Execution-Progress Model

Execution progress is represented by the domain
$$
S = \{\mathrm{Block},\, \mathrm{Ready},\, \mathrm{Exec},\, \mathrm{Finish}\}
$$
and $P = S \times \mathbb{N}_0$, with $p = (s, t)$ indicating the current stage and the remaining time at that stage. A partial order $\sqsubseteq_P$ is imposed:
$$
(s_1, t_1) \sqsubseteq_P (s_2, t_2) \iff s_1 \sqsubseteq_S s_2 \quad \text{or} \quad (s_1 = s_2 \land t_1 \ge t_2)
$$
where $\mathrm{Block} \sqsubset_S \mathrm{Ready} \sqsubset_S \mathrm{Exec} \sqsubset_S \mathrm{Finish}$.

A system state $c: \mathbb{T} \to P$ maps each task $t$ to its progress, ordered pointwise: $c \sqsubseteq_C c'$ iff $c(t) \sqsubseteq_P c'(t)$ for all $t$.

The state transition $upd: C \to C$ is defined such that in each scheduling tick, for each task $t$:
- If ready to move stage (all dependencies met and resources available) or Exec done: transition to next stage ($stage'(t)$) and set time to required allocation, otherwise decrement remaining time.

### 3.2 Deterministic Execution Constraints

To exclude timing anomalies, DDE enforces:
- **Resource Allocation Determinism**: Every task $t$ is always scheduled on a predetermined unit type $res_t$:
  $$
  resAllocPat_D = \{(t, res_t)\mid t \in \mathbb{T}\}
  $$
- **Execution Order Determinism**: Tasks must enter Exec in a single total order $O_D = (t_1 \preceq t_2 \preceq \cdots \preceq t_N)$ extending the DAG’s partial order. Task $t_j$ cannot start until all $t_i \prec t_j$ have started.

The DDE scheduler executes as follows (pseudocode as stated):

```python
while exists tick(c)==0:
    c ← upd(c)
for each t in ReadyQueue in order O_D:
    if all predecessors of t in O_D have begun Exec:
        assign t to an idle instance of res_t
        set its remaining time = WCET(t, res_t)
        mark t as begun Exec
```
Complexity per tick is $O(|\mathrm{ReadyQueue}| + \log N)$, assuming $O_D$ is maintained via a priority queue.

## 4. WCRT Estimation via Offline Simulation

Given the enforced determinism, the WCRT is derived from a single offline execution:
- Assign all tasks their WCETs and simulate $upd$ from all tasks in Block.
- Upon sink completion, response time $RT(v_\mathrm{sink})$ is both safe (no under-approximation) and tight (no excessive pessimism), as deterministic constraints preclude timing anomaly deviation.

Formally,
$$
\mathrm{WCRT} = \min_{\substack{resAllocPat_D,\, O_D}} \max_n \left( f_{\mathrm{sink}}(n) \right)
$$
where $f_{\mathrm{sink}}(n)$ is the finish time across all ticks.

## 5. Construction of Deterministic Execution Constraints

DDE constraints can be generated offline by either of two methods:

- **Trace Extraction**: Run any dynamic scheduler (e.g., HBFS) offline under all-WCET settings. For each task, record its start time, finish time, and chosen resource. Build $O_D$ by sorting tasks by $s_t$ (ties broken by task ID), set $resAllocPat_D(t)=res_t$.

- **Heuristic-Based HACPA**: Compute for each task a critical-path “rank”:
  $$
  \mathit{rank}(t) = \mathrm{avgCost}(t) + \max_{u \in succ(t)} \mathit{rank}(u)
  $$
  with $\mathrm{avgCost}(t) = \frac{1}{|M(t)|} \sum_{res \in M(t)} \mathrm{WCET}(t, res)$. Sort tasks by descending rank. For each $t$, choose the resource leading to earliest finish, update $O_D$ and $resAllocPat_D$ in assignment order.

## 6. Formal Guarantees and Correctness

The DDE paradigm is supported by a series of formal results:
- **Monotonicity**: Under DDE, execution progress is monotonic—no fast-execution state can ever fall behind a slower one under any evolution.
- **Strict TA Elimination**: Lemmas ensure forward progress, dependency monotonicity, and that staged transitions preserve the progress order. The general strict TA-freedom theorem constructs a general proof by induction and repeated application of monotonicity lemmas, showing that no dynamic execution under DDE can exhibit a strict timing anomaly.

This ensures the single all-WCET simulation bound is both sound (never optimistic) and maximally precise given the enforced constraints.

## 7. Empirical Evaluation and Observed Impact

Experiments employed random DAG task sets generated via the $G(n, p)$ model, with $n \in \{10, \dots, 40\}$ and edge-probability $p \in \{0.1, \dots, 0.9\}$. Variability in $\Gamma(v, res)$ was chosen to represent both wide and narrow WCET-BCET spreads.

Key findings:
- **TA Probability**: In unconstrained HFCFS, TAs occurred in up to 44.8% of tested systems at low $p$, vanishing as DAG density increased. HBFS displayed much lower rates ($\leq 2.6\%)$.
- **WCRT Reduction**: In TA-affected systems, DDE imposed on HFCFS reduced WCRT by between 5–25% (best observed: 72%) relative to the unconstrained maximum observed WCRT. HACPA-derived constraints further reduced WCRT.
- **Jitter**: Enforced determinism cut response-time jitter by 7–9% on average.
- **Average Response Time Impact**: The average overhead on AVRT was minor (1–12%; avg 4.2%). In TA-affected systems, AVRT sometimes decreased (average –1.2%, up to –40%).
- **Overhead**: Scheduling overhead for DDE was minimal (one priority-queue lookup per ready task per tick) relative to task execution costs.

A plausible implication is that the robustness and tight WCRT estimation provided by DDE are achieved with negligible runtime cost and limited sacrifice in average-case performance, supporting its practical suitability for real-world safety- or real-time-critical heterogeneous applications [2601.20445].

Source: https://www.emergentmind.com/topics/deterministic-dynamic-execution