← Documentation

sorted_phase_v13_full.py

The full experimental pipeline behind Axis5 and the Tier3 v13 definition: from a single database, fits the Axis5 covariance/weight model, determines its thresholds, and classifies every block's Tier3 state and collapse phase, all in one run.

LocationIncluded in the DOI 1.7 Zenodo archive (Merutan_DOI1.7.zip)
RoleThe full experimental pipeline: performs the covariance fitting (from a 1,000,000-block sample), determines Axis5's feature weights and thresholds, and runs Axis5 inference on the same database, all in a single pass. comp_* is computed mean-centered: (xb,i − μi) × wi.
Used byDOI 1.6 and DOI 1.7 — builds analysis_delta, the table that generate_axis5_tier3_full_db.py later joins against to produce axis5_full, the table those reports' Tier3/Axis5 results were queried from. (A further step assembles the full meltan_integrated_viewer_*.duckdb database referenced in DOI 1.7's videos, combining that output with the Axis1 and Axis6 databases from the same pipeline; its schema has been public since DOI 1.0's appendix, though that assembly step itself isn't separately published; see generate_axis5_tier3_full_db.py for how the two relate.)
StatusCurrent, as documented in DOI 1.7 — a different concern entirely from the JOIN-based verification pipeline (create_alignment_db_single.py / import_ground_truth_data.py) that was corrected and replaced. No bug or correction has been published against this script.

What it does

Run interactively, in one pass, against a single database:

  1. Prompts (via a file-picker dialog) for a base database (tta_delta_results.duckdb), attaches it read-only as base, and writes all output to a new analysis_results.duckdb alongside it.
  2. Computes Δ-based feature differences (change in artifact, noise, texture, edges, and sharpness between original and processed blocks) and classifies each block into a coarse delta_phase and a finer delta_phase_detail.
  3. Fits the Axis5 covariance/weight model from a random 1,000,000-block sample, determines its P50/P75/T1/T2 thresholds (Tukey fences) against the full dataset, and writes the Axis5 severity value for every block.
  4. Computes Axis3 (a global, per-image phase classification from change-point detection over jump_sum_block: critical / transition / plateau_low / plateau_hi).
  5. Recomputes Tier3 under the v13 definition — a block is Tier3=1 when its PC1 depth is at or above the image's 75th percentile and its local SSIM is at or below the image's 90th percentile — separately for noTTA and TTA, plus the noTTA→TTA delta.
  6. Recomputes Axis1 (PC1-depth percentile buckets) for this pipeline's own internal consistency. This is a preserved, historical computation path within this file, kept so results stay reproducible against DOI 1.6/1.7 — the published, authoritative Axis1 definition is documented separately in DOI 1.3.
  7. Derives Axis2 (a Tier3 blind-spot flag: 1 when TTA newly triggers Tier3 where noTTA didn't) and Axis4 (a severity bucket derived from delta_phase_detail).
  8. Writes everything to analysis_delta, plus a SHA-256 hash of the output database and a short analysis_results_definition.md recording the exact Tier3 v13 definition used.

How to run it

Interactive, with no command-line arguments: running the script opens a file-picker dialog to choose the base database (tta_delta_results.duckdb). The output database is written alongside it, in the same folder, as analysis_results.duckdb.