🤖 AI generated content
src/rootfilespec/bootstrap/array.py hardcodes only TArrayC/S/I/F/D.
TArrayL and TArrayL64 are missing. TArray §1 "Layout" lists seven classes; TArrayL is 8 bytes per element on disk (not sizeof(long)), as is TArrayL64.
- The fallback is actively wrong, not merely absent. TArray §2: a recorded streamer info for a concrete
TArray describes a layout one byte longer than the bytes (a kOffsetP presence flag that TArray::Streamer never writes). Because the two classes are not in BOOTSTRAP_TYPES, a file carrying their info gets a generated class; the reviewer printed class_definition() for the TArrayF info in data/classes/tarray-histogram.root and got BasicArray('>f', 'fN') with haspad defaulting to True (src/rootfilespec/container.py:59) — exactly the too-long reader. The hardcoded classes pass haspad=False (array.py:24-51) and are correct; that deserves a comment.
TArrayC is read unsigned — array.py:24 uses ">B"/np.uint8. Char_t is signed; the spec's fixture asserts the elements as i8 (reference/root-io-spec/gen/cases/classes/tarray/case.toml). Values ≥ 128 come out positive.
fN < 0 is not rejected (TArray §5 invariant 1) and would reach np.frombuffer(count=n) (container.py:48).
Evidence: reference/root-io-spec/data/classes/tarray.root → records /l and /q unreadable (Unknown type). data/serialization/version-zero.root → TH1L is generated as class TH1L(TArrayL64, TH1) with TArrayL64 falling back to Uninterpreted, and the read dies with TypeError: TH1L.__init__() missing 36 required positional arguments (error also reported as Class TH1L depends on TArrayL64 which is missing). No skhep_testdata file carries a TArrayL64 info.
Suggested fix: add TArrayL and TArrayL64 (both ">q", haspad=False) to array.py and bootstrap.__all__; change TArrayC to ">b"/np.int8; assert fN >= 0.
Severity / size: high for TH1L/TH2L and TArrayL* records from current ROOT, low for the TArrayC sign / S.
Related: #101, #102, #111 (version-zero.root also trips that).
Assisted-by: claude-code:claude-fable-5-1
src/rootfilespec/bootstrap/array.pyhardcodes onlyTArrayC/S/I/F/D.TArrayLandTArrayL64are missing. TArray §1 "Layout" lists seven classes;TArrayLis 8 bytes per element on disk (notsizeof(long)), as isTArrayL64.TArraydescribes a layout one byte longer than the bytes (akOffsetPpresence flag thatTArray::Streamernever writes). Because the two classes are not inBOOTSTRAP_TYPES, a file carrying their info gets a generated class; the reviewer printedclass_definition()for theTArrayFinfo indata/classes/tarray-histogram.rootand gotBasicArray('>f', 'fN')withhaspaddefaulting toTrue(src/rootfilespec/container.py:59) — exactly the too-long reader. The hardcoded classes passhaspad=False(array.py:24-51) and are correct; that deserves a comment.TArrayCis read unsigned —array.py:24uses">B"/np.uint8.Char_tis signed; the spec's fixture asserts the elements asi8(reference/root-io-spec/gen/cases/classes/tarray/case.toml). Values ≥ 128 come out positive.fN < 0is not rejected (TArray §5 invariant 1) and would reachnp.frombuffer(count=n)(container.py:48).Evidence:
reference/root-io-spec/data/classes/tarray.root→ records/land/qunreadable (Unknown type).data/serialization/version-zero.root→TH1Lis generated asclass TH1L(TArrayL64, TH1)withTArrayL64falling back toUninterpreted, and the read dies withTypeError: TH1L.__init__() missing 36 required positional arguments(error also reported asClass TH1L depends on TArrayL64 which is missing). Noskhep_testdatafile carries aTArrayL64info.Suggested fix: add
TArrayLandTArrayL64(both">q",haspad=False) toarray.pyandbootstrap.__all__; changeTArrayCto">b"/np.int8; assertfN >= 0.Severity / size: high for
TH1L/TH2LandTArrayL*records from current ROOT, low for theTArrayCsign / S.Related: #101, #102, #111 (
version-zero.rootalso trips that).Assisted-by: claude-code:claude-fable-5-1