Skip to content

Add VLBI VDIF recording and metadata post-processing - #843

Open
richarms wants to merge 24 commits into
masterfrom
vlbi-incorporation
Open

Add VLBI VDIF recording and metadata post-processing#843
richarms wants to merge 24 commits into
masterfrom
vlbi-incorporation

Conversation

@richarms

Copy link
Copy Markdown
Contributor

This adds product configuration and controller support for VLBI VDIF recording and postprocessing metadata generation from a gpucbf V-engine.

This branch introduces the sdp.vdif output stream type in product-config schema, wires it through product configuration, and generates the corresponding capture-time katsdpvlbi recorder task. The post-processing task is scheduled with the capture block, receives telstate context, can run in antab, pass_through, or disabled mode, and is colocated with the corresponding VLBI recorder. Implements version 4.8 of the product-configure schema. Tested end-to-end in the lab.

richarms added 13 commits April 10, 2026 09:15
Introduce the sdp.vdif output type to the product configuration model and schema so a VLBI recorder path can be expressed in product configs. This commit also adds focused product-config tests for the new stream type.
Teach the logical graph builder to create a dedicated vlbi.<stream> task for sdp.vdif outputs backed by gpucbf tied-array resampled voltage. The recorder task uses the katsdpvlbi image, computes the jive5ab mode from the upstream stream geometry, and extends the shared VLBI test config so the path is covered by focused graph tests.
Expose vlbimeta.mode through the product configuration model and schema so controllers can choose between disabled, pass-through, and antab post-processing. Keep the coverage narrow by extending only the product-config tests that validate option parsing.
Create a vlbimeta.<stream> post-process task for sdp.vdif outputs and pass the configured mode through to the entrypoint. This also reuses the already-resolved telstate endpoint for batch graphs so vlbimeta can consume capture-block telstate during post-processing.
Add a configurable VLBI recorder protocol to develop options, and use it when generating sdp.vdif recorder tasks. The recorder now requests a CBF interface with multicast and ibverbs metadata so scheduling matches the VLBI data path, and its command exports the assigned interface name for the recorder-side route guard. Focused tests cover option parsing and the generated logical task.
Give each vlbimeta task the vis stream it should read metadata from by selecting the calibrated vis stream when one sdp.cal output is present, and otherwise falling back to a single vis stream. When post-processing is instantiated, pin vlbimeta to the same host that ran the matching VLBI recorder so it can read the capture output locally. Focused tests cover the generated vlbimeta command and dataset-stream selection.
Use the SubarrayProduct node map when pinning vlbimeta to the VLBI recorder host during postprocessing. The previous code mistakenly looked for recorder nodes on CaptureBlock, which caused postprocessing to crash before vlbimeta could launch.

Add a focused regression test that enables vlbimeta for a VDIF stream and checks that postprocessing completes and accounts for the extra batch task.
Replace hardcoded batch task counts in the controller postprocess tests with counts derived from the capture block's generated postprocess graph. This keeps the assertions aligned with the configured postprocess tasks when vlbimeta or future batch tasks (thinking ahead to `katsdprfi` here) are added.
less_resources:
type: boolean
default: false
vlbi_recorder_protocol:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see this in the schema document. And once you've added it, it needs to be gated on if version >= "4.8".

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's still not in the schema document, nor in the signed M1000-0001-009 v4. So you'll probably need an ECP for this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still not addressed as far as I'm aware.

Comment thread src/katsdpcontroller/schemas/product_config.yaml.j2 Outdated
Comment thread src/katsdpcontroller/schemas/product_config.yaml.j2
Comment thread src/katsdpcontroller/product_config.py Outdated
Comment thread src/katsdpcontroller/product_config.py Outdated
Comment thread src/katsdpcontroller/product_config.py Outdated
Comment thread test/test_product_config.py Outdated
Comment thread test/test_product_config.py Outdated
Comment thread test/utils.py Outdated
Comment thread test/utils.py Outdated
bmerry added a commit that referenced this pull request Jun 23, 2026
This should NOT be merged as is, as it doesn't implement version 4.8
and does not support the 4.8 features in 4.9 documents. That will come
from #843.

See NGC-1992.
bmerry added a commit that referenced this pull request Jun 23, 2026
This should NOT be merged as is, as it doesn't implement version 4.8
and does not support the 4.8 features in 4.9 documents. That will come
from #843.

See NGC-1992.
bmerry added a commit that referenced this pull request Jun 24, 2026
This should NOT be merged as is, as it doesn't implement version 4.8
and does not support the 4.8 features in 4.9 documents. That will come
from #843.

See NGC-1992.
bmerry added a commit that referenced this pull request Jun 29, 2026
This should NOT be merged as is, as it doesn't implement version 4.8
and does not support the 4.8 features in 4.9 documents. That will come
from #843.

