cu29-derive 1.3.1

This is the copper project runtime generator. It cannot be used independently from the copper project.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
use super::*;
use std::fs;
use std::path::{Path, PathBuf};

fn unique_test_dir(name: &str) -> PathBuf {
    let nanos = std::time::SystemTime::now()
        .duration_since(std::time::UNIX_EPOCH)
        .expect("system clock before unix epoch")
        .as_nanos();
    std::env::temp_dir().join(format!("cu29_derive_{name}_{nanos}"))
}

fn write_file(path: &Path, content: &str) {
    if let Some(parent) = path.parent() {
        fs::create_dir_all(parent).expect("create parent dirs");
    }
    fs::write(path, content).expect("write file");
}

#[test]
fn disabled_keyframe_capture_emits_no_freeze_calls() {
    let task = quote! { tasks.0 };
    assert!(keyframe_freeze_task_tokens(false, &task).is_empty());
    assert!(keyframe_freeze_bridge_tokens(false).is_empty());
    assert!(
        keyframe_freeze_task_tokens(true, &task)
            .to_string()
            .contains("freeze_task")
    );
    assert!(
        keyframe_freeze_bridge_tokens(true)
            .to_string()
            .contains("freeze_any")
    );
}

// Compile fixtures assert diagnostic codes or short messages at the failing line.
#[test]
fn test_compile_fail() {
    use ui_test::custom_flags::edition::Edition;
    use ui_test::custom_flags::rustfix::RustfixMode;
    use ui_test::dependencies::DependencyBuilder;
    use ui_test::{Config, default_file_filter, default_per_file_config, run_tests_generic};

    let root = Path::new(env!("CARGO_MANIFEST_DIR"));
    let target_dir = std::env::var_os("CARGO_TARGET_DIR")
        .map(PathBuf::from)
        .unwrap_or_else(|| root.join("../../target"));
    let log_index_dir = target_dir.join("ui/derive/log_index/a/b/c");
    fs::create_dir_all(&log_index_dir).expect("create compile-test log index directory");

    let mut dependencies = DependencyBuilder {
        crate_manifest_path: root.join("tests/dependencies/Cargo.toml"),
        // Lockfiles are generated locally and are not committed in this workspace.
        bless_lockfile: true,
        ..DependencyBuilder::default()
    };
    // Share Cargo's normal artifact cache between the fail and pass suites.
    dependencies.program.out_dir_flag = None;
    dependencies.program.envs.push((
        "LOG_INDEX_DIR".into(),
        Some(log_index_dir.clone().into_os_string()),
    ));

    let mut config = Config::rustc(root.join("tests/compile_fail"));
    config.out_dir = target_dir.join("ui/derive");
    config.output_conflict_handling = ui_test::ignore_output_conflict;
    config
        .program
        .envs
        .push(("LOG_INDEX_DIR".into(), Some(log_index_dir.into_os_string())));
    let defaults = config.comment_defaults.base();
    defaults.custom.remove("edition");
    defaults.custom.remove("rustfix");
    defaults.add_custom("edition", Edition("2024".into()));
    defaults.add_custom("rustfix", RustfixMode::Disabled);
    defaults.add_custom("dependencies", dependencies);

    let mut pass = config.clone();
    pass.root_dir = build_compile_pass_umbrella();
    run_tests_generic(
        vec![config, pass],
        default_file_filter,
        default_per_file_config,
        ui_test::status_emitter::Text::quiet(),
    )
    .expect("compile tests failed");
}

fn build_compile_pass_umbrella() -> std::path::PathBuf {
    use std::fmt::Write as _;
    let pass_dir = std::path::Path::new("tests/compile_pass");
    let mut entries: Vec<std::path::PathBuf> = Vec::new();
    for sub in std::fs::read_dir(pass_dir).expect("read tests/compile_pass") {
        let sub = sub.expect("read tests/compile_pass entry");
        if !sub
            .file_type()
            .expect("stat tests/compile_pass entry")
            .is_dir()
        {
            continue;
        }
        for file in std::fs::read_dir(sub.path()).expect("read compile_pass subdir") {
            let p = file.expect("read compile_pass subdir entry").path();
            if p.extension().and_then(|x| x.to_str()) == Some("rs") {
                entries.push(p);
            }
        }
    }
    entries.sort();

    let mut src =
        String::from("//@check-pass\n#![allow(dead_code, unused_imports, non_snake_case)]\n");
    for p in &entries {
        let abs = std::fs::canonicalize(p)
            .unwrap_or_else(|e| panic!("canonicalize {}: {e}", p.display()));
        let subdir = abs
            .parent()
            .and_then(|d| d.file_name())
            .map(|s| s.to_string_lossy().into_owned())
            .unwrap_or_default();
        let stem = abs
            .file_stem()
            .expect("compile_pass file has stem")
            .to_string_lossy()
            .into_owned();
        let mod_name = format!("{subdir}_{stem}").replace('-', "_");
        writeln!(
            src,
            "#[path = {:?}] mod compile_pass_{};",
            abs.to_string_lossy(),
            mod_name
        )
        .expect("write to String");
    }
    src.push_str("fn main() {}\n");

    // Keep the umbrella outside `tests/` so cargo doesn't pick it up as an
    // integration test.
    let target_dir = std::env::var_os("CARGO_TARGET_DIR")
        .map(std::path::PathBuf::from)
        .unwrap_or_else(|| std::path::PathBuf::from("../../target"));
    let umbrella_dir = target_dir.join("generated");
    std::fs::create_dir_all(&umbrella_dir)
        .unwrap_or_else(|e| panic!("create {}: {e}", umbrella_dir.display()));
    let umbrella = umbrella_dir.join("compile_pass_umbrella.rs");
    if std::fs::read_to_string(&umbrella).ok().as_deref() != Some(src.as_str()) {
        std::fs::write(&umbrella, &src)
            .unwrap_or_else(|e| panic!("write {}: {e}", umbrella.display()));
    }
    std::fs::canonicalize(&umbrella)
        .unwrap_or_else(|e| panic!("canonicalize {}: {e}", umbrella.display()))
}

#[test]
fn runtime_plan_keeps_nc_order_for_non_first_connected_output() {
    use super::*;
    use cu29::config::CuConfig;
    use cu29::curuntime::{CuExecutionUnit, compute_runtime_plan};

    let config: CuConfig =
        read_config("tests/config/multi_output_source_non_first_connected_valid.ron")
            .expect("failed to read test config");
    let graph = config.get_graph(None).expect("missing graph");
    let src_id = graph.get_node_id_by_name("src").expect("missing src node");

    let runtime = compute_runtime_plan(graph).expect("runtime plan failed");
    let src_step = runtime
        .steps
        .iter()
        .find_map(|step| match step {
            CuExecutionUnit::Step(step) if step.node_id == src_id => Some(step),
            _ => None,
        })
        .expect("missing source step");

    assert_eq!(
        src_step.output_msg_pack.as_ref().unwrap().msg_types,
        vec!["i32", "bool"]
    );
}

#[test]
fn matching_task_ids_are_flattened_per_output_message() {
    use super::*;
    use cu29::config::CuConfig;

    let config: CuConfig =
        read_config("tests/config/multi_output_source_non_first_connected_valid.ron")
            .expect("failed to read test config");
    let graph = config.get_graph(None).expect("missing graph");
    let channel_usage = collect_bridge_channel_usage(graph);
    let mut bridge_specs = build_bridge_specs(&config, graph, &channel_usage);
    let (runtime_plan, exec_entities, plan_to_original) =
        build_execution_plan(&config, graph, "default", &mut bridge_specs)
            .expect("runtime plan failed");
    let output_packs = extract_output_packs(&runtime_plan);
    let task_names = collect_task_names(graph);
    let (_, node_output_positions) = collect_culist_metadata(
        &runtime_plan,
        &exec_entities,
        &mut bridge_specs,
        &plan_to_original,
    );

    // Rebuild per-slot origin ids like `gen_culist_support` does.
    let mut slot_origin_ids: Vec<Option<String>> = vec![None; output_packs.len()];
    for (node_id, task_id, _) in task_names {
        let output_position = node_output_positions
            .get(&node_id)
            .unwrap_or_else(|| panic!("Task {task_id} (node id: {node_id}) not found"));
        slot_origin_ids[*output_position] = Some(task_id);
    }

    let flattened_ids = flatten_slot_origin_ids(&output_packs, &slot_origin_ids);

    // src emits two messages (i32 + bool), both map to src.
    // sink contributes its own output slot (CuMsg<()>), mapped to sink.
    assert_eq!(
        flattened_ids,
        vec!["src".to_string(), "src".to_string(), "sink".to_string()]
    );
}

