D972 - A program's control flow is laid out as structure where it nests

Status: decided Date: 2026-10-25 known_by: measured

A program's blocks are emitted as the selections and loops they form, rather than as arms of one switch on a program counter inside one loop (D098). The dispatch loop stays as the fallback for a segment whose flow does not nest, and as the reference structure is checked against.

ORBISTOUN_CONTROL_FLOW=dispatch lays out every program as the dispatch loop, to compare the two.

Why: the dispatch loop gives the host compiler one loop in which any block may follow any other. Grand Theft Auto V's program at 0x74005b7e8600 (2,171 instructions, 210 blocks) makes a 643,528-word module that an RTX 5070 Ti's driver compiles in 256 s. Laid out as structure it is 642,410 words and compiles in 198-204 s, with the same lane work (D956) in both. Its first layout was refused because an arm skipped past its join, which the escapes above now express.

Rejected: