Skip to main content

Module pipeline_diagnostics

Module pipeline_diagnostics 

Source
Expand description

Structured per-load pipeline diagnostics — the cross-target contract.

Lives in ifc-lite-processing (not the geometry crate) because this is where the per-phase numbers are actually collected: the phase timers (ProcessingStats.{parse,entity_scan,lookup,preprocess,geometry}_time_ms) are measured by processor::process_geometry_*, and the per-element production counters (degenerate-backstop drops, CSG failure drains) are owned by element::produce_element_meshes. The geometry crate only knows router-level CSG/opening data, which it already publishes as ifc_lite_geometry::GeometryDiagnostics; this struct composes those aggregates with the pipeline-level timings and counts.

Serde contract: camelCase renames plus an explicit schema_version, the same pattern as GeometryDiagnostics (see its serializes_camelcase_keys_matching_the_ts_contract guard, mirrored below). The wasm getter (IfcAPI::getPipelineDiagnostics) crosses it to JS via serde_wasm_bindgen::to_value, exactly like diagnoseGeometry.

Population:

  • wasm: the LIVE channel. Accumulated on the NORMAL load path — every processGeometryBatch* call folds one [Self::record_batch] in (cheap counters plus two js_sys::Date::now() reads per batch, so it is always on). std::time::Instant traps on wasm32, so only phase_ms.geometry_ms/ total_ms are filled; the scan/prepass phases run in JS workers outside the wasm module and stay 0.
  • native: [Self::from_processing_stats] maps a finished ProcessingStats (all phase timers available) into this shape. It is provided for a native consumer that wants the unified vocabulary, but is NOT wired into a live server/CLI pipeline today — those surface the same numbers directly via ProcessingStats + GeometryDiagnostics. So the wasm getter is the only shipping producer; the native constructor is available API, not a second projection kept in lockstep.

Structs§

PipelineDiagnostics
Aggregate structured diagnostics for one model load. Counter names are aligned with the existing GeometryDiagnostics contract (total_csg_failures, hosts_with_openings, rect_fast, …) so a consumer reading both sees one vocabulary.
PipelinePhaseTimings
Pipeline phase wall-times in milliseconds. Field names mirror the ProcessingStats timers they are sourced from. On wasm32 only geometry_ms is populated (see the module docs).

Constants§

PIPELINE_DIAGNOSTICS_SCHEMA_VERSION
Version of the PipelineDiagnostics wire shape. Bump on any breaking key change so JS consumers can gate on it.