{"abstract":"Defaults override requested optimization.","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 list(defaults). Fixture 2 still yields ['-O0', '-g'] instead of ['-Ifoo', '-Ifoo', '-O2', '-g'].","family":"xt-compiler-flags-default-order","id":"FA-9256","implementations":{"attempt":{"sha256":"2bda2a19435c8bd8a44debbcfb34ee0e285815da9a0603029436ed23d6318e0b","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)\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"},"broken":{"sha256":"a2a752269be8da238b2bca43d37788176ca604d2a480f4eaf2d58445f36fd5c2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(defaults, requested, disabled, mandatory):\n    flags = list(requested) + list(defaults)\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"},"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-default-order","generated_at":"2026-09-29T14:38:28.448782+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":"Process requested options after defaults.","root_cause":"The implementation substitutes list(requested) + list(defaults) for list(defaults) + list(requested), so defaults override requested optimization.","sha256":"94e0b29d7ecd08367702760cceccafad52c6b03b7395502c0f0f047e0619adf9","title":"Compiler option precedence: Defaults override requested optimization · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":37.208,"exit_code":1,"observations":[{"actual":[],"check":"fixture 1","expected":[],"passed":true},{"actual":["-O0","-g"],"check":"fixture 2","expected":["-Ifoo","-Ifoo","-O2","-g"],"passed":false},{"actual":["-O1"],"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":["-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\": [\"-O0\", \"-g\"], \"expected\": [\"-Ifoo\", \"-Ifoo\", \"-O2\", \"-g\"], \"passed\": false}, {\"check\": \"fixture 3\", \"actual\": [\"-O1\"], \"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\": [\"-g\"], \"expected\": [\"-Ifoo\", \"-Ibar\", \"-g\"], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":35.729,"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":["-O1"],"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\": [\"-O1\"], \"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"},"fixed":{"elapsed_ms":37.145,"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"}