Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions docs/dev/debug_env_vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,18 @@ and release builds.
| `DELAUNAY_LARGE_DEBUG_BALL_RADIUS` | **value** | Radius for ball distribution |
| `DELAUNAY_LARGE_DEBUG_BOX_HALF_WIDTH` | **value** | Half-width for box distribution |
| `DELAUNAY_LARGE_DEBUG_CONSTRUCTION_MODE` | **value** | `new` (batch) or `incremental` |
| `DELAUNAY_LARGE_DEBUG_DEBUG_MODE` | **value** | `cadenced` or `strict` |
| `DELAUNAY_LARGE_DEBUG_INITIAL_SIMPLEX` | **value** | Batch initial simplex strategy: `first` (default) or `balanced` |
| `DELAUNAY_LARGE_DEBUG_DEBUG_MODE` | **value** | `cadenced` (ridge-link) or `strict` (per-insertion vertex-link) |
| `DELAUNAY_LARGE_DEBUG_SHUFFLE_SEED` | **value** | Vertex shuffle seed |
| `DELAUNAY_LARGE_DEBUG_PROGRESS_EVERY` | **value** | Progress logging interval |
| `DELAUNAY_LARGE_DEBUG_VALIDATE_EVERY` | **value** | Validation interval |
| `DELAUNAY_LARGE_DEBUG_REPAIR_EVERY` | **value** | Repair interval |
| `DELAUNAY_LARGE_DEBUG_REPAIR_EVERY` | **value** | Batch/incremental repair interval (default: 4) |
| `DELAUNAY_LARGE_DEBUG_REPAIR_MAX_FLIPS` | **value** | Flip budget override |
| `DELAUNAY_LARGE_DEBUG_MAX_RUNTIME_SECS` | **value** | Timeout (0 = no cap) |
| `DELAUNAY_LARGE_DEBUG_ALLOW_SKIPS` | presence | Allow vertex insertion skips |
| `DELAUNAY_LARGE_DEBUG_MAX_SKIP_PCT` | **value** | Maximum skipped-vertex percentage before failing (default: 5.0) |
| `DELAUNAY_LARGE_DEBUG_ALLOW_SKIPS` | presence | Allow any number of vertex insertion skips |
| `DELAUNAY_LARGE_DEBUG_SKIP_FINAL_REPAIR` | presence | Skip final global repair pass |
| `DELAUNAY_BATCH_REPAIR_TRACE` | presence | Trace cadenced batch-repair seed counts, flips, queues, and elapsed time |
| `DELAUNAY_LARGE_DEBUG_PREFIX_TOTAL` | **value** | Total prefix probes for bisect mode |
| `DELAUNAY_LARGE_DEBUG_PREFIX_MAX_PROBES` | **value** | Max probes per bisect run |
| `DELAUNAY_LARGE_DEBUG_PREFIX_MAX_RUNTIME_SECS` | **value** | Bisect probe timeout |
Expand Down
43 changes: 43 additions & 0 deletions src/core/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,49 @@ impl InsertionStatistics {
}
}

/// Release-visible telemetry for one transactional insertion.
///
/// These counters are intended for aggregate diagnostics rather than stable performance
/// benchmarking. They let batch construction report whether insertion time is dominated by
/// point location, scan fallbacks, local conflict regions, or global exterior-point scans.
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
pub(crate) struct InsertionTelemetry {
/// Number of point-location calls performed for this insertion.
pub locate_calls: usize,
/// Total facet-walk steps across all point-location calls.
pub locate_walk_steps_total: usize,
/// Maximum facet-walk steps taken by a single point-location call.
pub locate_walk_steps_max: usize,
/// Number of point-location calls that used the caller-provided hint.
pub locate_hint_uses: usize,
/// Number of point-location calls that fell back to a brute-force scan.
pub locate_scan_fallbacks: usize,
/// Number of point-location calls that ended inside a cell.
pub located_inside: usize,
/// Number of point-location calls that ended outside the convex hull.
pub located_outside: usize,
/// Number of point-location calls that ended on a lower-dimensional feature.
pub located_on_boundary: usize,

/// Number of local conflict-region computations observed by insertion.
pub conflict_region_calls: usize,
/// Total number of cells in local conflict regions.
pub conflict_region_cells_total: usize,
/// Maximum number of cells in a single local conflict region.
pub conflict_region_cells_max: usize,

/// Number of global exterior-point conflict scans.
pub global_conflict_scans: usize,
/// Total cells scanned by global exterior-point conflict scans.
pub global_conflict_cells_scanned: usize,
/// Total cells found by global exterior-point conflict scans.
pub global_conflict_cells_found_total: usize,
/// Maximum cells found by a single global exterior-point conflict scan.
pub global_conflict_cells_found_max: usize,
/// Wall-clock nanoseconds spent in global exterior-point conflict scans.
pub global_conflict_scan_nanos: u128,
}

/// Ephemeral insertion state used by Delaunay triangulations.
#[derive(Clone, Copy, Debug)]
pub(crate) struct DelaunayInsertionState {
Expand Down
Loading
Loading