Skip to content

feat(v0.2.0): fracture lineage DAG, persistent precursors, axis calibration, and reproducible pipeline - #17

Merged
jameslehoux merged 1 commit into
mainfrom
feat/v0.2-fracture-tracking-and-pipeline
Nov 17, 2026
Merged

jameslehoux merged 1 commit into
mainfrom
feat/v0.2-fracture-tracking-and-pipeline

Conversation

@jameslehoux

Copy link
Copy Markdown
Contributor

Summary

Completes the v0.2.0 milestone for BraggTrack across beamline ingestion, foundation-model compatibility, 4D fracture/coalescence lineage tracking, and single-command reproducible execution:

  1. ESRF-ID03 Ingestion, Physical Axis Calibration & 3-Axis Kinematics

    • Added AxisCalibration (voxel_to_physical(z, y, x) -> (mu, chi, d)) and NeXus/HDF5 auto-discovery (/entry_0000/ESRF-ID03/pco_nf/data, /entry*, NXentry, sibling mu/chi/d datasets, and generic *.h5/*.nxs/*.hdf5 fallback).
    • Scaled centroids, covariances, and eigenvalues in extract_instance_table while preserving integer voxel bbox_* coordinates for lossless 3D ROI cropping.
    • Vectorised remove_small_objects, merge_nearby_labels (6-connected face adjacency + bincount centroids), and relabel_sequential.
    • Extended kinematics.py with delta_d, calibrated_axes, and automatic kinematics.csv / kinematics_summary.json export in braggtrack-track-dataset.
  2. Public DINOv2 Default & Dynamic DINOv3 Compatibility

    • Switched DEFAULT_DINO_MODEL to public, ungated facebook/dinov2-small for zero-auth local, CI, and Colab execution while retaining full facebook/dinov3-vitb16-pretrain-lvd1689m compatibility via dynamic prefix/register token skipping (skip = max(0, seq_len - expected_patches)).
    • Updated braggtrack-segment-dataset to compute temporally smoothed Otsu thresholds (--smooth-window 5) in two O(1)-memory streaming passes.
  3. 4D Split/Merge Lineage DAG & Persistent Fracture Precursors

    • Added braggtrack/tracking/events.py (resolve_splits_and_merges) resolving 1 -> 2+ grain fracture splits and 2+ -> 1 coalescence merges with spatial gating, cosine similarity, fragment share bounds, intensity conservation, and Pass 0 cross-detector Hungarian jump-edge pruning.
    • Added braggtrack/tracking/precursors.py (compute_fracture_precursors) combining shape anisotropy, plateau-safe 3D ROI sub-peak multiplicity (peak_local_max), multi-view MIP patch cosine dispersion, and contiguous min_persistence filtering.
    • Added generate_fracture_scenario benchmark and braggtrack-events CLI (events.v1 schema).
  4. End-to-End Orchestrator, Statistical Ablation, Notebooks & Docs

    • Added braggtrack-run (braggtrack/cli/run_pipeline.py) chaining validate -> segment -> embed -> track -> events and emitting run_manifest.json (manifest.v1) with SHA-256 input checksums, git commit provenance, and per-stage profiling.
    • Added bootstrap 95% confidence intervals (--bootstrap-samples, --seed) to scripts/ablation_semantic.py.
    • Added events_acceptance gate (scripts/check_events_acceptance.py) to scripts/ci_report.py.
    • Updated and executed both notebooks/braggtrack_demo.ipynb and notebooks/dino_segmentation_comparison.ipynb, plus README.md, docs/architecture.md, CHANGELOG.md, and paper.md.

Verification

  • ruff check braggtrack/ tests/ scripts/ & ruff format --check braggtrack/ tests/ scripts/ — PASS
  • python scripts/pre_pr_check.py — PASS
  • pytest tests/ -v --cov=braggtrack — PASS (215 passed, 83%+ coverage)
  • python scripts/ci_report.py — PASS (overall=PASS across all 8 acceptance gates)
  • jupyter nbconvert --to notebook --execute on both notebooks — PASS

@jameslehoux
jameslehoux merged commit dee464b into main Nov 17, 2026
10 checks passed
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