Skip to content

Python tool for aircraft Doppler audio geolocation using historical ADS-B flight data (Source-available)

Verify real upload stages and prune irrelevant association clocks

Cinna Davisa3b1cd4c1ecd
diff --git a/README.md b/README.md
index 9baa931..efb9267 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@ DOPPLERGEIST investigates **where an audio recording was made** by comparing the
| Local upload application | CLI/API orchestration, persistent jobs and inspectable browser results on `main` | `dopplergeist analyze`, `dopplergeist serve` and `dopplergeist job`; see [Local upload workflow](docs/PRODUCT.md) |
| Independent location validation | Real-audio discovery, browser upload and measured-session experiments; no accepted blind real localization | [Real-data verification](#real-data-verification-2026-11-03); [acceptance #13](https://github.com/1337isnot1337/DOPPLERGEIST/issues/13) and [field recordings #53](https://github.com/1337isnot1337/DOPPLERGEIST/issues/53) remain open |
-Start with automatic discovery on a real recording below. The upload application contains intake, discovery, acquisition, geographic search and decision stages. The verified one-hour real MP3 upload stopped before geographic search because no defensible UTC recording start time was available. Current validation uses real recordings and measured trajectories. New synthetic experiments are stopped. Historical results remain documented.
+Start with automatic discovery on a real recording below. The upload application contains intake, discovery, acquisition, geographic search and decision stages. An undated one-hour real MP3 upload stopped at the recording-time gate. A separate development replay supplied the historical fitted clock interval and verified every stage with returned hypotheses; it remained inconclusive because search and data coverage were incomplete. Current validation uses real recordings and measured trajectories. New synthetic experiments are stopped. Historical results remain documented.
## Quickstart
@@ -99,10 +99,12 @@ These experiments used real recordings. The reference replay also used historica
| --- | --- | --- |
| Configured reference replay, installed package and fresh checkout | **43.8585 m** from the public reference; 3,587 trajectory segments, 2,525 coarse grid points and 283 ranked rows | Real audio and flight data, but source-informed event windows, frequency bands and regional bounds. The reference coordinate is not surveyed. `accepted_location=false` and model support remains incomplete. |
| Complete one-hour reference MP3 in actual Chromium | 42,085,293-byte upload, 16 acoustic proposals, persistent job and loaded diagnostics, and zero location cards | `needs_input / recording_time_required`. The original sample-zero UTC is unknown, so geographic search did not run. |
+| Complete reference MP3 through HTTP, with source-informed clock | 16 independent groups, 18 ridge records and 23 hypotheses; intake through decision verified, followed by browser display and reload | `inconclusive / search_incomplete`. Two tiles exhausted the association budget and 86 lacked terrain. The leading diagnostic hypothesis was about 66 km from the public reference. Regional inputs and a fitted clock do not establish independent accuracy. |
| Four original NASA acoustic recordings with measured GPS | Cub107, Edge038 and Edge066: zero proposals. Edge065: one proposal and a **474.0 m** conditional best grid point | The Edge065 event may be a background aircraft, not the measured drone. **568/4,200** grid points lack support and another mode is 1,899 m from the microphone. No validated localization. |
+| Original 246.8-second WSU recording with measured drone telemetry | Four automatic proposals; zero supported fits in 4,992 attempts | Every proposal extends before the published trajectory support. No coordinate or accepted location; supplied trajectory and uncertain relative timing. |
| 40 real smartphone aircraft recordings (automatic MP3 discovery) | Proposals in **36/40** recordings, with 136 groups total | All 40 jobs required recording-time evidence. Groups are not confirmed aircraft detections, and none returned a location. |
-The reference replay and browser upload test different paths. The replay performs a geographic ranking with supplied research settings. The browser test starts with an unconfigured MP3 upload but stops at the missing recording-time gate. The NASA tests use supplied aircraft trajectories and a restricted footprint. They do not test automatic historical flight association.
+These experiments test different paths. The configured replay supplies research settings. The undated browser upload stops at the missing recording-time gate. The timed HTTP replay uses automatic events and the default CONUS request, but only 256 coarse points and 243 refinement points were actually scored; most completed tiles were empty because the flight index is regional. The NASA and WSU tests use supplied trajectories and restricted footprints. They do not test automatic historical flight association. See the [full HTTP replay instructions](benchmarks/README.md#real-reference-full-http-pipeline) and [compact results](benchmarks/real-http-2026-11-03/summary.json).
The [worker report](docs/verification/WORKER_E2E_2026-11-03.md) records inputs, source revisions, outcomes and limits. See the [configured replay workflow](https://github.com/1337isnot1337/DOPPLERGEIST/actions/runs/41580126694), [passing real Chromium job](https://github.com/1337isnot1337/DOPPLERGEIST/actions/runs/41580605939/job/125734292619), [passing NASA job](https://github.com/1337isnot1337/DOPPLERGEIST/actions/runs/41580450522/job/125733788989) and [40-recording result table](benchmarks/real-discovery-20261103.csv). The configured replay *step* passed in the first workflow, but that workflow ended in failure due to separate verifier and downloader defects. Both utility defects were fixed and their own jobs passed.
diff --git a/benchmarks/README.md b/benchmarks/README.md
index bee74dd..836b1df 100644
--- a/benchmarks/README.md
+++ b/benchmarks/README.md
@@ -227,3 +227,145 @@ synthetic data were generated, and all original negative results are retained.
The reusable CLI was also run against all four originals with the isolated
installed package. Preparation, default search, evaluation and the shorter-window
search all completed and reproduced the proposal counts above.
+
+## Real WSU supplied-trajectory session benchmark
+
+`scripts/benchmark_wsu_session.py` processes the complete 246.8-second recording
+from WSU's October 11, 2024 flight 5, using device 1/channel 1 selected before
+acoustic inspection. The [dataset](https://doi.org/10.26183/07nm-4p35) and
+[publisher README](https://rds.westernsydney.edu.au/Centres/ICNS/2026/Jahir_Rodriguez/README.md)
+credit Belman Jahir Rodríguez, Sergio F. Chevtchenko, Marcelo Herrera Martínez,
+Yeshwanth Bethi and Saeed Afshar. External recordings and metadata retain their
+CC BY-SA 4.0 license. This repository's adapter is independently written.
+
+Retrieve these four original public inputs into a new directory. The adapter
+checks their pinned lengths and hashes; these identify the versions downloaded
+for the experiment and are not publisher-issued checksums.
+
+```sh
+mkdir -p data
+mkdir data/wsu-test1-originals
+wsu_source='https://rds.westernsydney.edu.au/Centres/ICNS/2026/Jahir_Rodriguez'
+wsu_flight="$wsu_source/dataset/test_1/Oct_11_2024/flight_5"
+curl -fL "$wsu_flight/device_1_nosync.wav" -o data/wsu-test1-originals/device_1_nosync.wav
+curl -fL "$wsu_flight/Oct-11th-2024-03-49PM-Flight-Airdata.csv" -o data/wsu-test1-originals/flight.csv
+curl -fL "$wsu_flight/alignment_params.json" -o data/wsu-test1-originals/alignment_params.json
+curl -fL "$wsu_source/dataset/test_1/Oct_11_2024/ref/DJIFlightRecord_2024-10-11_%5B14-32-34%5D.csv" -o data/wsu-test1-originals/reference.csv
+
+PYTHONPATH=src .venv/bin/python scripts/benchmark_wsu_session.py discover \
+ --audio data/wsu-test1-originals/device_1_nosync.wav \
+ --output results/wsu-new/discovery
+PYTHONPATH=src .venv/bin/python scripts/benchmark_wsu_session.py search \
+ --discovery results/wsu-new/discovery \
+ --flight-csv data/wsu-test1-originals/flight.csv \
+ --alignment data/wsu-test1-originals/alignment_params.json \
+ --output results/wsu-new/search
+PYTHONPATH=src .venv/bin/python scripts/benchmark_wsu_session.py evaluate \
+ --search results/wsu-new/search \
+ --reference-csv data/wsu-test1-originals/reference.csv \
+ --output results/wsu-new/evaluation.json
+```
+
+The original six-channel PCM32 WAV is 284,313,644 bytes at 48 kHz. The published
+alignment maps audio time 82.0 s to flight-log row 39 (elapsed time 3,900 ms).
+Every trajectory row is retained, using
+`audio_seconds = 82 + (flight_milliseconds - 3900) / 1000`. The resulting
+trajectory support is 78.1–241.1 s. Reference coordinates are opened only by
+`evaluate`; discovery reads only audio, and search uses only the supplied flight.
+This process separation is not a sealed holdout.
+
+| Stage | Recorded result |
+| --- | --- |
+| Complete-recording discovery, unchanged defaults | Four proposals, all at 60.0–82.0 s; 2.80 s, 505 MiB peak RSS |
+| Conditional search | All four proposals retained; 624 cells per scenario; constant-tone and 2% drift fits |
+| Motion support | Zero fully supported fits in 4,992 attempted fits; every proposal has ridge samples before the first measured flight state |
+| Final outcome | `no_supported_fit`; no coordinate, location error, or accepted localization |
+
+Discovery ran at `1aa763b`; final search ran at `a661424` in 2.31 s with 157 MiB
+peak RSS. The direct discovery/matching modules were unchanged between these
+revisions. No detector thresholds or event windows were adjusted after inspection.
+The four proposals remain unconfirmed sounds; missing trajectory support does
+not establish their source identity or a false-alarm rate.
+
+This low-speed multirotor case has limited Doppler variation. The measured log's
+maximum reported horizontal speed is 11.40 m/s. A post-result calculation using
+the published array reference and nominal 343 m/s sound speed gives radial speeds
+of -7.66 to +7.41 m/s and a 4.30% relative decline from the maximum modeled
+frequency factor to its minimum. The largest modeled decline among sampled
+12-second intervals is 3.35%, close to
+discovery's fixed 3% minimum. Discovery also requires at least 12 seconds,
+4 Hz decline and sustained ridge support. Some modeled intervals cross the
+fractional threshold, so low speed
+alone does not explain why frozen discovery and the supplied trajectory yielded
+no supported match.
+These telemetry calculations establish a difficult operating regime, not a
+diagnosed implementation defect or a measured rotor-frequency model.
+
+The camera-based audio/GPS alignment has no measured uncertainty. The WAV has no
+recording-clock tags; rounded UTC labels in the flight CSV do not establish the
+audio clock. Published MSL heights are used as a common-datum approximation, with
+flat receiver height derived from the initial aircraft altitude plus microphone
+height. The grid covers the supplied flight footprint plus 500 m, rounded outward
+to 100 m and sampled at 50 m cell centers. Clock error, altitude datum, weather,
+background aircraft, and microphone GPS uncertainty remain unresolved. This
+Australian supplied-flight experiment does not verify national acquisition,
+automatic flight identification, or the independent real-location acceptance gate.
+
+## Real reference full HTTP pipeline
+
+This development replay verifies actual intake, automatic discovery, input
+acquisition, tiled search, physical refinement and decision through the local
+HTTP service. It uses the complete real recording, no supplied acoustic windows,
+frequency bands or flight IDs, and the default CONUS request. Its restored flight
+index and terrain are regional and incomplete. Its 20-second recording-start
+interval surrounds a historical fitted clock, not an independently measured one.
+It cannot satisfy independent real-location acceptance.
+
+Restore the published inputs, build the partial index, and encode the entire
+recording. The helper refuses an existing output directory. FFmpeg's `-n` flag
+preserves an existing MP3.
+
+```sh
+.venv/bin/python scripts/restore_artifacts.py \
+ --bundle data-source --bundle data-adsb-derived --bundle data-terrain
+.venv/bin/python scripts/prepare_reference_upload.py \
+ --data-root data --output results/reference-upload-setup-new
+ffmpeg -n -nostdin -hide_banner -loglevel error \
+ -i data/source/reference-recording.wav -map 0:a:0 \
+ -codec:a libmp3lame -q:a 2 results/reference-whole-new.mp3
+.venv/bin/python scripts/verify_upload_http.py \
+ --audio results/reference-whole-new.mp3 \
+ --operator-config results/reference-upload-setup-new/operator.json \
+ --start-utc 2026-09-08T20:17:20Z --end-utc 2026-09-08T20:17:40Z \
+ --time-source 'Development interval around the historical fitted clock; not independently measured recording time' \
+ --expect-status inconclusive --require-full-pipeline \
+ --timeout-s 1800 --poll-interval-s 1 \
+ --output results/reference-http-new
+```
+
+At `a661424`, the actual upload completed in 253.71 seconds, with 16 independent
+groups, 18 ridge records and 23 returned hypotheses. All seven operational
+stages passed the strict verifier. The scientific decision remained
+`inconclusive / search_incomplete`; `supported_decision` was false.
+A fresh run after integration with upstream at `7df7c04` completed in 223.75
+seconds, again passing the strict verifier with the same leading hypothesis,
+counts and scientific status. The new audio resume checkpoint was created;
+this run did not test restarting an interrupted analysis.
+The leading diagnostic hypothesis was 65,998.78 m from the unsurveyed public
+reference, measured after outputs were frozen. It misses all three distance
+tiers, and this source-informed replay is ineligible for independent accuracy.
+
+The search completed 19,190 of 19,278 tiles. This count includes empty tiles:
+256 coarse points and 243 refinement points were actually scored, with possible
+overlap between the grids. Eighty-six tiles lacked terrain coverage and two
+exhausted the association budget. All 16 independent groups remained eligible;
+there was no two- or three-event cap. Separate real-point diagnosis found
+56 points in one failed tile that individually exceed 20,000 associations.
+Smaller tiles alone cannot remove that failure.
+
+The strict undated control returned `needs_input / recording_time_required`
+and correctly failed the full-pipeline requirement. A separate Chromium check
+loaded and reloaded the completed timed job, displayed its hypotheses and
+incomplete-coverage warnings, and reported no page errors. It did not rerun the
+analysis. Source revisions, measured runtimes and limits for these experiments
+are kept together in [the compact result](real-http-2026-11-03/summary.json).
diff --git a/benchmarks/real-http-2026-11-03/summary.json b/benchmarks/real-http-2026-11-03/summary.json
new file mode 100644
index 0000000..3f30c4e
--- /dev/null
+++ b/benchmarks/real-http-2026-11-03/summary.json
@@ -0,0 +1,436 @@
+{
+ "schema_version": 1,
+ "date_utc": "2026-11-03",
+ "scope": "Real-data operational verification and explicitly limited localization experiments",
+ "accepted_automatic_real_location_established": false,
+ "independent_national_accuracy_established": false,
+ "source_revision_basis": "Configured/undated backend and HTTP backend/verifier revisions were checked against recorded source hashes. Browser revision is inferred separately; no source-file hash manifest is duplicated here.",
+ "raw_artifact_locations": {
+ "reference_experiments": "/dev/shm/dopplergeist-e2e-0158",
+ "wsu_experiment": "/dev/shm/dopplergeist-wsu-0158",
+ "limit": "These workspace paths identify original outputs; this file preserves compact results, not a copy of raw recordings or run directories."
+ },
+ "reference_recording": {
+ "source_url": "https://www.youtube.com/watch?v=4CxVxuMVkMc",
+ "original_wav_sha256": "262d9c4eba1c80657813c604140ba2afbbaabed2b3aebc833cba7cafdc005e9f",
+ "complete_mp3_sha256": "e1c13dafd8d1634bbf84df843c31771318e15a31ebb86dd165af7ee312ab80a0",
+ "complete_mp3_bytes": 42085293,
+ "conversion": "Complete source WAV converted to MP3 without event or frequency selection"
+ },
+ "public_comparison_reference": {
+ "lat": 40.8766,
+ "lon": -73.5247,
+ "source_url": "https://app.osprey-watch.org/nest/3916",
+ "limit": "Rounded public reference; not a surveyed microphone position; uncertainty unquantified. Distance tiers are diagnostic comparisons, not accepted benchmark performance."
+ },
+ "configured_replay": {
+ "source_revision": "1aa763bde2cd0e0ca7e8c7a492748a21e953c3f2",
+ "entry_point": "dopplergeist run data/source/reproduce-local.json",
+ "raw_artifact_subdirectory": "results/configured-reference",
+ "scope": "configured_research_ranking",
+ "exit_code": 0,
+ "pipeline_elapsed_s": 48.44553686099971,
+ "process_elapsed_s": 51.39583562400003,
+ "process_peak_rss_kib": 822336,
+ "observations": 583176,
+ "trajectory_segments": 3587,
+ "manually_configured_events": 2,
+ "ranked_points": 283,
+ "accepted_location": false,
+ "model_support_complete": false,
+ "model_assessment_complete": false,
+ "best": {
+ "lat": 40.87693175890468,
+ "lon": -73.52498229500986,
+ "flight_ids": [
+ "a1dfeb:1",
+ "ace391:3"
+ ],
+ "recording_start_time_s": 1788898649.6620934,
+ "score": 5.608620381268416
+ },
+ "distance_to_unsurveyed_public_reference_m": 43.85847078233993,
+ "diagnostic_reference_distance_tiers": {
+ "within_100_m": true,
+ "within_500_m": true,
+ "within_1000_m": true
+ },
+ "eligible_for_independent_accuracy": false,
+ "unsupported_cpa_work_evaluations": 684,
+ "unreported_candidate_clock_envelopes": 290,
+ "limit": "Historical source-informed regional bounds and manual event windows/bands; reproduces a ranked hypothesis, not automatic independent localization."
+ },
+ "undated_negative_control": {
+ "backend_source_revision": "1aa763bde2cd0e0ca7e8c7a492748a21e953c3f2",
+ "verifier_code_later_committed_at": "a6614246c11f102ca382daee58df3e93129817a7",
+ "raw_artifact_subdirectory": "results/undated-strict",
+ "started_utc": "2026-11-03T05:23:06.899786Z",
+ "elapsed_s": 22.97885105199748,
+ "status": "needs_input",
+ "reason_code": "recording_time_required",
+ "http_checks_passed": true,
+ "pipeline_evidence_passed": true,
+ "candidate_count": 0,
+ "full_pipeline_requirements_met": false,
+ "verification_passed": false,
+ "supported_decision": false,
+ "verified_stages": [
+ "automatic_provenance",
+ "intake",
+ "discovery"
+ ],
+ "independent_event_groups": 16,
+ "ridge_records": 18,
+ "observed_verifier_exit_code": 1,
+ "expected_control_outcome_observed": true,
+ "regression": "The pre-patch inspector rejected these same real artifacts by comparing 16 independent groups with 18 ridge records. The patched inspector passes the evidence; strict full-path mode correctly rejects this early exit.",
+ "decoded_duration_s": 3600.1845
+ },
+ "automatic_http_configuration": {
+ "request": {
+ "schema_version": 1,
+ "search": {
+ "coverage": "conus"
+ },
+ "time_window": {
+ "start_utc": "2026-09-08T20:17:20Z",
+ "end_utc": "2026-09-08T20:17:40Z",
+ "source": "user",
+ "source_detail": "Development replay window around the historical two-event fitted recording start, 2026-09-08T20:17:29.662Z. This is source-informed timing, not an independently measured recording clock."
+ }
+ },
+ "event_and_frequency_selection": "automatic_whole_recording",
+ "flight_data_scope": "Regional real observations; incomplete for requested CONUS coverage",
+ "terrain": "One regional Copernicus raster plus EGM96 geoid; no constant-height fallback",
+ "search_budget": {
+ "spacing_m": 2000,
+ "tile_cells": 16,
+ "max_tracks_per_tile": 2000,
+ "max_track_samples_per_tile": 500000,
+ "max_cpa_rows": 100000,
+ "max_candidates_per_tile": 20000,
+ "top_k": 20,
+ "refine_spacing_m": 500,
+ "refine_finalists": 3,
+ "cpa_step_s": 2.0,
+ "max_tiles": null
+ },
+ "timing_limit": "The 20-second start interval uses the historical fitted clock, not an independent recording-clock measurement."
+ },
+ "automatic_http_runs": [
+ {
+ "run": "full-real-upload",
+ "source_revision": "a6614246c11f102ca382daee58df3e93129817a7",
+ "job_id": "656c4d0366f946e2b5cecde816796fb5",
+ "started_utc": "2026-11-03T05:24:16.299207Z",
+ "elapsed_s": 253.70854865300134,
+ "verification_passed": true,
+ "full_pipeline_observed": true,
+ "full_pipeline_requirements_met": true,
+ "supported_decision": false,
+ "candidate_count": 23,
+ "verified_stages": [
+ "automatic_provenance",
+ "intake",
+ "discovery",
+ "acquisition",
+ "search",
+ "refinement",
+ "decision"
+ ],
+ "scientific_status": "inconclusive",
+ "reason_code": "search_incomplete",
+ "independent_event_groups": 16,
+ "ridge_records": 18,
+ "all_proposed_event_groups_considered": true,
+ "leading_diagnostic_candidate": {
+ "lat": 40.29036692309594,
+ "lon": -73.39639659006407,
+ "score": 1.876204051040268,
+ "score_kind": "matched_group_support_minus_normalized_residual",
+ "event_ids": [
+ "event-0007",
+ "event-0010",
+ "event-0012"
+ ],
+ "flight_ids": [
+ "a069fe",
+ "a50e36:1",
+ "a2b407"
+ ],
+ "recording_start_utc": "2026-09-08T20:17:27.487467Z"
+ },
+ "leading_distance_to_unsurveyed_public_reference_m": 65998.78178232844,
+ "diagnostic_reference_distance_tiers": {
+ "within_100_m": false,
+ "within_500_m": false,
+ "within_1000_m": false
+ },
+ "eligible_for_independent_accuracy": false,
+ "search": {
+ "tiles_total": 19278,
+ "tiles_completed": 19190,
+ "grid_points_searched": 256,
+ "refinement_points_searched": 243,
+ "elapsed_s": 170.59513875800258,
+ "process_peak_rss_mib": 413.1328125,
+ "data_scope_complete": false,
+ "model_support_complete": false,
+ "model_assessment_complete": false,
+ "tiles_failed": 88,
+ "failed_tiles_by_reason": {
+ "missing_dem": 86,
+ "association_candidate_budget": 2
+ },
+ "candidate_budget_failure_tiles": [
+ "58_67",
+ "58_68"
+ ],
+ "point_count_scope": "grid_points_searched counts coarse grid points. Refinement points are separate stage counts; the two grids can overlap. Completed tiles include empty tiles and do not establish nationwide evaluated locations or data coverage.",
+ "model_work": {
+ "unsupported_cpa_track_evaluations": 58,
+ "unclassified_score_candidates": 1113,
+ "evaluated_trials": 32846,
+ "rejected_trials": 31416,
+ "unknown_trials": 17298,
+ "unreported_trial_envelopes": 0
+ }
+ },
+ "final_refinement_failures": [],
+ "service_exit_code": 0,
+ "forced_kill": false,
+ "terminal_result_preserved": true,
+ "decoded_duration_s": 3600.1845
+ },
+ {
+ "run": "integrated-real-upload",
+ "source_revision": "7df7c0427c4dee8371a26c846480119faf0a4198",
+ "job_id": "f458e3e22fc14eeb852c1c3eaa994d05",
+ "started_utc": "2026-11-03T05:34:53.500493Z",
+ "elapsed_s": 223.66514769600326,
+ "verification_passed": true,
+ "full_pipeline_observed": true,
+ "full_pipeline_requirements_met": true,
+ "supported_decision": false,
+ "candidate_count": 23,
+ "verified_stages": [
+ "automatic_provenance",
+ "intake",
+ "discovery",
+ "acquisition",
+ "search",
+ "refinement",
+ "decision"
+ ],
+ "scientific_status": "inconclusive",
+ "reason_code": "search_incomplete",
+ "independent_event_groups": 16,
+ "ridge_records": 18,
+ "all_proposed_event_groups_considered": true,
+ "leading_diagnostic_candidate": {
+ "lat": 40.29036692309594,
+ "lon": -73.39639659006407,
+ "score": 1.876204051040268,
+ "score_kind": "matched_group_support_minus_normalized_residual",
+ "event_ids": [
+ "event-0007",
+ "event-0010",
+ "event-0012"
+ ],
+ "flight_ids": [
+ "a069fe",
+ "a50e36:1",
+ "a2b407"
+ ],
+ "recording_start_utc": "2026-09-08T20:17:27.487467Z"
+ },
+ "leading_distance_to_unsurveyed_public_reference_m": 65998.78178232844,
+ "diagnostic_reference_distance_tiers": {
+ "within_100_m": false,
+ "within_500_m": false,
+ "within_1000_m": false
+ },
+ "eligible_for_independent_accuracy": false,
+ "search": {
+ "tiles_total": 19278,
+ "tiles_completed": 19190,
+ "grid_points_searched": 256,
+ "refinement_points_searched": 243,
+ "elapsed_s": 150.93368178899982,
+ "process_peak_rss_mib": 413.0,
+ "data_scope_complete": false,
+ "model_support_complete": false,
+ "model_assessment_complete": false,
+ "tiles_failed": 88,
+ "failed_tiles_by_reason": {
+ "missing_dem": 86,
+ "association_candidate_budget": 2
+ },
+ "candidate_budget_failure_tiles": [
+ "58_67",
+ "58_68"
+ ],
+ "point_count_scope": "grid_points_searched counts coarse grid points. Refinement points are separate stage counts; the two grids can overlap. Completed tiles include empty tiles and do not establish nationwide evaluated locations or data coverage.",
+ "model_work": {
+ "unsupported_cpa_track_evaluations": 58,
+ "unclassified_score_candidates": 1113,
+ "evaluated_trials": 32846,
+ "rejected_trials": 31416,
+ "unknown_trials": 17298,
+ "unreported_trial_envelopes": 0
+ }
+ },
+ "final_refinement_failures": [],
+ "service_exit_code": 0,
+ "forced_kill": false,
+ "terminal_result_preserved": true,
+ "decoded_duration_s": 3600.1845,
+ "process_elapsed_s": 223.74997905599957,
+ "process_peak_child_rss_kib": 422912,
+ "observed_verifier_exit_code": 0,
+ "comparison_to_first_http_run": {
+ "audio_identical": true,
+ "request_identical": true,
+ "operator_identical": true,
+ "discovery_events_identical": true,
+ "all_ranked_candidates_identical": true
+ }
+ }
+ ],
+ "dense_tile_diagnostic": {
+ "source_run": "full-real-upload",
+ "raw_artifact_subdirectory": "tile-pressure-58_68",
+ "tile": "58_68",
+ "receiver_points": 256,
+ "cpa_rows": 42595,
+ "candidate_cap": 20000,
+ "individual_points_exceeding_cap": 56,
+ "enumerated_candidates_at_remaining_points": 468937,
+ "smaller_partition_failures": {
+ "16": {
+ "partitions": 1,
+ "over_capacity_or_containing_failed_point": 1
+ },
+ "8": {
+ "partitions": 4,
+ "over_capacity_or_containing_failed_point": 4
+ },
+ "4": {
+ "partitions": 16,
+ "over_capacity_or_containing_failed_point": 9
+ },
+ "2": {
+ "partitions": 64,
+ "over_capacity_or_containing_failed_point": 22
+ },
+ "1": {
+ "partitions": 256,
+ "over_capacity_or_containing_failed_point": 56
+ }
+ },
+ "limit": "Diagnostic enumeration on real observations; no new scientific scoring. Subdivision alone does not remove candidate-budget failures.",
+ "source_run_revision": "a6614246c11f102ca382daee58df3e93129817a7",
+ "partition_count_basis": "Aggregated per-point enumeration totals; these partition counts are not separate tiled search replays."
+ },
+ "wsu_real_session": {
+ "dataset_doi": "https://doi.org/10.26183/07nm-4p35",
+ "discovery_source_revision": "1aa763bde2cd0e0ca7e8c7a492748a21e953c3f2",
+ "conditional_search_source_revision": "a6614246c11f102ca382daee58df3e93129817a7",
+ "runner_first_committed_at": "69273215b80641133d14e6238143060a8c4b75d0",
+ "scope": "real_WSU_supplied_trajectory_published_relative_alignment",
+ "complete_recording_duration_s": 246.8,
+ "microphone_channel_one_based": 1,
+ "automatic_proposals": 4,
+ "proposal_windows_s": [
+ [
+ 60.0,
+ 80.5
+ ],
+ [
+ 60.5,
+ 80.0
+ ],
+ [
+ 60.5,
+ 82.0
+ ],
+ [
+ 60.5,
+ 80.0
+ ]
+ ],
+ "published_trajectory_audio_time_bounds_s": [
+ 78.1,
+ 241.1
+ ],
+ "measured_trajectory_rows": 1631,
+ "source_drift_fractions": [
+ 0.0,
+ 0.02
+ ],
+ "attempted_grid_fits": 4992,
+ "supported_grid_fits": 0,
+ "unknown_grid_fits": 4992,
+ "status": "no_supported_fit",
+ "accepted_location": false,
+ "distance_error_evaluated": false,
+ "diagnostic_reference_distance_tiers": {
+ "within_100_m": null,
+ "within_500_m": null,
+ "within_1000_m": null
+ },
+ "eligible_for_independent_accuracy": false,
+ "limits": [
+ "All detected ridges begin before published trajectory support; no fully supported fit.",
+ "Supplied-track experiment outside the CONUS product path; no measured absolute-clock or height-datum uncertainty.",
+ "Reference coordinates were read only after the conditional search; no independent accepted location."
+ ]
+ },
+ "saved_job_browser_reload_runs": [
+ {
+ "source_revision": "69273215b80641133d14e6238143060a8c4b75d0",
+ "source_revision_inferred_from_local_reflog_and_result_timestamp": true,
+ "source_revision_limit": "The browser receipt did not capture Git HEAD. Its timestamp falls after this commit and before the next commit; only documentation edits intervened.",
+ "source_run": "full-real-upload",
+ "raw_artifact_subdirectory": "results/saved-job-browser",
+ "passed": true,
+ "job_id": "656c4d0366f946e2b5cecde816796fb5",
+ "status": "inconclusive",
+ "candidate_count": 23,
+ "event_groups": 16,
+ "ridge_records": 18,
+ "reload_preserved_result": true,
+ "browser_version": "156.0.8078.80",
+ "page_errors": [],
+ "pipeline_rerun": false,
+ "supported_location": false,
+ "runner_scope": "Separate Chromium saved-job rendering/reload check; not a second upload or pipeline execution"
+ },
+ {
+ "source_revision": "7df7c0427c4dee8371a26c846480119faf0a4198",
+ "source_revision_inferred_from_local_reflog_and_result_timestamp": false,
+ "source_run": "integrated-real-upload",
+ "raw_artifact_subdirectory": "results/integrated-browser",
+ "passed": true,
+ "job_id": "f458e3e22fc14eeb852c1c3eaa994d05",
+ "status": "inconclusive",
+ "candidate_count": 23,
+ "event_groups": 16,
+ "ridge_records": 18,
+ "all_candidate_cards_verified": 23,
+ "reload_preserved_result": true,
+ "browser_version": "156.0.8078.80",
+ "page_errors": [],
+ "mutating_requests": [],
+ "pipeline_rerun": false,
+ "supported_location": false,
+ "service_returncode": 0,
+ "job_artifact_count": 19249,
+ "job_artifacts_unchanged": true,
+ "backend_unchanged": true,
+ "recorded_backend_matches_completed_http_run": true,
+ "recorded_frontend_matches_source_revision": true,
+ "runner_scope": "Separate Chromium saved-job rendering and reload check; no new upload, no mutating requests and no pipeline rerun"
+ }
+ ]
+}
diff --git a/docs/PRODUCT.md b/docs/PRODUCT.md
index 7149ed1..4568e64 100644
--- a/docs/PRODUCT.md
+++ b/docs/PRODUCT.md
@@ -84,6 +84,34 @@ and input validation. They do not establish scientific localization accuracy.
Automatic CI checks installation, source compilation, CLI help, and packaged
assets without generated data.
+### Verify the complete HTTP pipeline
+
+`scripts/verify_upload_http.py` submits a real recording to a local service and
+checks the saved inputs, stage outputs, terminal decision and persisted result.
+Use `--require-full-pipeline` to require acquisition, search, refinement and
+decision evidence as well as intake/discovery, with at least one returned
+candidate. A correctly handled missing clock or empty search cannot pass this
+stronger operational check.
+
+```bash
+python scripts/verify_upload_http.py \
+ --audio path/to/real-recording.mp3 \
+ --operator-config operator.json \
+ --start-utc "$RECORDING_START_UTC_MIN" \
+ --end-utc "$RECORDING_START_UTC_MAX" \
+ --time-source 'Evidence establishing the recording-start interval' \
+ --expect-status inconclusive --require-full-pipeline \
+ --output results/new-real-http-run
+```
+
+Declare the expected outcome before running. An expected `inconclusive` result
+can verify that every stage ran; it does not establish a supported location.
+It can pass with incomplete search coverage; the result retains those limitations.
+Use `--expect-status succeeded` when testing that acceptance requirement, then
+evaluate location error against an independent reference after the run. The
+verifier reports operational verification and `supported_decision` separately.
+It counts independent harmonic groups separately from their ridge records.
+
## Provider and search configuration
`--online` requires no JSON configuration: it uses the per-user cache and public
diff --git a/scripts/benchmark_wsu_session.py b/scripts/benchmark_wsu_session.py
new file mode 100644
index 0000000..d32c253
--- /dev/null
+++ b/scripts/benchmark_wsu_session.py
@@ -0,0 +1,302 @@
+#!/usr/bin/env python3
+"""Measured WSU drone session: discovery, conditional fitting, then evaluation.
+
+This is a supplied-trajectory experiment outside the CONUS/absolute-UTC product
+path. The published camera-based audio/GPS alignment has unmeasured uncertainty.
+Receiver coordinates are read only by the separate evaluate command. Discovery
+keeps production defaults and reads the complete, preselected first microphone.
+No waveform, trajectory, recording date, or successful decision is fabricated.
+"""
+import argparse
+from collections import Counter
+from dataclasses import asdict
+import hashlib
+import json
+from pathlib import Path
+import resource
+import subprocess
+import time
+
+import numpy as np
+import pandas as pd
+from pyproj import Geod, Transformer
+from scipy.io import wavfile
+
+from dopplergeist.discovery import DiscoverySettings, discover_events
+from dopplergeist.geometry import AcousticSupportError, Track, ecef
+from dopplergeist.intake import intake_recording
+from dopplergeist.matching import fit_ridge, prepare_events
+
+
+BASE = "https://rds.westernsydney.edu.au/Centres/ICNS/2026/Jahir_Rodriguez/"
+SESSION = "dataset/test_1/Oct_11_2024/flight_5/"
+SCOPE = "real_WSU_supplied_trajectory_published_relative_alignment"
+DATASET = {
+ "title": "UAV Acoustic Localization Dataset",
+ "creators": "Belman Jahir Rodríguez, Sergio F. Chevtchenko, Marcelo Herrera Martínez, Yeshwanth Bethi, Saeed Afshar",
+ "doi": "https://doi.org/10.26183/07nm-4p35",
+ "license": "CC BY-SA 4.0; external recordings and metadata retain that license",
+}
+# Identities of the actual official files retrieved for this experiment. These
+# pins identify the downloaded versions; they are not publisher-issued hashes.
+SOURCES = {
+ "audio": (284313644, "b209a042aac5b9abcd575ecc71ceb1c162021ca86771a5295c9d7dd6ce18c825"),
+ "flight": (579075, "77974bf089826d8da23f3de50874cda26bf678de81d80051f44ec5b083be8424"),
+ "alignment": (946, "cd2145d0adb74faa7650671d08ebff971f1861aa5105f48ce47ce7eea49c2a91"),
+ "reference": (402253, "b1f105b477bea3c5682aaa884ca11f63bfcf391af701e040ce098dfb0bb033fc"),
+}
+LIMITS = [
+ "One supplied measured trajectory; aircraft identity is not established by fitting.",
+ "Published camera-based relative alignment has no measured timing uncertainty.",
+ "Common MSL heights are used as a local ECEF approximation; datum accuracy is unverified.",
+ "Flat receiver height uses the initial aircraft altitude plus published microphone height.",
+ "Search covers the supplied flight footprint plus a fixed margin, not national coverage.",
+ "No complete background flight inventory, calibrated uncertainty, or accepted location.",
+ "Public development measurement; no sealed holdout or product acceptance assessment.",
+]
+
+
+def digest(path):
+ h = hashlib.sha256()
+ with Path(path).open("rb") as stream:
+ for chunk in iter(lambda: stream.read(1024 * 1024), b""):
+ h.update(chunk)
+ return h.hexdigest()
+
+
+def verify_source(path, role):
+ expected_size, expected_digest = SOURCES[role]
+ if Path(path).stat().st_size != expected_size or digest(path) != expected_digest:
+ raise ValueError(f"Not the pinned official WSU {role} input")
+
+
+def plain(value):
+ if isinstance(value, dict):
+ return {str(k): plain(v) for k, v in value.items()}
+ if isinstance(value, (tuple, list)):
+ return [plain(v) for v in value]
+ if isinstance(value, np.ndarray):
+ return plain(value.tolist())
+ if isinstance(value, (np.integer, np.bool_)):
+ return value.item()
+ if isinstance(value, (float, np.floating)):
+ return float(value) if np.isfinite(value) else None
+ return value
+
+
+def write(path, value):
+ with Path(path).open("x") as stream:
+ stream.write(json.dumps(plain(value), indent=2, allow_nan=False) + "\n")
+
+
+def read(path):
+ return json.loads(Path(path).read_text())
+
+
+def new_directory(path):
+ path = Path(path).resolve()
+ path.mkdir(parents=True, exist_ok=False)
+ return path
+
+
+def discover(args):
+ output = new_directory(args.output)
+ began = time.monotonic()
+ source = Path(args.audio).resolve()
+ verify_source(source, "audio")
+ rate, samples = wavfile.read(source, mmap=True)
+ if rate != 48000 or samples.dtype != np.int32 or samples.ndim != 2 or samples.shape[1] != 6:
+ raise ValueError("Expected the original six-channel 48 kHz PCM32 WSU recording")
+ # Device 1/channel 1 is declared before acoustic inspection; retain all frames.
+ mono = output / "device1-channel1.wav"
+ wavfile.write(mono, rate, samples[:, 0])
+ recording = intake_recording(mono, output / "intake")
+ settings = DiscoverySettings()
+ events = discover_events(recording, output_dir=output / "discovery", settings=settings)
+ summary = {
+ "scope": SCOPE, "dataset": DATASET,
+ "source_url": BASE + SESSION + "device_1_nosync.wav",
+ "source_path": str(source), "source_size_bytes": source.stat().st_size,
+ "source_sha256": SOURCES["audio"][1], "mono_channel_one_based": 1,
+ "source_frames": len(samples), "source_sample_rate_hz": rate,
+ "source_duration_s": len(samples) / rate,
+ "complete_recording_used": True, "discovery_settings": asdict(settings),
+ "event_count": len(events),
+ "independent_proposal_count": len({event["harmonic_group_id"] for event in events}),
+ "events": [{k: event[k] for k in ("event_id", "start_s", "end_s", "band_hz")} for event in events],
+ "trajectory_or_truth_loaded": False, "runtime_s": time.monotonic() - began,
+ "peak_rss_kib": resource.getrusage(resource.RUSAGE_SELF).ru_maxrss,
+ "source_revision": subprocess.check_output(
+ ["git", "rev-parse", "HEAD"], cwd=Path(__file__).resolve().parents[1], text=True).strip(),
+ "accepted_location": False, "limitations": LIMITS,
+ }
+ write(output / "summary.json", summary)
+ print(json.dumps(plain(summary), indent=2))
+
+
+def load_trajectory(csv_path, alignment_path):
+ verify_source(csv_path, "flight")
+ verify_source(alignment_path, "alignment")
+ alignment = read(alignment_path)
+ if (alignment.get("session") != "Oct_11_2024" or str(alignment.get("flight_id")) != "5"
+ or alignment.get("sample_rate_hz") != 48000
+ or alignment.get("corrections_samples", [None])[0] != 0):
+ raise ValueError("Expected the published device-1 alignment for WSU test session 1")
+ frame = pd.read_csv(csv_path)
+ columns = ["time(millisecond)", "latitude", "longitude", "altitude_above_seaLevel(feet)"]
+ values = frame[columns].to_numpy(dtype=float)
+ if len(values) < 3 or not np.all(np.isfinite(values)) or not np.all(np.diff(values[:, 0]) > 0):
+ raise ValueError("Measured trajectory rows must be finite and strictly timed; no repair is performed")
+ index = alignment["start_index_csv"]
+ if type(index) is not int or not 0 <= index < len(values):
+ raise ValueError("Published alignment row is outside the measured trajectory")
+ # The publisher aligns its 100 ms audio blocks to successive telemetry rows.
+ if not np.allclose(np.diff(values[:, 0]), 100, rtol=0, atol=1e-8):
+ raise ValueError("Telemetry does not support the publisher's one-row-per-100-ms mapping")
+ clock = float(alignment["skip_seconds"]) + (values[:, 0] - values[index, 0]) / 1000
+ height = values[:, 3] * 0.3048
+ track = Track("WSU-published-flight-5", clock, values[:, 1], values[:, 2], height,
+ "DJI Air 3 measured telemetry")
+ track.altitude_basis = ["publisher_MSL_unverified"] * len(clock)
+ return track, alignment
+
+
+def search(args):
+ output = new_directory(args.output)
+ began = time.monotonic()
+ summary = read(Path(args.discovery) / "summary.json")
+ if summary.get("source_sha256") != SOURCES["audio"][1] or summary.get("complete_recording_used") is not True:
+ raise ValueError("Expected complete-recording discovery from the pinned WSU audio")
+ discovery = read(Path(args.discovery) / "discovery" / "discovery.json")
+ events, measurements = prepare_events(discovery["events"])
+ track, alignment = load_trajectory(args.flight_csv, args.alignment)
+ forward = Transformer.from_crs("EPSG:4326", "EPSG:32756", always_xy=True)
+ inverse = Transformer.from_crs("EPSG:32756", "EPSG:4326", always_xy=True)
+ x, y = forward.transform(track.lon, track.lat)
+ step, margin = args.grid_step_m, args.padding_m
+ if not np.isfinite(step) or not np.isfinite(margin) or step <= 0 or margin <= 0:
+ raise ValueError("Grid step and flight-footprint margin must be finite and positive")
+ bounds = [np.floor((min(x) - margin) / 100) * 100, np.floor((min(y) - margin) / 100) * 100,
+ np.ceil((max(x) + margin) / 100) * 100, np.ceil((max(y) + margin) / 100) * 100]
+ east = np.arange(bounds[0] + step / 2, bounds[2], step)
+ north = np.arange(bounds[1] + step / 2, bounds[3], step)
+ if not len(east) or not len(north) or len(east) * len(north) > args.max_grid_points:
+ raise ValueError("Empty grid or explicit work budget exceeded; search was not truncated")
+ receiver_height = float(track.altitude[0] + alignment["mic_array"]["h_"][0])
+ motion = {"globally_subsonic": True}
+ try:
+ track.validate_motion_support()
+ except AcousticSupportError as error:
+ motion = {"globally_subsonic": False, "reason": error.reason}
+ result = {"scope": SCOPE, "dataset": DATASET, "source_revision": subprocess.check_output(
+ ["git", "rev-parse", "HEAD"], cwd=Path(__file__).resolve().parents[1], text=True).strip(),
+ "source_urls": {"audio": BASE + SESSION + "device_1_nosync.wav",
+ "flight": BASE + SESSION + "Oct-11th-2024-03-49PM-Flight-Airdata.csv",
+ "alignment": BASE + SESSION + "alignment_params.json"},
+ "audio_clock_mapping": "t_audio = skip_seconds + (time_millisecond - aligned_row_time_millisecond)/1000",
+ "skip_seconds": alignment["skip_seconds"], "start_index_csv": alignment["start_index_csv"],
+ "absolute_UTC_uncertainty_established": False, "all_measured_trajectory_rows_retained": True,
+ "trajectory_rows": len(track.time), "trajectory_audio_time_bounds_s": track.time[[0, -1]],
+ "motion_support": motion, "receiver_height_msl_approximation_m": receiver_height,
+ "search_domain": {"source": "measured flight footprint plus fixed margin, rounded outward to100m",
+ "crs": "EPSG:32756", "bounds": bounds, "step_m": step, "padding_m": margin,
+ "grid_nodes": "cell centers; no target coordinate inserted"},
+ "events_retained": len(events), "results": [], "reference_coordinates_loaded": False,
+ "accepted_location": False, "limitations": LIMITS}
+ for i, (event, measurement) in enumerate(zip(events, measurements)):
+ for drift in (0.0, 0.02):
+ loss = np.full((len(north), len(east)), np.nan)
+ reasons = Counter()
+ best = None
+ for iy, yy in enumerate(north):
+ for ix, xx in enumerate(east):
+ lon, lat = inverse.transform(xx, yy)
+ try:
+ fit = fit_ridge(track, ecef(lat, lon, receiver_height), measurement, 0.0,
+ event["f0_range_hz"], 343.0, event["quality"]["frequency_loss_scale_hz"], drift)
+ except AcousticSupportError as error:
+ reasons[error.reason] += 1
+ continue
+ if not np.isfinite(fit.get("score", np.nan)) or fit.get("support_fraction") != 1.0:
+ reasons["incomplete_trajectory_or_ridge_support"] += 1
+ continue
+ loss[iy, ix] = -fit["score"]
+ if best is None or loss[iy, ix] < best["loss_hz"]:
+ best = {"lat": lat, "lon": lon, "east_m": xx, "north_m": yy,
+ "loss_hz": loss[iy, ix], "fit": fit,
+ "domain_edge": ix in (0, len(east) - 1) or iy in (0, len(north) - 1)}
+ identity = f"event-{i:03d}-drift-{drift:g}"
+ np.savez_compressed(output / (identity + ".npz"), east_m=east, north_m=north, loss_hz=loss)
+ item = {"id": identity, "event_id": event["event_id"], "source_drift_fraction": drift,
+ "grid_points": loss.size, "supported_points": np.isfinite(loss).sum(),
+ "unknown_points": (~np.isfinite(loss)).sum(), "unknown_reasons": dict(reasons),
+ "best": best, "unique_location_established": False}
+ if best is not None:
+ yy, xx = np.where(np.isfinite(loss) & (loss <= best["loss_hz"] + 1.0))
+ item["within_one_hz_radius_m"] = np.max(np.hypot(east[xx] - best["east_m"], north[yy] - best["north_m"]))
+ result["results"].append(item)
+ result["status"] = ("no_proposal" if not events else "no_supported_fit"
+ if all(row["best"] is None for row in result["results"]) else "conditional_fits_only")
+ result["runtime_s"] = time.monotonic() - began
+ result["peak_rss_kib"] = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
+ write(output / "result.json", result)
+ print(json.dumps(plain(result), indent=2))
+
+
+def evaluate(args):
+ result = read(Path(args.search) / "result.json")
+ if result.get("scope") != SCOPE or result.get("reference_coordinates_loaded") is not False:
+ raise ValueError("Expected frozen WSU search results without reference coordinates")
+ verify_source(args.reference_csv, "reference")
+ reference = pd.read_csv(args.reference_csv)
+ lat = reference["latitude"].astype(float).mean()
+ lon = reference["longitude"].astype(float).mean()
+ if not np.isfinite(lat) or not np.isfinite(lon):
+ raise ValueError("Invalid published reference coordinate")
+ geod = Geod(ellps="WGS84")
+ rows = []
+ for case in result["results"]:
+ row = {"id": case["id"], "accepted_location": False, "source_association": "unconfirmed"}
+ if case["best"] is not None:
+ best = case["best"]
+ error = geod.inv(lon, lat, best["lon"], best["lat"])[2]
+ row.update(horizontal_error_to_published_array_origin_m=error,
+ within_100_m=error <= 100, within_500_m=error <= 500, within_1000_m=error <= 1000)
+ rows.append(row)
+ report = {"scope": SCOPE, "dataset": DATASET, "frozen_search": str(Path(args.search).resolve()),
+ "reference_source": BASE + "dataset/test_1/Oct_11_2024/ref/DJIFlightRecord_2024-10-11_%5B14-32-34%5D.csv",
+ "reference_kind": "Publisher reference-flight mean GPS, not an independently surveyed microphone",
+ "reference_rows": len(reference), "mic_horizontal_offset_m": 0.1,
+ "measured_reference_uncertainty_available": False, "results": rows,
+ "accepted_location": False, "limitations": LIMITS}
+ write(args.output, report)
+ print(json.dumps(plain(report), indent=2))
+
+
+def main():
+ parser = argparse.ArgumentParser(description=__doc__)
+ commands = parser.add_subparsers(dest="command", required=True)
+ command = commands.add_parser("discover")
+ command.add_argument("--audio", required=True)
+ command.add_argument("--output", required=True)
+ command.set_defaults(function=discover)
+ command = commands.add_parser("search")
+ command.add_argument("--discovery", required=True)
+ command.add_argument("--flight-csv", required=True)
+ command.add_argument("--alignment", required=True)
+ command.add_argument("--output", required=True)
+ command.add_argument("--grid-step-m", type=float, default=50.0)
+ command.add_argument("--padding-m", type=float, default=500.0)
+ command.add_argument("--max-grid-points", type=int, default=10000)
+ command.set_defaults(function=search)
+ command = commands.add_parser("evaluate")
+ command.add_argument("--search", required=True)
+ command.add_argument("--reference-csv", required=True)
+ command.add_argument("--output", required=True)
+ command.set_defaults(function=evaluate)
+ args = parser.parse_args()
+ args.function(args)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/scripts/prepare_reference_upload.py b/scripts/prepare_reference_upload.py
new file mode 100644
index 0000000..0ab2822
--- /dev/null
+++ b/scripts/prepare_reference_upload.py
@@ -0,0 +1,99 @@
+"""Prepare the restored reference recording's automatic development replay.
+
+The regional flight data are incomplete, and the clock interval comes from a
+historical fit. This replay does not establish independent location acceptance.
+Restore the reference ADS-B and terrain bundles before running this helper.
+"""
+import argparse
+import json
+from pathlib import Path
+import time
+
+
+def save(path, value):
+ with path.open("x") as handle:
+ json.dump(value, handle, indent=2, allow_nan=False)
+ handle.write("\n")
+
+
+def main():
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument("--data-root", type=Path, required=True,
+ help="Restored data directory containing adsb/ and terrain/")
+ parser.add_argument("--output", type=Path, required=True,
+ help="New directory for the index, report, operator and request")
+ args = parser.parse_args()
+ data = args.data_root.expanduser().resolve()
+ output = args.output.expanduser().resolve()
+ parquet = data / "adsb/2026-09-08/reference-region.parquet"
+ dem = data / "terrain/Copernicus_DSM_COG_10_N40_00_W074_00_DEM.tif"
+ geoid = data / "terrain/us_nga_egm96_15.tif"
+ if output.exists():
+ parser.error(f"Output already exists; choose a new directory: {output}")
+ for path in (parquet, dem, geoid):
+ if not path.is_file():
+ parser.error(f"Required restored input is missing: {path}")
+
+ from dopplergeist.data_access import FlightIndex
+
+ output.mkdir(parents=True, exist_ok=False)
+ coverage = {
+ "bounds": [-74.299988, 40.100005, -72.700011, 41.599964],
+ "time_range_s": [1788825600.17, 1788911999.6],
+ "all_aircraft": False,
+ "source_note": (
+ "Restored historical reference-region.parquet. The listed bounds and "
+ "times are observed sample extrema, not established selection coverage. "
+ "Original geographic selection bounds are unknown. The original ingestion "
+ "excluded known jets. This index cannot establish complete coverage."
+ ),
+ "selection_bounds_known": False,
+ "extent_kind": "observed_sample_extrema_only",
+ }
+ began = time.monotonic()
+ index = FlightIndex.from_parquet(output / "reference-region.sqlite", parquet, coverage=coverage)
+ save(output / "index-report.json", dict(index.report, elapsed_s=time.monotonic() - began))
+ operator = {
+ "flight_indexes": [str(index.path.resolve())],
+ "offline": True,
+ "terrain": {"rasters": [str(dem)], "geoid_raster": str(geoid)},
+ "search_budget": {
+ "spacing_m": 2000,
+ "tile_cells": 16,
+ "top_k": 20,
+ "refine_spacing_m": 500,
+ "refine_finalists": 3,
+ },
+ "refine_finalists": 3,
+ }
+ request = {
+ "schema_version": 1,
+ "search": {"coverage": "conus"},
+ "time_window": {
+ "start_utc": "2026-09-08T20:17:20Z",
+ "end_utc": "2026-09-08T20:17:40Z",
+ "source": "user",
+ "source_detail": (
+ "Source-informed development replay interval around historical fitted "
+ "sample-zero 2026-09-08T20:17:29.662Z from "
+ "evidence/results/reference-local-fast/report.json. "
+ "This is not an independently measured recording clock."
+ ),
+ },
+ }
+ save(output / "operator.json", operator)
+ save(output / "request.json", request)
+ print(json.dumps({
+ "index": str(index.path),
+ "rows": index.report["rows"],
+ "segments": index.report["segments"],
+ "operator": str(output / "operator.json"),
+ "request": str(output / "request.json"),
+ "source_coverage_complete": False,
+ "validation_scope": "Source-informed development replay; not independent acceptance",
+ "elapsed_s": time.monotonic() - began,
+ }, indent=2), flush=True)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/scripts/verify_upload_http.py b/scripts/verify_upload_http.py
index c857dc5..4191844 100644
--- a/scripts/verify_upload_http.py
+++ b/scripts/verify_upload_http.py
@@ -4,6 +4,8 @@
Exit zero means HTTP, persistence, stage evidence, and outcome checks passed.
The receipt separately preserves the producer's scientific status. An expected
inconclusive response is never counted as supported localization or accuracy.
+With --require-full-pipeline, verification also requires every pipeline stage
+and at least one returned candidate; an early exit cannot pass that requirement.
The existing browser verifier is independent and remains unchanged.
"""
from __future__ import annotations
@@ -618,6 +620,27 @@ def inspect_finite_search(artifact, read, search, configuration, refinement):
return result
+def inspect_discovery_counts(events, provenance):
+ """Count independent groups separately from their measured harmonic ridges."""
+ groups = len({event.get("harmonic_group_id", event["event_id"]) for event in events})
+ if provenance.get("discovered_events") != groups:
+ raise ValueError("Provenance has a different independent-event count")
+ # Older producers recorded only the group count. The ridge artifact still
+ # identifies every event; check the additional counter when it is present.
+ if "discovered_ridges" in provenance and provenance["discovered_ridges"] != len(events):
+ raise ValueError("Provenance has a different discovered-ridge count")
+ return {"event_groups": groups, "ridge_records": len(events)}
+
+
+def complete_pipeline_with_candidates(evidence, candidate_count):
+ """An operational full-path check is stronger than an expected early exit."""
+ stages = {"automatic_provenance", "intake", "discovery", "acquisition",
+ "search", "refinement", "decision"}
+ return (evidence.get("passed") is True and evidence.get("full_pipeline_observed") is True
+ and stages.issubset(evidence.get("stages_verified", []))
+ and type(candidate_count) is int and candidate_count > 0)
+
+
def inspect_pipeline_evidence(directory, final, wire, operator):
"""Check stage receipts, separately from HTTP success or location accuracy.
@@ -703,7 +726,7 @@ def inspect_pipeline_evidence(directory, final, wire, operator):
require(discovery.get("source_sha256") == input_record["sha256"]
and discovery.get("events") == events, "Discovery source or events differ from the terminal result")
if not interrupted:
- require(provenance.get("discovered_events") == len(events), "Provenance has a different discovered-event count")
+ report["discovery_counts"] = inspect_discovery_counts(events, provenance)
chunks = discovery.get("chunks")
require(isinstance(chunks, list) and chunks, "Discovery has no whole-recording chunk evidence")
covered = 0.0
@@ -853,9 +876,12 @@ def inspect_pipeline_evidence(directory, final, wire, operator):
def verify_http(audio, output, *, request=None, operator=None, expect_status,
- expect_reason=None, timeout_s=600.0, poll_interval_s=0.25):
+ expect_reason=None, timeout_s=600.0, poll_interval_s=0.25,
+ require_full_pipeline=False):
if expect_status not in TERMINAL:
raise ValueError("Declare an expected terminal status before execution")
+ if type(require_full_pipeline) is not bool:
+ raise ValueError("require_full_pipeline must be a boolean")
for name, value in (("timeout_s", timeout_s), ("poll_interval_s", poll_interval_s)):
if not math.isfinite(value) or value <= 0:
raise ValueError(f"{name} must be finite and positive")
@@ -882,6 +908,7 @@ def verify_http(audio, output, *, request=None, operator=None, expect_status,
"python_executable": sys.executable, "python_version": sys.version,
"verification_passed": False, "http_checks_passed": False, "pipeline_evidence_passed": False,
"full_pipeline_observed": False, "supported_decision": False,
+ "require_full_pipeline": require_full_pipeline, "full_pipeline_requirements_met": False,
"location_accuracy_evaluated": False, "browser_verified": False,
"interrupted": False, "interruption_signal": None,
"limitations": ["HTTP verification does not establish location accuracy or browser behavior.",
@@ -965,6 +992,8 @@ def verify_http(audio, output, *, request=None, operator=None, expect_status,
write_json(output / "pipeline-evidence.json", evidence)
receipt["pipeline_evidence_passed"] = evidence["passed"]
receipt["full_pipeline_observed"] = evidence["full_pipeline_observed"]
+ receipt["full_pipeline_requirements_met"] = complete_pipeline_with_candidates(
+ evidence, receipt.get("candidate_count"))
receipt["pipeline_evidence_errors"] = evidence["errors"]
files = {path.relative_to(directory).as_posix(): {"bytes": path.stat().st_size, "sha256": sha256(path)}
for path in sorted(directory.rglob("*")) if path.is_file() and not path.is_symlink()}
@@ -976,7 +1005,12 @@ def verify_http(audio, output, *, request=None, operator=None, expect_status,
and receipt.get("terminal_result_preserved_after_shutdown")
and receipt["service"]["returncode"] == 0 and not receipt["service"]["forced_kill"]
and not receipt.get("shutdown_error") and not receipt["interrupted"])
- receipt["verification_passed"] = verified and bool(receipt.get("expectation_matched"))
+ if require_full_pipeline and not receipt["full_pipeline_requirements_met"]:
+ receipt["requirement_error"] = (
+ "Full pipeline verification requires verified acquisition, search, refinement, "
+ "and decision stages with at least one candidate.")
+ receipt["verification_passed"] = (verified and bool(receipt.get("expectation_matched"))
+ and (not require_full_pipeline or receipt["full_pipeline_requirements_met"]))
receipt["supported_decision"] = (verified and receipt["full_pipeline_observed"]
and receipt.get("status") == "succeeded")
except Exception as exc:
@@ -1004,6 +1038,8 @@ def main(argv=None):
parser.add_argument("--time-source", default="Explicit verification recording-start window")
parser.add_argument("--expect-status", choices=sorted(TERMINAL), required=True)
parser.add_argument("--expect-reason")
+ parser.add_argument("--require-full-pipeline", action="store_true",
+ help="Fail unless every pipeline stage is verified and at least one candidate is returned")
parser.add_argument("--timeout-s", type=float, default=600)
parser.add_argument("--poll-interval-s", type=float, default=0.25)
args = parser.parse_args(argv)
@@ -1017,7 +1053,8 @@ def main(argv=None):
operator = json.loads(args.operator_config.read_text()) if args.operator_config else {}
receipt = verify_http(args.audio, args.output, request=request, operator=operator,
expect_status=args.expect_status, expect_reason=args.expect_reason,
- timeout_s=args.timeout_s, poll_interval_s=args.poll_interval_s)
+ timeout_s=args.timeout_s, poll_interval_s=args.poll_interval_s,
+ require_full_pipeline=args.require_full_pipeline)
except (OSError, ValueError, TypeError) as exc:
parser.error(str(exc))
print(json.dumps({"report": str(args.output.resolve() / "http-verification.json"),
@@ -1025,9 +1062,11 @@ def main(argv=None):
"http_checks_passed": receipt["http_checks_passed"],
"pipeline_evidence_passed": receipt["pipeline_evidence_passed"],
"full_pipeline_observed": receipt["full_pipeline_observed"],
+ "full_pipeline_requirements_met": receipt["full_pipeline_requirements_met"],
"reason_code": receipt.get("reason_code"), "supported_decision": receipt["supported_decision"],
"location_accuracy_evaluated": False, "interrupted": receipt["interrupted"],
- "interruption_signal": receipt["interruption_signal"], "error": receipt.get("error")}))
+ "interruption_signal": receipt["interruption_signal"], "error": receipt.get("error"),
+ "requirement_error": receipt.get("requirement_error")}))
return 0 if receipt["verification_passed"] else 1
diff --git a/src/dopplergeist/tiled_search.py b/src/dopplergeist/tiled_search.py
index ab20b9d..14dfc34 100644
--- a/src/dopplergeist/tiled_search.py
+++ b/src/dopplergeist/tiled_search.py
@@ -154,6 +154,22 @@ def _tracks(indexes, bounds, time_range, budget):
return tracks
+def _association_clock_window(start_window, sweep_s):
+ """Enclose every association clock that could reach the scoring window."""
+ lower, upper = map(float, start_window)
+ if not all(math.isfinite(v) for v in (lower, upper, sweep_s)) or lower > upper or sweep_s < 0:
+ raise ValueError("Recording clock bounds and sweep must be finite and ordered")
+ # Association intervals are expanded by the scorer before intersection with
+ # the requested window. Prune only outside that expanded envelope. Round
+ # both the envelope and its center/radius representation outward at Unix
+ # timestamp precision, so an inclusive endpoint cannot disappear.
+ lower = math.nextafter(lower - sweep_s, -math.inf)
+ upper = math.nextafter(upper + sweep_s, math.inf)
+ center = lower + (upper - lower) / 2
+ tolerance = math.nextafter(max(center - lower, upper - center), math.inf)
+ return center, tolerance
+
+
@_cache_ridge_fits
def _score(points, tracks, events, measurements, budget, parameters, filters, start_window=None, *, ledger=None, stage=None):
radius = max(e["slant_range_m"][1] for e in events)
@@ -201,6 +217,9 @@ def _score(points, tracks, events, measurements, budget, parameters, filters, st
subset = filters.get("association", "subsets" if parameters.get("mode") == "robust_ridge" else "full") == "subsets"
if subset:
from .matching import association_candidates
+ if start_window is not None and kwargs["time_origin"] is None:
+ kwargs["time_origin"], kwargs["time_tolerance_s"] = _association_clock_window(
+ start_window, parameters.get("time_sweep_s", 5.0))
candidates, counts = association_candidates(table, events, **kwargs,
min_events=filters.get("min_events", 1), max_events=filters.get("max_events") or len(events),
max_candidates=budget.max_candidates_per_tile)
diff --git a/tests/test_real_association_clock_window.py b/tests/test_real_association_clock_window.py
new file mode 100644
index 0000000..da59432
--- /dev/null
+++ b/tests/test_real_association_clock_window.py
@@ -0,0 +1,62 @@
+"""Clock pruning checked against archived real flight and acoustic observations."""
+import json
+from pathlib import Path
+
+import pandas as pd
+
+from dopplergeist.matching import association_candidates
+from dopplergeist.tiled_search import _association_clock_window
+
+
+def real_associations():
+ path = Path(__file__).parent / "data/reference-cpa-real.json"
+ recorded = json.loads(path.read_text())
+ table = pd.DataFrame(recorded["cpa_rows"])
+ candidates, counts = association_candidates(table, recorded["events"])
+ return table, recorded["events"], candidates, counts
+
+
+def scheduled_intervals(candidates, window, sweep_s):
+ """Join the same observed association identities after the clock restriction."""
+ retained = {}
+ for candidate in candidates:
+ lower, upper = candidate["recording_start_bounds_s"]
+ interval = (max(lower - sweep_s, window[0]), min(upper + sweep_s, window[1]))
+ if interval[0] > interval[1]:
+ continue
+ identity = (tuple(candidate["event_indices"]),
+ tuple((row["flight_id"], row["emission_time"]) for row in candidate["passes"]))
+ assert identity not in retained
+ retained[identity] = interval
+ return retained
+
+
+def bounded_associations(table, events, window, sweep_s):
+ center, tolerance = _association_clock_window(window, sweep_s)
+ return association_candidates(table, events, time_origin=center, time_tolerance_s=tolerance)
+
+
+def test_real_recording_window_avoids_unrelated_clock_work_without_losing_trials():
+ table, events, original, original_counts = real_associations()
+ # Historical source-informed development clock; not independent field truth.
+ window, sweep_s = (1788898640.0, 1788898660.0), 5.0
+ bounded, bounded_counts = bounded_associations(table, events, window, sweep_s)
+ expected = scheduled_intervals(original, window, sweep_s)
+ assert len(original) == 10549 and len(expected) == 26
+ assert scheduled_intervals(bounded, window, sweep_s) == expected
+ assert bounded_counts["work_units"] < original_counts["work_units"] / 10
+
+
+def test_real_association_clock_endpoints_remain_inclusive():
+ table, events, original, _ = real_associations()
+ # Use interval endpoints from measured passages, including subsecond Unix
+ # times. No acoustic sample, trajectory, event or flight identity is changed.
+ for candidate in (original[0], original[5274], original[-1]):
+ lower, upper = candidate["recording_start_bounds_s"]
+ for sweep_s in (0.0, 5.0):
+ for instant in (lower - sweep_s, upper + sweep_s):
+ window = (instant, instant)
+ expected = scheduled_intervals(original, window, sweep_s)
+ assert expected
+ bounded, _ = bounded_associations(table, events, window, sweep_s)
+ assert scheduled_intervals(bounded, window, sweep_s) == expected
diff --git a/tests/test_real_upload_verification.py b/tests/test_real_upload_verification.py
new file mode 100644
index 0000000..dd77b13
--- /dev/null
+++ b/tests/test_real_upload_verification.py
@@ -0,0 +1,55 @@
+"""Verifier regressions using archived real-recording observations only."""
+import importlib.util
+import json
+from pathlib import Path
+
+import pytest
+
+
+ROOT = Path(__file__).parents[1]
+SPEC = importlib.util.spec_from_file_location("verify_real_upload_evidence",
+ ROOT / "scripts/verify_upload_http.py")
+HTTP = importlib.util.module_from_spec(SPEC)
+SPEC.loader.exec_module(HTTP)
+
+
+def observed_harmonic_identities():
+ source = ROOT / "evidence/audio/w1-fragments-20261102/reference-discovery/discovery.json"
+ discovery = json.loads(source.read_text())
+ # The historical producer saved one event per group and all measured ridges
+ # separately. Express those same observed groups as the current producer's
+ # one-record-per-ridge identities; no audio or trajectory is generated.
+ identities = []
+ for event, ridges in zip(discovery["events"], discovery["harmonic_ridges"], strict=True):
+ for index, _ in enumerate(ridges):
+ identities.append({"event_id": f"{event['event_id']}-ridge-{index + 1}",
+ "harmonic_group_id": event["harmonic_group_id"]})
+ assert len(discovery["events"]) == 6 and len(identities) == 7
+ return identities
+
+
+def test_real_harmonic_records_keep_independent_event_and_ridge_counts():
+ events = observed_harmonic_identities()
+ assert HTTP.inspect_discovery_counts(events, {"discovered_events": 6, "discovered_ridges": 7}) == {
+ "event_groups": 6, "ridge_records": 7}
+ with pytest.raises(ValueError, match="independent-event count"):
+ HTTP.inspect_discovery_counts(events, {"discovered_events": 7, "discovered_ridges": 7})
+ with pytest.raises(ValueError, match="discovered-ridge count"):
+ HTTP.inspect_discovery_counts(events, {"discovered_events": 6, "discovered_ridges": 6})
+
+
+def test_historical_real_group_count_remains_verifiable():
+ source = ROOT / "evidence/audio/w1-fragments-20261102/reference-discovery/discovery.json"
+ events = json.loads(source.read_text())["events"]
+ assert HTTP.inspect_discovery_counts(events, {"discovered_events": 6}) == {
+ "event_groups": 6, "ridge_records": 6}
+
+
+def test_completed_real_upload_needing_time_does_not_satisfy_full_pipeline():
+ root = ROOT / "evidence/e2e-worker-20261103"
+ receipt = json.loads((root / "real-http-verification.json").read_text())
+ evidence = json.loads((root / "real-pipeline-evidence.json").read_text())
+ assert receipt["verification_passed"] is True
+ assert receipt["status"] == "needs_input"
+ assert evidence["passed"] is True
+ assert HTTP.complete_pipeline_with_candidates(evidence, receipt["candidate_count"]) is False