{"abstract":"Loop invariant motion speculates a trapping operation on a zero-trip loop.","category":"Compiler transformation correctness","checks":6,"contract":"Return whether an operation may hoist: invariant and (safe to speculate or guaranteed executed by this loop).","contract_signature":"invariant, safe, trips","evaluation_group":"model-f5fb9bff50605480","failed_approach":"Checking only trip count discards the independent invariant requirement.","family":"z-compilers-hoist-trap","id":"FA-11461","implementations":{"attempt":{"sha256":"628c5b4bda62b7558bb03b7efec5c1d750c90e11ae62d82478f8d7c55ff0b132","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(invariant, safe, trips):\n    return safe or trips > 0\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('zero-trip trapping', solve(True,False,0), False)\ncheck('executed trapping', solve(True,False,N), True)\ncheck('safe zero-trip', solve(True,True,0), True)\ncheck('variant safe', solve(False,True,N), False)\ncheck('variant trapping', solve(False,False,N), False)\ncheck('variant skipped', solve(False,False,0), False)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"e2201aba3ac36a9a24a767ae5aaa21a56d785bfb01f652d225676035691b4bc9","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(invariant, safe, trips):\n    return invariant\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('zero-trip trapping', solve(True,False,0), False)\ncheck('executed trapping', solve(True,False,N), True)\ncheck('safe zero-trip', solve(True,True,0), True)\ncheck('variant safe', solve(False,True,N), False)\ncheck('variant trapping', solve(False,False,N), False)\ncheck('variant skipped', solve(False,False,0), False)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":" This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"z-compilers-hoist-trap","generated_at":"2026-09-29T14:38:48.069504+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A deterministic miniature compiler-pass model; inputs are explicit IR facts, not a production compiler.","root_cause":"Invariance is mistaken for permission to execute earlier.","sha256":"851378a574726e01f209a034737c6e0c5fcf3192bbb2a51ba59a939c45a0b60d","title":"Loop invariant motion speculates a trapping operation on a zero-trip loop · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":38.793,"exit_code":1,"observations":[{"actual":false,"check":"zero-trip trapping","expected":false,"passed":true},{"actual":true,"check":"executed trapping","expected":true,"passed":true},{"actual":true,"check":"safe zero-trip","expected":true,"passed":true},{"actual":true,"check":"variant safe","expected":false,"passed":false},{"actual":true,"check":"variant trapping","expected":false,"passed":false},{"actual":false,"check":"variant skipped","expected":false,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"zero-trip trapping\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"executed trapping\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"safe zero-trip\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"variant safe\", \"actual\": true, \"expected\": false, \"passed\": false}, {\"check\": \"variant trapping\", \"actual\": true, \"expected\": false, \"passed\": false}, {\"check\": \"variant skipped\", \"actual\": false, \"expected\": false, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.098,"exit_code":1,"observations":[{"actual":true,"check":"zero-trip trapping","expected":false,"passed":false},{"actual":true,"check":"executed trapping","expected":true,"passed":true},{"actual":true,"check":"safe zero-trip","expected":true,"passed":true},{"actual":false,"check":"variant safe","expected":false,"passed":true},{"actual":false,"check":"variant trapping","expected":false,"passed":true},{"actual":false,"check":"variant skipped","expected":false,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"zero-trip trapping\", \"actual\": true, \"expected\": false, \"passed\": false}, {\"check\": \"executed trapping\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"safe zero-trip\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"variant safe\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"variant trapping\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"variant skipped\", \"actual\": false, \"expected\": false, \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}