{"abstract":"Cost-to-retail ratio is too low because inbound freight is left out of the cost pool.","category":"Inventory cost layering","checks":7,"contract":"Input totals for a period. Cost pool = begin_cost + purch_cost + freight_in - returns_cost. Retail pool = begin_retail + purch_retail - returns_retail + markups - markup_cancel. Net markdowns = markdowns - markdown_cancel. The conventional (LCM) ratio uses the retail pool before markdowns; the cost method ratio deducts net markdowns. Ending retail = retail pool - net markdowns - sales - employee_discounts. Ending cost = round-half-up(ending retail * cost pool / ratio denominator). Return {ratio_bp (rounded half up), ending_retail, ending_cost}.","evaluation_group":"w2-inventory-cost-layering-retail-method","failed_approach":"Adding freight-in to the retail pool as well dilutes the ratio again.","family":"w2-inventory-cost-layering-retail-method-freight-in-capitalization","id":"FA-59996","implementations":{"attempt":{"sha256":"f5dfdfb568f45503151ace1825af249e9df6e36eced2d125e8b53949f8268edf","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    cost_pool = x['begin_cost'] + x['purch_cost'] + x['freight_in'] - x['returns_cost']\n    retail_pool = x['begin_retail'] + x['purch_retail'] - x['returns_retail'] + x['markups'] - x['markup_cancel'] + x['freight_in']\n    net_md = x['markdowns'] - x['markdown_cancel']\n    denom = retail_pool if x['method'] == 'conventional' else retail_pool - net_md\n    ending_retail = retail_pool - net_md - x['sales'] - x['employee_discounts']\n    ratio_bp = (2 * cost_pool * 10000 + denom) // (2 * denom)\n    ending_cost = (2 * ending_retail * cost_pool + denom) // (2 * denom)\n    return {'ratio_bp': ratio_bp, 'ending_retail': ending_retail, 'ending_cost': ending_cost}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['conventional', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30100, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3010, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5864, 'ending_retail': 16490, 'ending_cost': 9670}], ['cost method', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30100, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3010, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6122, 'ending_retail': 16490, 'ending_cost': 10096}], ['no markdowns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30100, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 0, 'markdown_cancel': 0, 'sales': 40001, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5864, 'ending_retail': 21099, 'ending_cost': 12373}], ['heavy returns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30100, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 5000, 'returns_retail': 8001, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3010, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6107, 'ending_retail': 10089, 'ending_cost': 6161}], ['no freight', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30100, 'purch_retail': 50000, 'freight_in': 0, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3010, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 0, 'method': 'conventional'}, {'ratio_bp': 5670, 'ending_retail': 17290, 'ending_cost': 9804}], ['markup cancel', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30100, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 2000, 'markup_cancel': 1999, 'markdowns': 3010, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 6216, 'ending_retail': 12991, 'ending_cost': 8075}], ['discounts heavy', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30100, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3010, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 3001, 'method': 'cost'}, {'ratio_bp': 6122, 'ending_retail': 14289, 'ending_cost': 8748}]], [['conventional', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30200, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3020, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5880, 'ending_retail': 16480, 'ending_cost': 9691}], ['cost method', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30200, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3020, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6140, 'ending_retail': 16480, 'ending_cost': 10119}], ['no markdowns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30200, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 0, 'markdown_cancel': 0, 'sales': 40002, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5880, 'ending_retail': 21098, 'ending_cost': 12407}], ['heavy returns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30200, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 5000, 'returns_retail': 8002, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3020, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6127, 'ending_retail': 10078, 'ending_cost': 6175}], ['no freight', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30200, 'purch_retail': 50000, 'freight_in': 0, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3020, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 0, 'method': 'conventional'}, {'ratio_bp': 5687, 'ending_retail': 17280, 'ending_cost': 9826}], ['markup cancel', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30200, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 2000, 'markup_cancel': 1998, 'markdowns': 3020, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 6233, 'ending_retail': 12982, 'ending_cost': 8091}], ['discounts heavy', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30200, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3020, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 3002, 'method': 'cost'}, {'ratio_bp': 6140, 'ending_retail': 14278, 'ending_cost': 8767}]], [['conventional', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30300, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3030, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5897, 'ending_retail': 16470, 'ending_cost': 9712}], ['cost method', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30300, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3030, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6158, 'ending_retail': 16470, 'ending_cost': 10143}], ['no markdowns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30300, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 0, 'markdown_cancel': 0, 'sales': 40003, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5897, 'ending_retail': 21097, 'ending_cost': 12440}], ['heavy returns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30300, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 5000, 'returns_retail': 8003, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3030, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6148, 'ending_retail': 10067, 'ending_cost': 6189}], ['no freight', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30300, 'purch_retail': 50000, 'freight_in': 0, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3030, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 0, 'method': 'conventional'}, {'ratio_bp': 5703, 'ending_retail': 17270, 'ending_cost': 9849}], ['markup cancel', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30300, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 2000, 'markup_cancel': 1997, 'markdowns': 3030, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 6250, 'ending_retail': 12973, 'ending_cost': 8108}], ['discounts heavy', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30300, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3030, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 3003, 'method': 'cost'}, {'ratio_bp': 6158, 'ending_retail': 14267, 'ending_cost': 8786}]], [['conventional', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30400, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3040, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5913, 'ending_retail': 16460, 'ending_cost': 9732}], ['cost method', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30400, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3040, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6176, 'ending_retail': 16460, 'ending_cost': 10166}], ['no markdowns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30400, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 0, 'markdown_cancel': 0, 'sales': 40004, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5913, 'ending_retail': 21096, 'ending_cost': 12474}], ['heavy returns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30400, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 5000, 'returns_retail': 8004, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3040, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6168, 'ending_retail': 10056, 'ending_cost': 6202}], ['no freight', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30400, 'purch_retail': 50000, 'freight_in': 0, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3040, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 0, 'method': 'conventional'}, {'ratio_bp': 5719, 'ending_retail': 17260, 'ending_cost': 9871}], ['markup cancel', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30400, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 2000, 'markup_cancel': 1996, 'markdowns': 3040, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 6267, 'ending_retail': 12964, 'ending_cost': 8124}], ['discounts heavy', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30400, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3040, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 3004, 'method': 'cost'}, {'ratio_bp': 6176, 'ending_retail': 14256, 'ending_cost': 8805}]], [['conventional', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30500, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3050, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5929, 'ending_retail': 16450, 'ending_cost': 9753}], ['cost method', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30500, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3050, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6194, 'ending_retail': 16450, 'ending_cost': 10189}], ['no markdowns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30500, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 0, 'markdown_cancel': 0, 'sales': 40005, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5929, 'ending_retail': 21095, 'ending_cost': 12507}], ['heavy returns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30500, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 5000, 'returns_retail': 8005, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3050, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6188, 'ending_retail': 10045, 'ending_cost': 6216}], ['no freight', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30500, 'purch_retail': 50000, 'freight_in': 0, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3050, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 0, 'method': 'conventional'}, {'ratio_bp': 5735, 'ending_retail': 17250, 'ending_cost': 9893}], ['markup cancel', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30500, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 2000, 'markup_cancel': 1995, 'markdowns': 3050, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 6284, 'ending_retail': 12955, 'ending_cost': 8141}], ['discounts heavy', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30500, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3050, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 3005, 'method': 'cost'}, {'ratio_bp': 6194, 'ending_retail': 14245, 'ending_cost': 8823}]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(args), expected)\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":"11b8af31802aa4c5b127d8b0a6530da46900a244f8f09bed719f47d0557baa67","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    cost_pool = x['begin_cost'] + x['purch_cost'] - x['returns_cost']\n    retail_pool = x['begin_retail'] + x['purch_retail'] - x['returns_retail'] + x['markups'] - x['markup_cancel']\n    net_md = x['markdowns'] - x['markdown_cancel']\n    denom = retail_pool if x['method'] == 'conventional' else retail_pool - net_md\n    ending_retail = retail_pool - net_md - x['sales'] - x['employee_discounts']\n    ratio_bp = (2 * cost_pool * 10000 + denom) // (2 * denom)\n    ending_cost = (2 * ending_retail * cost_pool + denom) // (2 * denom)\n    return {'ratio_bp': ratio_bp, 'ending_retail': ending_retail, 'ending_cost': ending_cost}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['conventional', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30100, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3010, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5864, 'ending_retail': 16490, 'ending_cost': 9670}], ['cost method', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30100, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3010, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6122, 'ending_retail': 16490, 'ending_cost': 10096}], ['no markdowns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30100, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 0, 'markdown_cancel': 0, 'sales': 40001, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5864, 'ending_retail': 21099, 'ending_cost': 12373}], ['heavy returns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30100, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 5000, 'returns_retail': 8001, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3010, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6107, 'ending_retail': 10089, 'ending_cost': 6161}], ['no freight', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30100, 'purch_retail': 50000, 'freight_in': 0, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3010, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 0, 'method': 'conventional'}, {'ratio_bp': 5670, 'ending_retail': 17290, 'ending_cost': 9804}], ['markup cancel', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30100, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 2000, 'markup_cancel': 1999, 'markdowns': 3010, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 6216, 'ending_retail': 12991, 'ending_cost': 8075}], ['discounts heavy', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30100, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3010, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 3001, 'method': 'cost'}, {'ratio_bp': 6122, 'ending_retail': 14289, 'ending_cost': 8748}]], [['conventional', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30200, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3020, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5880, 'ending_retail': 16480, 'ending_cost': 9691}], ['cost method', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30200, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3020, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6140, 'ending_retail': 16480, 'ending_cost': 10119}], ['no markdowns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30200, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 0, 'markdown_cancel': 0, 'sales': 40002, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5880, 'ending_retail': 21098, 'ending_cost': 12407}], ['heavy returns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30200, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 5000, 'returns_retail': 8002, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3020, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6127, 'ending_retail': 10078, 'ending_cost': 6175}], ['no freight', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30200, 'purch_retail': 50000, 'freight_in': 0, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3020, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 0, 'method': 'conventional'}, {'ratio_bp': 5687, 'ending_retail': 17280, 'ending_cost': 9826}], ['markup cancel', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30200, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 2000, 'markup_cancel': 1998, 'markdowns': 3020, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 6233, 'ending_retail': 12982, 'ending_cost': 8091}], ['discounts heavy', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30200, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3020, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 3002, 'method': 'cost'}, {'ratio_bp': 6140, 'ending_retail': 14278, 'ending_cost': 8767}]], [['conventional', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30300, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3030, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5897, 'ending_retail': 16470, 'ending_cost': 9712}], ['cost method', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30300, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3030, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6158, 'ending_retail': 16470, 'ending_cost': 10143}], ['no markdowns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30300, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 0, 'markdown_cancel': 0, 'sales': 40003, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5897, 'ending_retail': 21097, 'ending_cost': 12440}], ['heavy returns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30300, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 5000, 'returns_retail': 8003, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3030, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6148, 'ending_retail': 10067, 'ending_cost': 6189}], ['no freight', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30300, 'purch_retail': 50000, 'freight_in': 0, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3030, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 0, 'method': 'conventional'}, {'ratio_bp': 5703, 'ending_retail': 17270, 'ending_cost': 9849}], ['markup cancel', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30300, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 2000, 'markup_cancel': 1997, 'markdowns': 3030, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 6250, 'ending_retail': 12973, 'ending_cost': 8108}], ['discounts heavy', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30300, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3030, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 3003, 'method': 'cost'}, {'ratio_bp': 6158, 'ending_retail': 14267, 'ending_cost': 8786}]], [['conventional', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30400, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3040, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5913, 'ending_retail': 16460, 'ending_cost': 9732}], ['cost method', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30400, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3040, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6176, 'ending_retail': 16460, 'ending_cost': 10166}], ['no markdowns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30400, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 0, 'markdown_cancel': 0, 'sales': 40004, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5913, 'ending_retail': 21096, 'ending_cost': 12474}], ['heavy returns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30400, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 5000, 'returns_retail': 8004, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3040, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6168, 'ending_retail': 10056, 'ending_cost': 6202}], ['no freight', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30400, 'purch_retail': 50000, 'freight_in': 0, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3040, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 0, 'method': 'conventional'}, {'ratio_bp': 5719, 'ending_retail': 17260, 'ending_cost': 9871}], ['markup cancel', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30400, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 2000, 'markup_cancel': 1996, 'markdowns': 3040, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 6267, 'ending_retail': 12964, 'ending_cost': 8124}], ['discounts heavy', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30400, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3040, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 3004, 'method': 'cost'}, {'ratio_bp': 6176, 'ending_retail': 14256, 'ending_cost': 8805}]], [['conventional', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30500, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3050, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5929, 'ending_retail': 16450, 'ending_cost': 9753}], ['cost method', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30500, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3050, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6194, 'ending_retail': 16450, 'ending_cost': 10189}], ['no markdowns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30500, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 0, 'markdown_cancel': 0, 'sales': 40005, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5929, 'ending_retail': 21095, 'ending_cost': 12507}], ['heavy returns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30500, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 5000, 'returns_retail': 8005, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3050, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6188, 'ending_retail': 10045, 'ending_cost': 6216}], ['no freight', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30500, 'purch_retail': 50000, 'freight_in': 0, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3050, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 0, 'method': 'conventional'}, {'ratio_bp': 5735, 'ending_retail': 17250, 'ending_cost': 9893}], ['markup cancel', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30500, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 2000, 'markup_cancel': 1995, 'markdowns': 3050, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 6284, 'ending_retail': 12955, 'ending_cost': 8141}], ['discounts heavy', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30500, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3050, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 3005, 'method': 'cost'}, {'ratio_bp': 6194, 'ending_retail': 14245, 'ending_cost': 8823}]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(args), expected)\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":"6b36780c7110caf65b55d4eec6565ef01ff7f6ae54b4d5799bd9c8adc472f3e1","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    cost_pool = x['begin_cost'] + x['purch_cost'] + x['freight_in'] - x['returns_cost']\n    retail_pool = x['begin_retail'] + x['purch_retail'] - x['returns_retail'] + x['markups'] - x['markup_cancel']\n    net_md = x['markdowns'] - x['markdown_cancel']\n    denom = retail_pool if x['method'] == 'conventional' else retail_pool - net_md\n    ending_retail = retail_pool - net_md - x['sales'] - x['employee_discounts']\n    ratio_bp = (2 * cost_pool * 10000 + denom) // (2 * denom)\n    ending_cost = (2 * ending_retail * cost_pool + denom) // (2 * denom)\n    return {'ratio_bp': ratio_bp, 'ending_retail': ending_retail, 'ending_cost': ending_cost}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['conventional', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30100, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3010, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5864, 'ending_retail': 16490, 'ending_cost': 9670}], ['cost method', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30100, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3010, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6122, 'ending_retail': 16490, 'ending_cost': 10096}], ['no markdowns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30100, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 0, 'markdown_cancel': 0, 'sales': 40001, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5864, 'ending_retail': 21099, 'ending_cost': 12373}], ['heavy returns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30100, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 5000, 'returns_retail': 8001, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3010, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6107, 'ending_retail': 10089, 'ending_cost': 6161}], ['no freight', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30100, 'purch_retail': 50000, 'freight_in': 0, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3010, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 0, 'method': 'conventional'}, {'ratio_bp': 5670, 'ending_retail': 17290, 'ending_cost': 9804}], ['markup cancel', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30100, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 2000, 'markup_cancel': 1999, 'markdowns': 3010, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 6216, 'ending_retail': 12991, 'ending_cost': 8075}], ['discounts heavy', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30100, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3010, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 3001, 'method': 'cost'}, {'ratio_bp': 6122, 'ending_retail': 14289, 'ending_cost': 8748}]], [['conventional', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30200, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3020, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5880, 'ending_retail': 16480, 'ending_cost': 9691}], ['cost method', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30200, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3020, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6140, 'ending_retail': 16480, 'ending_cost': 10119}], ['no markdowns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30200, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 0, 'markdown_cancel': 0, 'sales': 40002, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5880, 'ending_retail': 21098, 'ending_cost': 12407}], ['heavy returns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30200, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 5000, 'returns_retail': 8002, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3020, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6127, 'ending_retail': 10078, 'ending_cost': 6175}], ['no freight', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30200, 'purch_retail': 50000, 'freight_in': 0, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3020, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 0, 'method': 'conventional'}, {'ratio_bp': 5687, 'ending_retail': 17280, 'ending_cost': 9826}], ['markup cancel', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30200, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 2000, 'markup_cancel': 1998, 'markdowns': 3020, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 6233, 'ending_retail': 12982, 'ending_cost': 8091}], ['discounts heavy', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30200, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3020, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 3002, 'method': 'cost'}, {'ratio_bp': 6140, 'ending_retail': 14278, 'ending_cost': 8767}]], [['conventional', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30300, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3030, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5897, 'ending_retail': 16470, 'ending_cost': 9712}], ['cost method', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30300, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3030, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6158, 'ending_retail': 16470, 'ending_cost': 10143}], ['no markdowns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30300, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 0, 'markdown_cancel': 0, 'sales': 40003, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5897, 'ending_retail': 21097, 'ending_cost': 12440}], ['heavy returns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30300, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 5000, 'returns_retail': 8003, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3030, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6148, 'ending_retail': 10067, 'ending_cost': 6189}], ['no freight', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30300, 'purch_retail': 50000, 'freight_in': 0, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3030, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 0, 'method': 'conventional'}, {'ratio_bp': 5703, 'ending_retail': 17270, 'ending_cost': 9849}], ['markup cancel', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30300, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 2000, 'markup_cancel': 1997, 'markdowns': 3030, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 6250, 'ending_retail': 12973, 'ending_cost': 8108}], ['discounts heavy', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30300, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3030, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 3003, 'method': 'cost'}, {'ratio_bp': 6158, 'ending_retail': 14267, 'ending_cost': 8786}]], [['conventional', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30400, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3040, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5913, 'ending_retail': 16460, 'ending_cost': 9732}], ['cost method', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30400, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3040, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6176, 'ending_retail': 16460, 'ending_cost': 10166}], ['no markdowns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30400, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 0, 'markdown_cancel': 0, 'sales': 40004, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5913, 'ending_retail': 21096, 'ending_cost': 12474}], ['heavy returns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30400, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 5000, 'returns_retail': 8004, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3040, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6168, 'ending_retail': 10056, 'ending_cost': 6202}], ['no freight', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30400, 'purch_retail': 50000, 'freight_in': 0, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3040, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 0, 'method': 'conventional'}, {'ratio_bp': 5719, 'ending_retail': 17260, 'ending_cost': 9871}], ['markup cancel', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30400, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 2000, 'markup_cancel': 1996, 'markdowns': 3040, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 6267, 'ending_retail': 12964, 'ending_cost': 8124}], ['discounts heavy', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30400, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3040, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 3004, 'method': 'cost'}, {'ratio_bp': 6176, 'ending_retail': 14256, 'ending_cost': 8805}]], [['conventional', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30500, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3050, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5929, 'ending_retail': 16450, 'ending_cost': 9753}], ['cost method', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30500, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3050, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6194, 'ending_retail': 16450, 'ending_cost': 10189}], ['no markdowns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30500, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 0, 'markdown_cancel': 0, 'sales': 40005, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 5929, 'ending_retail': 21095, 'ending_cost': 12507}], ['heavy returns', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30500, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 5000, 'returns_retail': 8005, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3050, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'cost'}, {'ratio_bp': 6188, 'ending_retail': 10045, 'ending_cost': 6216}], ['no freight', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30500, 'purch_retail': 50000, 'freight_in': 0, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3050, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 0, 'method': 'conventional'}, {'ratio_bp': 5735, 'ending_retail': 17250, 'ending_cost': 9893}], ['markup cancel', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30500, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 2000, 'markup_cancel': 1995, 'markdowns': 3050, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 800, 'method': 'conventional'}, {'ratio_bp': 6284, 'ending_retail': 12955, 'ending_cost': 8141}], ['discounts heavy', {'begin_cost': 6000, 'begin_retail': 10000, 'purch_cost': 30500, 'purch_retail': 50000, 'freight_in': 1200, 'returns_cost': 1000, 'returns_retail': 1600, 'markups': 4000, 'markup_cancel': 500, 'markdowns': 3050, 'markdown_cancel': 400, 'sales': 42000, 'employee_discounts': 3005, 'method': 'cost'}, {'ratio_bp': 6194, 'ending_retail': 14245, 'ending_cost': 8823}]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(args), expected)\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":"Stipulated bounded teaching model with explicit toy rules; not an accounting-standard implementation. 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":"w2-inventory-cost-layering-retail-method-freight-in-capitalization","generated_at":"2026-09-29T14:46:41.492872+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Inventory valuation and cost-of-goods decisions depend on this rule.","repair":"Add freight-in to the cost pool.","root_cause":"The cost pool omits freight-in.","sha256":"620fc06bb3482d26feffac9f88cb6eab4ebb5547083b1f0e09260cfd62515fd1","title":"Retail inventory method estimate: freight-in capitalization · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.543,"exit_code":1,"observations":[{"actual":{"ending_cost":10177,"ending_retail":17690,"ratio_bp":5753},"check":"conventional","expected":{"ending_cost":9670,"ending_retail":16490,"ratio_bp":5864},"passed":false},{"actual":{"ending_cost":10616,"ending_retail":17690,"ratio_bp":6001},"check":"cost method","expected":{"ending_cost":10096,"ending_retail":16490,"ratio_bp":6122},"passed":false},{"actual":{"ending_cost":12828,"ending_retail":22299,"ratio_bp":5753},"check":"no markdowns","expected":{"ending_cost":12373,"ending_retail":21099,"ratio_bp":5864},"passed":false},{"actual":{"ending_cost":6741,"ending_retail":11289,"ratio_bp":5972},"check":"heavy returns","expected":{"ending_cost":6161,"ending_retail":10089,"ratio_bp":6107},"passed":false},{"actual":{"ending_cost":9804,"ending_retail":17290,"ratio_bp":5670},"check":"no freight","expected":{"ending_cost":9804,"ending_retail":17290,"ratio_bp":5670},"passed":true},{"actual":{"ending_cost":8643,"ending_retail":14191,"ratio_bp":6091},"check":"markup cancel","expected":{"ending_cost":8075,"ending_retail":12991,"ratio_bp":6216},"passed":false},{"actual":{"ending_cost":9295,"ending_retail":15489,"ratio_bp":6001},"check":"discounts heavy","expected":{"ending_cost":8748,"ending_retail":14289,"ratio_bp":6122},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"conventional\", \"actual\": {\"ratio_bp\": 5753, \"ending_retail\": 17690, \"ending_cost\": 10177}, \"expected\": {\"ratio_bp\": 5864, \"ending_retail\": 16490, \"ending_cost\": 9670}, \"passed\": false}, {\"check\": \"cost method\", \"actual\": {\"ratio_bp\": 6001, \"ending_retail\": 17690, \"ending_cost\": 10616}, \"expected\": {\"ratio_bp\": 6122, \"ending_retail\": 16490, \"ending_cost\": 10096}, \"passed\": false}, {\"check\": \"no markdowns\", \"actual\": {\"ratio_bp\": 5753, \"ending_retail\": 22299, \"ending_cost\": 12828}, \"expected\": {\"ratio_bp\": 5864, \"ending_retail\": 21099, \"ending_cost\": 12373}, \"passed\": false}, {\"check\": \"heavy returns\", \"actual\": {\"ratio_bp\": 5972, \"ending_retail\": 11289, \"ending_cost\": 6741}, \"expected\": {\"ratio_bp\": 6107, \"ending_retail\": 10089, \"ending_cost\": 6161}, \"passed\": false}, {\"check\": \"no freight\", \"actual\": {\"ratio_bp\": 5670, \"ending_retail\": 17290, \"ending_cost\": 9804}, \"expected\": {\"ratio_bp\": 5670, \"ending_retail\": 17290, \"ending_cost\": 9804}, \"passed\": true}, {\"check\": \"markup cancel\", \"actual\": {\"ratio_bp\": 6091, \"ending_retail\": 14191, \"ending_cost\": 8643}, \"expected\": {\"ratio_bp\": 6216, \"ending_retail\": 12991, \"ending_cost\": 8075}, \"passed\": false}, {\"check\": \"discounts heavy\", \"actual\": {\"ratio_bp\": 6001, \"ending_retail\": 15489, \"ending_cost\": 9295}, \"expected\": {\"ratio_bp\": 6122, \"ending_retail\": 14289, \"ending_cost\": 8748}, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.843,"exit_code":1,"observations":[{"actual":{"ending_cost":9351,"ending_retail":16490,"ratio_bp":5670},"check":"conventional","expected":{"ending_cost":9670,"ending_retail":16490,"ratio_bp":5864},"passed":false},{"actual":{"ending_cost":9762,"ending_retail":16490,"ratio_bp":5920},"check":"cost method","expected":{"ending_cost":10096,"ending_retail":16490,"ratio_bp":6122},"passed":false},{"actual":{"ending_cost":11964,"ending_retail":21099,"ratio_bp":5670},"check":"no markdowns","expected":{"ending_cost":12373,"ending_retail":21099,"ratio_bp":5864},"passed":false},{"actual":{"ending_cost":5933,"ending_retail":10089,"ratio_bp":5880},"check":"heavy returns","expected":{"ending_cost":6161,"ending_retail":10089,"ratio_bp":6107},"passed":false},{"actual":{"ending_cost":9804,"ending_retail":17290,"ratio_bp":5670},"check":"no freight","expected":{"ending_cost":9804,"ending_retail":17290,"ratio_bp":5670},"passed":true},{"actual":{"ending_cost":7808,"ending_retail":12991,"ratio_bp":6010},"check":"markup cancel","expected":{"ending_cost":8075,"ending_retail":12991,"ratio_bp":6216},"passed":false},{"actual":{"ending_cost":8459,"ending_retail":14289,"ratio_bp":5920},"check":"discounts heavy","expected":{"ending_cost":8748,"ending_retail":14289,"ratio_bp":6122},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"conventional\", \"actual\": {\"ratio_bp\": 5670, \"ending_retail\": 16490, \"ending_cost\": 9351}, \"expected\": {\"ratio_bp\": 5864, \"ending_retail\": 16490, \"ending_cost\": 9670}, \"passed\": false}, {\"check\": \"cost method\", \"actual\": {\"ratio_bp\": 5920, \"ending_retail\": 16490, \"ending_cost\": 9762}, \"expected\": {\"ratio_bp\": 6122, \"ending_retail\": 16490, \"ending_cost\": 10096}, \"passed\": false}, {\"check\": \"no markdowns\", \"actual\": {\"ratio_bp\": 5670, \"ending_retail\": 21099, \"ending_cost\": 11964}, \"expected\": {\"ratio_bp\": 5864, \"ending_retail\": 21099, \"ending_cost\": 12373}, \"passed\": false}, {\"check\": \"heavy returns\", \"actual\": {\"ratio_bp\": 5880, \"ending_retail\": 10089, \"ending_cost\": 5933}, \"expected\": {\"ratio_bp\": 6107, \"ending_retail\": 10089, \"ending_cost\": 6161}, \"passed\": false}, {\"check\": \"no freight\", \"actual\": {\"ratio_bp\": 5670, \"ending_retail\": 17290, \"ending_cost\": 9804}, \"expected\": {\"ratio_bp\": 5670, \"ending_retail\": 17290, \"ending_cost\": 9804}, \"passed\": true}, {\"check\": \"markup cancel\", \"actual\": {\"ratio_bp\": 6010, \"ending_retail\": 12991, \"ending_cost\": 7808}, \"expected\": {\"ratio_bp\": 6216, \"ending_retail\": 12991, \"ending_cost\": 8075}, \"passed\": false}, {\"check\": \"discounts heavy\", \"actual\": {\"ratio_bp\": 5920, \"ending_retail\": 14289, \"ending_cost\": 8459}, \"expected\": {\"ratio_bp\": 6122, \"ending_retail\": 14289, \"ending_cost\": 8748}, \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.314,"exit_code":0,"observations":[{"actual":{"ending_cost":9670,"ending_retail":16490,"ratio_bp":5864},"check":"conventional","expected":{"ending_cost":9670,"ending_retail":16490,"ratio_bp":5864},"passed":true},{"actual":{"ending_cost":10096,"ending_retail":16490,"ratio_bp":6122},"check":"cost method","expected":{"ending_cost":10096,"ending_retail":16490,"ratio_bp":6122},"passed":true},{"actual":{"ending_cost":12373,"ending_retail":21099,"ratio_bp":5864},"check":"no markdowns","expected":{"ending_cost":12373,"ending_retail":21099,"ratio_bp":5864},"passed":true},{"actual":{"ending_cost":6161,"ending_retail":10089,"ratio_bp":6107},"check":"heavy returns","expected":{"ending_cost":6161,"ending_retail":10089,"ratio_bp":6107},"passed":true},{"actual":{"ending_cost":9804,"ending_retail":17290,"ratio_bp":5670},"check":"no freight","expected":{"ending_cost":9804,"ending_retail":17290,"ratio_bp":5670},"passed":true},{"actual":{"ending_cost":8075,"ending_retail":12991,"ratio_bp":6216},"check":"markup cancel","expected":{"ending_cost":8075,"ending_retail":12991,"ratio_bp":6216},"passed":true},{"actual":{"ending_cost":8748,"ending_retail":14289,"ratio_bp":6122},"check":"discounts heavy","expected":{"ending_cost":8748,"ending_retail":14289,"ratio_bp":6122},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"conventional\", \"actual\": {\"ratio_bp\": 5864, \"ending_retail\": 16490, \"ending_cost\": 9670}, \"expected\": {\"ratio_bp\": 5864, \"ending_retail\": 16490, \"ending_cost\": 9670}, \"passed\": true}, {\"check\": \"cost method\", \"actual\": {\"ratio_bp\": 6122, \"ending_retail\": 16490, \"ending_cost\": 10096}, \"expected\": {\"ratio_bp\": 6122, \"ending_retail\": 16490, \"ending_cost\": 10096}, \"passed\": true}, {\"check\": \"no markdowns\", \"actual\": {\"ratio_bp\": 5864, \"ending_retail\": 21099, \"ending_cost\": 12373}, \"expected\": {\"ratio_bp\": 5864, \"ending_retail\": 21099, \"ending_cost\": 12373}, \"passed\": true}, {\"check\": \"heavy returns\", \"actual\": {\"ratio_bp\": 6107, \"ending_retail\": 10089, \"ending_cost\": 6161}, \"expected\": {\"ratio_bp\": 6107, \"ending_retail\": 10089, \"ending_cost\": 6161}, \"passed\": true}, {\"check\": \"no freight\", \"actual\": {\"ratio_bp\": 5670, \"ending_retail\": 17290, \"ending_cost\": 9804}, \"expected\": {\"ratio_bp\": 5670, \"ending_retail\": 17290, \"ending_cost\": 9804}, \"passed\": true}, {\"check\": \"markup cancel\", \"actual\": {\"ratio_bp\": 6216, \"ending_retail\": 12991, \"ending_cost\": 8075}, \"expected\": {\"ratio_bp\": 6216, \"ending_retail\": 12991, \"ending_cost\": 8075}, \"passed\": true}, {\"check\": \"discounts heavy\", \"actual\": {\"ratio_bp\": 6122, \"ending_retail\": 14289, \"ending_cost\": 8748}, \"expected\": {\"ratio_bp\": 6122, \"ending_retail\": 14289, \"ending_cost\": 8748}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}