FAILURE MAP
← Case archive

FA-89720 / Instruction set emulation / Member archive

Backward branch offset not sign-extended · case 05

A backward loop branch jumps far forward out of the program.

Member previewVariant 5 · 3 implementations · 6 checks per implementation

Case contract

Input [prog, limit]: word-indexed instructions at byte addresses 4*i: addi rt rs imm, beq/bne/beql rs rt off16, j index, nop, halt; 8 registers with r0 hardwired to 0. Branch target = branch address + 4 + (sign-extended off16 << 2). The instruction after a branch or jump (its delay slot) always executes before control transfers, except that a not-taken beql skips (annuls) its slot. j target = ((pc+4) & 0xF0000000) | (index << 2). Addresses outside the program behave as halt. Return [executed pcs, registers].

Why this case matters

Emulating MIPS-style pipelines requires executing the architectural delay slot and computing targets from the slot address.

One recorded failure

Sample boundary fixture

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

Boundary fixtureActualExpectedOutcome
backward counted loop[[0, 4, 8, 12, 16, 262148], [0, 5, 2, 1, 0, 0, 0, 0]][[0, 4, 8, 12, 16, 4, 8, 12, 16, 4, 8, 12, 16, 4, 8, 12, 16, 4, 8, 12, 16, 4, 8, 12, 16, 20], [0, 0, 12, 6, 0, 0, 0, 0]]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 ↗