FA-55946 / Astronomical coordinate conventions / Open access
Multiorder sky cell encoding: Multiorder order-band exclusive endpoint is mistaken for pixel payload length · case 01
The adapter reports an incorrect order stop while other fields remain valid.
ROOT CAUSE
Multiorder order-band exclusive endpoint is mistaken for pixel payload length. Faulty expression: 12*4**d['order']
VERIFIED REPAIR
Preserve the declared model convention at this site: 16*4**d['order']
Unsuccessful approach: A partial convention repair still uses 16*4**d['order']-1
Case contract
A bounded multiorder sky cell uses uniq=4*4**order+pixel, where pixel is the global nested pixel index with 0<=pixel<12*4**order. Coarsening one level preserves face by integer division of pixel by four. Cell area is normalized to whole-sky area one. Output fields are defined by: uniq = 4*4**d['order']+d['pixel']; band_start = 4*4**d['order']; cell_area = 1/(12*4**d['order']); cell_mass = d['density']/(12*4**d['order']); child_uniq = 4*4**(d['order']+1)+4*d['pixel']+d['sub']; order_stop = 16*4**d['order']
Why this case matters
Catalog, detector, sky-coordinate, and spectroscopy adapters must preserve the association between numeric coordinates and their declared reference conventions.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
return {'uniq': 4*4**d['order']+d['pixel'], 'band_start': 4*4**d['order'], 'cell_area': 1/(12*4**d['order']), 'cell_mass': d['density']/(12*4**d['order']), 'child_uniq': 4*4**(d['order']+1)+4*d['pixel']+d['sub'], 'order_stop': 12*4**d['order']}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'order': 2, 'pixel': 17, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 81, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 326, 'order_stop': 256}), ({'order': 0, 'pixel': 0, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 4, 'band_start': 4, 'cell_area': 0.08333333333333333, 'cell_mass': 0.6666666666666666, 'child_uniq': 18, 'order_stop': 16}), ({'order': 1, 'pixel': 5, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 21, 'band_start': 16, 'cell_area': 0.020833333333333332, 'cell_mass': 0.16666666666666666, 'child_uniq': 86, 'order_stop': 64}), ({'order': 2, 'pixel': 17, 'area': 1, 'density': 0, 'sub': 2}, {'uniq': 81, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.0, 'child_uniq': 326, 'order_stop': 256}), ({'order': 2, 'pixel': 17, 'area': 1, 'density': 8, 'sub': 0}, {'uniq': 81, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 324, 'order_stop': 256}), ({'order': 3, 'pixel': 100, 'area': 1, 'density': -2, 'sub': 2}, {'uniq': 356, 'band_start': 256, 'cell_area': 0.0013020833333333333, 'cell_mass': -0.0026041666666666665, 'child_uniq': 1426, 'order_stop': 1024})], 2: [({'order': 2, 'pixel': 18, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 82, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 330, 'order_stop': 256}), ({'order': 0, 'pixel': 1, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 5, 'band_start': 4, 'cell_area': 0.08333333333333333, 'cell_mass': 0.6666666666666666, 'child_uniq': 22, 'order_stop': 16}), ({'order': 1, 'pixel': 6, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 22, 'band_start': 16, 'cell_area': 0.020833333333333332, 'cell_mass': 0.16666666666666666, 'child_uniq': 90, 'order_stop': 64}), ({'order': 2, 'pixel': 18, 'area': 1, 'density': 0, 'sub': 2}, {'uniq': 82, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.0, 'child_uniq': 330, 'order_stop': 256}), ({'order': 2, 'pixel': 18, 'area': 1, 'density': 8, 'sub': 0}, {'uniq': 82, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 328, 'order_stop': 256}), ({'order': 3, 'pixel': 101, 'area': 1, 'density': -2, 'sub': 2}, {'uniq': 357, 'band_start': 256, 'cell_area': 0.0013020833333333333, 'cell_mass': -0.0026041666666666665, 'child_uniq': 1430, 'order_stop': 1024})], 3: [({'order': 2, 'pixel': 19, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 83, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 334, 'order_stop': 256}), ({'order': 0, 'pixel': 2, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 6, 'band_start': 4, 'cell_area': 0.08333333333333333, 'cell_mass': 0.6666666666666666, 'child_uniq': 26, 'order_stop': 16}), ({'order': 1, 'pixel': 7, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 23, 'band_start': 16, 'cell_area': 0.020833333333333332, 'cell_mass': 0.16666666666666666, 'child_uniq': 94, 'order_stop': 64}), ({'order': 2, 'pixel': 19, 'area': 1, 'density': 0, 'sub': 2}, {'uniq': 83, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.0, 'child_uniq': 334, 'order_stop': 256}), ({'order': 2, 'pixel': 19, 'area': 1, 'density': 8, 'sub': 0}, {'uniq': 83, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 332, 'order_stop': 256}), ({'order': 3, 'pixel': 102, 'area': 1, 'density': -2, 'sub': 2}, {'uniq': 358, 'band_start': 256, 'cell_area': 0.0013020833333333333, 'cell_mass': -0.0026041666666666665, 'child_uniq': 1434, 'order_stop': 1024})], 4: [({'order': 2, 'pixel': 20, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 84, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 338, 'order_stop': 256}), ({'order': 0, 'pixel': 3, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 7, 'band_start': 4, 'cell_area': 0.08333333333333333, 'cell_mass': 0.6666666666666666, 'child_uniq': 30, 'order_stop': 16}), ({'order': 1, 'pixel': 8, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 24, 'band_start': 16, 'cell_area': 0.020833333333333332, 'cell_mass': 0.16666666666666666, 'child_uniq': 98, 'order_stop': 64}), ({'order': 2, 'pixel': 20, 'area': 1, 'density': 0, 'sub': 2}, {'uniq': 84, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.0, 'child_uniq': 338, 'order_stop': 256}), ({'order': 2, 'pixel': 20, 'area': 1, 'density': 8, 'sub': 0}, {'uniq': 84, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 336, 'order_stop': 256}), ({'order': 3, 'pixel': 103, 'area': 1, 'density': -2, 'sub': 2}, {'uniq': 359, 'band_start': 256, 'cell_area': 0.0013020833333333333, 'cell_mass': -0.0026041666666666665, 'child_uniq': 1438, 'order_stop': 1024})], 5: [({'order': 2, 'pixel': 21, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 85, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 342, 'order_stop': 256}), ({'order': 0, 'pixel': 4, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 8, 'band_start': 4, 'cell_area': 0.08333333333333333, 'cell_mass': 0.6666666666666666, 'child_uniq': 34, 'order_stop': 16}), ({'order': 1, 'pixel': 9, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 25, 'band_start': 16, 'cell_area': 0.020833333333333332, 'cell_mass': 0.16666666666666666, 'child_uniq': 102, 'order_stop': 64}), ({'order': 2, 'pixel': 21, 'area': 1, 'density': 0, 'sub': 2}, {'uniq': 85, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.0, 'child_uniq': 342, 'order_stop': 256}), ({'order': 2, 'pixel': 21, 'area': 1, 'density': 8, 'sub': 0}, {'uniq': 85, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 340, 'order_stop': 256}), ({'order': 3, 'pixel': 104, 'area': 1, 'density': -2, 'sub': 2}, {'uniq': 360, 'band_start': 256, 'cell_area': 0.0013020833333333333, 'cell_mass': -0.0026041666666666665, 'child_uniq': 1442, 'order_stop': 1024})]}
for i, (record, expected) in enumerate(fixtures[N]):
check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| astronomical fixture 0 | {'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 326, 'order_stop': 192, 'uniq': 81} | {'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 326, 'order_stop': 256, 'uniq': 81} | Failed |
| astronomical fixture 1 | {'band_start': 4, 'cell_area': 0.08333333333333333, 'cell_mass': 0.6666666666666666, 'child_uniq': 18, 'order_stop': 12, 'uniq': 4} | {'band_start': 4, 'cell_area': 0.08333333333333333, 'cell_mass': 0.6666666666666666, 'child_uniq': 18, 'order_stop': 16, 'uniq': 4} | Failed |
| astronomical fixture 2 | {'band_start': 16, 'cell_area': 0.020833333333333332, 'cell_mass': 0.16666666666666666, 'child_uniq': 86, 'order_stop': 48, 'uniq': 21} | {'band_start': 16, 'cell_area': 0.020833333333333332, 'cell_mass': 0.16666666666666666, 'child_uniq': 86, 'order_stop': 64, 'uniq': 21} | Failed |
| astronomical fixture 3 | {'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.0, 'child_uniq': 326, 'order_stop': 192, 'uniq': 81} | {'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.0, 'child_uniq': 326, 'order_stop': 256, 'uniq': 81} | Failed |
| astronomical fixture 4 | {'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 324, 'order_stop': 192, 'uniq': 81} | {'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 324, 'order_stop': 256, 'uniq': 81} | Failed |
| astronomical fixture 5 | {'band_start': 256, 'cell_area': 0.0013020833333333333, 'cell_mass': -0.0026041666666666665, 'child_uniq': 1426, 'order_stop': 768, 'uniq': 356} | {'band_start': 256, 'cell_area': 0.0013020833333333333, 'cell_mass': -0.0026041666666666665, 'child_uniq': 1426, 'order_stop': 1024, 'uniq': 356} | Failed |
SHA-256 / ef92c89a7a995bb24181e2aa169952197510f8443490f90d62c2c488b804dca7
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
return {'uniq': 4*4**d['order']+d['pixel'], 'band_start': 4*4**d['order'], 'cell_area': 1/(12*4**d['order']), 'cell_mass': d['density']/(12*4**d['order']), 'child_uniq': 4*4**(d['order']+1)+4*d['pixel']+d['sub'], 'order_stop': 16*4**d['order']-1}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'order': 2, 'pixel': 17, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 81, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 326, 'order_stop': 256}), ({'order': 0, 'pixel': 0, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 4, 'band_start': 4, 'cell_area': 0.08333333333333333, 'cell_mass': 0.6666666666666666, 'child_uniq': 18, 'order_stop': 16}), ({'order': 1, 'pixel': 5, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 21, 'band_start': 16, 'cell_area': 0.020833333333333332, 'cell_mass': 0.16666666666666666, 'child_uniq': 86, 'order_stop': 64}), ({'order': 2, 'pixel': 17, 'area': 1, 'density': 0, 'sub': 2}, {'uniq': 81, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.0, 'child_uniq': 326, 'order_stop': 256}), ({'order': 2, 'pixel': 17, 'area': 1, 'density': 8, 'sub': 0}, {'uniq': 81, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 324, 'order_stop': 256}), ({'order': 3, 'pixel': 100, 'area': 1, 'density': -2, 'sub': 2}, {'uniq': 356, 'band_start': 256, 'cell_area': 0.0013020833333333333, 'cell_mass': -0.0026041666666666665, 'child_uniq': 1426, 'order_stop': 1024})], 2: [({'order': 2, 'pixel': 18, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 82, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 330, 'order_stop': 256}), ({'order': 0, 'pixel': 1, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 5, 'band_start': 4, 'cell_area': 0.08333333333333333, 'cell_mass': 0.6666666666666666, 'child_uniq': 22, 'order_stop': 16}), ({'order': 1, 'pixel': 6, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 22, 'band_start': 16, 'cell_area': 0.020833333333333332, 'cell_mass': 0.16666666666666666, 'child_uniq': 90, 'order_stop': 64}), ({'order': 2, 'pixel': 18, 'area': 1, 'density': 0, 'sub': 2}, {'uniq': 82, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.0, 'child_uniq': 330, 'order_stop': 256}), ({'order': 2, 'pixel': 18, 'area': 1, 'density': 8, 'sub': 0}, {'uniq': 82, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 328, 'order_stop': 256}), ({'order': 3, 'pixel': 101, 'area': 1, 'density': -2, 'sub': 2}, {'uniq': 357, 'band_start': 256, 'cell_area': 0.0013020833333333333, 'cell_mass': -0.0026041666666666665, 'child_uniq': 1430, 'order_stop': 1024})], 3: [({'order': 2, 'pixel': 19, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 83, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 334, 'order_stop': 256}), ({'order': 0, 'pixel': 2, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 6, 'band_start': 4, 'cell_area': 0.08333333333333333, 'cell_mass': 0.6666666666666666, 'child_uniq': 26, 'order_stop': 16}), ({'order': 1, 'pixel': 7, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 23, 'band_start': 16, 'cell_area': 0.020833333333333332, 'cell_mass': 0.16666666666666666, 'child_uniq': 94, 'order_stop': 64}), ({'order': 2, 'pixel': 19, 'area': 1, 'density': 0, 'sub': 2}, {'uniq': 83, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.0, 'child_uniq': 334, 'order_stop': 256}), ({'order': 2, 'pixel': 19, 'area': 1, 'density': 8, 'sub': 0}, {'uniq': 83, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 332, 'order_stop': 256}), ({'order': 3, 'pixel': 102, 'area': 1, 'density': -2, 'sub': 2}, {'uniq': 358, 'band_start': 256, 'cell_area': 0.0013020833333333333, 'cell_mass': -0.0026041666666666665, 'child_uniq': 1434, 'order_stop': 1024})], 4: [({'order': 2, 'pixel': 20, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 84, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 338, 'order_stop': 256}), ({'order': 0, 'pixel': 3, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 7, 'band_start': 4, 'cell_area': 0.08333333333333333, 'cell_mass': 0.6666666666666666, 'child_uniq': 30, 'order_stop': 16}), ({'order': 1, 'pixel': 8, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 24, 'band_start': 16, 'cell_area': 0.020833333333333332, 'cell_mass': 0.16666666666666666, 'child_uniq': 98, 'order_stop': 64}), ({'order': 2, 'pixel': 20, 'area': 1, 'density': 0, 'sub': 2}, {'uniq': 84, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.0, 'child_uniq': 338, 'order_stop': 256}), ({'order': 2, 'pixel': 20, 'area': 1, 'density': 8, 'sub': 0}, {'uniq': 84, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 336, 'order_stop': 256}), ({'order': 3, 'pixel': 103, 'area': 1, 'density': -2, 'sub': 2}, {'uniq': 359, 'band_start': 256, 'cell_area': 0.0013020833333333333, 'cell_mass': -0.0026041666666666665, 'child_uniq': 1438, 'order_stop': 1024})], 5: [({'order': 2, 'pixel': 21, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 85, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 342, 'order_stop': 256}), ({'order': 0, 'pixel': 4, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 8, 'band_start': 4, 'cell_area': 0.08333333333333333, 'cell_mass': 0.6666666666666666, 'child_uniq': 34, 'order_stop': 16}), ({'order': 1, 'pixel': 9, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 25, 'band_start': 16, 'cell_area': 0.020833333333333332, 'cell_mass': 0.16666666666666666, 'child_uniq': 102, 'order_stop': 64}), ({'order': 2, 'pixel': 21, 'area': 1, 'density': 0, 'sub': 2}, {'uniq': 85, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.0, 'child_uniq': 342, 'order_stop': 256}), ({'order': 2, 'pixel': 21, 'area': 1, 'density': 8, 'sub': 0}, {'uniq': 85, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 340, 'order_stop': 256}), ({'order': 3, 'pixel': 104, 'area': 1, 'density': -2, 'sub': 2}, {'uniq': 360, 'band_start': 256, 'cell_area': 0.0013020833333333333, 'cell_mass': -0.0026041666666666665, 'child_uniq': 1442, 'order_stop': 1024})]}
for i, (record, expected) in enumerate(fixtures[N]):
check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| astronomical fixture 0 | {'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 326, 'order_stop': 255, 'uniq': 81} | {'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 326, 'order_stop': 256, 'uniq': 81} | Failed |
| astronomical fixture 1 | {'band_start': 4, 'cell_area': 0.08333333333333333, 'cell_mass': 0.6666666666666666, 'child_uniq': 18, 'order_stop': 15, 'uniq': 4} | {'band_start': 4, 'cell_area': 0.08333333333333333, 'cell_mass': 0.6666666666666666, 'child_uniq': 18, 'order_stop': 16, 'uniq': 4} | Failed |
| astronomical fixture 2 | {'band_start': 16, 'cell_area': 0.020833333333333332, 'cell_mass': 0.16666666666666666, 'child_uniq': 86, 'order_stop': 63, 'uniq': 21} | {'band_start': 16, 'cell_area': 0.020833333333333332, 'cell_mass': 0.16666666666666666, 'child_uniq': 86, 'order_stop': 64, 'uniq': 21} | Failed |
| astronomical fixture 3 | {'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.0, 'child_uniq': 326, 'order_stop': 255, 'uniq': 81} | {'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.0, 'child_uniq': 326, 'order_stop': 256, 'uniq': 81} | Failed |
| astronomical fixture 4 | {'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 324, 'order_stop': 255, 'uniq': 81} | {'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 324, 'order_stop': 256, 'uniq': 81} | Failed |
| astronomical fixture 5 | {'band_start': 256, 'cell_area': 0.0013020833333333333, 'cell_mass': -0.0026041666666666665, 'child_uniq': 1426, 'order_stop': 1023, 'uniq': 356} | {'band_start': 256, 'cell_area': 0.0013020833333333333, 'cell_mass': -0.0026041666666666665, 'child_uniq': 1426, 'order_stop': 1024, 'uniq': 356} | Failed |
SHA-256 / 6046396d4a844a38c4e55c5056012ace2d984c4e4af22a4884a416e1fe2296bd
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
return {'uniq': 4*4**d['order']+d['pixel'], 'band_start': 4*4**d['order'], 'cell_area': 1/(12*4**d['order']), 'cell_mass': d['density']/(12*4**d['order']), 'child_uniq': 4*4**(d['order']+1)+4*d['pixel']+d['sub'], 'order_stop': 16*4**d['order']}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'order': 2, 'pixel': 17, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 81, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 326, 'order_stop': 256}), ({'order': 0, 'pixel': 0, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 4, 'band_start': 4, 'cell_area': 0.08333333333333333, 'cell_mass': 0.6666666666666666, 'child_uniq': 18, 'order_stop': 16}), ({'order': 1, 'pixel': 5, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 21, 'band_start': 16, 'cell_area': 0.020833333333333332, 'cell_mass': 0.16666666666666666, 'child_uniq': 86, 'order_stop': 64}), ({'order': 2, 'pixel': 17, 'area': 1, 'density': 0, 'sub': 2}, {'uniq': 81, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.0, 'child_uniq': 326, 'order_stop': 256}), ({'order': 2, 'pixel': 17, 'area': 1, 'density': 8, 'sub': 0}, {'uniq': 81, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 324, 'order_stop': 256}), ({'order': 3, 'pixel': 100, 'area': 1, 'density': -2, 'sub': 2}, {'uniq': 356, 'band_start': 256, 'cell_area': 0.0013020833333333333, 'cell_mass': -0.0026041666666666665, 'child_uniq': 1426, 'order_stop': 1024})], 2: [({'order': 2, 'pixel': 18, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 82, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 330, 'order_stop': 256}), ({'order': 0, 'pixel': 1, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 5, 'band_start': 4, 'cell_area': 0.08333333333333333, 'cell_mass': 0.6666666666666666, 'child_uniq': 22, 'order_stop': 16}), ({'order': 1, 'pixel': 6, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 22, 'band_start': 16, 'cell_area': 0.020833333333333332, 'cell_mass': 0.16666666666666666, 'child_uniq': 90, 'order_stop': 64}), ({'order': 2, 'pixel': 18, 'area': 1, 'density': 0, 'sub': 2}, {'uniq': 82, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.0, 'child_uniq': 330, 'order_stop': 256}), ({'order': 2, 'pixel': 18, 'area': 1, 'density': 8, 'sub': 0}, {'uniq': 82, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 328, 'order_stop': 256}), ({'order': 3, 'pixel': 101, 'area': 1, 'density': -2, 'sub': 2}, {'uniq': 357, 'band_start': 256, 'cell_area': 0.0013020833333333333, 'cell_mass': -0.0026041666666666665, 'child_uniq': 1430, 'order_stop': 1024})], 3: [({'order': 2, 'pixel': 19, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 83, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 334, 'order_stop': 256}), ({'order': 0, 'pixel': 2, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 6, 'band_start': 4, 'cell_area': 0.08333333333333333, 'cell_mass': 0.6666666666666666, 'child_uniq': 26, 'order_stop': 16}), ({'order': 1, 'pixel': 7, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 23, 'band_start': 16, 'cell_area': 0.020833333333333332, 'cell_mass': 0.16666666666666666, 'child_uniq': 94, 'order_stop': 64}), ({'order': 2, 'pixel': 19, 'area': 1, 'density': 0, 'sub': 2}, {'uniq': 83, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.0, 'child_uniq': 334, 'order_stop': 256}), ({'order': 2, 'pixel': 19, 'area': 1, 'density': 8, 'sub': 0}, {'uniq': 83, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 332, 'order_stop': 256}), ({'order': 3, 'pixel': 102, 'area': 1, 'density': -2, 'sub': 2}, {'uniq': 358, 'band_start': 256, 'cell_area': 0.0013020833333333333, 'cell_mass': -0.0026041666666666665, 'child_uniq': 1434, 'order_stop': 1024})], 4: [({'order': 2, 'pixel': 20, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 84, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 338, 'order_stop': 256}), ({'order': 0, 'pixel': 3, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 7, 'band_start': 4, 'cell_area': 0.08333333333333333, 'cell_mass': 0.6666666666666666, 'child_uniq': 30, 'order_stop': 16}), ({'order': 1, 'pixel': 8, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 24, 'band_start': 16, 'cell_area': 0.020833333333333332, 'cell_mass': 0.16666666666666666, 'child_uniq': 98, 'order_stop': 64}), ({'order': 2, 'pixel': 20, 'area': 1, 'density': 0, 'sub': 2}, {'uniq': 84, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.0, 'child_uniq': 338, 'order_stop': 256}), ({'order': 2, 'pixel': 20, 'area': 1, 'density': 8, 'sub': 0}, {'uniq': 84, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 336, 'order_stop': 256}), ({'order': 3, 'pixel': 103, 'area': 1, 'density': -2, 'sub': 2}, {'uniq': 359, 'band_start': 256, 'cell_area': 0.0013020833333333333, 'cell_mass': -0.0026041666666666665, 'child_uniq': 1438, 'order_stop': 1024})], 5: [({'order': 2, 'pixel': 21, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 85, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 342, 'order_stop': 256}), ({'order': 0, 'pixel': 4, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 8, 'band_start': 4, 'cell_area': 0.08333333333333333, 'cell_mass': 0.6666666666666666, 'child_uniq': 34, 'order_stop': 16}), ({'order': 1, 'pixel': 9, 'area': 1, 'density': 8, 'sub': 2}, {'uniq': 25, 'band_start': 16, 'cell_area': 0.020833333333333332, 'cell_mass': 0.16666666666666666, 'child_uniq': 102, 'order_stop': 64}), ({'order': 2, 'pixel': 21, 'area': 1, 'density': 0, 'sub': 2}, {'uniq': 85, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.0, 'child_uniq': 342, 'order_stop': 256}), ({'order': 2, 'pixel': 21, 'area': 1, 'density': 8, 'sub': 0}, {'uniq': 85, 'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 340, 'order_stop': 256}), ({'order': 3, 'pixel': 104, 'area': 1, 'density': -2, 'sub': 2}, {'uniq': 360, 'band_start': 256, 'cell_area': 0.0013020833333333333, 'cell_mass': -0.0026041666666666665, 'child_uniq': 1442, 'order_stop': 1024})]}
for i, (record, expected) in enumerate(fixtures[N]):
check('astronomical fixture %s' % i, solve(record), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| astronomical fixture 0 | {'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 326, 'order_stop': 256, 'uniq': 81} | {'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 326, 'order_stop': 256, 'uniq': 81} | Passed |
| astronomical fixture 1 | {'band_start': 4, 'cell_area': 0.08333333333333333, 'cell_mass': 0.6666666666666666, 'child_uniq': 18, 'order_stop': 16, 'uniq': 4} | {'band_start': 4, 'cell_area': 0.08333333333333333, 'cell_mass': 0.6666666666666666, 'child_uniq': 18, 'order_stop': 16, 'uniq': 4} | Passed |
| astronomical fixture 2 | {'band_start': 16, 'cell_area': 0.020833333333333332, 'cell_mass': 0.16666666666666666, 'child_uniq': 86, 'order_stop': 64, 'uniq': 21} | {'band_start': 16, 'cell_area': 0.020833333333333332, 'cell_mass': 0.16666666666666666, 'child_uniq': 86, 'order_stop': 64, 'uniq': 21} | Passed |
| astronomical fixture 3 | {'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.0, 'child_uniq': 326, 'order_stop': 256, 'uniq': 81} | {'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.0, 'child_uniq': 326, 'order_stop': 256, 'uniq': 81} | Passed |
| astronomical fixture 4 | {'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 324, 'order_stop': 256, 'uniq': 81} | {'band_start': 64, 'cell_area': 0.005208333333333333, 'cell_mass': 0.041666666666666664, 'child_uniq': 324, 'order_stop': 256, 'uniq': 81} | Passed |
| astronomical fixture 5 | {'band_start': 256, 'cell_area': 0.0013020833333333333, 'cell_mass': -0.0026041666666666665, 'child_uniq': 1426, 'order_stop': 1024, 'uniq': 356} | {'band_start': 256, 'cell_area': 0.0013020833333333333, 'cell_mass': -0.0026041666666666665, 'child_uniq': 1426, 'order_stop': 1024, 'uniq': 356} | Passed |
SHA-256 / 033700d75052a2539ad9fc73ecf706dc5f31469c8915c302c253a97b858c7922
Verification & scope
Explicitly stipulated finite algebraic adapter; no standards conformance, physical accuracy, or production-library claim. Inputs are the documented finite valid model domain. 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.
Observations recorded using Python 3.12.14 at 2026-09-29T14:46:02.460972+00:00.
Case digest / b4a8ad8f43dc7931aa1c1e9e97d2ad0a624bb1bad482023f84b2404e4bf9303a