See NGC-1992.
@richarms
richarms force-pushed the vlbi-incorporation branch from dc1b393 to dbd224d Compare July 8, 2026 13:04
@richarms

richarms commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

I've pushed follow-up changes to adress review comments:

  • Added 4.8 gating for the new VLBI config options in product config schema.
  • Removed duplicate Python-side enum validation for vlbi_recorder_protocol and vlbimeta.mode; these are now left to jsonschema validation.
  • Added cbf.tied_array_resampled_voltage as the CBF-facing stream type for vlbi. Changed sdp.vdif to require cbf.tied_array_resampled_voltage as its source.
  • Removed the SDP stream from CONFIG_CBF_ONLY.
  • Moved the generator-specific VLBI tests into test_generator.py.

@richarms
richarms requested a review from bmerry July 9, 2026 07:46
Comment thread src/katsdpcontroller/schemas/product_config.yaml.j2 Outdated
Comment thread src/katsdpcontroller/schemas/product_config.yaml.j2 Outdated
less_resources:
type: boolean
default: false
vlbi_recorder_protocol:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's still not in the schema document, nor in the signed M1000-0001-009 v4. So you'll probably need an ECP for this.

Comment thread src/katsdpcontroller/generator.py Outdated
Comment thread src/katsdpcontroller/product_config.py Outdated
"""VDIF-ready tied-array-resampled-voltage stream from CBF."""

stream_type: ClassVar[str] = "cbf.tied_array_resampled_voltage"
_valid_src_types: ClassVar[_ValidTypes] = {"gpucbf.tied_array_resampled_voltage"}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_valid_src_types: ClassVar[_ValidTypes] = {"gpucbf.tied_array_resampled_voltage"}
_valid_src_types: ClassVar[_ValidTypes] = {"cbf.tied_array_channelised_voltage"}

I see M1000-0000-009 incorrectly lists it at cbf.tied_array_resampled_voltage. That'll need fixing.

Comment thread src/katsdpcontroller/schemas/product_config.yaml.j2 Outdated
Comment thread src/katsdpcontroller/product_config.py Outdated
Comment thread src/katsdpcontroller/product_config.py Outdated
Comment thread src/katsdpcontroller/product_config.py Outdated
Comment thread src/katsdpcontroller/tasks.py Outdated
Addresses the core review comments: cbf.tied_array_resampled_voltage is now an input type, it follows the other CBF input schema pattern, it requires a pair of cbf.tied_array_channelised_voltage sources, and the stream now gets bandwidth/channels/bits/pols from CBF sensors instead of the gpucbf stream model. The redundant VdifStream.__init__ validation was also removed.
@richarms
richarms force-pushed the vlbi-incorporation branch from 1430103 to 7d9d035 Compare July 22, 2026 11:32
@richarms

richarms commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the detailed reviews. I have reworked the branch to implement your stream-model and schema suggestions.

  • The VLBI additions are gated on product-config schema 4.8.
  • cbf.tied_array_resampled_voltage is now an external input type following the cbf.* pattern.
  • It requires exactly two cbf.tied_array_channelised_voltage source streams.
  • Its bandwidth, channel count, sample depth and polarisation ordering come from CBF sensors obtained through CAM.
  • sdp.vdif accepts only this external CBF stream as its source; the direct gpucbf.* paths have been removed.
  • Redundant schema validation was removed.
  • The shared product-config fixture was updated to 4.8, and generator-specific tests were moved to test_generator.py.
  • Mean-power history is now handled by katsdpcam2telstate, rather than adding things to controller.

I also (successfully) ran the branch through in the lab.

@richarms
richarms requested a review from bmerry August 4, 2026 12:10

@bmerry bmerry left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking much better architecturally.

less_resources:
type: boolean
default: false
vlbi_recorder_protocol:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still not addressed as far as I'm aware.

Comment thread src/katsdpcontroller/generator.py Outdated
Comment thread src/katsdpcontroller/product_config.py Outdated
Comment thread test/test_generator.py Outdated
Comment thread test/test_product_config.py Outdated
Comment thread test/test_product_controller.py Outdated
Comment thread test/utils.py Outdated
Move the VLBI task alongside its friends, clarify the CBF VDIF stream docstring, and correct the new generator test copyright.
`vgpu` labels tied-array resampled-voltage multicast outputs with the vdif port name, while its channelised inputs use spead. The plumbing of `katsdpvlbi` wasn't following this convention, using spead as the stream name. Apply the correct(/vgpu) convention to external cbf.tied_array_resampled_voltage inputs: accept a vdif URL, construct the multicast node with a vdif port, and connect the recorder to the corresponding _vdif endpoint. Also update the fixtures and generator assertions.

@bmerry bmerry left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes look okay, but you've still got this vlbi_recorder_protocol in the implementation that's not defined in the ICD.

@richarms

richarms commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Great thanks. I suggest that we not make that block this PR, and I'll follow this up as an ICD amendment

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.

3 participants