FAILURE MAP
← Case archive

FA-90123 / Bytecode virtual machines / Member archive

Structured control: untaken br_if leaves its condition behind · case 03

Code after a failed conditional branch computes with an extra zero on the stack.

Member previewVariant 3 · 3 implementations · 8 checks per implementation

Case contract

WebAssembly-style structured control over a value stack. block k / loop / end nest; each block or loop pushes a label recording its operand height and arity (block: k result values, loop: 0). br d targets the d-th enclosing label counting outward from 0; the branch keeps the top arity values, discards operands down to the label height, then for a block pops that label and continues after its end, for a loop keeps the loop label and continues at the first instruction inside the loop. br_if pops a condition and branches when it is non-zero. Other ops: const v, add, sub, eqz, get k, set k, drop. Each instruction costs one fuel. Return status (done/fuel/trap), stack and locals.

Why this case matters

Label-depth branching is the core of structured bytecode interpreters.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
untaken br_if consumes its condition{"locals": [], "stack": [30, 3], "status": "done"}{"locals": [], "stack": [33], "status": "done"}Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

Member access is invitation-based. Sign in with your invited account to inspect the sources.

Sign in to the archive ↗