Skip to content

perf(geometry): int32 vtkOriginalPointIds + width-agnostic hardware-selection#79

Merged
akaszynski merged 1 commit into
mainfrom
feat/int32-original-ids
Jun 19, 2026
Merged

perf(geometry): int32 vtkOriginalPointIds + width-agnostic hardware-selection#79
akaszynski merged 1 commit into
mainfrom
feat/int32-original-ids

Conversation

@akaszynski

Copy link
Copy Markdown
Member

Summary

Two coupled changes that make the width-relaxed int32 rule safe for named public id arrays (not just vtkCellArray connectivity):

  1. Render hardware-selection is now width-agnostic. The GPU picking path remaps a picked pixel's raw VTK point/cell id to the value in a passthrough id array. It previously did vtkArrayDownCast<vtkIdTypeArray>(...), which returns null on an int32 array → the remap was silently skipped → wrong picked ids. All four mappers (vtkOpenGLPolyDataMapper, plus the Batched, LowMemory, and LowMemoryBatched variants) now fetch the array as vtkDataArray and read values via GetComponent (exact for ids < 2^53, identical to the former vtkIdType GetValue), including the UpdateMaximumPointId/CellId id-bit-sizing paths.

  2. vtkGeometryFilter::PassPointIds stores vtkOriginalPointIds as int32-when-fits (templated PassPointIdsFill), halving its footprint on large extracted surfaces. Values are sacred; only the container width narrows.

New validation: a hardware-selection (picking) gate

Neither the bitexact nor the pixel-exact gate exercises selection, so this PR adds one (tests/renderexact/run_select.py + compare_select.py, wired into ci/run-renderexact.sh under the same software-EGL driver). It renders the surface of a hex lattice with the mapper remapping picked point ids through vtkOriginalPointIds, runs a full-viewport vtkHardwareSelector POINT selection, and asserts fvtk's selected original-id set equals stock's. The lattice makes original ids a non-identity map of surface ids, so a dropped int32 remap would change the result — the gate is discriminating.

Validation (executor build + manylinux_2_28 container)

  • bitexact 262/262op_geometry / op_geometry_ugrid / op_geometry_ugrid_mixed now enable PassThroughPointIdsOn, so the int32 vtkOriginalPointIds array is compared against stock's int64 (width-normalized → values match).
  • selection gatesurface_pointpick: 54 selected ids match (stock dtype=int64, fvtk dtype=int32).
  • pixel-exact render — unchanged, byte-identical.

Dependency / merge ordering

Carries the width-relaxed integer comparison in tests/bitexact/compare.py (compare integer arrays by value cast to int64). This is identical in intent to the change in the vtkCellArray-int32 PR (#76) — land #76 first and this hunk de-dupes on rebase. Without it, the int32-vs-int64 dtype mismatch reds the suite.

Follow-ups (not in this PR)

PassCellIds int32 (template the CompositeCellIds OrigIds pointer + add cell-picking to the gate), vtkDataSetSurfaceFilter (10 sites), vtkStripper.

🤖 Generated with Claude Code

…tic selection

vtkGeometryFilter::PassPointIds now stores the vtkOriginalPointIds passthrough
array in an int32 container when every input point id fits in 0x7FFFFFFF (else
int64), halving its footprint on large extracted surfaces. Values are sacred;
only the container width changes.

This is only safe because the render hardware-selection path reads point/cell id
passthrough arrays width-agnostically: vtkOpenGLPolyDataMapper (and the Batched,
LowMemory, and LowMemoryBatched variants) previously did
vtkArrayDownCast<vtkIdTypeArray>(...) which returns NULL on an int32 array,
silently skipping the picked-id remap. They now fetch the array as vtkDataArray
and read values via GetComponent (exact for ids < 2^53, identical to the former
vtkIdType GetValue), including the UpdateMaximumPointId/CellId id-bit-sizing
paths.

Validation:
  * bitexact: op_geometry / op_geometry_ugrid / op_geometry_ugrid_mixed now
    enable PassThroughPointIdsOn, so the int32 vtkOriginalPointIds array is
    compared against stock's int64 (width-normalized -> values must match).
  * NEW selection gate (tests/renderexact/run_select.py + compare_select.py,
    wired into ci/run-renderexact.sh): renders the surface of a hex lattice with
    the mapper remapping picked point ids through vtkOriginalPointIds, runs a
    full-viewport vtkHardwareSelector POINT selection, and asserts fvtk's
    selected original-id set equals stock's. The lattice makes original ids a
    non-identity map of surface ids, so a dropped int32 remap would change the
    result -- the gate is discriminating.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@akaszynski akaszynski force-pushed the feat/int32-original-ids branch from a34dc2a to 8203d5b Compare June 19, 2026 22:20
@akaszynski akaszynski merged commit 8203d5b into main Jun 19, 2026
9 checks passed
@akaszynski akaszynski deleted the feat/int32-original-ids branch June 19, 2026 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant