Skip to content

ports: tools/volrover-goldens, the legacy libraries' T1 goldens, GenSeg first (P0b, part 3) - #1115

Merged
transfix merged 2 commits into
masterfrom
p0b/volrover-goldens
Nov 10, 2026
Merged

transfix merged 2 commits into
masterfrom
p0b/volrover-goldens

Conversation

@transfix

Copy link
Copy Markdown
Owner

Part 3 of phase P0b, the VolumeRover ports' shared pieces (docs/roadmap/VOLROVER-LIBRARY-PORTS-ROADMAP.md §1.7 T1, §7). It is independent of #1110 and #1113. It is additive and touches nothing libcvc builds.

What it adds

Each port starts by matching the legacy library's output on committed inputs (T1). tools/volrover-goldens/make_goldens.py makes those outputs reproducibly:

  1. It fetches transfix/volrover at the sha in volrover.sha (1cf0fbd7, master on 2026-11-09), as a shallow, sparse checkout.
  2. It builds the legacy libraries with the tool's own CMakeLists.txt. That build is never part of libcvc's.
    • GPL code may be built there and only there: the legacy tree's own CGAL, for Skeletonization and ContourTiler later.
    • Nothing built there is linked into libcvc.
  3. It runs them on committed inputs and writes src/cvc/tests/data/volrover-goldens/<library>/. With --check, it makes them again and fails on any difference.

GenSeg first:

  • Built as they are at the pinned sha: the legacy segment.cpp (the fast marching) and inout.cpp (its rawiv reader and writer).
  • Driver: genseg_driver.cpp stands in for the XML-RPC entry general_segmentation.cpp. It builds the seed lists the same way and calls read_data and Segment as that entry did.
  • Shim: three small headers stand in for VolMagick's VolumeFileInfo (only the rawiv header, for the border point cloud's world coordinates), big_endian(), and genseg.h's XmlRpcValue declaration. The real VolMagick needs volrover's whole core library, and GenSeg reads every voxel by hand anyway. The goldens never use those coordinates.
  • Inputs: three committed float32 volumes, 20³ to 24³ (about 140 KB), with their thresholds and seeds. make_inputs.py wrote them once, so the goldens never depend on a machine's exp().
    • two_blobs: two touching blobs;
    • three_classes_noisy: three classes on noisy data, so GenSeg's automatic seeds join in;
    • two_seeds_one_class: a class with two seeds.
  • Goldens per case:
    • <case>.labels.u8: the class of every voxel;
    • <case>.indices.txt: the legacy border voxels, where fronts met;
    • <case>.json: the case, the sha, the platform, class counts and SHA-256s.
  • A .gitattributes keeps line-ending conversion off these files.

CI: a new volrover goldens (legacy parity data) job runs --check on Linux when the tool, its inputs or the goldens change. When the goldens differ, it uploads the ones it made.

Checked

On Windows (MSVC 2022): the script fetched the pinned sha, built legacy GenSeg, wrote the goldens, and --check reproduced them byte for byte.

Case Class voxels Border voxels
two_blobs 241, 81 26
three_classes_noisy 119, 278, 2757 1090
two_seeds_one_class 128, 1260 401

Not yet known: whether Linux/GCC gives the same bytes as MSVC. The legacy fast marching uses exp() and sqrt() on floats, so a tie could break differently. The new CI job answers this on this PR. If they differ, the Linux goldens (from the job's artifact) become the reference, and the README will say so.

…eg first (P0b, part 3)

The VolumeRover ports each start by matching the legacy library's output on committed inputs
(VOLROVER-LIBRARY-PORTS-ROADMAP.md §1.7 T1). tools/volrover-goldens/make_goldens.py makes those
outputs reproducibly:

- fetches transfix/volrover at the sha in volrover.sha (1cf0fbd7, master 2026-11-09), shallow and
  sparse;
- builds the legacy libraries with the tool's own CMakeLists.txt, never part of libcvc's build
  (GPL code, such as the legacy tree's own CGAL for the libraries that need it, may be built
  there and only there);
- runs them on committed inputs and writes src/cvc/tests/data/volrover-goldens/<library>/, or
  with --check makes them again and fails on any difference.

GenSeg first: the legacy segment.cpp and inout.cpp as they are at the pinned sha, a driver that
calls read_data and Segment as the XML-RPC entry general_segmentation.cpp did, and a three-header
shim for what they include and the goldens never reach (VolMagick's VolumeFileInfo, big_endian(),
and genseg.h's XmlRpcValue declaration; the real VolMagick needs volrover's whole core library).
Three committed 20^3-24^3 cases (two touching blobs; three classes on noisy data, with GenSeg's
automatic seeds; a class with two seeds) give per-voxel labels, the border voxels where fronts
met, and a JSON record with SHA-256s.

A `volrover goldens` CI job runs --check on Linux when the tool, its inputs or the goldens change,
and uploads the goldens it made when they differ. The goldens here were made on Windows (MSVC
2022); --check there reproduces them.
…as on Windows/MSVC

CI's check on ubuntu-24.04 (GCC) made the goldens committed from Windows (MSVC 2022) byte for byte,
for all three cases. The README records it.
@transfix
transfix merged commit 114a630 into master Nov 10, 2026
28 of 31 checks passed
@transfix
transfix deleted the p0b/volrover-goldens branch November 10, 2026 07:46
transfix added a commit that referenced this pull request Nov 10, 2026
…ld panels (#1123), ocean shore (#1128)

Also #1124, #1115 and #1120.

Conflicts, both sides kept:
- ariadne.h: post_signal also hands the signal to the event tap, and
  stays a host-thread call outside a pump, as post_input is. The tap is
  set on the drain's thread, which is the host thread.
- ariadne.cpp: deliver_input and post_signal post to the document's
  scheduler (current_sched) when a resident takes the event, and queue it
  for the tap when the tap takes that kind. post_signal keeps its
  assert_outside_pump. The tap's events are handed over in drain_begin,
  after the input residents and before the has? snapshot, so what they
  start runs in the frame's pump.
- ariadne_script_engine_test.cpp: this branch's isolated-document tests
  and master's hook tests, all kept.

A lane's hook residents run on the host thread: a document that uses an
engine stays there (require_host_thread), so the hook queues and the
receiver's start_process need no more.
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.

1 participant