Column Row Pipeline Design
Status: Partially implemented. GatherResult, interval-window primitives, ColumnRecipe::row_pipeline_json, TensorDesign JSON round-trip, identity row-pipeline dispatch, DigitalIntervalSeries row-pipeline gather windows, pipeline_value_bindings for row-specific PipelineValueStore values, DigitalEventSeries sample-time row-pipeline dispatch, TimeFrame row sources, PointCoordinate keypoint coordinate projection, and Phase 9c column presets with TensorDesigner Add Preset… support are implemented. Phase 9g polymorphic preset refactoring is implemented, paving the way for file-based presets and dynamic UI generation. The broader preset file library and user/bundled preset catalog (Phase 10) remain planned.
This document describes the target architecture for per-column gather geometry in lazy-column tensors. The implementation sequence is tracked separately in Column Row Pipeline Roadmap.
See also:
- Tensor stack overview
- TensorDesign library
- TensorColumnBuilders
- GatherResult row-aligned container design
- DigitalIntervalSeries interval layouts
- Whisker-contact scenario
Goal
TensorDesign should support feature tables where every row comes from one row source, but each column can choose a different row-aligned temporal geometry before gathering its source data.
The motivating table is:
- One row per whisker
Contactinterval. - A curvature column reduced over the full contact interval.
- A spike column reduced over a short window around contact onset.
- An angle column sampled at contact onset.
- Downstream analysis, such as binning angle and estimating
P(spike | bin), remains outside tensor building.
The design should use existing project primitives instead of tensor-specific interval abstractions:
- DataObjects carry
TimeFrameand entity identity. - TransformPipelines mutate or derive DataObjects.
GatherResultstores gathered row DataObjects plus prepared window metadata when direct gathering is needed.- TensorDesign assembles the row source, column recipes, lazy providers, and output
TensorData.
Current State
Implemented today:
TensorDesigncan build lazy-column tensors from interval, timestamp, TimeFrame, and derived timestamp row sources.- Interval-row columns gather over the full row interval.
ColumnRecipe::pipeline_jsondescribes source processing and interval range reductions.ColumnRecipe::row_pipeline_jsonis parsed, serialized, and used for interval-row gather geometry.ColumnRecipe::pipeline_value_bindingsis parsed, serialized, and used to bind one row-alignedDigitalEventSeriesvalue intoPipelineValueStoreper tensor row.ColumnRecipe::interval_propertyprovides row metadata columns such as interval start, end, and duration.- Empty or whitespace
row_pipeline_jsonand explicit empty-step descriptors are treated as identity row geometry. - Non-identity interval-row pipelines may produce row-aligned
DigitalIntervalSeriesprepared windows. - TensorDesign verifies row-pipeline window output preserves the original row count.
- Digital event/interval iteration exposes
ClockTicksAPI-facing values, so cross-timeframe temporal math should happen in clock-tick coordinates rather than rawTimeFrameIndexcoordinates. PipelineValueStorecan storeClockTicks, andNormalizeTimeParamsV2::alignment_timeis aClockTicksvalue.- Direct binding sources from DataManager keys and derived binding sources using
source_pipeline_jsonare supported when they resolve to row-alignedDigitalEventSeriesobjects. NormalizeDigitalEventSeriesRelativenormalizes gatheredDigitalEventSeriesrows to relativeClockTicksstorage before reductions such asEventCountInWindow.gatherAndExecutePipeline()can execute JSON-loaded container steps before the terminal range reduction, and can apply a per-row bound pipeline copy when row stores are supplied.DigitalEventSeriesrow-pipeline outputs are routed to timestamp/sample providers for interval-row columns without terminal range reductions.ShiftDigitalEventSeriesexpresses sample offsets as a normal TransformPipeline step.- Angle-at-contact-onset point sampling is tested through TensorDesign JSON in the whisker-contact scenario.
row_source.time_keywithrow_type: "timeframe"builds one row per index in a registered TimeFrame.PointCoordinateconvertsPointDatatoRaggedAnalogTimeSeriesfor x/y keypoint columns.GatherResultconsumes preparedDigitalIntervalSerieswindows and can hold companion alignment events, but TensorDesign should not rely on that metadata path for column transformations.GatherResultconverts prepared window bounds to the gathered sourceTimeFramewithconvertTimeFrameRange().DigitalIntervalSeriessupportsIntervalLayout::OverlappingthroughcreateOverlapping().IntervalToEvent,EventToInterval, andPruneOverlappingIntervalsare registered TransformsV2 algorithms.
Not implemented yet:
- Row-pipeline caching across columns.
- Broader preset catalog and bundled/user preset file library.
- UI support for configuring row pipelines.
Problem
Original interval-row tensor columns always gathered source data over the full row interval. With the implemented DigitalIntervalSeries row-pipeline path, onset-window event reductions are now expressible in TensorDesign JSON. With pipeline_value_bindings, per-row normalization context is also expressible for row-aligned DigitalEventSeries markers. With DigitalEventSeries row-pipeline dispatch, point sampling is expressible in row-pipeline JSON. Phase 9c presets cover common authoring patterns; remaining gaps are row-pipeline caching, preset libraries, and richer UI for manually configuring row pipelines.
The full design addresses these common per-row features:
- Spike presence within
[-W, +W]of contact onset. - Analog value sampled at contact onset.
- Statistics over a lagged or shifted version of the row interval.
- Statistics aligned to a data-derived point inside a row, such as a peak curvature time.
Adding tensor-specific fields such as lag, window_start, or gather_mode would duplicate the TransformPipeline and DataObject systems. Those systems already handle TimeFrame conversion and entity identity, which are core requirements for correct scientific analysis.
Core Model
The target per-column data flow is:
flowchart LR
RowSource["row_source DataObject"]
RowDesc["RowDescriptor"]
RowPipeline["row_pipeline_json\nTransformPipeline"]
Metadata["row-aligned gather geometry\nDIS windows or DES sample times"]
Gather["GatherResult<SourceT>"]
Context["iterable bindings\noptional marker per row"]
SourcePipeline["pipeline_json\nper-row transform + reduction"]
Value["one value per row"]
RowSource --> RowDesc
RowSource --> RowPipeline --> Metadata --> Gather --> SourcePipeline --> Value
RowSource --> Context --> SourcePipeline
row_source defines row identity. row_pipeline_json defines where a column looks for data. pipeline_json defines how the gathered source data becomes a column value.
The invariant is that row i remains row i. A row pipeline may change the gather bounds or sample time for row i, but it must not silently reorder rows, merge rows, or create extra rows unless the column builder explicitly supports that behavior.
Responsibilities
| Component | Responsibility |
|---|---|
| DataObjects | Store data, TimeFrame, entity IDs, view/copy semantics, and materialization behavior. |
| TransformsV2 row pipeline | Derive row-aligned gather inputs from the row source, such as windows or sample times. |
GatherResult |
Gather source rows from prepared windows. It does not execute TransformPipelines or own per-row column context. |
| TransformsV2 iterable binding | Maps one element per row from a DataObject iterable into PipelineValueStore keys. |
pipeline_json |
Processes gathered source rows with PipelineValueStore parameter bindings and produces a scalar column value or supported DataObject output. |
| TensorDesign | Parse recipes, build row descriptors, connect row pipelines to column providers, and assemble TensorData. |
TensorData materialization stops at scalar float. pipeline_json may produce a gathered DataObject (for example a relative DigitalEventSeries after NormalizeDigitalEventSeriesRelative), but LazyColumnTensorStorage column providers must collapse each row to a single float. Gather-layer DataObject output is valid for intermediate transforms and future GatherResult tooling; only aggregators with ColumnOutputKind::ScalarFloat are exposed as tensor column presets.
This keeps the dependency direction aligned with the GatherResult refactor:
TensorDesign / TransformsV2 extensions -> GatherResult -> DataObjects
not:
GatherResult -> TensorDesign or TransformPipeline execution
Row Identity And Gather Inputs
| Concept | Defined by | Example |
|---|---|---|
| Row identity | TensorDesignSpec::row_source |
Contact interval i |
| Row descriptor | Original row source | Contact start/end metadata |
| Gather windows | row_pipeline_json output or identity row source |
Trial window or onset window around contact i |
| Sample times | row_pipeline_json output, when sampling |
Contact onset event for row i |
| Iterable binding values | DataManager object or row-pipeline output | ClockTicks for raster/PSTH row i |
| Feature value | pipeline_json over gathered source rows |
Spike presence, mean curvature, angle sample |
Prepared windows should be represented as DigitalIntervalSeries. Per-row sample times should be represented as DigitalEventSeries. These are normal DataObjects, not tensor-specific side channels.
When a column needs to normalize gathered data relative to a marker that is not the gather window start, that marker should be supplied through PipelineValueStore parameter binding for pipeline_json, not encoded as a second output of row_pipeline_json.
For example, a spike raster column may gather spikes inside each trial window, then run a normalize-time transform with the contact onset event for that row supplied through the value store as ClockTicks.
Transform Composition
TensorDesign should express per-column geometry through composed registered transforms rather than new tensor enums.
TransformPipeline execution and iterable bindings both use the DataObject view() contract. For example, a DigitalEventSeries contributes ClockTicksWithId elements. Users should not need to choose between entity-carrying and bare-time implementation types; presets and generated raw JSON should select the appropriate registered transform for the pipeline execution mode.
For value projections, bindValueProjectionV2() operates on ElementVariant types. ElementVariant contains ClockTicks but not ClockTicksWithId; when the source view element is ClockTicksWithId, the projection helper passes element.time() into the TransformPipeline. Therefore the canonical normalize transform for DigitalEventSeries event times is NormalizeClockTicksValueV2. The EntityId remains available from the original ClockTicksWithId view element outside the TransformPipeline.
| Intent | Row pipeline output | Source pipeline |
|---|---|---|
| Mean over full contact | Identity row DigitalIntervalSeries |
Range reduction such as MeanValue |
| Spike near onset | IntervalToEvent(start) sample times followed by EventToInterval(pre, post) windows |
Event presence or event count reduction |
| Angle at onset | IntervalToEvent(start) sample times |
Sample-at-event provider behavior |
| Raster/PSTH over trials | Trial windows from identity row source | Normalize event times with one marker per row, then count/bin/export |
| Lagged contact statistic | IntervalShift(delta) windows |
Any interval reduction |
| Peak-centered feature | Data-derived row transform producing one event per row | Sample or windowed reduction around that event |
Implemented transforms that should be reused:
| Transform | Status | Role |
|---|---|---|
IntervalToEvent |
Implemented | Extract start, end, or center events from interval rows. |
EventToInterval |
Implemented | Expand events into overlapping gather windows. |
PruneOverlappingIntervals |
Implemented | Optional keep-first pruning when a caller explicitly wants to drop overlapping windows. |
ShiftDigitalEventSeries |
Implemented | Apply lag/lead offsets to row-pipeline sample times. |
Potential future transforms should be added only when there is a concrete use case:
| Transform | Need |
|---|---|
IntervalShift |
Lag or lead a row interval while preserving row count. |
| Data-derived event transforms | Produce one event per row from a row object plus another source object. |
| Fused convenience transforms | Optional wrappers around common compositions; they should still return normal DataObjects. |
Row Source Extensions
The implemented row sources include interval rows from DigitalIntervalSeries, timestamp rows from DigitalEventSeries, TimeFrame rows from registered TimeKeys, and derived timestamp rows from timestamp-bearing data objects through extractTimeIndices().
TimeFrame rows let a tensor have one row per index in a named TimeFrame without requiring a synthetic data object:
{
"row_source": {
"time_key": "Time",
"row_type": "timeframe"
}
}This is distinct from row_source.data_key, because timeframes are DataManager time metadata addressed by TimeKey, not normal data object keys. In the TensorDesigner UI this appears as a separate TimeFrame Rows option populated from DataManager::getTimeFrameKeys(). This makes the row-source distinction clearer:
| UI row mode | Source list | Row identity |
|---|---|---|
| Interval Rows | DigitalIntervalSeries data keys |
one row per interval |
| Timestamp Rows | DigitalEventSeries data keys |
one row per event |
| TimeFrame Rows | TimeKey entries |
one row per TimeFrame index |
| Derived from Source | timestamp-bearing data object keys | one row per timestamp extracted from the data object |
Derived from Source should remain available for objects such as AnalogTimeSeries, PointData, LineData, MaskData, DigitalEventSeries, and DigitalIntervalSeries, but the UI should describe it as “derive rows from timestamps in a data object” rather than implying a row TransformPipeline.
Point And Keypoint Columns
Point/keypoint tables are a motivating case for presets because the low-level representation is simple but verbose. For example, a PointData object representing one tracked keypoint often needs two scalar tensor columns, x and y, at each row time.
The preferred low-level building block is a parameterized TransformsV2 container transform rather than tensor-specific column enums or two separate element transforms:
PointCoordinate: PointData -> RaggedAnalogTimeSeries
parameters: coordinate = "x" | "y"
This keeps the implementation in one registry entry with a small coordinate switch, preserves PointData as the input object, and produces an analog-family output that existing timestamp sampling and interval reductions can consume.
A one-keypoint tensor column group would expand to two ColumnRecipes:
[
{
"name": "nose_x",
"source_key": "Nose",
"pipeline_json": "{\"steps\": [{\"step_id\": \"x\", \"transform_name\": \"PointCoordinate\", \"parameters\": {\"coordinate\": \"x\"}}]}"
},
{
"name": "nose_y",
"source_key": "Nose",
"pipeline_json": "{\"steps\": [{\"step_id\": \"y\", \"transform_name\": \"PointCoordinate\", \"parameters\": {\"coordinate\": \"y\"}}]}"
}
]For multiple keypoints, the same idea expands one source key into two columns. For example Nose and Paw become Nose_x, Nose_y, Paw_x, and Paw_y. Users should not need to manually author those four raw pipelines; this should be handled by multi-column presets.
For interval-row analyses, the row pipeline can still determine when the point is sampled. For example, point x/y at contact onset uses Contact -> IntervalToEvent(start) as row_pipeline_json, then applies PointCoordinate to the sampled PointData source.
PointCoordinate should preserve all point entries as a RaggedAnalogTimeSeries: if a PointData time contains multiple points, the corresponding ragged analog time contains multiple x or y values. Tensor timestamp sampling currently consumes the first value at a time point, which is appropriate for single-keypoint-per-time data and should be documented or made configurable before using multi-point-per-time data. Interval-row workflows can use normal range reductions such as MeanValue, SumValue, or MaxValue over the coordinate values.
Proposed Recipe Shape
The minimal API extension is one optional field on ColumnRecipe:
struct ColumnRecipe {
std::string column_name;
std::string source_key;
std::string pipeline_json;
std::string row_pipeline_json;
std::optional<IntervalProperty> interval_property;
std::vector<PipelineValueBindingRecipe> pipeline_value_bindings;
};PipelineValueBindingRecipe has the implemented shape:
struct PipelineValueBindingRecipe {
std::string source_key;
std::string source_pipeline_json;
std::string store_key;
};An omitted or empty row_pipeline_json means identity: use the original row source as the gather geometry.
For interval row sources, identity means the existing full-interval behavior. This preserves current JSON designs.
Proposed JSON
Raw row-pipeline JSON is the low-level target shape and is not valid until row_pipeline_json support is implemented:
{
"tensor_key": "contact_onset_features",
"row_source": {
"data_key": "Contact",
"row_type": "interval"
},
"columns": [
{
"name": "mean_curvature",
"source_key": "Curvature",
"pipeline_json": "{\"steps\": [], \"range_reduction\": {\"reduction_name\": \"MeanValue\"}}"
},
{
"name": "spike_in_window",
"source_key": "Spikes",
"row_pipeline_json": "{\"steps\": [{\"transform_name\": \"IntervalToEvent\", \"parameters\": {\"point\": \"start\"}}, {\"transform_name\": \"EventToInterval\", \"parameters\": {\"pre_expansion\": 150, \"post_expansion\": 150}}]}",
"pipeline_json": "{\"steps\": [], \"range_reduction\": {\"reduction_name\": \"EventPresence\"}}"
},
{
"name": "angle_at_onset",
"source_key": "Angle",
"row_pipeline_json": "{\"steps\": [{\"transform_name\": \"IntervalToEvent\", \"parameters\": {\"point\": \"start\"}}]}",
"pipeline_json": "{\"steps\": []}"
}
]
}row_pipeline_json describes only the row-aligned gather or sample input. The DigitalIntervalSeries gather-window form and DigitalEventSeries sample-time form are implemented. row_pipeline_json should not also be responsible for carrying a separate normalization marker. If a column needs one marker per row for a transform such as normalize-time, that marker should be loaded into PipelineValueStore during per-row pipeline_json execution.
PipelineValueStore Iterable Binding
TransformsV2 already has the mechanism needed to inject runtime values into a TransformPipeline: PipelineValueStore plus parameter bindings loaded from pipeline JSON. GatherResult previously used this mechanism through TransformsV2 gather extension helpers such as buildGatherRowStore().
The row-pipeline refactor reuses that mechanism rather than adding TensorData-specific context plumbing. The implemented iterable binding layer lives in the TensorColumnBuilders/TransformsV2 integration and is exposed through ColumnRecipe::pipeline_value_bindings.
The core contract is:
- A column recipe identifies an iterable context source through
pipeline_value_bindings. - The source is a DataObject in
DataManageror a DataObject produced by a row TransformPipeline. - The source has one row-aligned element per tensor row.
- For row
i, the iterable binding converts elementiinto the DataObject’s default binding value and writes it intoPipelineValueStoreunder the declared key. pipeline_jsonparameter bindings map those store keys onto transform parameters.
This is conceptually equivalent to how the GatherResult extension previously created a per-row store, but the values are no longer limited to GatherResult metadata. Any row-aligned iterable DataObject can supply bound values.
Binding declarations live on ColumnRecipe, beside pipeline_json. They are not embedded in PipelineDescriptor, because the descriptor remains a reusable transform pipeline that does not know about DataManager keys, tensor rows, or external iterable sources. All pipeline-valued fields, including row_pipeline_json, source_pipeline_json, and pipeline_json, use the same PipelineDescriptor schema.
Binding Source Options
There are two useful source forms.
Direct DataManager source:
{
"source_key": "ContactOnset",
"store_key": "row_alignment_time"
}DataManager source plus transform pipeline:
{
"source_key": "Contact",
"source_pipeline_json": "{\"steps\": [{\"transform_name\": \"IntervalToEvent\", \"parameters\": {\"point\": \"start\"}}]}",
"store_key": "row_alignment_time"
}The second form covers the case where the iterable does not already exist as a DataManager object. The implicit default is identity: if source_pipeline_json is omitted or empty, use the DataObject referenced by source_key directly.
This keeps every binding grounded in a DataManager key while still allowing the iterable to be derived. It also makes testing straightforward: a direct-key test and a key-plus-transform test should produce the same PipelineValueStore values when the derived object is equivalent to a precomputed object.
Binding Value Semantics
The user should not need to specify an extractor for the initial Phase 5 use case. Instead, each supported DataObject type should define a default binding value for one row element.
Initial support should be deliberately narrow:
| Source DataObject | Row element | Default binding value |
|---|---|---|
DigitalEventSeries |
ClockTicksWithId event row i |
event.time() as ClockTicks |
If a caller needs interval start, end, or center as the bound value, it should first derive a DigitalEventSeries with IntervalToEvent. This avoids requiring users to choose coordinate extractors and keeps start/end/center selection in the TransformPipeline where it already belongs.
The ClockTicks refactor removes the need for binding declarations to carry TimeFrame pointers. DigitalEventSeries::view() and DigitalIntervalSeries::view() expose API-facing elements in clock ticks (ClockTicksWithId and ClockTicksIntervalWithId) while storage/persistence APIs can still expose TimeFrameIndex through explicit stored-value accessors.
Phase 5 binds temporal iterable values as ClockTicks. NormalizeTimeParamsV2::alignment_time receives ClockTicks, not raw TimeFrameIndex values.
This also means IntervalToEvent and EventToInterval should compose in clock-tick coordinates at the API boundary. If a transform still uses TimeFrameIndex internally, that should be treated as an implementation detail hidden behind the DataObject view/storage boundary.
For NormalizeTime, the user-facing intent is simply “normalize event time by a row-specific clock tick”. The raw transform name for DigitalEventSeries value projections is NormalizeClockTicksValueV2 because the projection helper extracts ClockTicks from ClockTicksWithId view elements before transform execution. When the gathered row should remain a DigitalEventSeries, use the container transform NormalizeDigitalEventSeriesRelative, which writes relative ClockTicks storage and preserves event EntityIds. Presets should hide these raw transform names when possible.
Execution Shape
For a gathered source and one binding source:
windows_i = row_pipeline(row_source)[i]
row_i = gather(source_key, windows_i)
iterable = source_pipeline(source_key_for_binding)
store_i = buildGatherRowStore(gathered, i) or empty PipelineValueStore
store_i[store_key] = defaultBindingValue(iterable, i)
pipeline_i = pipeline_json with param_bindings applied from store_i
value_i = execute/reduce pipeline_i(row_i)
buildGatherRowStore() may still be useful as a base store for generic row metadata such as trial_index and trial_duration, but TensorDesign should not depend on GatherResult::alignmentTimeAt() for normalization markers. Iterable bindings should override or add store keys explicitly.
Validation Rules
Phase 5 enforces these rules:
- Binding source DataObject must exist or the binding source pipeline must produce a supported DataObject.
- Binding source row count must equal the
GatherResultrow count. store_keymust be unique within the column and must not collide with base row-store keys; reject duplicates rather than silently overwriting.- Produced DataObject type must have a default binding value implementation.
- Binding value construction must be deterministic and must not mutate the source object.
- If row filtering is introduced later, filtering must be applied consistently to gather windows and binding sources.
Failure occurs at provider construction when possible. If a lazy source can only be evaluated at provider invocation time, fail with a message that identifies the column, binding source, and store key.
Motivating Test Cases
Phase 5 has tests using the raster/PSTH normalization pattern.
Direct iterable source:
row_source: Contact intervals
source_key: Spikes
row_pipeline_json: identity or trial window pipeline
pipeline_value_bindings: ContactOnset DigitalEventSeries[i] -> ClockTicks -> row_alignment_time
pipeline_json: NormalizeTime(alignment_time bound to row_alignment_time) + event/bin reduction
Derived iterable source:
row_source: Contact intervals
source_key: Spikes
row_pipeline_json: identity or trial window pipeline
pipeline_value_bindings: Contact -> IntervalToEvent(start) -> ClockTicks -> row_alignment_time
pipeline_json: NormalizeTime(alignment_time bound to row_alignment_time) + event/bin reduction
The tests assert that normalized event times are relative to the bound marker, not to the gather window start. They also assert row-count mismatch rejection by using a binding source with a missing event.
Example binding shape, shown as design intent rather than final JSON:
{
"pipeline_json": "{\"steps\": [{\"step_id\": \"normalize\", \"transform_name\": \"NormalizeDigitalEventSeriesRelative\", \"parameters\": {\"alignment_time\": 0}, \"param_bindings\": {\"alignment_time\": \"row_alignment_time\"}}], \"range_reduction\": {\"reduction_name\": \"EventCountInWindow\", \"parameters\": {\"window_start\": 0.0, \"window_end\": 15.0}}}",
"pipeline_value_bindings": [
{
"source_key": "ContactOnset",
"store_key": "row_alignment_time"
}
]
}The ownership is clear: TransformsV2 binds row-specific values into PipelineValueStore; TensorDesign selects the row source, gather/sample input, and column recipe; TensorData stores the resulting column values.
Raster/PSTH Example
A raster or PSTH-like tensor column illustrates the separation between gather input and transform context:
- The row source defines trials, such as one
DigitalIntervalSeriesinterval per contact or behavioral trial. row_pipeline_jsondefines which spikes are gathered for each row. This can be identity for full-trial windows or a window-producing transform for a restricted interval.- The gathered row DataObject is a
DigitalEventSeriessubset in source coordinates. pipeline_jsonruns per row and includes a normalize-time transform, such asNormalizeDigitalEventSeriesRelativefor event-series rows.- The normalize-time transform needs one marker for the current row, such as contact onset or cue time.
- That marker is supplied through
PipelineValueStorewhen executingpipeline_json, not throughGatherResultrow metadata and not as a paired output ofrow_pipeline_json.
Conceptually:
row_pipeline_json: trial interval -> spike gather window
gather: Spikes + window_i -> spikes_i
iterable binding: ContactOnset[i] -> ClockTicks -> PipelineValueStore["row_alignment_time"]
pipeline_json: NormalizeTime(spikes_i, row_alignment_time) -> PSTH/bin/reduction output
This keeps row_pipeline_json focused on selecting rows of source data and keeps transformations such as normalization inside the column pipeline where they belong.
Provider Dispatch
The implemented dispatch for interval-row columns is:
- If
interval_propertyis present, use the existing row metadata provider and ignore source gather. - Resolve
row_pipeline_json. - If
row_pipeline_jsonis empty, use the current full-interval gather path. - If the row pipeline produces
DigitalIntervalSerieswindows, verify row count and gather the column source throughGatherResult. - Build any iterable
PipelineValueStorebindings requested bypipeline_value_bindings, such as one normalization marker per row. Initial support binds oneClockTicksvalue per row from a direct or derivedDigitalEventSeries. - Run
pipeline_jsonover gathered rows with the row store to produce one value per tensor row. - If the row pipeline produces
DigitalEventSeriessample times and the column pipeline has no terminal range reduction, route those sample times to timestamp/sample provider behavior.
Planned dispatch extensions are:
- Optional future expansion may allow recipes to choose whether
DigitalEventSeriesrow-pipeline output should sample directly or be expanded to windows withEventToInterval.
The dispatch should reject row-pipeline outputs that do not preserve row count unless the recipe explicitly opts into row filtering.
Implemented behavior rejects DigitalEventSeries row-pipeline output only when the interval-row column also declares a terminal range reduction, because sample-time output is point geometry rather than gather-window geometry.
TimeFrame Semantics
Window-producing transforms operate in their input DataObject’s TimeFrame. They should not need a hidden tensor-specific output-timeframe parameter.
GatherResult handles source query conversion at gather time:
prepared window TimeFrame -> source DataObject TimeFrame
Projection and trial-relative transforms should use ClockTicks values supplied through PipelineValueStore. TimeFrame conversion should happen at DataObject boundaries, not in TensorDesign JSON.
The row descriptor should continue to describe the original row source, not the per-column gather window. Per-column geometry is column metadata used to produce a value; it does not redefine tensor row identity.
Overlapping Windows
Gather geometry can overlap even when the semantic row source is disjoint.
| Role | Layout | Example |
|---|---|---|
| Row source | Usually Disjoint |
Contact intervals or trial epochs. |
| Gather geometry | Usually Overlapping |
Onset windows around nearby contacts. |
Window-producing row pipelines should use DigitalIntervalSeries::createOverlapping() when overlap is possible. They should not rely on default disjoint insertion behavior because disjoint series merge overlapping intervals and destroy row identity.
Overlap pruning is not a tensor default. It drops rows and changes the analysis question. Use PruneOverlappingIntervals only when a recipe or caller explicitly requests this behavior, and apply the same kept-row selection to any iterable context sources.
Relationship To Plot Alignment
PlotAlignmentGather already follows the core prepared-window model for UI plotting:
- Build
DigitalIntervalSerieswindows. - Build or reuse companion
DigitalEventSeriesalignment events. - Call
GatherResult::create(source, windows, alignment_events).
Tensor row pipelines should use the same DataObject vocabulary for windows and events, but column normalization should be modeled as PipelineValueStore parameter binding rather than inherited from GatherResult alignment metadata. Plot code may later share descriptor-building helpers with TensorDesign, but the TensorDesign row-pipeline design does not require a plot refactor.
Out Of Scope
- Binned or grouped downstream analysis such as
P(spike | angle bin). - Nonlinear time warping.
- Persisting gather windows as a new DataManager object type.
- UI affordances for editing row-pipeline JSON or presets.
- Backward compatibility for removed GatherResult interval adapters.
Open Questions
- Should row pipelines be allowed to use
additional_input_keys, and if so should those keys be declared per column or at the tensor level? - Should identical row pipelines be cached across columns during one tensor build?
- How should
DigitalEventSeriesrow-pipeline output choose between point sampling, window expansion, or rejection? - Should row filtering ever be supported, or should row pipelines always be required to preserve row count?
- Should raw JSON expose low-level transform names such as
NormalizeClockTicksValueV2, or should TensorDesign provide friendlier aliases/presets for common column workflows?
Settled for Phase 5:
- Temporal iterable values bind as
ClockTicks. NormalizeTimeParamsV2::alignment_timeisClockTicks.PipelineValueStoresupportsClockTicksstorage and JSON binding throughClockTicksReflector.- Binding declarations live on
ColumnRecipe, not insidePipelineDescriptor. source_pipeline_jsonuses the samePipelineDescriptorschema asrow_pipeline_jsonandpipeline_json.- Duplicate binding
store_keyvalues should be rejected rather than overwritten. - Direct-key bindings and key-plus-
source_pipeline_jsonbindings are implemented forDigitalEventSeriessources.
Tests
Current coverage is split by architectural layer:
| Test file | Layer | Coverage |
|---|---|---|
tests/TransformsV2/test_tensor_column_builders.test.cpp |
TransformsV2 column-builder layer | resolveIntervalGatherWindows(), identity row pipelines, DigitalIntervalSeries row-pipeline output, overlapping windows, row-count rejection, interval-property bypass, provider dispatch, JSON-loaded container steps before reduction, direct/derived pipeline_value_bindings, and binding row-count rejection. |
tests/TensorDesign/test_tensor_design_builder.cpp |
TensorDesign JSON/build layer | Parse/serialize row_pipeline_json, parse/serialize pipeline_value_bindings, identity behavior, Phase 4 JSON builds, Phase 5 bound-normalization JSON builds, mixed interval-property/gather columns, cross-timeframe gather windows, and offset compatibility characterization. |
tests/TensorDesign/test_tensor_whisker_contact_scenario.cpp |
TensorDesign scenario integration | Builds the whisker-contact JSON design with mean curvature, full-contact spike count, contact-onset spike presence, and angle-at-onset point sampling through row_pipeline_json. |
tests/TransformsV2/test_tensor_whisker_contact_scenario.cpp |
Lower-level TransformsV2 scenario integration | Exercises programmatic buildIntervalPipelineProvider() and lazy tensor construction over the same fixture without TensorDesign JSON. |
The two whisker-contact test files intentionally cover different levels. The TransformsV2 test validates the lower-level provider/lazy tensor path. The TensorDesign test validates the JSON-to-tensor path, including the new contact-aligned spike column. If test runtime becomes a concern, keep both layers but reduce duplicate statistical assertions rather than deleting one file.