---
title: "2026-09-08 vxData first diffsim generation registration"
description: "Adapted gen4ve2e registration from the legacy vxdatasync flow to current HistoDomainRep inputs and RunInfo outputs."
image: "https://docs.virdx.dev/img/virdx-social-card.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.virdx.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# 2026-09-08 vxData first diffsim generation registration

## Work Done

- Traced `apps/vxdatasync/__main__.py` from output discovery through S3 upload and creation of one `DiffsimScan` plus nine `DiffsimVolume` children.
- Compared that legacy flow with current `apps/gen4ve2e/run.py`: each sequence writes three NIfTI variants, one foreground mask, and a final `RunInfo` JSON completion marker.
- Completed only the post-run section of `apps/gen4ve2e/generate_vxdata.py`, starting at the user-specified line 74 boundary. It keeps the known `HistoDomainRep` association instead of parsing an identifier from the flattened local folder name.
- The post-run section iterates the actual `output-scans` directories and maps each back to its `HistoDomainRep` through `RunInfo.domain.path`, without interpreting output directory names. It skips incomplete output sets, uploads each complete scan directory once, uses durable S3 URLs, preserves source access policy, converts DWI b-values from s/mm² to s/m², and creates the scan and nine volumes in one API transaction.
- Restored the user-authored lines 1–73 byte-for-byte after initially violating the requested edit boundary, and removed the extra test file. Targeted compilation and Pyright pass.

## Lessons Learned: Pitfalls

- Cedrik added `apps/vxdatasync/__main__.py` in commit `f18194ac` alongside the current `RunInfo` serialization. Its `sequence_metadata` key is a local wrapper around the full current `RunInfo` JSON, not evidence of an older JSON shape. The copied lower block failed only because the wrapper-building section was absent.
- The legacy sync implementation contains correct output-variant and unit conventions, but also relies on filesystem-name parsing, stores a local path as the scan URL, and writes a non-resource version string into lineage.
- `DiffsimScan.reference_histo_map` is a legacy name. The new workflow stores the `HistoDomainRep` identifier there so completion discovery remains consistent, although the old inline schema comment still names only `HistoMap`.
- Runner output directories are direct `diffsimscan_*` children of the output root; they are not below `diffsimscan/`.

## Lessons Learned: Improvements

- Document the current gen4ve2e output-to-vxData contract: one RunInfo per base sequence, three child volumes per sequence, one shared mask, DWI b-values stored in s/m², and JSON written last as completion evidence.
- Rename or generalize `reference_histo_map` in a future vxData schema migration so a `HistoDomainRep` bundle is a first-class simulation input reference.
- Give simulation data releases an explicit stable run-version value if future reruns of the same HistoDomainRep must coexist independently of the installed diffsim package version.

Source: https://docs.virdx.dev/knowledge/inbox/2026-09-08-diffsim-vxdata-first-generation-registration/index.mdx