#[test]
fn bridge_resources_are_collected() {
    use super::*;
    use cu29::config::{CuGraph, Flavor, Node};
    use std::collections::HashMap;
    use syn::parse_str;

    let mut graph = CuGraph::default();
    let mut node = Node::new_with_flavor("radio", "bridge::Dummy", Flavor::Bridge);
    let mut res = HashMap::new();
    res.insert("serial".to_string(), "fc.serial0".to_string());
    node.set_resources(Some(res));
    graph.add_node(node).expect("bridge node");

    let task_specs = CuTaskSpecSet::from_graph(&graph).expect("task specs");
    let bridge_spec = BridgeSpec {
        id: "radio".to_string(),
        type_path: parse_str("bridge::Dummy").unwrap(),
        run_in_sim: true,
        config_index: 0,
        tuple_index: 0,
        monitor_index: None,
        rx_channels: Vec::new(),
        tx_channels: Vec::new(),
    };

    let mut config = cu29::config::CuConfig::default();
    config.resources.push(ResourceBundleConfig {
        resources: None,
        id: "fc".to_string(),
        provider: "board::Bundle".to_string(),
        config: None,
        missions: None,
    });
    let bundle_specs = build_bundle_specs(&config, "default").expect("bundle specs");
    let specs = collect_resource_specs(&graph, &task_specs, &[bridge_spec], &bundle_specs)
        .expect("collect specs");
    assert_eq!(specs.len(), 1);
    assert!(matches!(specs[0].owner, ResourceOwner::Bridge(0)));
    assert_eq!(specs[0].binding_name, "serial");
    assert_eq!(specs[0].bundle_index, 0);
    assert_eq!(specs[0].resource_name, "serial0");
}

#[test]
fn copper_runtime_args_parse_subsystem_mode() {
    use super::*;
    use quote::quote;

    let args = CopperRuntimeArgs::parse_tokens(quote!(
        config = "multi_copper.ron",
        subsystem = "ping",
        sim_mode,
        ignore_resources
    ))
    .expect("parse runtime args");

    assert_eq!(args.config_path, "multi_copper.ron");
    assert_eq!(args.subsystem_id.as_deref(), Some("ping"));
    assert!(args.sim_mode);
    assert!(args.ignore_resources);
}

#[test]
fn resolve_runtime_config_from_multi_config_selects_local_subsystem() {
    use super::*;

    let root = unique_test_dir("multi_runtime_resolve");
    let alpha_config = root.join("alpha.ron");
    let beta_base_config = root.join("beta_base.ron");
    let beta_config = root.join("beta.ron");
    let network_config = root.join("multi.ron");

    write_file(
        &alpha_config,
        r#"
(
    tasks: [
        (id: "src", type: "AlphaSource", run_in_sim: true),
        (id: "sink", type: "AlphaSink", run_in_sim: true),
    ],
    cnx: [
        (src: "src", dst: "sink", msg: "u32"),
    ],
)
"#,
    );
    write_file(
        &beta_base_config,
        r#"
(
    tasks: [
        (id: "src", type: "BetaSource", run_in_sim: true),
    ],
)
"#,
    );
    write_file(
        &beta_config,
        r#"
(
    includes: [
        (path: "beta_base.ron", params: {}),
    ],
    tasks: [
        (id: "sink", type: "BetaSink", run_in_sim: true),
    ],
    cnx: [
        (src: "src", dst: "sink", msg: "u64"),
    ],
)
"#,
    );
    write_file(
        &network_config,
        r#"
(
    subsystems: [
        (id: "beta", config: "beta.ron"),
        (id: "alpha", config: "alpha.ron"),
    ],
    interconnects: [],
)
"#,
    );

    let args = CopperRuntimeArgs {
        config_path: "multi.ron".to_string(),
        subsystem_id: Some("beta".to_string()),
        sim_mode: false,
        ignore_resources: false,
    };

    let resolved =
        resolve_runtime_config_with_root(&args, &root).expect("resolve multi runtime config");

    assert_eq!(resolved.subsystem_id.as_deref(), Some("beta"));
    assert_eq!(resolved.subsystem_code, 1);
    let graph = resolved
        .local_config
        .get_graph(None)
        .expect("resolved local config graph");
    assert!(graph.get_node_id_by_name("src").is_some());
    assert!(resolved.bundled_local_config_content.contains("BetaSource"));
    assert!(
        !resolved
            .bundled_local_config_content
            .contains("beta_base.ron")
    );

    let bundled = CuConfig::deserialize_ron(&resolved.bundled_local_config_content)
        .expect("bundled subsystem config must not need include path resolution");
    let bundled_graph = bundled.get_graph(None).expect("bundled graph");
    assert!(bundled_graph.get_node_id_by_name("src").is_some());
    assert!(bundled_graph.get_node_id_by_name("sink").is_some());
    assert_eq!(bundled_graph.edge_count(), 1);
}

