PM-301f · Module 2

Sub-Prompt Sequencing

4 min read

Sequencing determines the order in which sub-prompts execute. The dependency graph drives sequencing — a sub-prompt that requires output from another must execute after that other completes. Parallel-safe sub-prompts can execute simultaneously. Getting sequencing wrong produces either deadlock (waiting for output that hasn't been produced yet) or garbage-in garbage-out (using incomplete upstream output).

  1. Derive Sequencing from the Dependency Graph Already mapped in Lesson 2. Each level of the dependency graph represents a batch of sub-prompts that can execute simultaneously. Level 0 first, then level 1, then level 2. Within each level, execution is parallel. Between levels, execution is sequential.
  2. Parallel-Safe Identification Two sub-prompts are parallel-safe if and only if neither requires the output of the other. If S2 and S3 both depend on S1 but not on each other, they are parallel-safe. If S2 uses any output that S3 produces (or vice versa), they are not parallel-safe, even if both depend on S1.
  3. Dependency Violations in Practice The most common sequencing error: starting a sub-prompt before all its dependencies are complete. This happens when a developer incorrectly classifies a task as parallel-safe. Prevention: for each sub-prompt, list its inputs and verify each input is a concrete output from a preceding level. Any input that is not verified produces a sequencing vulnerability.
Sub-Prompt Sequencing Verification

| Sub-Task | Depends On    | Parallel With | Execute Level |
|----------|---------------|---------------|---------------|
| S1       | (none)        | (none)        | 0             |
| S2       | S1            | S3            | 1             |
| S3       | S1            | S2            | 1             |
| S4       | S2, S3        | S5            | 2             |
| S5       | S2, S3        | S4            | 2             |
| S6       | S4            | (none)        | 3             |
| S7       | S4, S5        | (none)        | 3             |

Execution schedule:
Level 0: [S1]
Level 1: [S2, S3] — run in parallel
Level 2: [S4, S5] — run in parallel, start only after S2 AND S3 complete
Level 3: [S6] — start only after S4 completes
Level 3: [S7] — start only after S4 AND S5 complete

Critical path: S1 → S2 → S4 → S7 (4 sequential steps)
Optimization: S3 and S5 are on a parallel path — they don't extend the critical path