Skip to content

ports P0d, part 2: cvc::point_classes, .vgr and .pts on each app, point-classes.* and pycvc - #1160

Merged
transfix merged 13 commits into
masterfrom
p0d/point-classes
Nov 14, 2026
Merged

transfix merged 13 commits into
masterfrom
p0d/point-classes

Conversation

@transfix

@transfix transfix commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Part 2 of phase P0d in docs/roadmap/VOLROVER-LIBRARY-PORTS-ROADMAP.md (§4, §5, §7): cvc::point_classes, the seeds GenSeg (P5) grows from and the points volume_grid (P8) marks.

Stacked on #1156, whose xml_lite the .vgr reader uses. Until #1156 merges, this PR carries its commits (merged in as 7c93e1a and 998b12b). Review only 5d4e07a, b5c0179 and a9f1a52. It targets master so CI runs. Merge #1156 first; then this one's diff is its own.

What lands

  • The type (inc/cvc/volume/point_classes.h):
    • classes of voxel points (i j k), each with a name, colour, display radius, variable and timestep;
    • a class is known by its name, variable and timestep together, as VolumeGridRover kept one list per variable and timestep;
    • add, remove and set_class;
    • new classes take a fixed palette's colours (whole 255ths, so .vgr keeps them exactly). The legacy drew random colours with srand(time(NULL));
    • point_class_problems(pc, dims);
    • parameter tables for point_class's metadata and for point_class_read_params (dims, bbox, variable, timestep).
  • Formats, each app's own (point_class_handlers(app), in app.slot<T>()):
    • .vgr, read and written. VolumeGridRover's reader was stubbed out in the Qt6 migration. A radius attribute is added, read as 1 when absent.
    • .pts, read only. Given the volume's dims and box, object coordinates become voxels as loadPointClassesSlot computed them (truncated, then clamped). Without them, each coordinate goes to the nearest index.
  • DSL intrinsics.
    • point-classes.add, remove, points and info, and params.* with the tables point-classes.read (read_point_classes' parameters) and point-classes.class.
    • No intrinsic reads or writes files (Joe, 2026-11-12; commits b5c0179, a9f1a52): the DSL deals with point classes on the state tree. They reach it, and leave it for a file, through read_point_classes / write_point_classes, pycvc or a node's request. A test checks that point-classes.read, .write and .formats stay unbound.
    • Edits return a new data object and never change their input; nil starts from no classes.
    • register_point_class_intrinsics(env, ictx, app) binds them in one environment; install_point_class_intrinsics(app) adds them as the app's own keyed provider (cvc.point-classes).
  • pycvc (pycvc_point_classes.i):
    • point_classes, point_class and point_class_read_params, with their tables;
    • points(), and points_array(), an (n, 3) int32 numpy copy;
    • read_point_classes / write_point_classes, which release the GIL;
    • %template(IntVector) std::vector<int>.
  • No statics. tools/singleton_scan/allowlist.txt is unchanged.

Tests

  • point_classes_test: in CVC_PORT_TESTS and SAN_CXX_TESTS. It covers:
    • the model;
    • T8: both tables;
    • T9: the .vgr round trip, the hand-made legacy samples in src/cvc/tests/data/point_classes (QDom's attribute order, a repeated point, a name reused across timesteps; .pts with and without a grid), and a bad-file corpus;
    • T6: two apps, two threads, order;
    • the intrinsics, with an edit never changing its input, and an Ariadne document marking a point through the app's provider.
  • T11: test_pycvc_point_classes.py, in ctest and SAN_PY_TESTS.

Checked locally (Windows, MSVC 19.44, Release):

  • point_classes_test: 16/16;
  • contour_stack_test: 22/22;
  • pycvc_point_classes passes, and 48 of 49 pycvc tests pass. The one failure, pycvc_physics, runs a C++ physics test binary that wasn't built locally.

Not checked locally: wasm-mt under node, Linux/macOS, and the writable-data scan. CI checks them.

…urs.* and pycvc

The contours the tiler (P3b) and volume_grid (P10) share
(docs/roadmap/VOLROVER-LIBRARY-PORTS-ROADMAP.md §3, P0d):

- inc/cvc/geometry/contours.h: slices by z index (a spacing and origin, or a slice's own plane),
  closed polygons per component, components with a colour and a visibility; contour_problems();
  parameter tables for contour_component and contour_read_params.
- Readers and writers are each app's own (contour_handlers(app), a file_handler_registry in
  app.slot<T>()): Reconstruct .ser with its sections, the Tiling .config + .pts, ctr2suf
  .contour, VolumeGridRover's .pcd (written only) and a .cvcc JSON file. Reconstruct traces are
  mapped through the inverse of their section transform, exactly for affine ones and by Newton's
  method otherwise (the legacy reader was right only for a translation).
- src/cvc/utility/xml_lite: a small stateless XML reader. boost::property_tree's XML parser keeps
  function-local statics the writable-data scan would flag; the name filters use boost::regex,
  whose statics are already allowlisted, rather than std::regex.
- contours.read / write / info / formats and params.* with the tables "contours.read" and
  "contours.component": register_contour_intrinsics(env, ictx, app) for one environment, and
  install_contour_intrinsics(app) as the app's own keyed action-intrinsic provider.
- pycvc: contour_stack, read_contours / write_contours (the GIL released), both tables through
  PYCVC_PARAM_TABLE.
- Tests: contour_stack_test (in CVC_PORT_TESTS and the sanitizer lanes): the model, T8, T9 with
  legacy samples and a bad-file corpus, T6 (two apps, two threads, order), the DSL and an Ariadne
  document through the provider. test_pycvc_contours.py (T11). docs/PORT_SHARED_TYPES.md.
…nt-classes.* and pycvc

The seeds GenSeg (P5) grows from and the points volume_grid (P8) marks
(docs/roadmap/VOLROVER-LIBRARY-PORTS-ROADMAP.md §4, §5, P0d). On part 1 (#1156), whose xml_lite
the .vgr reader uses.

- inc/cvc/volume/point_classes.h: classes of voxel points (i j k), each with a name, colour,
  display radius, variable and timestep, known by name, variable and timestep together; add,
  remove, set_class; new classes take a fixed palette's colours (the legacy used srand(time));
  point_class_problems(pc, dims); tables for point_class's metadata and point_class_read_params
  (dims, bbox, variable, timestep).
- Formats each app's own (point_class_handlers(app), in app.slot<T>()): VolumeGridRover's .vgr
  read and written (its reader was stubbed out in the Qt6 migration; a radius attribute added),
  and its .pts point list read, with object coordinates turned into voxels as the legacy did when
  the volume's dims and box are given.
- point-classes.read / write / add / remove / points / info / formats and params.* (tables
  "point-classes.read", "point-classes.class"). Edits return a new data object and never change
  their input. register_point_class_intrinsics(env, ictx, app) and
  install_point_class_intrinsics(app), a keyed per-app provider.
- pycvc: point_classes, point_class and point_class_read_params with their tables, points() and
  points_array() (an (n, 3) int32 numpy copy), read/write with the GIL released; IntVector.
- Tests: point_classes_test (CVC_PORT_TESTS, sanitizer lanes): the model, T8, T9 with legacy
  samples and a bad-file corpus, T6, the DSL, an Ariadne document through the provider.
  test_pycvc_point_classes.py (T11). docs/PORT_SHARED_TYPES.md gains the section.
Joe (2026-11-12): the intrinsics deal with data on the state tree; writing it to files is left to
the rest of libcvc (write_contours, pycvc, a node's request, the CLI). So contours.write goes,
and contours.formats lists only the extensions contours.read reads. A test checks that
contours.write stays unbound, and that the stack contours.read puts on the tree is the one
write_contours writes. The docs and the roadmap's §1.6 row say so.
… state tree

As for contours (Joe, 2026-11-12): point-classes.write goes, and point-classes.formats lists only
what point-classes.read reads. Writing classes from the tree to a file is write_point_classes',
pycvc's or a node request's. A test checks point-classes.write stays unbound and reads back what
write_point_classes wrote from the tree; the docs and the roadmap's §1.6 row say so.
…on the tree

Joe (2026-11-12): drop the read intrinsics too. No contours intrinsic touches files: a stack
reaches the state tree, and leaves it for a file, through read_contours / write_contours, pycvc,
a node's request or the CLI. contours.* is now contours.info, with params.* and the tables
"contours.read" (read_contours' parameters) and "contours.component". The tests put stacks on
the tree from C++ (contour_stack_value, or the stack itself) and check that contours.read,
contours.write and contours.formats stay unbound.
# Conflicts:
#	docs/roadmap/VOLROVER-LIBRARY-PORTS-ROADMAP.md
As for contours (Joe, 2026-11-12): no point-classes intrinsic touches files. Classes reach the
state tree, and leave it for a file, through read_point_classes / write_point_classes, pycvc or a
node's request. point-classes.* keeps add, remove, points and info, with params.* and the tables
"point-classes.read" (read_point_classes' parameters) and "point-classes.class". The tests put
classes on the tree from C++ and check that point-classes.read, .write and .formats stay unbound.
@transfix
transfix enabled auto-merge (squash) November 12, 2026 08:23
@transfix
transfix disabled auto-merge November 12, 2026 08:42
@transfix
transfix enabled auto-merge (squash) November 12, 2026 09:56
@transfix
transfix disabled auto-merge November 13, 2026 23:31
@transfix
transfix enabled auto-merge (squash) November 14, 2026 01:49
@transfix
transfix merged commit b1ceef5 into master Nov 14, 2026
27 checks passed
@transfix
transfix deleted the p0d/point-classes branch November 14, 2026 11:37
transfix added a commit that referenced this pull request Nov 14, 2026
…#1222-#1225, #1229)

Master's #1190 (file-pick and http-upload) was written for a single async host; this branch runs
an isolated document's programs on its own group's host, on a pool worker in an `any` group.

- net_intrinsics.cpp: StartedRequest takes master's deliver()/on_outcome, settling through the
  host's finisher. http-upload is its own provider, `any` as the requests are: it parks on the
  calling program's host (ictx.host), takes its progress path from ictx.root_path (no tree walk
  on a worker), and a started upload (a browser page) keeps the host's finisher, not the host.
- ariadne.cpp: file-pick, file-info and file-forget bind into the program's env as they are, in
  every group (install_backend_verbs), not through the backend verbs' host_proxied wrapper, which
  cannot park an async verb. file-pick parks on the program's own host, claims the Runtime's
  picker hub under its lock where it is called, and opens the picker on the host thread
  (exec_pool::run_on_host; inline when called there). Its answer goes through the host's
  finisher, as the host may be gone by then.
- ci.yml: the sanitizer list keeps this branch's tests and master's point_classes_test.
- STATE_EXEC_THREADED.md: rows for http-upload, the file verbs, and the contours and
  point-classes providers. The last two are registered without a kind, so they are host_only, and
  an isolated document in an app that installs them goes to a host-affinity group.
- New test: AriadneIsolatedDocs.FilePickOpensItsPickerOnTheFramesThread.
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