Skip to content

TdtRawIO: detect SEV vs TEV using the UCF flag instead of silent per-channel fallback - #1835

Merged
alejoe91 merged 3 commits into
NeuralEnsemble:masterfrom
h-mayorquin:fix_tdt
Oct 8, 2026
Merged

alejoe91 merged 3 commits into
NeuralEnsemble:masterfrom
h-mayorquin:fix_tdt

Conversation

@h-mayorquin

Copy link
Copy Markdown
Contributor

Closes #1817.

In TdtRawIO._parse_header, storage mode (SEV vs TEV) is a per-store configuration choice set at recording time via Synapse's "Discrete Files" option, and encoded in the TSQ event type via the EVTYPE_UCF bit (0x10). The previous implementation ignored this flag and instead globbed for an SEV file per channel, silently falling back to the TEV buffer when one was not found. Because TEV does not contain valid stream data for a UCF-flagged store, that fallback produced wrong data rather than an error.

The check now runs once per store using info["TankEvType"] & EVTYPE_UCF. When the bit is set, a missing SEV file raises NeoReadWriteError with the store name, channel, and segment, making the failure mode explicit. When the bit is not set, the existing TEV fallback path is preserved so non-UCF recordings continue to work unchanged. EVTYPE_MASK already excludes the UCF bit, so none of the existing stream filtering is affected.

@samuelgarcia samuelgarcia added this to the 0.14.5 milestone Apr 22, 2026
@h-mayorquin

Copy link
Copy Markdown
Contributor Author

@JuliaSprenger we should add a flag that keeps the data loading for a while before we merge this.

@alejoe91 alejoe91 modified the milestones: 0.14.5, 0.14.6 Jun 24, 2026
@zm711

zm711 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

So we need to wait for you to update before we merge?

@alejoe91

alejoe91 commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

@h-mayorquin updates on this?

@h-mayorquin

Copy link
Copy Markdown
Contributor Author

@zm711 and @alejoe91, sorry for the delay on this.
I was waiting to add a flag that keeps the old data loading for a while, but I am dropping that idea.

The TDT Python SDK never falls back from SEV to TEV when the EVTYPE_UCF bit is set (it warns and skips the store). So the old fallback returned wrong data, and a flag would only preserve that. From my side this is ready to merge.

@alejoe91
alejoe91 merged commit b4a30ba into NeuralEnsemble:master Oct 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TdtRawIO: Detect SEV vs TEV format using the UCF flag instead of per-channel silent fallback

4 participants