Skip to content

mesh_lab skeleton: the skeleton request, its children and a mesh_tools section, a skeleton lab demo (P2) - #1402

Merged
transfix merged 6 commits into
masterfrom
tfx/laughing-chatelet-8f7511
Nov 21, 2026
Merged

transfix merged 6 commits into
masterfrom
tfx/laughing-chatelet-8f7511

Conversation

@transfix

@transfix transfix commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Phase P2 of docs/roadmap/VOLROVER-LIBRARY-PORTS-ROADMAP.md (§7's row, §2 "Ariadne"): P1's cvc::skeletonize in Ariadne, as a mesh_lab request.

The request (src/cvcGL/ariadne/mesh_nodes.cpp, documented in mesh_nodes.h and ARIADNE.md §5.4)

  • mesh_ops.request = skeleton runs cvc::skeletonize_job on the shown mesh's vertices. It runs as a sliced task on the app's scheduler: cooperative slices on single-threaded wasm, pool chunks where there are threads.
  • Parameters: skeleton_params' table under <node>.mesh_ops.skeleton.*, with their properties.
    • Seeded from a skeleton: { ... } prop, else the defaults, and read when a run starts.
    • A value that doesn't parse, or is out of range, is reported in skeleton.status, and nothing runs.
    • A parameter changed while a run is going applies to the next run, and the status says so (§1.5).
  • Published:
    • job_keys' busy, stoppable, status, progress, phase, stats.work_ms and pid;
    • info.{points, strands, sheets, clusters, lines, triangles} and warnings.
  • stop (a request word, as in fe_lab) ends a run at its next step and keeps the last skeleton.
  • Other requests wait while a skeleton runs, so the mesh it reads stays the one shown.
  • A new mesh (an operation, a load or a reset) clears the skeleton.
  • The result is drawn in two children, <id>_strands (lines) and <id>_sheets. view.strands and view.sheets show or hide each.
  • The parts also go on the data channel at <node>.skeleton.{strands, sheets, helix} as cvc::geometry.
  • A fix in passing: a realize-time load (keys an init: wrote) now runs before a request already waiting in the key, instead of replacing it.

View tags (scene_realize.h, scene_views.cpp)

  • The children are tagged skeleton.
  • The node's own surface is tagged surface, for its props alone: a new RealizedScene::TaggedNode::subtree flag, which views honour when they hide, restyle and frame.
  • So show: [skeleton] shows an untagged mesh_lab's skeleton alone, and hide: [surface] shows any mesh_lab without its surface.
  • Behaviour change: a view whose show: list names neither tag now leaves a mesh_lab out, as it would any tagged node. No document in the tree has such a view. (Children alone couldn't do this: a node's tags hold for its subtree, so a view leaving the surface out took the skeleton with it.)
  • A view naming tags to show now waits until a node it lets in has bounds before it frames. It used to frame, once, on every visible prop in its renderer when none had bounds yet. show: [skeleton] raced the run: CI's Linux run framed the skeleton golden's side view on the surfaces, its Windows run on the skeleton (1.9% of pixels apart).
  • shown_bounds (the framing's bounds) now leaves out a node an entry out of the view takes along, as the renderer does: a mesh_lab tagged lab no longer puts its skeleton children in show: [skeleton]'s framing.

Golden waits (cvcgl_ari_golden.cpp)

  • RealizedScene::settling holds probes that a custom node type registers. A probe is true while the node's work would still change the frame: a request waiting, a job running, a colour not yet made.
  • The harness steps on until every probe is false, then 4 more frames, before it captures.
  • Documents whose nodes register no probe take no extra frames. Checked locally: the other goldens take the same frame counts as before.

Component, demo, golden, browser

  • mesh_tools.ari gains a Skeleton section: the main parameters, Skeleton and Stop buttons, a progress bar labelled by phase, the counts, and a show toggle for each part.
  • Demo: examples/ariadne/documents/skeleton_lab.ari decimates the embedded bunny to 4,000 triangles, then skeletonizes it. A second view shows the skeleton alone. It is in the gallery as skeleton_lab_ari, with a thumbnail.
  • Golden: src/cvcGL/test/golden/skeleton.ari.
    • It reads a committed 4,000-triangle bunny (golden/data/bunny_4k.off, 119 KB, written once by cvc::simplify), so every platform skeletonizes the same points and CI's Debug lanes don't decimate.
    • Its PNG, golden/skeleton.png, comes from this PR's CI (an ari-golden artifact, llvmpipe), as orthoslicer demo: three volume_slice planes beside a volren, a slice view down any axis (P7) #1257's did; the harness refuses any renderer but llvmpipe. It was retaken on the framing fix (from package-linux / libcvc-release-grpc at 6b8e6af); that run's Linux and Windows llvmpipe frames agree to a largest channel difference of 1.
  • arigl-web: a smoke case. src/cvc/tests/data/ariadne_docset/app/skeleton.ari decimates to 2,000 triangles and prints the counts once the skeleton is drawn.
  • Recipes: arigl-web's and the gallery's recipes gain shewchuk-predicates. arigl-web's full build now fails at configure without them (otherwise the page's skeleton could only report an error).

Tests

  • cvcgl_mesh_skeleton (headless, 47 checks), plus a cvcgl_mesh_skeleton_cooperative entry run with CVC_SLICED_THREADING=cooperative. It covers:
    • keys, properties and props seeding;
    • the children, holding exactly skeletonize's output, and the data channel;
    • the view keys and the view tags;
    • stop before the first step and, in cooperative mode, part-way through;
    • bad values and a bad prop;
    • a parameter written mid-run;
    • clearing on a new mesh;
    • two apps in one process;
    • T7: the frames a cooperative run spans stay short.
  • cvcgl_ariadne_views: a parts case with two mesh_labs (one untagged, one tagged lab) under show: [skeleton], hide: [surface] and show: [lab]. It also checks that show: [skeleton] is framed on the untagged mesh_lab's skeleton once it has one (the old code framed on both bunnies).
  • skeleton_test: SkeletonParams.OnTheStateTree (T8). It covers every field struct → keys → struct, seeding and properties, and an unparseable or out-of-range value. It is in the ports lane, so it runs natively and under node.

Verified locally (Windows, MSVC Release, libigl + Shewchuk)

  • cvcGL tests:
    • cvcgl_mesh_skeleton passes in both modes;
    • cvcgl_ariadne_views passes, 63 checks;
    • cvcgl_ariadne_realize passes, 424 checks;
    • cvcgl_fe_interval passes;
    • the other cvcGL tests that use tagged nodes, views or repeats pass: cvcgl_ariadne_{data,labels,physics,pick,repeat,ribbons,scenes,slice_view}, cvcgl_ari_switch, cvcgl_viewport_refresh and cvcgl_volume_slice;
    • cvcgl_tf_binding passes run alone or serially (4 of 4). It failed once under ctest -j4, in its threaded overlay "mid-computation" timing check, which this PR doesn't touch.
  • skeleton_test passes natively (11 tests) and in a wasm-mt build under node 22 (11 tests).
  • cvcgl_ari_golden on this machine's GPU (not llvmpipe) draws the skeleton document with its run settled.
  • arigl runs skeleton_lab.ari end to end.

Not verified here: macOS (the arigl-web smoke passed on CI). macOS's Apple Software Renderer may need a skeleton.macos.png, as the orthoslicer did (#1333). package-macos runs only on pushes, so that shows on master's run, or on a push to ci/full/**.

…s section, a skeleton lab demo (P2)

Phase P2 of docs/roadmap/VOLROVER-LIBRARY-PORTS-ROADMAP.md: P1's cvc::skeletonize in Ariadne.

- mesh_lab `skeleton` request: cvc::skeletonize_job on the shown mesh's vertices as a sliced
  task on the app's scheduler. Its parameters are skeleton_params' table under
  <node>.mesh_ops.skeleton.* (seeded from a `skeleton:` prop, with their properties, read when a
  run starts; a bad value is reported and nothing runs; one changed mid-run applies to the next
  run, and the status says so). It publishes job_keys' busy, stoppable, status, progress, phase,
  stats.work_ms and pid, plus info.* and warnings. `stop` ends it and keeps the last skeleton,
  other requests wait while it runs, and a new mesh clears it. A realize-time load now runs
  before a request already waiting instead of replacing it.
- Children <id>_strands (lines) and <id>_sheets, view.strands / view.sheets, and the parts on
  the data channel at <node>.skeleton.{strands, sheets, helix}.
- View tags: the children are tagged skeleton and the node's own surface surface, for its props
  alone (RealizedScene::TaggedNode::subtree, honoured by scene_views when hiding, restyling and
  framing), so show: [skeleton] shows the skeleton alone and hide: [surface] drops the surface.
- RealizedScene::settling: probes a custom node type registers while its work would still change
  the frame; cvcgl_ari_golden steps on until they are all false before it captures.
- mesh_tools.ari: a Skeleton section (parameters, Skeleton and Stop, progress, counts, a show
  toggle per part).
- examples/ariadne/documents/skeleton_lab.ari, in the gallery as skeleton_lab_ari with a
  thumbnail. Golden src/cvcGL/test/golden/skeleton.ari on a committed 4,000-triangle bunny
  (golden/data/bunny_4k.off); its PNG follows from CI's llvmpipe run. arigl-web smoke case
  (docset skeleton.ari). arigl-web's and the gallery's recipes gain shewchuk-predicates, and
  arigl-web's full build fails at configure without them.
- Tests: cvcgl_mesh_skeleton, plus a cooperative-threading entry; cvcgl_ariadne_views' parts
  case; SkeletonParams.OnTheStateTree in skeleton_test (ports lane: native and wasm-mt).
- Docs: ARIADNE.md (§5.4 rows and the skeleton, Tags, golden tests), INDEX.ari, the roadmap's §2
  and P2 row.
The skeleton document's reference frame, taken from the ari-golden
artifact of package-linux / libcvc-release-grpc (llvmpipe, LLVM 20.1.8)
on this PR: the run settled (done, 315 strands, 2 sheets from 2064
points), the skeleton alone in the side view and over the translucent
bunny in the main view.
… it frames

A view frames its camera once, the first frame it holds props with bounds. A view
with show: [skeleton] lets in a mesh_lab's skeleton children, which have bounds only
once the run ends; until then shown_bounds found none and the view framed on every
visible prop in its renderer (the surfaces) instead, for good. Whether the skeleton
was there first was a race: CI's Linux run framed on the surfaces, its Windows run on
the skeleton, so the skeleton golden differed in its side view (1.9% of pixels).

- A view whose show: list lets in tagged nodes, none of them with bounds yet, now
  waits for them. With no tagged node let in, it frames on what it draws, as before.
- shown_bounds leaves out a node an entry out of the view takes along (the entry's own
  node, and with subtree every node under it), as the view's renderer does: a
  mesh_lab tagged lab no longer puts its skeleton children (tagged lab and skeleton)
  in show: [skeleton]'s framing.
- cvcgl_ariadne_views: show: [skeleton] is framed on the untagged mesh_lab's skeleton
  once it has one (fails on the old code: framed on both bunnies).
- The skeleton golden and the skeleton_lab demo: the side view's zoom 0.85 -> 0.6, now
  that it is framed on the skeleton itself.
- ARIADNE.md: when a view naming tags to show is framed.

skeleton.png still holds the old framing; its replacement comes from this commit's
llvmpipe run.
The skeleton document's frame from package-linux / libcvc-release-grpc's
ari-golden artifact (llvmpipe, LLVM 20.1.8) at 6b8e6af, where the side
view waits for the skeleton's bounds and frames on it (zoom 0.6). The run
settled: 315 strands, 2 sheets from 2064 points. The previous golden had
the side view framed on the surfaces, the losing side of the race.
…eleton branch

P4 added RealizedScene::pending_work, a probe per custom node that is true while its work
is in flight, for the golden harness to wait on: the same thing as P2's
RealizedScene::settling. The merge keeps master's name and drops settling:

- scene_realize.h: one pending_work, its comment covering both (a contour_lab's tile, a
  mesh_lab's skeleton, a result not drawn yet).
- mesh_lab registers its probe on pending_work; cvcgl_mesh_skeleton reads it there.
- cvcgl_ari_golden: one loop. It steps until no probe has said busy for kMinFrames frames
  after the one it went idle on (P2's "until done, then kMinFrames more", with P4's restart
  when a probe goes busy again), under P2's 180 s ceiling. The skeleton golden gets the
  frames it was taken with; the contour tiler two more, after its scene has settled.
- arigl-web and libcvc-examples-web recipes: clipper2, cdt and shewchuk-predicates, with
  one comment saying the predicates serve the tiler (P4) and the skeleton (P2).
- demos.json and arigl_web_smoke.mjs: both demos and both page cases.
- ARIADNE.md, the roadmap and skeleton.ari name pending_work.
@transfix
transfix merged commit 1c73c5e into master Nov 21, 2026
29 checks passed
@transfix
transfix deleted the tfx/laughing-chatelet-8f7511 branch November 21, 2026 08:48
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