FA-11571 / Filesystem semantics / Open access
Sparse holes disappear when file bytes are reconstructed · case 01
Sparse holes disappear when file bytes are reconstructed.
ROOT CAUSE
Only allocated cells are concatenated, collapsing logical offsets.
VERIFIED REPAIR
Read each logical position and substitute a zero byte for unallocated cells.
Unsuccessful approach: Padding at the end preserves size but moves bytes that follow internal holes.
Case contract
Deterministic in-memory filesystem model. Logical file has nonnegative size and a map from allocated integer offsets to byte values 0..255. Return all logical bytes as a list; offsets outside size are ignored.
Why this case matters
An offline semantic experiment for file API clients; it models only the stated operations, not a complete operating system.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(size, cells):
return [cells[p] for p in sorted(cells) if 0<=p<size]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('leading hole',solve(N+1,{N:65}),[0]*N+[65])
check('internal hole',solve(3,{0:65,2:66}),[65,0,66])
check('trailing hole',solve(3,{0:65}),[65,0,0])
check('all hole',solve(N,{}),[0]*N)
check('empty file',solve(0,{0:65}),[])
check('allocated zero retained',solve(2,{0:0,1:66}),[0,66])
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 |
|---|---|---|---|
| leading hole | [65] | [0, 65] | Failed |
| internal hole | [65, 66] | [65, 0, 66] | Failed |
| trailing hole | [65] | [65, 0, 0] | Failed |
| all hole | [] | [0] | Failed |
| empty file | [] | [] | Passed |
| allocated zero retained | [0, 66] | [0, 66] | Passed |
SHA-256 / ec0ee2fc6de107c6b7c4b345b12ce985b4f2ee1e065312fe523756c8c18c8b8a
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(size, cells):
values=[cells[p] for p in sorted(cells) if 0<=p<size]
return values+[0]*(size-len(values))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('leading hole',solve(N+1,{N:65}),[0]*N+[65])
check('internal hole',solve(3,{0:65,2:66}),[65,0,66])
check('trailing hole',solve(3,{0:65}),[65,0,0])
check('all hole',solve(N,{}),[0]*N)
check('empty file',solve(0,{0:65}),[])
check('allocated zero retained',solve(2,{0:0,1:66}),[0,66])
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 |
|---|---|---|---|
| leading hole | [65, 0] | [0, 65] | Failed |
| internal hole | [65, 66, 0] | [65, 0, 66] | Failed |
| trailing hole | [65, 0, 0] | [65, 0, 0] | Passed |
| all hole | [0] | [0] | Passed |
| empty file | [] | [] | Passed |
| allocated zero retained | [0, 66] | [0, 66] | Passed |
SHA-256 / e7f0534a9a3084e192c127c53c70974301f1f98335cab1da2849827c877d0021
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(size, cells):
return [cells.get(p,0) for p in range(size)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('leading hole',solve(N+1,{N:65}),[0]*N+[65])
check('internal hole',solve(3,{0:65,2:66}),[65,0,66])
check('trailing hole',solve(3,{0:65}),[65,0,0])
check('all hole',solve(N,{}),[0]*N)
check('empty file',solve(0,{0:65}),[])
check('allocated zero retained',solve(2,{0:0,1:66}),[0,66])
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 |
|---|---|---|---|
| leading hole | [0, 65] | [0, 65] | Passed |
| internal hole | [65, 0, 66] | [65, 0, 66] | Passed |
| trailing hole | [65, 0, 0] | [65, 0, 0] | Passed |
| all hole | [0] | [0] | Passed |
| empty file | [] | [] | Passed |
| allocated zero retained | [0, 66] | [0, 66] | Passed |
SHA-256 / d872122492a43c8a1899b47c7189de38c10b263915bff3f082db255e98332e8f
Verification & scope
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:38:49.125405+00:00.
Case digest / 1c5440ca3ba32aeaa061184d93181b2573b8f84a5ae882d49383a52b998db0a2