#[test]
fn resolve_runtime_config_bundles_resolved_single_config() {
    use super::*;

    let root = unique_test_dir("single_runtime_resolve");
    let base_config = root.join("base.ron");
    let app_config = root.join("app.ron");

    write_file(
        &base_config,
        r#"
(
    tasks: [
        (id: "src", type: "IncludedSource", run_in_sim: true),
    ],
)
"#,
    );
    write_file(
        &app_config,
        r#"
(
    includes: [
        (path: "base.ron", params: {}),
    ],
    tasks: [
        (id: "sink", type: "LocalSink", run_in_sim: true),
    ],
    cnx: [
        (src: "src", dst: "sink", msg: "u32"),
    ],
)
"#,
    );

    let args = CopperRuntimeArgs {
        config_path: "app.ron".to_string(),
        subsystem_id: None,
        sim_mode: false,
        ignore_resources: false,
    };

    let resolved =
        resolve_runtime_config_with_root(&args, &root).expect("resolve single runtime config");

    assert!(
        resolved
            .bundled_local_config_content
            .contains("IncludedSource")
    );
    assert!(!resolved.bundled_local_config_content.contains("base.ron"));
    let bundled = CuConfig::deserialize_ron(&resolved.bundled_local_config_content)
        .expect("bundled config must not need include path resolution");
    let graph = bundled.get_graph(None).expect("bundled graph");
    assert!(graph.get_node_id_by_name("src").is_some());
    assert!(graph.get_node_id_by_name("sink").is_some());
    assert_eq!(graph.edge_count(), 1);
}

#[test]
fn resolve_runtime_config_uses_forwarded_features_for_codegen_and_reload() {
    use super::*;

    let root = unique_test_dir("feature_runtime_resolve");
    let camera_config = root.join("camera.ron");
    let app_config = root.join("app.ron");

    write_file(
        &camera_config,
        r#"
(
    tasks: [
        (id: "camera", type: "target_camera::Camera"),
        (id: "sink", type: "tasks::CameraSink"),
    ],
    cnx: [
        (src: "camera", dst: "sink", msg: "target_camera::Frame"),
    ],
)
"#,
    );
    write_file(
        &app_config,
        r#"
(
    tasks: [],
    cnx: [],
    includes: [
        (path: "camera.ron", when: Feature("camera")),
    ],
)
"#,
    );

    let args = CopperRuntimeArgs {
        config_path: "app.ron".to_string(),
        subsystem_id: None,
        sim_mode: false,
        ignore_resources: false,
    };

    let without_camera = resolve_runtime_config_with_root_and_features(&args, &root, &[]).unwrap();
    assert!(without_camera.active_features.is_empty());
    assert!(
        !without_camera
            .bundled_local_config_content
            .contains("target_camera")
    );

    let with_camera =
        resolve_runtime_config_with_root_and_features(&args, &root, &["camera"]).unwrap();
    assert_eq!(with_camera.active_features, ["camera"]);
    assert!(
        with_camera
            .bundled_local_config_content
            .contains("target_camera::Camera")
    );
    assert!(
        with_camera
            .bundled_local_config_content
            .contains("target_camera::Frame")
    );
    assert!(!with_camera.bundled_local_config_content.contains("Feature"));
}

#[test]
fn resolve_multi_runtime_config_uses_forwarded_features() {
    use super::*;

    let root = unique_test_dir("feature_multi_runtime_resolve");
    write_file(
        &root.join("camera.ron"),
        r#"
(
    tasks: [
        (id: "camera", type: "target_camera::Camera"),
        (id: "sink", type: "tasks::CameraSink"),
    ],
    cnx: [
        (src: "camera", dst: "sink", msg: "target_camera::Frame"),
    ],
)
"#,
    );
    write_file(
        &root.join("robot.ron"),
        r#"
(
    tasks: [],
    cnx: [],
    includes: [
        (path: "camera.ron", when: Feature("camera")),
    ],
)
"#,
    );
    write_file(
        &root.join("multi.ron"),
        r#"
(
    subsystems: [
        (id: "robot", config: "robot.ron"),
    ],
    interconnects: [],
)
"#,
    );

    let args = CopperRuntimeArgs {
        config_path: "multi.ron".to_string(),
        subsystem_id: Some("robot".to_string()),
        sim_mode: false,
        ignore_resources: false,
    };

    let without_camera = resolve_runtime_config_with_root_and_features(&args, &root, &[]).unwrap();
    assert_eq!(
        without_camera
            .local_config
            .get_graph(None)
            .unwrap()
            .node_count(),
        0
    );

    let with_camera =
        resolve_runtime_config_with_root_and_features(&args, &root, &["camera"]).unwrap();
    assert_eq!(
        with_camera
            .local_config
            .get_graph(None)
            .unwrap()
            .node_count(),
        2
    );
    assert!(
        with_camera
            .bundled_local_config_content
            .contains("target_camera::Frame")
    );
}

