{"abstract":"Mandatory flags are appended repeatedly.","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.","evaluation_group":"xt-compiler-flags","failed_approach":"The attempted repair substitutes if flag in flags:. Fixture 2 still yields ['-Ifoo', '-Ifoo', '-O2'] instead of ['-Ifoo', '-Ifoo', '-O2', '-g'].","family":"xt-compiler-flags-mandatory-dup","id":"FA-9276","implementations":{"attempt":{"sha256":"cc2553ffc73c81e723ea3336de2356b3ba8a2eb220e11b2707d93cbe625c85ec","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('-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 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":"7e7968ab8c93201af0de0ca78e405039ab9f9697eb19d1138b825f886b276169","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('-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 True: 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"},"fixed":{"sha256":"b4bb251e00777e051e560851f671826ee06cfaf8bb741bcc364a5aa6245f0297","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('-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-mandatory-dup","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.","repair":"Append mandatory flags only when absent.","root_cause":"The implementation substitutes if True: for if flag not in flags:, so mandatory flags are appended repeatedly.","sha256":"00f2765f2d077b9ea455ff068953746c16cfc54fa63fb7b1d3b2e18b42103ad0","title":"Compiler option precedence: Mandatory flags are appended repeatedly · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":39.37,"exit_code":1,"observations":[{"actual":[],"check":"fixture 1","expected":[],"passed":true},{"actual":["-Ifoo","-Ifoo","-O2"],"check":"fixture 2","expected":["-Ifoo","-Ifoo","-O2","-g"],"passed":false},{"actual":["-O3"],"check":"fixture 3","expected":["-O3"],"passed":true},{"actual":["-g","-g"],"check":"fixture 4","expected":["-g"],"passed":false},{"actual":["-Wb"],"check":"fixture 5","expected":["-Wb"],"passed":true},{"actual":["-Ifoo","-Ibar"],"check":"fixture 6","expected":["-Ifoo","-Ibar","-g"],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"fixture 2\", \"actual\": [\"-Ifoo\", \"-Ifoo\", \"-O2\"], \"expected\": [\"-Ifoo\", \"-Ifoo\", \"-O2\", \"-g\"], \"passed\": false}, {\"check\": \"fixture 3\", \"actual\": [\"-O3\"], \"expected\": [\"-O3\"], \"passed\": true}, {\"check\": \"fixture 4\", \"actual\": [\"-g\", \"-g\"], \"expected\": [\"-g\"], \"passed\": false}, {\"check\": \"fixture 5\", \"actual\": [\"-Wb\"], \"expected\": [\"-Wb\"], \"passed\": true}, {\"check\": \"fixture 6\", \"actual\": [\"-Ifoo\", \"-Ibar\"], \"expected\": [\"-Ifoo\", \"-Ibar\", \"-g\"], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":36.362,"exit_code":1,"observations":[{"actual":[],"check":"fixture 1","expected":[],"passed":true},{"actual":["-Ifoo","-Ifoo","-O2","-g"],"check":"fixture 2","expected":["-Ifoo","-Ifoo","-O2","-g"],"passed":true},{"actual":["-O3"],"check":"fixture 3","expected":["-O3"],"passed":true},{"actual":["-g","-g"],"check":"fixture 4","expected":["-g"],"passed":false},{"actual":["-Wb"],"check":"fixture 5","expected":["-Wb"],"passed":true},{"actual":["-Ifoo","-Ibar","-g","-g"],"check":"fixture 6","expected":["-Ifoo","-Ibar","-g"],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"fixture 2\", \"actual\": [\"-Ifoo\", \"-Ifoo\", \"-O2\", \"-g\"], \"expected\": [\"-Ifoo\", \"-Ifoo\", \"-O2\", \"-g\"], \"passed\": true}, {\"check\": \"fixture 3\", \"actual\": [\"-O3\"], \"expected\": [\"-O3\"], \"passed\": true}, {\"check\": \"fixture 4\", \"actual\": [\"-g\", \"-g\"], \"expected\": [\"-g\"], \"passed\": false}, {\"check\": \"fixture 5\", \"actual\": [\"-Wb\"], \"expected\": [\"-Wb\"], \"passed\": true}, {\"check\": \"fixture 6\", \"actual\": [\"-Ifoo\", \"-Ibar\", \"-g\", \"-g\"], \"expected\": [\"-Ifoo\", \"-Ibar\", \"-g\"], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":38.249,"exit_code":0,"observations":[{"actual":[],"check":"fixture 1","expected":[],"passed":true},{"actual":["-Ifoo","-Ifoo","-O2","-g"],"check":"fixture 2","expected":["-Ifoo","-Ifoo","-O2","-g"],"passed":true},{"actual":["-O3"],"check":"fixture 3","expected":["-O3"],"passed":true},{"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":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"fixture 2\", \"actual\": [\"-Ifoo\", \"-Ifoo\", \"-O2\", \"-g\"], \"expected\": [\"-Ifoo\", \"-Ifoo\", \"-O2\", \"-g\"], \"passed\": true}, {\"check\": \"fixture 3\", \"actual\": [\"-O3\"], \"expected\": [\"-O3\"], \"passed\": true}, {\"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\": true}\n"}},"verified":true,"visibility":"public"}