FA-11546 / Filesystem semantics / Open access
Duplicated descriptors advance independent read positions · case 01
Duplicated descriptors advance independent read positions.
ROOT CAUSE
A duplicated descriptor is modeled as a fresh open-file description.
VERIFIED REPAIR
Use one shared position for reads through either duplicated descriptor.
Unsuccessful approach: Synchronizing positions only after the first read still loses later interleavings.
Case contract
Deterministic in-memory filesystem model. Two descriptors are duplicates of one open-file description at offset zero. Return text read by alternating descriptors for nonnegative requested lengths; EOF reads return empty text.
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(text, lengths):
positions=[0,0]
out=[]
for i,k in enumerate(lengths):
d=i%2; p=positions[d]; out.append(text[p:p+k]); positions[d]+=len(out[-1])
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
s='abcdef'+str(N)
check('interleaved duplicate reads',solve(s,[1,1,1,1]),['a','b','c','d'])
check('one read',solve(s,[2]),['ab'])
check('zero length does not advance',solve(s,[0,2,1]),['','ab','c'])
check('EOF clips count',solve(s,[100,1]),[s,''])
check('empty file',solve('',[N,1]),['',''])
check('no reads',solve(s,[]),[])
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 |
|---|---|---|---|
| interleaved duplicate reads | ['a', 'a', 'b', 'b'] | ['a', 'b', 'c', 'd'] | Failed |
| one read | ['ab'] | ['ab'] | Passed |
| zero length does not advance | ['', 'ab', 'a'] | ['', 'ab', 'c'] | Failed |
| EOF clips count | ['abcdef1', 'a'] | ['abcdef1', ''] | Failed |
| empty file | ['', ''] | ['', ''] | Passed |
| no reads | [] | [] | Passed |
SHA-256 / 94f5674aed72a2865dd4865ca0dae86aa970a1e4cdb7407a7a319e2b882953b5
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(text, lengths):
positions=[0,0]
out=[]
for i,k in enumerate(lengths):
d=i%2; p=positions[d]; out.append(text[p:p+k]); positions[d]+=len(out[-1])
if i==0: positions[1]=positions[0]
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
s='abcdef'+str(N)
check('interleaved duplicate reads',solve(s,[1,1,1,1]),['a','b','c','d'])
check('one read',solve(s,[2]),['ab'])
check('zero length does not advance',solve(s,[0,2,1]),['','ab','c'])
check('EOF clips count',solve(s,[100,1]),[s,''])
check('empty file',solve('',[N,1]),['',''])
check('no reads',solve(s,[]),[])
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 |
|---|---|---|---|
| interleaved duplicate reads | ['a', 'b', 'b', 'c'] | ['a', 'b', 'c', 'd'] | Failed |
| one read | ['ab'] | ['ab'] | Passed |
| zero length does not advance | ['', 'ab', 'a'] | ['', 'ab', 'c'] | Failed |
| EOF clips count | ['abcdef1', ''] | ['abcdef1', ''] | Passed |
| empty file | ['', ''] | ['', ''] | Passed |
| no reads | [] | [] | Passed |
SHA-256 / 65c5b223bb800bd6e8acbbaecb88ae506f24cdcb5ea3f959134f3e46f814c65c
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(text, lengths):
position=0
out=[]
for k in lengths:
part=text[position:position+k]; out.append(part); position+=len(part)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
s='abcdef'+str(N)
check('interleaved duplicate reads',solve(s,[1,1,1,1]),['a','b','c','d'])
check('one read',solve(s,[2]),['ab'])
check('zero length does not advance',solve(s,[0,2,1]),['','ab','c'])
check('EOF clips count',solve(s,[100,1]),[s,''])
check('empty file',solve('',[N,1]),['',''])
check('no reads',solve(s,[]),[])
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 |
|---|---|---|---|
| interleaved duplicate reads | ['a', 'b', 'c', 'd'] | ['a', 'b', 'c', 'd'] | Passed |
| one read | ['ab'] | ['ab'] | Passed |
| zero length does not advance | ['', 'ab', 'c'] | ['', 'ab', 'c'] | Passed |
| EOF clips count | ['abcdef1', ''] | ['abcdef1', ''] | Passed |
| empty file | ['', ''] | ['', ''] | Passed |
| no reads | [] | [] | Passed |
SHA-256 / 887c1824232cdfc64308ffe6a627059bb33c26b321e6f8d34a6b677a080f2047
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:48.884763+00:00.
Case digest / ed9370828dff00c7b5ac0081fdabe76f2f183aa8e7009bfc74c1e14036e9ec65