Ip020 — OBJ vertex-normal index out of range silently discards the entire normal channel

§12.15 import-format parser robustness (sub-class: attribute-channel-underrun)

P2 — spec deviation (no data loss)

silent-loss

Sources

Description

A face record's `vn` slot references a normal index beyond the declared `vn` count (`f 1//1 2//2 3//1` with only one `vn` in the file). Rather than raising or clamping just the offending reference, a loader that bounds-checks the referenced-normal array as a whole may respond to any one invalid index by discarding per-vertex normals for the entire mesh and silently substituting a recomputed geometric (flat, per-face) normal — even for the two vertex refs (`1` and `3`) whose `vn` index was perfectly valid.

Reproducer recipe

three `v` lines forming a triangle whose winding order gives a computed geometric normal of `(0,0,-1)`, one `vn 0.0 0.0 1.0` (the opposite direction, so declared-vs-computed are unambiguously distinguishable), and a face `f 1//1 2//2 3//1` where index `2` for `vn` is out of range (only one `vn` exists).

Expected kernel behavior

bounds-check every `vn`/`vt` reference against the declared count of that channel individually; an out-of-range reference on one vertex should not silently discard valid per-vertex data supplied for the other vertices of the same face.

Notes

Cross-oracle: trimesh 4.12.2 raises no exception and silently drops the file's declared normal data entirely, returning `vertex_normals==[[0,0,-1],[0,0,-1],[0,0,-1]]` for every vertex — matching the recomputed geometric `face_normals` (`[0,0,-1]`), not the file's declared `vn 0.0 0.0 1.0` — verified 2026-07-17 (confirmed against an all-valid-index control file, which correctly returns the declared `[0,0,1]` normal). Synonyms: "OBJ vn index out of range", "normal channel underrun", "silent normal-channel drop", "geometric-normal fallback masks bad index". Provenance tier: bytes-only.

Expected validation

Provenance tier

bytes-only — defect not fully embodied in fixture bytes.

Byte assertions

Live oracle output

No live oracle data — run _run_corpus to populate.

Fixture content

Show fixture bytes (with defect highlighting)
1v 0.0 0.0 0.0
2v 0.0 1.0 0.0
3v 1.0 0.0 0.0
4vn 0.0 0.0 1.0
5f 1//1 2//2 3//1