FAILURE MAP
← Case archive

FA-90254 / Bytecode virtual machines / Member archive

Numeric for loop: float loops always test ascending · case 04

Descending float loops execute zero iterations.

Member previewVariant 4 · 3 implementations · 10 checks per implementation

Case contract

Numeric for-loop preparation (Lua-style FORPREP/FORLOOP). A zero step is an error. With integer init and step, a float limit is floored for positive steps and ceiled for negative ones; the loop is skipped when init is already past the limit in the step direction; otherwise the iteration count (limit - init) // step is precomputed (for negative steps (init - limit) // -step) and the loop runs count + 1 times. Otherwise the loop uses floats and re-tests v <= limit (v >= limit for negative steps). Return at most the first 20 control values.

Why this case matters

Loop-preparation opcodes must precompute counts exactly to avoid off-by-one and overflow bugs.

One recorded failure

Sample boundary fixture

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

Boundary fixtureActualExpectedOutcome
float loop reaches its limit exactly[][1.0, 0.75, 0.5, 0.25, 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 ↗