Repository navigation
P3b part 2: cvc tile, pycvc and tiler.tile (the ContourTiler port's surfaces) - #1334
Merged
Merged
Conversation
…f0fbd7) The legacy library (transfix/volrover src/ContourTiler and inc/ContourTiler at the commit tools/volrover-goldens/volrover.sha pins), copied without changes so the next commit's diff is the port: the library's sources and the headers they include, without its tools (ecs, smfconvert, decimate, sandbox, ContourNear), its command line (main.cpp, cl_options.cpp), its readers (reader_ser.h, reader_csv.h, xml/), dev.cpp, minkowski.cpp (nothing calls it), CGAL_hash.cpp and tiler_output.cpp (debug output). Not built.
…int hashes, grid convexity
tiler_tile_op wraps tile_contours_job in cvc/core/job_intrinsics.h's three forms. The result is a dict of "surfaces" (component name to a cvc::geometry data object) and "warnings", so a skipped contour is not lost. -start publishes the job keys under its target; a node's is <node>.tiler. tiler_intrinsics_test (T10): the three forms cooperative and threaded, a stack as a state path or a data object, bad parameters raising at the call, job.cancel and kill, params.defaults, and an Ariadne action starting it under the default limits. In the ports lane and the sanitizer lanes.
Reads any contour format and writes one surface per component, <outdir>/<basename><component>_tiles.<ext>, and all of them as <basename>_tiles.<ext>, as the legacy contour_tiler did. The parameters come from tile_params' table; the legacy flags (-C -e -r -v -c -x -s -z --color -d -b -n -o raw --printcomponents) are rewritten to them. Debug-output flags and the ones the legacy ignored for a series are accepted with a note; -o gnuplot, -I and smoothing are refused. cvc_cli_test: help, a tube, the legacy flags (component filters, slice range, base name, colour, --printcomponents) and bad input.
pycvc_tiler.i wraps tile_contours on a contour_stack, with tile_params' fields as keywords, and its result: names(), surface(name) (KeyError for none), the surfaces as a dict of geometries, and the warnings. The call releases the GIL. pycvc_jobs.i adds tile_contours_job. test_pycvc_tiler.py (T11): a tube, keywords and params, ValueError for bad input, another thread running during the call, the job's steps and cancel.
…18 settles on it clang-format re-wraps a comment holding tabs differently on every pass, so the changed-lines check never passed on those lines. Also drops the doubled blank lines the include clean-up left.
…tiler-core # Conflicts: # .github/workflows/ci.yml
# Conflicts: # .github/workflows/ci.yml
…ts, no FMA) The legacy's choices follow its containers' iteration order and std::sort's order of ties. The branch parity case failed on wasm32 (other untiled regions, other topology) and on macOS arm64 (other contour triangles). - Hashes: Boost 1.86's 64-bit hash_value(double) and hash_combine, computed in 64 bits everywhere. Where size_t is 32 bits they are folded to lo32 + hi32, which is what Boost.Unordered's 64-bit bucket placement reduces a hash to, so the buckets and iteration order are the 64-bit ones. On 64-bit platforms the values are boost's own, unchanged. - The four std::sort calls whose ties matter (the OTV candidates by distance among them) are stable_sort, so ties keep their input order on every standard library. MSVC already gave that order: Windows still matches the goldens. - The tiler's sources compile with -ffp-contract=off, as nav, lsys and world. Checked: native MSVC tiler_test 20/20 and tiler_legacy_test 58/58; wasm-mt under node tiler_test 20/20, with the committed series embedded (the CI failure reproduced first, the same numbers).
…und) trim() calls find_last_adj(end, c.end(), p) once its cuts reach the polyline's end. The legacy then formed begin + 1 past the end and read *end (asan-ubsan: heap-buffer-overflow in TilerLegacy_intersection.intersection_poly). An empty range now returns end, which ends trim()'s loop as the legacy meant to.
…tiler-surfaces # Conflicts: # .github/workflows/ci.yml # docs/roadmap/VOLROVER-LIBRARY-PORTS-ROADMAP.md # src/cvc/CMakeLists.txt # src/cvc/tests/port_tests.cmake
transfix
added a commit
that referenced
this pull request
Nov 18, 2026
…twin TilerIntrinsicsAriadne.AnActionStartsItUnderTheDefaultLimits (#1334) tiles a 30-slice tube through an action's frame loop under ctest's default 300 s and a 300 s loop of its own. It takes 109-111 s in a Debug job (two other branches' package-linux / libcvc-debug runs today); on #1351's run 44274032889 the runner was 3-5x slower (the segmentation twin took 548 s, the skeleton's 31 s against 10 s) and it timed out three times. Its segmentation twin got ctest TIMEOUT 900 and a 900 s loop for the same reason; this gives it the same.
transfix
added a commit
that referenced
this pull request
Nov 18, 2026
…tprint (after #1349) (#1351) * water: fade each glitter ripple by its own pixel footprint, twelve of them The rings on terrain_lab's lake were the A4 shading's glitter ripples (oMicroSlope) aliasing. They faded together as the isotropic footprint (the geometric mean of the pixel's axes) grew from 0.12 m to 0.5 m. At a grazing angle the mean hides the long axis: from 140 m at 10 degrees a pixel is 0.1 m across the view and 0.58 m along it, the mean read 0.24 m and kept 80 % of the waves, and the pixel sampled them along the view at under two pixels a crest. A fixed wave sampled past that aliases into a zone plate: evenly spaced rings round the screen point where it is one crest a pixel. They kept their place on the screen when the orbit centre moved; with the ripples off they were gone. Each ripple now fades by how far its own phase turns across the pixel (the rest position's screen derivatives, along the wave's direction): whole within an eighth of a turn, gone at a quarter. The variance it drops goes to the GGX lobe, as the shared fade's did. oWaterFull takes the derivatives (dpx, dpy), which both callers (the water node, lsystem_coast) already take before any branch. Twelve ripples in place of six (1.7 m down to 0.43 m in equal ratios, golden-ratio directions within 0.95 rad of the wind, scattered phases): six fixed waves of equal steepness sum to a pattern that repeats, read as regular parallel ridges near the camera at 16 m/s and, once the rings were gone, a diagonal lattice further off. With the ripples off the near grid's own waves leave the lake almost flat, so they carry its texture. * water: the ripples skip a pixel too coarse for them, from constant tables A pixel too coarse for the longest ripple whichever way it runs (k times its shortest axis, bounded below by its area over the root of its axes' squares, at least a quarter turn) skips the loop, as the shared fade skipped it past 0.5 m: far water costs what it did. The wavenumbers, frequencies and direction cosines are constants, not worked out per fragment. Measured with a scratch harness (oWaterFull on a full 1280 x 720 quad, glFinish over 100 quads, old and new alternated 12 times, Intel Arc iGPU): 0.081 ms a frame more than the six ripples' 0.087 where every ripple is resolved, 0.054 on terrain_lab's grazing view, 0.001 where none is. * water: the cascades' slopes per fragment, filtered at the pixel's footprint The near grid took its normal from its vertices (central differences 1-4 m wide over 2-8 m triangles), which drops every wave under about 4 m, a lake's short-cascade peak; the far grid took central differences of nearest texels per fragment. OceanCascades now writes each cascade's height slopes (the spectrum's own dh/dx and dh/dy, which the time pass works out for the Jacobian's buffers) into a layer of an RG16F 2D texture array, one pass with a draw buffer a layer, and mipmaps it. Both grids read it per fragment with textureGrad at their own footprint (anisotropic where the context can), so the waves a pixel cannot resolve average away instead of aliasing. The near grid's vertex normal carries only the swell; oWaterFull's nstep is 0 (nothing coarser than the pixel bounds the normal). One more fragment sampler: cvcgl_ariadne_realize's 16-unit scene draws with none short. vtkOpenGLFramebufferObject::AddColorAttachment attaches a texture array's layer as a 2D texture and leaves the attachment empty, so the layers are attached with glFramebufferTextureLayer. cvcgl_ocean_fft checks the layers against the height tiles' central differences (correlation 0.93-0.96, ratio 1.11-1.19 at N = 64) and counts the pass (3 + 2 log2 N). On terrain_lab's sheltered lake little changes: the lee scales the cascades to about 0.06-0.3, and the ripples, which take the share the lee removes, still carry most of the near texture. With the lee off at 16 m/s the cascades' slopes draw a short-crested sea. No rings in any view. Cost (scratch harness, full 1280 x 720 quad, Intel Arc iGPU): near grid +0.018 ms close, +0.051 ms grazing; far grid -0.085 ms, -0.07 ms grazing (two filtered reads in place of eight nearest fetches); slope pass and mipmaps +0.08 ms a frame. * tests: the tiler's action test gets the segmentation's 900 s, as its twin TilerIntrinsicsAriadne.AnActionStartsItUnderTheDefaultLimits (#1334) tiles a 30-slice tube through an action's frame loop under ctest's default 300 s and a 300 s loop of its own. It takes 109-111 s in a Debug job (two other branches' package-linux / libcvc-debug runs today); on #1351's run 44274032889 the runner was 3-5x slower (the segmentation twin took 548 s, the skeleton's 31 s against 10 s) and it timed out three times. Its segmentation twin got ctest TIMEOUT 900 and a 900 s loop for the same reason; this gives it the same.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
P3b part 2 of the VolumeRover library ports (
docs/roadmap/VOLROVER-LIBRARY-PORTS-ROADMAP.md§3, §7): the tiler from #1332 on the command line, in pycvc and in the DSL.The core, #1332, merged on 2026-11-17 (10c5d3a). This PR now targets master, with master merged in, and its diff is only the surfaces.
What it adds
tiler.tile(inc/cvc/geometry/tiler_intrinsics.h):tile_contours_jobbehindcvc/core/job_intrinsics.h's three forms,tiler.tile,-asyncand-start.tile_params' fields;params.defaults "tiler.tile"lists them.surfaces(component name to acvc::geometrydata object) andwarnings. The roadmap's table said a plain dict of surfaces; thewarningsentry keeps a skipped contour's warning, and the table is updated.-startpublishes the job keys under its target; a node's target is<node>.tiler(§3).add_tiler_intrinsics(app)registers it for Ariadne documents, asadd_skeleton_intrinsicsdoes.cvc tile: reads any contour format (.ser,.contour,.cvcc, ...) and writes<outdir>/<basename><component>_tiles.<ext>per component, plus<basename>_tiles.<ext>for all components, as the legacy tool did.tile_params' table.cl_parseflags are rewritten to them:-C -e -r -v,-c/-x(exact names, escaped into--include/--excludepatterns),-s first last,-z(slice spacing),--color r g b,-d -b -n,-o raw,--printcomponents. So VolumeRover2's free-text default-C 0.01 -e 1e-15 -o rawworks as is.-i -p -R -B -T -O -P -V -U),-f, and-m,-F,-S -1, which the legacy ignored for a series.-o gnuplot,-Iand smoothing (-S n).cvc tile in.ser -o outdirbecame-d outdir, since-ostays the legacy output format.pycvc_tiler.i,pycvc_jobs.i):pycvc.tile_contours(stack, curation_delta=0.01, ...)takestile_paramsor its fields as keywords, and releases the GIL. Bad input raises ValueError.names(),surface(name)(KeyError for a component with none),surfaces(a dict of geometries) andwarnings.pycvc.tile_contours_job(...)is the resumable job.The one thing the keys don't carry is the slice pair being tiled.
job_keyspublishesstatusonly at start and finish, andphaseas "tiling 42%".tile_stepper::label()has the pair, for P4'scontour_labto show in its progress bar. Publishing it through the shared job keys would change every port's keys, so it is left for P4.Tests
tiler_intrinsics_test(T10), 9 tests:curation_deltathe slices are too close for;params.defaults;job.canceland kill;tiler.tile-startunder the default limits, with<node>.tiler.progressrising across frames.It joins
CVC_PORT_TESTS(the wasm lane) andSAN_CXX_TESTS(ci.yml, a one-line change).cvc_cli_test(T12): help, a tube, the legacy flags (component filters, slice range, base name, colour,--printcomponents, notes), and bad input.test_pycvc_tiler.py(T11): a tube, keywords and params, ValueError, another thread running during the call, the job's steps and cancel.Checked locally:
tiler_intrinsics_test9/9;cvc_cli_test*Tile*4/4 (and*Skeleton*4/4); ctestpycvc_tiler,pycvc_jobs,pycvc_skeleton,pycvc_contours,pycvc_segmentationandpycvc_paramspass.tiler_intrinsics_test9/9. The local relink drops NODERAWFS on Windows; the test reads no files.cvc tileon the committedbranchseries writes both surfaces and reports the legacy's untiled-region warning.Not checked locally: Linux and macOS, the sanitizer lanes, the singleton scan (no statics added). CI runs all of these.