{"abstract":"Ground-up and sub-basic layers come back unrated.","category":"Insurance premium rating","checks":10,"contract":"Input basic (premium at basic limit), ilf table [[limit, factor*1000]] ascending, attachment, layer_limit. ILF(0)=0 and ILF is linear between tabulated points (including from 0 to the basic limit); limits above the table are unrated. Layer premium = floor(basic*(ILF(att+lim)-ILF(att))/1000+1/2). layer_limit<=0 or attachment<0 -> 'invalid'.","evaluation_group":"w2-insurance_premium_rating-ilf-layer","failed_approach":"Anchoring the origin at factor 1000 makes the first dollar of cover cost a full basic premium.","family":"w2-insurance_premium_rating-ilf-layer-zero-anchor","id":"FA-62946","implementations":{"attempt":{"sha256":"7074c468d657cf5fb503bf378ca2dcbeb60e7bec57cec822b7a7e1aa560b6ab7","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    if x['layer_limit']<=0 or x['attachment']<0: return 'invalid'\n    tab=[[0,1000]]+x['ilf']\n    def ilf(L):\n        if L>tab[-1][0]: return None\n        for (l0,f0),(l1,f1) in zip(tab,tab[1:]):\n            if l0<=L<=l1:\n                return f0+Fraction(f1-f0)*(L-l0)/(l1-l0)\n    top=ilf(x['attachment']+x['layer_limit']); bot=ilf(x['attachment'])\n    if top is None or bot is None: return 'unrated'\n    return math.floor(x['basic']*(top-bot)/1000+Fraction(1,2))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['primary basic limit', {'basic': 43747, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': 0, 'layer_limit': 100000}, 43747], ['primary interpolated limit', {'basic': 104803, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': 0, 'layer_limit': 375000}, 150130], ['excess layer 500 xs 500', {'basic': 91047, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': 500000, 'layer_limit': 500000}, 22944], ['excess layer interpolated', {'basic': 74589, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': 130000, 'layer_limit': 650000}, 47298], ['layer up to maximum', {'basic': 60555, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': 1000000, 'layer_limit': 1000000}, 14897], ['layer beyond maximum', {'basic': 100477, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': 1500000, 'layer_limit': 1000000}, 'unrated'], ['limit below basic', {'basic': 110006, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': 0, 'layer_limit': 60000}, 66004], ['zero width layer rejected', {'basic': 64657, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': 250000, 'layer_limit': 0}, 'invalid'], ['negative attachment rejected', {'basic': 109079, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': -50000, 'layer_limit': 100000}, 'invalid'], ['high excess layer', {'basic': 61004, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': 250000, 'layer_limit': 750000}, 30319]], [['primary basic limit', {'basic': 83688, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': 0, 'layer_limit': 100000}, 83688], ['primary interpolated limit', {'basic': 62537, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': 0, 'layer_limit': 400000}, 91554], ['excess layer 500 xs 500', {'basic': 72974, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': 500000, 'layer_limit': 500000}, 18535], ['excess layer interpolated', {'basic': 96963, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': 180000, 'layer_limit': 310000}, 36820], ['layer up to maximum', {'basic': 51640, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': 1000000, 'layer_limit': 1000000}, 12497], ['layer beyond maximum', {'basic': 96337, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': 1500000, 'layer_limit': 1000000}, 'unrated'], ['limit below basic', {'basic': 80166, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': 0, 'layer_limit': 25000}, 20042], ['zero width layer rejected', {'basic': 40984, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': 250000, 'layer_limit': 0}, 'invalid'], ['negative attachment rejected', {'basic': 99315, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': -50000, 'layer_limit': 100000}, 'invalid'], ['high excess layer', {'basic': 88492, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': 250000, 'layer_limit': 750000}, 43715]], [['primary basic limit', {'basic': 103077, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': 0, 'layer_limit': 100000}, 103077], ['primary interpolated limit', {'basic': 75700, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': 0, 'layer_limit': 410000}, 112066], ['excess layer 500 xs 500', {'basic': 91514, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': 500000, 'layer_limit': 500000}, 23428], ['excess layer interpolated', {'basic': 116014, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': 180000, 'layer_limit': 330000}, 45723], ['layer up to maximum', {'basic': 104427, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': 1000000, 'layer_limit': 1000000}, 24854], ['layer beyond maximum', {'basic': 94873, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': 1500000, 'layer_limit': 1000000}, 'unrated'], ['limit below basic', {'basic': 82268, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': 0, 'layer_limit': 75000}, 61701], ['zero width layer rejected', {'basic': 98050, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': 250000, 'layer_limit': 0}, 'invalid'], ['negative attachment rejected', {'basic': 105611, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': -50000, 'layer_limit': 100000}, 'invalid'], ['high excess layer', {'basic': 93132, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': 250000, 'layer_limit': 750000}, 45728]], [['primary basic limit', {'basic': 99090, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': 0, 'layer_limit': 100000}, 99090], ['primary interpolated limit', {'basic': 69051, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': 0, 'layer_limit': 470000}, 106504], ['excess layer 500 xs 500', {'basic': 103830, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': 500000, 'layer_limit': 500000}, 26788], ['excess layer interpolated', {'basic': 41042, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': 130000, 'layer_limit': 300000}, 17960], ['layer up to maximum', {'basic': 69534, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': 1000000, 'layer_limit': 1000000}, 16271], ['layer beyond maximum', {'basic': 116762, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': 1500000, 'layer_limit': 1000000}, 'unrated'], ['limit below basic', {'basic': 119876, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': 0, 'layer_limit': 60000}, 71926], ['zero width layer rejected', {'basic': 54051, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': 250000, 'layer_limit': 0}, 'invalid'], ['negative attachment rejected', {'basic': 49440, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': -50000, 'layer_limit': 100000}, 'invalid'], ['high excess layer', {'basic': 49001, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': 250000, 'layer_limit': 750000}, 23912]], [['primary basic limit', {'basic': 88505, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': 0, 'layer_limit': 100000}, 88505], ['primary interpolated limit', {'basic': 109050, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': 0, 'layer_limit': 315000}, 153597], ['excess layer 500 xs 500', {'basic': 53196, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': 500000, 'layer_limit': 500000}, 13831], ['excess layer interpolated', {'basic': 106149, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': 230000, 'layer_limit': 370000}, 34357], ['layer up to maximum', {'basic': 43019, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': 1000000, 'layer_limit': 1000000}, 9894], ['layer beyond maximum', {'basic': 50180, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': 1500000, 'layer_limit': 1000000}, 'unrated'], ['limit below basic', {'basic': 81006, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': 0, 'layer_limit': 85000}, 68855], ['zero width layer rejected', {'basic': 54442, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': 250000, 'layer_limit': 0}, 'invalid'], ['negative attachment rejected', {'basic': 105893, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': -50000, 'layer_limit': 100000}, 'invalid'], ['high excess layer', {'basic': 110451, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': 250000, 'layer_limit': 750000}, 53569]]]\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":"9c854762eadfefc9b518e65efec73b0eb1474f0a2e8058095f7ebb39ad7ec171","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    if x['layer_limit']<=0 or x['attachment']<0: return 'invalid'\n    tab=x['ilf']\n    def ilf(L):\n        if L>tab[-1][0]: return None\n        for (l0,f0),(l1,f1) in zip(tab,tab[1:]):\n            if l0<=L<=l1:\n                return f0+Fraction(f1-f0)*(L-l0)/(l1-l0)\n    top=ilf(x['attachment']+x['layer_limit']); bot=ilf(x['attachment'])\n    if top is None or bot is None: return 'unrated'\n    return math.floor(x['basic']*(top-bot)/1000+Fraction(1,2))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['primary basic limit', {'basic': 43747, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': 0, 'layer_limit': 100000}, 43747], ['primary interpolated limit', {'basic': 104803, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': 0, 'layer_limit': 375000}, 150130], ['excess layer 500 xs 500', {'basic': 91047, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': 500000, 'layer_limit': 500000}, 22944], ['excess layer interpolated', {'basic': 74589, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': 130000, 'layer_limit': 650000}, 47298], ['layer up to maximum', {'basic': 60555, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': 1000000, 'layer_limit': 1000000}, 14897], ['layer beyond maximum', {'basic': 100477, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': 1500000, 'layer_limit': 1000000}, 'unrated'], ['limit below basic', {'basic': 110006, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': 0, 'layer_limit': 60000}, 66004], ['zero width layer rejected', {'basic': 64657, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': 250000, 'layer_limit': 0}, 'invalid'], ['negative attachment rejected', {'basic': 109079, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': -50000, 'layer_limit': 100000}, 'invalid'], ['high excess layer', {'basic': 61004, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': 250000, 'layer_limit': 750000}, 30319]], [['primary basic limit', {'basic': 83688, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': 0, 'layer_limit': 100000}, 83688], ['primary interpolated limit', {'basic': 62537, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': 0, 'layer_limit': 400000}, 91554], ['excess layer 500 xs 500', {'basic': 72974, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': 500000, 'layer_limit': 500000}, 18535], ['excess layer interpolated', {'basic': 96963, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': 180000, 'layer_limit': 310000}, 36820], ['layer up to maximum', {'basic': 51640, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': 1000000, 'layer_limit': 1000000}, 12497], ['layer beyond maximum', {'basic': 96337, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': 1500000, 'layer_limit': 1000000}, 'unrated'], ['limit below basic', {'basic': 80166, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': 0, 'layer_limit': 25000}, 20042], ['zero width layer rejected', {'basic': 40984, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': 250000, 'layer_limit': 0}, 'invalid'], ['negative attachment rejected', {'basic': 99315, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': -50000, 'layer_limit': 100000}, 'invalid'], ['high excess layer', {'basic': 88492, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': 250000, 'layer_limit': 750000}, 43715]], [['primary basic limit', {'basic': 103077, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': 0, 'layer_limit': 100000}, 103077], ['primary interpolated limit', {'basic': 75700, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': 0, 'layer_limit': 410000}, 112066], ['excess layer 500 xs 500', {'basic': 91514, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': 500000, 'layer_limit': 500000}, 23428], ['excess layer interpolated', {'basic': 116014, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': 180000, 'layer_limit': 330000}, 45723], ['layer up to maximum', {'basic': 104427, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': 1000000, 'layer_limit': 1000000}, 24854], ['layer beyond maximum', {'basic': 94873, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': 1500000, 'layer_limit': 1000000}, 'unrated'], ['limit below basic', {'basic': 82268, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': 0, 'layer_limit': 75000}, 61701], ['zero width layer rejected', {'basic': 98050, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': 250000, 'layer_limit': 0}, 'invalid'], ['negative attachment rejected', {'basic': 105611, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': -50000, 'layer_limit': 100000}, 'invalid'], ['high excess layer', {'basic': 93132, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': 250000, 'layer_limit': 750000}, 45728]], [['primary basic limit', {'basic': 99090, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': 0, 'layer_limit': 100000}, 99090], ['primary interpolated limit', {'basic': 69051, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': 0, 'layer_limit': 470000}, 106504], ['excess layer 500 xs 500', {'basic': 103830, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': 500000, 'layer_limit': 500000}, 26788], ['excess layer interpolated', {'basic': 41042, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': 130000, 'layer_limit': 300000}, 17960], ['layer up to maximum', {'basic': 69534, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': 1000000, 'layer_limit': 1000000}, 16271], ['layer beyond maximum', {'basic': 116762, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': 1500000, 'layer_limit': 1000000}, 'unrated'], ['limit below basic', {'basic': 119876, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': 0, 'layer_limit': 60000}, 71926], ['zero width layer rejected', {'basic': 54051, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': 250000, 'layer_limit': 0}, 'invalid'], ['negative attachment rejected', {'basic': 49440, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': -50000, 'layer_limit': 100000}, 'invalid'], ['high excess layer', {'basic': 49001, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': 250000, 'layer_limit': 750000}, 23912]], [['primary basic limit', {'basic': 88505, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': 0, 'layer_limit': 100000}, 88505], ['primary interpolated limit', {'basic': 109050, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': 0, 'layer_limit': 315000}, 153597], ['excess layer 500 xs 500', {'basic': 53196, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': 500000, 'layer_limit': 500000}, 13831], ['excess layer interpolated', {'basic': 106149, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': 230000, 'layer_limit': 370000}, 34357], ['layer up to maximum', {'basic': 43019, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': 1000000, 'layer_limit': 1000000}, 9894], ['layer beyond maximum', {'basic': 50180, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': 1500000, 'layer_limit': 1000000}, 'unrated'], ['limit below basic', {'basic': 81006, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': 0, 'layer_limit': 85000}, 68855], ['zero width layer rejected', {'basic': 54442, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': 250000, 'layer_limit': 0}, 'invalid'], ['negative attachment rejected', {'basic': 105893, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': -50000, 'layer_limit': 100000}, 'invalid'], ['high excess layer', {'basic': 110451, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': 250000, 'layer_limit': 750000}, 53569]]]\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":"e2e3d07c004686436b5bb96f0891d7e1db9e30acf1560be07023527514a697fb","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    if x['layer_limit']<=0 or x['attachment']<0: return 'invalid'\n    tab=[[0,0]]+x['ilf']\n    def ilf(L):\n        if L>tab[-1][0]: return None\n        for (l0,f0),(l1,f1) in zip(tab,tab[1:]):\n            if l0<=L<=l1:\n                return f0+Fraction(f1-f0)*(L-l0)/(l1-l0)\n    top=ilf(x['attachment']+x['layer_limit']); bot=ilf(x['attachment'])\n    if top is None or bot is None: return 'unrated'\n    return math.floor(x['basic']*(top-bot)/1000+Fraction(1,2))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['primary basic limit', {'basic': 43747, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': 0, 'layer_limit': 100000}, 43747], ['primary interpolated limit', {'basic': 104803, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': 0, 'layer_limit': 375000}, 150130], ['excess layer 500 xs 500', {'basic': 91047, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': 500000, 'layer_limit': 500000}, 22944], ['excess layer interpolated', {'basic': 74589, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': 130000, 'layer_limit': 650000}, 47298], ['layer up to maximum', {'basic': 60555, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': 1000000, 'layer_limit': 1000000}, 14897], ['layer beyond maximum', {'basic': 100477, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': 1500000, 'layer_limit': 1000000}, 'unrated'], ['limit below basic', {'basic': 110006, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': 0, 'layer_limit': 60000}, 66004], ['zero width layer rejected', {'basic': 64657, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': 250000, 'layer_limit': 0}, 'invalid'], ['negative attachment rejected', {'basic': 109079, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': -50000, 'layer_limit': 100000}, 'invalid'], ['high excess layer', {'basic': 61004, 'ilf': [[100000, 1000], [250000, 1310], [500000, 1555], [1000000, 1807], [2000000, 2053]], 'attachment': 250000, 'layer_limit': 750000}, 30319]], [['primary basic limit', {'basic': 83688, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': 0, 'layer_limit': 100000}, 83688], ['primary interpolated limit', {'basic': 62537, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': 0, 'layer_limit': 400000}, 91554], ['excess layer 500 xs 500', {'basic': 72974, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': 500000, 'layer_limit': 500000}, 18535], ['excess layer interpolated', {'basic': 96963, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': 180000, 'layer_limit': 310000}, 36820], ['layer up to maximum', {'basic': 51640, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': 1000000, 'layer_limit': 1000000}, 12497], ['layer beyond maximum', {'basic': 96337, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': 1500000, 'layer_limit': 1000000}, 'unrated'], ['limit below basic', {'basic': 80166, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': 0, 'layer_limit': 25000}, 20042], ['zero width layer rejected', {'basic': 40984, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': 250000, 'layer_limit': 0}, 'invalid'], ['negative attachment rejected', {'basic': 99315, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': -50000, 'layer_limit': 100000}, 'invalid'], ['high excess layer', {'basic': 88492, 'ilf': [[100000, 1000], [250000, 1320], [500000, 1560], [1000000, 1814], [2000000, 2056]], 'attachment': 250000, 'layer_limit': 750000}, 43715]], [['primary basic limit', {'basic': 103077, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': 0, 'layer_limit': 100000}, 103077], ['primary interpolated limit', {'basic': 75700, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': 0, 'layer_limit': 410000}, 112066], ['excess layer 500 xs 500', {'basic': 91514, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': 500000, 'layer_limit': 500000}, 23428], ['excess layer interpolated', {'basic': 116014, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': 180000, 'layer_limit': 330000}, 45723], ['layer up to maximum', {'basic': 104427, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': 1000000, 'layer_limit': 1000000}, 24854], ['layer beyond maximum', {'basic': 94873, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': 1500000, 'layer_limit': 1000000}, 'unrated'], ['limit below basic', {'basic': 82268, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': 0, 'layer_limit': 75000}, 61701], ['zero width layer rejected', {'basic': 98050, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': 250000, 'layer_limit': 0}, 'invalid'], ['negative attachment rejected', {'basic': 105611, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': -50000, 'layer_limit': 100000}, 'invalid'], ['high excess layer', {'basic': 93132, 'ilf': [[100000, 1000], [250000, 1330], [500000, 1565], [1000000, 1821], [2000000, 2059]], 'attachment': 250000, 'layer_limit': 750000}, 45728]], [['primary basic limit', {'basic': 99090, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': 0, 'layer_limit': 100000}, 99090], ['primary interpolated limit', {'basic': 69051, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': 0, 'layer_limit': 470000}, 106504], ['excess layer 500 xs 500', {'basic': 103830, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': 500000, 'layer_limit': 500000}, 26788], ['excess layer interpolated', {'basic': 41042, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': 130000, 'layer_limit': 300000}, 17960], ['layer up to maximum', {'basic': 69534, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': 1000000, 'layer_limit': 1000000}, 16271], ['layer beyond maximum', {'basic': 116762, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': 1500000, 'layer_limit': 1000000}, 'unrated'], ['limit below basic', {'basic': 119876, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': 0, 'layer_limit': 60000}, 71926], ['zero width layer rejected', {'basic': 54051, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': 250000, 'layer_limit': 0}, 'invalid'], ['negative attachment rejected', {'basic': 49440, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': -50000, 'layer_limit': 100000}, 'invalid'], ['high excess layer', {'basic': 49001, 'ilf': [[100000, 1000], [250000, 1340], [500000, 1570], [1000000, 1828], [2000000, 2062]], 'attachment': 250000, 'layer_limit': 750000}, 23912]], [['primary basic limit', {'basic': 88505, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': 0, 'layer_limit': 100000}, 88505], ['primary interpolated limit', {'basic': 109050, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': 0, 'layer_limit': 315000}, 153597], ['excess layer 500 xs 500', {'basic': 53196, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': 500000, 'layer_limit': 500000}, 13831], ['excess layer interpolated', {'basic': 106149, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': 230000, 'layer_limit': 370000}, 34357], ['layer up to maximum', {'basic': 43019, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': 1000000, 'layer_limit': 1000000}, 9894], ['layer beyond maximum', {'basic': 50180, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': 1500000, 'layer_limit': 1000000}, 'unrated'], ['limit below basic', {'basic': 81006, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': 0, 'layer_limit': 85000}, 68855], ['zero width layer rejected', {'basic': 54442, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': 250000, 'layer_limit': 0}, 'invalid'], ['negative attachment rejected', {'basic': 105893, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': -50000, 'layer_limit': 100000}, 'invalid'], ['high excess layer', {'basic': 110451, 'ilf': [[100000, 1000], [250000, 1350], [500000, 1575], [1000000, 1835], [2000000, 2065]], 'attachment': 250000, 'layer_limit': 750000}, 53569]]]\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":"A deterministic bounded teaching model of a stipulated toy rating contract. Amounts are integer cents and factors exact rationals; it makes no claim of conformance with any filed rating plan, bureau manual or jurisdiction. 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-insurance_premium_rating-ilf-layer-zero-anchor","generated_at":"2026-09-29T14:47:09.514201+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Premium rating engines apply ordered tabular rules where one misplaced boundary or step silently misprices policies.","repair":"Prepend the origin point (0, 0).","root_cause":"The table starts at the basic limit so ILF(0) and smaller limits have no segment.","sha256":"936b97f83303a296039d2098efc04fc9e3624779ac066903ef1f80768b7ae001","title":"Increased limits factor layer pricing: ILF curve has no origin point below the basic limit · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":47.867,"exit_code":1,"observations":[{"actual":0,"check":"primary basic limit","expected":43747,"passed":false},{"actual":45327,"check":"primary interpolated limit","expected":150130,"passed":false},{"actual":22944,"check":"excess layer 500 xs 500","expected":22944,"passed":true},{"actual":47298,"check":"excess layer interpolated","expected":47298,"passed":true},{"actual":14897,"check":"layer up to maximum","expected":14897,"passed":true},{"actual":"unrated","check":"layer beyond maximum","expected":"unrated","passed":true},{"actual":0,"check":"limit below basic","expected":66004,"passed":false},{"actual":"invalid","check":"zero width layer rejected","expected":"invalid","passed":true},{"actual":"invalid","check":"negative attachment rejected","expected":"invalid","passed":true},{"actual":30319,"check":"high excess layer","expected":30319,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"primary basic limit\", \"actual\": 0, \"expected\": 43747, \"passed\": false}, {\"check\": \"primary interpolated limit\", \"actual\": 45327, \"expected\": 150130, \"passed\": false}, {\"check\": \"excess layer 500 xs 500\", \"actual\": 22944, \"expected\": 22944, \"passed\": true}, {\"check\": \"excess layer interpolated\", \"actual\": 47298, \"expected\": 47298, \"passed\": true}, {\"check\": \"layer up to maximum\", \"actual\": 14897, \"expected\": 14897, \"passed\": true}, {\"check\": \"layer beyond maximum\", \"actual\": \"unrated\", \"expected\": \"unrated\", \"passed\": true}, {\"check\": \"limit below basic\", \"actual\": 0, \"expected\": 66004, \"passed\": false}, {\"check\": \"zero width layer rejected\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"negative attachment rejected\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"high excess layer\", \"actual\": 30319, \"expected\": 30319, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":46.38,"exit_code":1,"observations":[{"actual":"unrated","check":"primary basic limit","expected":43747,"passed":false},{"actual":"unrated","check":"primary interpolated limit","expected":150130,"passed":false},{"actual":22944,"check":"excess layer 500 xs 500","expected":22944,"passed":true},{"actual":47298,"check":"excess layer interpolated","expected":47298,"passed":true},{"actual":14897,"check":"layer up to maximum","expected":14897,"passed":true},{"actual":"unrated","check":"layer beyond maximum","expected":"unrated","passed":true},{"actual":"unrated","check":"limit below basic","expected":66004,"passed":false},{"actual":"invalid","check":"zero width layer rejected","expected":"invalid","passed":true},{"actual":"invalid","check":"negative attachment rejected","expected":"invalid","passed":true},{"actual":30319,"check":"high excess layer","expected":30319,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"primary basic limit\", \"actual\": \"unrated\", \"expected\": 43747, \"passed\": false}, {\"check\": \"primary interpolated limit\", \"actual\": \"unrated\", \"expected\": 150130, \"passed\": false}, {\"check\": \"excess layer 500 xs 500\", \"actual\": 22944, \"expected\": 22944, \"passed\": true}, {\"check\": \"excess layer interpolated\", \"actual\": 47298, \"expected\": 47298, \"passed\": true}, {\"check\": \"layer up to maximum\", \"actual\": 14897, \"expected\": 14897, \"passed\": true}, {\"check\": \"layer beyond maximum\", \"actual\": \"unrated\", \"expected\": \"unrated\", \"passed\": true}, {\"check\": \"limit below basic\", \"actual\": \"unrated\", \"expected\": 66004, \"passed\": false}, {\"check\": \"zero width layer rejected\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"negative attachment rejected\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"high excess layer\", \"actual\": 30319, \"expected\": 30319, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":45.634,"exit_code":0,"observations":[{"actual":43747,"check":"primary basic limit","expected":43747,"passed":true},{"actual":150130,"check":"primary interpolated limit","expected":150130,"passed":true},{"actual":22944,"check":"excess layer 500 xs 500","expected":22944,"passed":true},{"actual":47298,"check":"excess layer interpolated","expected":47298,"passed":true},{"actual":14897,"check":"layer up to maximum","expected":14897,"passed":true},{"actual":"unrated","check":"layer beyond maximum","expected":"unrated","passed":true},{"actual":66004,"check":"limit below basic","expected":66004,"passed":true},{"actual":"invalid","check":"zero width layer rejected","expected":"invalid","passed":true},{"actual":"invalid","check":"negative attachment rejected","expected":"invalid","passed":true},{"actual":30319,"check":"high excess layer","expected":30319,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"primary basic limit\", \"actual\": 43747, \"expected\": 43747, \"passed\": true}, {\"check\": \"primary interpolated limit\", \"actual\": 150130, \"expected\": 150130, \"passed\": true}, {\"check\": \"excess layer 500 xs 500\", \"actual\": 22944, \"expected\": 22944, \"passed\": true}, {\"check\": \"excess layer interpolated\", \"actual\": 47298, \"expected\": 47298, \"passed\": true}, {\"check\": \"layer up to maximum\", \"actual\": 14897, \"expected\": 14897, \"passed\": true}, {\"check\": \"layer beyond maximum\", \"actual\": \"unrated\", \"expected\": \"unrated\", \"passed\": true}, {\"check\": \"limit below basic\", \"actual\": 66004, \"expected\": 66004, \"passed\": true}, {\"check\": \"zero width layer rejected\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"negative attachment rejected\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"high excess layer\", \"actual\": 30319, \"expected\": 30319, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}