Repository navigation
feat(v0.4.0): GP-guided autonomous DFXM Scout-and-Zoom, ask-tell agent API, operando sync & Red-Team hardening - #19
Merged
Conversation
…nc, uncertainty & batched DINOv2
…team physics hardening
…ng, UCB/EI acquisition, and ask-tell API
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.
Summary
Implements BraggTrack
v0.4.0, adding GP-guided autonomous Dark-Field X-ray Microscopy ("Scout-and-Zoom") target selection, aBluesky-Adaptivestyletell / ask / reportcausal streaming agent, operando electrochemistry synchronization, batchedDINOv2ViT inference,darfix/ ESRF BLISS auto-calibration, and comprehensive Red-Team crystallographic & live-streaming hardening:Gaussian Process Trajectory Forecasting, Bayesian Acquisition &
tell / ask / reportAgent (braggtrack.autonomous,braggtrack-watch)gp.py): Combines inverse-variance-weighted linear trend estimation with aMatérn(nu=1.5)Gaussian Process (scikit-learn, zero extra dependencies) weighted by analytical Poisson centroid variances (alpha = sigma_pos**2) to forecast smooth(mu, chi, d)setpoints across uniform or irregularelapsed_stimestamps and size1-sigmarocking windows from posterior uncertainty.ucb,ei,max_variance): Ranks candidate grains via Upper Confidence Bound, Expected Improvement, or pure Kriging variance exploration, with optional multi-fidelity GP conditioning on measured high-resolution DFXM zoom outcomes (tell_zoom_outcome).Bluesky-AdaptiveAgent Protocol (streaming.py): Exposes decoupledtell(),ask(),tell_zoom_outcome(), andreport()methods alongsidesliding_window_scans=24) for constant per-scan latency across1,000+scan operando campaigns.trigger.py,replay.py,watch_autonomous.py): Supports--mode {replay, shadow, watch, active},--acquisition {ucb, ei, max_variance}, diffractometer motor soft-limit clamping, electrochemical voltage windows, per-lineage X-ray dose caps, synchrotron beam-dump suppression, and closed-loop baseline evaluation (mean_setpoint_mae, pre-split recall/precision/lead time vsbrightest_intensity,strain_only,random).Ancestor-Referenced Kinematics & Analytical Strain Uncertainties (
segmentation/features.py,tracking/kinematics.py)detector_gain-aware) +1/12voxel quantization centroid errors intostrain_err, ancestor-referencedlineage_strainacross1 -> 2+splits, wall-clockstrain_rate_per_s, and Hungarian runner-upassignment_margin.Operando Electrochemistry Synchronization (
io/operando_log.py,viz/operando.py).csv/.tsvand Biologic.mptparsing with Savitzky–Golay regularizedplot_operando_strain_and_events).Batched
DINOv2ViT Inference & Zero-Configdarfix/ ESRF BLISS Compatibility (semantic/dino.py,io/nexus.py)embed_batch,extract_patch_features_batch, aspect-ratio-preserving square letterbox MIP padding, and automaticNXdata@signal/@axes+ BLISSinstrument/positionerscalibration.Red-Team Crystallographic, Streaming & Security Hardening (
test_redteam_hardening.py)PositionShapeCost,resolve_track_gaps, andresolve_splits_and_merges, plusmechanical_splitvsphase_split(H2 -> H3) disambiguation.kurtosis_{mu,chi,d}), boundary truncation flags (touches_rocking_border),float32segmentation, and sub-voxel plateauh_maxima_seeds.swmr=Truereaders, file quiescence checks, partial-write resilience, strict--configkey validation, and CSP + HTML escaping ingenerate_html_report.Ecosystem Positioning & Literature (
docs/positioning.md,paper.md,paper.bib,.github/workflows/release.yml)BraggTrackalongsidedarfix,ImageD11,HEXRD,BraggNN,TrackMate 7,LapTrack,gpCAM(@Noack2021),Bluesky-Adaptive(@Maffettone2023),ANDiE(@McDannald2022),Kalinin(@Kalinin2021), and the Facility Autonomy Levels (FAL) taxonomy (@LeHouxFAL2026,@Lu2025).Verification
ruff check&ruff format --checkacrossbraggtrack/,tests/,scripts/(0issues)pytest tests/(250 passed)python scripts/ci_report.py(overall=PASSacross all 9 acceptance gates)python scripts/pre_pr_check.py(pre_pr_check=PASS)jupyter nbconvert --to notebook --execute notebooks/braggtrack_demo.ipynb(clean execution)