#[test]
fn resolve_runtime_config_preserves_mission_task_order_in_bundle() {
    use super::*;

    let root = unique_test_dir("mission_runtime_resolve_order");
    let base_config = root.join("base.ron");
    let app_config = root.join("app.ron");

    write_file(
        &base_config,
        r#"
(
    tasks: [
        (id: "c", type: "TaskC", missions: ["one", "two"]),
    ],
)
"#,
    );
    write_file(
        &app_config,
        r#"
(
    includes: [
        (path: "base.ron", params: {}),
    ],
    missions: [
        (id: "one"),
        (id: "two"),
    ],
    tasks: [
        (id: "a", type: "TaskA", missions: ["two"]),
        (id: "b", type: "TaskB", missions: ["one"]),
    ],
)
"#,
    );

    let args = CopperRuntimeArgs {
        config_path: "app.ron".to_string(),
        subsystem_id: None,
        sim_mode: false,
        ignore_resources: false,
    };
    let resolved = resolve_runtime_config_with_root(&args, &root)
        .expect("resolve mission config with includes");
    let bundled = CuConfig::deserialize_ron(&resolved.bundled_local_config_content)
        .expect("bundled mission config");

    let task_order = |config: &CuConfig, mission: &str| {
        config
            .get_graph(Some(mission))
            .expect("mission graph")
            .get_all_nodes()
            .into_iter()
            .filter(|(_, node)| node.get_flavor() == Flavor::Task)
            .map(|(_, node)| node.get_id())
            .collect::<Vec<_>>()
    };

    assert_eq!(task_order(&resolved.local_config, "one"), vec!["b", "c"]);
    assert_eq!(task_order(&resolved.local_config, "two"), vec!["a", "c"]);
    assert_eq!(
        task_order(&bundled, "one"),
        task_order(&resolved.local_config, "one")
    );
    assert_eq!(
        task_order(&bundled, "two"),
        task_order(&resolved.local_config, "two")
    );
    assert!(!resolved.bundled_local_config_content.contains("base.ron"));
}

#[test]
fn resolve_runtime_config_rejects_missing_subsystem() {
    use super::*;

    let root = unique_test_dir("multi_runtime_missing_subsystem");
    let alpha_config = root.join("alpha.ron");
    let network_config = root.join("multi.ron");

    write_file(
        &alpha_config,
        r#"
(
    tasks: [
        (id: "src", type: "AlphaSource", run_in_sim: true),
        (id: "sink", type: "AlphaSink", run_in_sim: true),
    ],
    cnx: [
        (src: "src", dst: "sink", msg: "u32"),
    ],
)
"#,
    );
    write_file(
        &network_config,
        r#"
(
    subsystems: [
        (id: "alpha", config: "alpha.ron"),
    ],
    interconnects: [],
)
"#,
    );

    let args = CopperRuntimeArgs {
        config_path: "multi.ron".to_string(),
        subsystem_id: Some("missing".to_string()),
        sim_mode: false,
        ignore_resources: false,
    };

    let err = resolve_runtime_config_with_root(&args, &root).expect_err("missing subsystem");
    assert!(err.to_string().contains("Subsystem 'missing'"));
}

#[test]
fn synthesized_single_output_type_name_parses_for_task_traits() {
    use super::*;

    let src_ty: Type = parse_quote!(SingleSource);
    let regular_ty: Type = parse_quote!(RegularTask);

    let src_name = synthesized_single_output_msg_name(&src_ty, CuTaskType::Source, false, false);
    let regular_name =
        synthesized_single_output_msg_name(&regular_ty, CuTaskType::Regular, false, false);
    let anytime_name =
        synthesized_single_output_msg_name(&regular_ty, CuTaskType::Regular, true, false);
    let stateless_name =
        synthesized_single_output_msg_name(&regular_ty, CuTaskType::Regular, false, true);

    parse_str::<Type>(src_name.as_str()).expect("source payload type should parse");
    parse_str::<Type>(regular_name.as_str()).expect("regular payload type should parse");
    parse_str::<Type>(anytime_name.as_str()).expect("anytime payload type should parse");
    parse_str::<Type>(stateless_name.as_str()).expect("stateless payload type should parse");
}