FA-71860 / Error-correcting codes / Member archive
Shortened Hamming wraps an out-of-range syndrome · case 05
Double errors in a shortened code are silently "corrected" at a wrong bit.
Case contract
Single-error-correcting Hamming decoder for a full or shortened code of length n >= 3 (bits 0/1, else None). Positions are 1-based; parity bits sit at powers of two. The syndrome is the XOR of the positions holding a 1. A syndrome above n points outside the shortened code and is "uncorrectable" (data None); otherwise the bit at the syndrome position is flipped. Return [status, data bits from non-power-of-two positions, syndrome].
Why this case matters
Memory and link controllers use (shortened) Hamming codes to repair single-bit upsets.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression [[1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0]] | ["corrected", [1, 0, 1, 0, 1, 1, 1, 0], 14] | ["uncorrectable", null, 14] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