Skip to content

[Bug] ZMQ write() does not prepend simtime, breaking mixed ZMQ/file-based studies #244

Description

@GaneshPatil7517

hey @pradeeban Sir
When write() sends data over ZMQ, it sends val directly:

ZMQ path (line ~244)

zmq_p.send_json_with_retry(val) # Sends raw val — no simtime prefix

But when writing to file, it prepends simtime:

File path (line ~315)

data_to_write = [simtime + delta] + _to_native(val) # Prepends simtime

Meanwhile, read() always expects inval[0] to be simtime:

simtime = max(simtime, current_simtime_from_file) # Assumes inval[0] is simtime
return inval[1:] # Returns everything after simtime

Impact: A study with a ZMQ writer → file reader (or vice versa) will:

  • Interpret the first data value as simtime (data corruption)
  • Return one fewer data element than expected
  • Silently produce wrong results

This makes mixed ZMQ/file topologies fundamentally broken.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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