Skip to content

with_ts detection in importIitYarpDataLog of importIitYarp.py may cause problems for short bitStrings and with uint32 overflow #52

@denyunhero

Description

@denyunhero

Description

The current implementation of the importIitYarpDataLog function in importIitYarp.py (as installed via pip install bimvee) attempts to detect whether the binary bitstream segments of a .log file contain timestamps by checking the monotonicity of bitStrings[::2]. However, this approach may cause some problems for two key reasons:

  1. It evaluates the condition even when bitStrings is extremely short (length 1–2), which causes np.all(...) to trivially return True.
  2. It uses np.uint32 values for timestamps. When calling np.diff(...), negative differences silently overflow and become large unsigned integers — leading to false positive detection of monotonicity.

As a result, with_ts may be incorrectly set to True, and the decoder applies incorrect timestamps to events, leading to corrupted and misaligned event data.


Steps to Reproduce

  • Use a .log file where early lines contain only 1–2 binary events
  • Check with_ts value during parsing — it will often be True from the first line
  • If timestamps are missing, the decoder still applies them incorrectly

Example of Silent Overflow

import numpy as np

a = np.array([100, 50], dtype=np.uint32)
print(np.diff(a))         # array([4294967246], dtype=uint32)
print(np.diff(a) >= 0)    # True — logically incorrect

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions