{"abstract":"Optimization options survive twice.","category":"Build systems","checks":6,"contract":"Append defaults, replace optimization options by the last requested optimization, preserve repeated include options, remove explicitly disabled warnings, and append mandatory flags exactly once.","contract_signature":"defaults, requested, disabled, mandatory","evaluation_group":"xt-compiler-flags","failed_approach":"The attempted repair substitutes x.startswith('-O0'). Fixture 2 still yields ['-Ifoo', '-Ifoo', '-O0', '-g'] instead of ['-Ifoo', '-Ifoo', '-O2', '-g'].","family":"xt-compiler-flags-opt-detection","id":"FA-9261","implementations":{"attempt":{"sha256":"42b805441cf450863017cad50b7bd038216be05fe0bdf768baa9a72c00f04f40","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(defaults, requested, disabled, mandatory):\n    flags = list(defaults) + list(requested)\n    opts = [x for x in flags if x.startswith('-O0')]\n    flags = [x for x in flags if not x.startswith('-O')]\n    flags = [x for x in flags if x not in disabled]\n    if opts: flags.append(opts[-1])\n    for flag in mandatory:\n        if flag not in flags: flags.append(flag)\n    return flags\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1', solve([], [], [], []), [])\ncheck('fixture 2', solve(['-O0', '-Wall'], ['-O2', '-Ifoo', '-Ifoo'], ['-Wall'], ['-g']), ['-Ifoo', '-Ifoo', '-O2', '-g'])\ncheck('fixture 3', solve(['-O1'], ['-O3'], [], []), ['-O3'])\ncheck('fixture 4', solve(['-g'], [], [], ['-g']), ['-g'])\ncheck('fixture 5', solve(['-Wa', '-Wb'], [], ['-Wa'], []), ['-Wb'])\ncheck('fixture 6', solve([], ['-Ifoo', '-Ibar'], [], ['-g', '-g']), ['-Ifoo', '-Ibar', '-g'])\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":"6ed0f0265be11ce1c5e3251af21943dbe659ba61aa71acb5b2ec6973d91a5210","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(defaults, requested, disabled, mandatory):\n    flags = list(defaults) + list(requested)\n    opts = [x for x in flags if x == '-O']\n    flags = [x for x in flags if not x.startswith('-O')]\n    flags = [x for x in flags if x not in disabled]\n    if opts: flags.append(opts[-1])\n    for flag in mandatory:\n        if flag not in flags: flags.append(flag)\n    return flags\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1', solve([], [], [], []), [])\ncheck('fixture 2', solve(['-O0', '-Wall'], ['-O2', '-Ifoo', '-Ifoo'], ['-Wall'], ['-g']), ['-Ifoo', '-Ifoo', '-O2', '-g'])\ncheck('fixture 3', solve(['-O1'], ['-O3'], [], []), ['-O3'])\ncheck('fixture 4', solve(['-g'], [], [], ['-g']), ['-g'])\ncheck('fixture 5', solve(['-Wa', '-Wb'], [], ['-Wa'], []), ['-Wb'])\ncheck('fixture 6', solve([], ['-Ifoo', '-Ibar'], [], ['-g', '-g']), ['-Ifoo', '-Ibar', '-g'])\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":"xt-compiler-flags-opt-detection","generated_at":"2026-09-29T14:38:28.606971+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"An offline model of compiler option precedence, suitable for testing build and release tooling without external services.","root_cause":"The implementation substitutes x == '-O' for x.startswith('-O'), so optimization options survive twice.","sha256":"9cc8dbb66ace2f0295af2958736ee13d98eff4ee71f64407d3c17061fa789c08","title":"Compiler option precedence: Optimization options survive twice · 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":36.956,"exit_code":1,"observations":[{"actual":[],"check":"fixture 1","expected":[],"passed":true},{"actual":["-Ifoo","-Ifoo","-O0","-g"],"check":"fixture 2","expected":["-Ifoo","-Ifoo","-O2","-g"],"passed":false},{"actual":[],"check":"fixture 3","expected":["-O3"],"passed":false},{"actual":["-g"],"check":"fixture 4","expected":["-g"],"passed":true},{"actual":["-Wb"],"check":"fixture 5","expected":["-Wb"],"passed":true},{"actual":["-Ifoo","-Ibar","-g"],"check":"fixture 6","expected":["-Ifoo","-Ibar","-g"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"fixture 2\", \"actual\": [\"-Ifoo\", \"-Ifoo\", \"-O0\", \"-g\"], \"expected\": [\"-Ifoo\", \"-Ifoo\", \"-O2\", \"-g\"], \"passed\": false}, {\"check\": \"fixture 3\", \"actual\": [], \"expected\": [\"-O3\"], \"passed\": false}, {\"check\": \"fixture 4\", \"actual\": [\"-g\"], \"expected\": [\"-g\"], \"passed\": true}, {\"check\": \"fixture 5\", \"actual\": [\"-Wb\"], \"expected\": [\"-Wb\"], \"passed\": true}, {\"check\": \"fixture 6\", \"actual\": [\"-Ifoo\", \"-Ibar\", \"-g\"], \"expected\": [\"-Ifoo\", \"-Ibar\", \"-g\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.167,"exit_code":1,"observations":[{"actual":[],"check":"fixture 1","expected":[],"passed":true},{"actual":["-Ifoo","-Ifoo","-g"],"check":"fixture 2","expected":["-Ifoo","-Ifoo","-O2","-g"],"passed":false},{"actual":[],"check":"fixture 3","expected":["-O3"],"passed":false},{"actual":["-g"],"check":"fixture 4","expected":["-g"],"passed":true},{"actual":["-Wb"],"check":"fixture 5","expected":["-Wb"],"passed":true},{"actual":["-Ifoo","-Ibar","-g"],"check":"fixture 6","expected":["-Ifoo","-Ibar","-g"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"fixture 2\", \"actual\": [\"-Ifoo\", \"-Ifoo\", \"-g\"], \"expected\": [\"-Ifoo\", \"-Ifoo\", \"-O2\", \"-g\"], \"passed\": false}, {\"check\": \"fixture 3\", \"actual\": [], \"expected\": [\"-O3\"], \"passed\": false}, {\"check\": \"fixture 4\", \"actual\": [\"-g\"], \"expected\": [\"-g\"], \"passed\": true}, {\"check\": \"fixture 5\", \"actual\": [\"-Wb\"], \"expected\": [\"-Wb\"], \"passed\": true}, {\"check\": \"fixture 6\", \"actual\": [\"-Ifoo\", \"-Ibar\", \"-g\"], \"expected\": [\"-Ifoo\", \"-Ibar\", \"-g\"], \"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."}}