Commit 3b039760 authored by Andrey Filippov's avatar Andrey Filippov

CLAUDE: item-4 R3b - det_merged_file: explicit merged-CUAS stack override for the mode-3 detector

Andrey 07/20: A/B must borrow another version dir's merged stack while
STAYING in the current version dir (switching x3d versions rebuilds all
pre-curt files). New saved param curt.det_merged_file (file, directory =
newest *-CUAS-MERGED-CUAS.tiff, bare name = relative to model dir; empty =
the old model-dir scan). Outputs still land in the model dir; fail-loud.
Co-Authored-By: 's avatarClaude Fable 5 <noreply@anthropic.com>
parent 6b67e25e
...@@ -76,7 +76,28 @@ public class CuasDetectRT { ...@@ -76,7 +76,28 @@ public class CuasDetectRT {
// The REAL stack is always the pyramid base (gives the full-length levels); the synthetic // By Claude on 06/14/2026 // The REAL stack is always the pyramid base (gives the full-length levels); the synthetic // By Claude on 06/14/2026
// reference grid (if curt_synth_src) is loaded separately (inside ingest()) and injected per-level. // reference grid (if curt_synth_src) is loaded separately (inside ingest()) and injected per-level.
final String fpixels_suffix = SUFFIX_FPIXELS_TIFF; // By Claude on 06/14/2026 final String fpixels_suffix = SUFFIX_FPIXELS_TIFF; // By Claude on 06/14/2026
String [] fpixels_paths = CorrectionParameters.getFilesByExtensionAsArray(model_directory, fpixels_suffix); // By Claude on 06/11/2026 // item 4 R3 (Andrey 07/20): explicit merged-stack override - lets an A/B consume another version
// dir's stack while STAYING in the current version dir (switching x3d versions rebuilds all
// pre-curt files). Empty = the old model-dir scan. Fail-LOUD like det_rt_log_file. By Claude on 07/20/2026
final String merged_override = clt_parameters.curt.det_merged_file.trim();
String [] fpixels_paths;
if (!merged_override.isEmpty()) {
String mp = merged_override;
if (!new java.io.File(mp).exists() && !new java.io.File(mp).isAbsolute()) {
mp = model_directory + java.io.File.separator + merged_override; // bare name = relative to the model dir
}
java.io.File mf = new java.io.File(mp);
if (mf.isDirectory()) { // directory = its newest matching stack
String [] cand = CorrectionParameters.getFilesByExtensionAsArray(mf.getPath(), fpixels_suffix);
if (cand.length == 0) throw new IllegalStateException("det_merged_file: no *"+fpixels_suffix+" in directory "+mf.getPath());
mp = newestFile(cand);
}
if (!new java.io.File(mp).exists()) throw new IllegalStateException("det_merged_file: not found: "+merged_override);
fpixels_paths = new String [] {mp};
System.out.println("CuasDetectRT: merged-CUAS stack OVERRIDE (curt.det_merged_file): "+mp+" (outputs still -> "+model_directory+")");
} else {
fpixels_paths = CorrectionParameters.getFilesByExtensionAsArray(model_directory, fpixels_suffix); // By Claude on 06/11/2026
}
if (fpixels_paths.length > 0) { if (fpixels_paths.length > 0) {
fpixels_file = newestFile(fpixels_paths); // pick up the newest matching file // By Claude on 06/14/2026 fpixels_file = newestFile(fpixels_paths); // pick up the newest matching file // By Claude on 06/14/2026
if (fpixels_paths.length > 1) { if (fpixels_paths.length > 1) {
......
...@@ -36,6 +36,7 @@ public class CuasRtParameters { ...@@ -36,6 +36,7 @@ public class CuasRtParameters {
public double det_ema_rate = 0.02; // item 4 R2 (ruling 3.1: EMA refresh reasonable to TRY): per-scene EMA rate of the post-LoG average, avg += rate*(LoG - avg) where the gate admits. 0 = OFF (prior-file-only base, no refresh). // By Claude on 07/19/2026 public double det_ema_rate = 0.02; // item 4 R2 (ruling 3.1: EMA refresh reasonable to TRY): per-scene EMA rate of the post-LoG average, avg += rate*(LoG - avg) where the gate admits. 0 = OFF (prior-file-only base, no refresh). // By Claude on 07/19/2026
public double det_ema_gate = 10.0; // item 4 R2 (ruling 3.1: the EMA MUST be gated so extremely slow-apparent-motion targets - fast but head-on, ~static px - are never absorbed into the background): update only where |LoG - avg| <= this (post-LoG counts). <=0 = UNGATED (a loud console warning; only for experiments). Default 10 is a placeholder dial - size it from the post-LoG noise floor of real runs. // By Claude on 07/19/2026 public double det_ema_gate = 10.0; // item 4 R2 (ruling 3.1: the EMA MUST be gated so extremely slow-apparent-motion targets - fast but head-on, ~static px - are never absorbed into the background): update only where |LoG - avg| <= this (post-LoG counts). <=0 = UNGATED (a loud console warning; only for experiments). Default 10 is a placeholder dial - size it from the post-LoG noise floor of real runs. // By Claude on 07/19/2026
public String det_rt_log_file = ""; // item 4 R3 (detector A/B): path to a pose-RT run's -CUAS-RT-LOG stack (det_log_save output; a directory = use its newest *-CUAS-RT-LOG.tiff). Non-empty = the offline detector (proc mode 3) consumes these RT detection frames INSTEAD of its own subtract-avg+LoG conditioning; when the merged-CUAS stack is also present AND curt_subtract_avg is on, the offline frames are still computed and compared (RELATIVE tol, ruling 3.3 - offline subtracts PRE-LoG, RT subtracts POST-LoG, equal by linearity except NaN edges). Outputs get an -RTLOG name suffix. Empty = normal offline path. // By Claude on 07/19/2026 public String det_rt_log_file = ""; // item 4 R3 (detector A/B): path to a pose-RT run's -CUAS-RT-LOG stack (det_log_save output; a directory = use its newest *-CUAS-RT-LOG.tiff). Non-empty = the offline detector (proc mode 3) consumes these RT detection frames INSTEAD of its own subtract-avg+LoG conditioning; when the merged-CUAS stack is also present AND curt_subtract_avg is on, the offline frames are still computed and compared (RELATIVE tol, ruling 3.3 - offline subtracts PRE-LoG, RT subtracts POST-LoG, equal by linearity except NaN edges). Outputs get an -RTLOG name suffix. Empty = normal offline path. // By Claude on 07/19/2026
public String det_merged_file = ""; // item 4 R3 (Andrey 07/20: testing vs previous results while STAYING in the current version dir - switching x3d versions rebuilds all pre-curt files): explicit merged-CUAS stack for the mode-3 detector (a directory = its newest *-CUAS-MERGED-CUAS.tiff; a bare name = relative to the model dir). Empty = scan the model dir as before. Outputs still land in the model dir. Fail-loud if set and not found. // By Claude on 07/20/2026
public boolean pose_lean = false; // phase B measurement engine: TD-average the 16 sensors (CuasTD, CPU bridge) then ONE conj-multiply vs the virtual-center TD -> FZ-normalize -> PD -> argmax+eigen (getMaxXYCmEig) -> 3-angle LMA. All existing GPU kernels. v1: NO motion-blur compensation - compare vs the NOMB baseline. // By Claude on 07/05/2026 public boolean pose_lean = false; // phase B measurement engine: TD-average the 16 sensors (CuasTD, CPU bridge) then ONE conj-multiply vs the virtual-center TD -> FZ-normalize -> PD -> argmax+eigen (getMaxXYCmEig) -> 3-angle LMA. All existing GPU kernels. v1: NO motion-blur compensation - compare vs the NOMB baseline. // By Claude on 07/05/2026
public boolean pose_full = false; // DEBUG: use ALL strength-selected tiles (~1074) - the -POSE-RT-TILE-CALIB calibration is neither read nor written (temporary bypass of the 150-tile filter for measurement debugging). // By Claude on 07/04/2026 public boolean pose_full = false; // DEBUG: use ALL strength-selected tiles (~1074) - the -POSE-RT-TILE-CALIB calibration is neither read nor written (temporary bypass of the 150-tile filter for measurement debugging). // By Claude on 07/04/2026
public boolean pose_corr_save = false; // DEBUG: save the per-scene 2D correlations vs the virtual center in the pixel domain (-POSE-RT-CORR2D: z=scenes, tile grid of 16x16 cells, last LMA cycle) - lean engine only. // By Claude on 07/04/2026 public boolean pose_corr_save = false; // DEBUG: save the per-scene 2D correlations vs the virtual center in the pixel domain (-POSE-RT-CORR2D: z=scenes, tile grid of 16x16 cells, last LMA cycle) - lean engine only. // By Claude on 07/04/2026
...@@ -175,6 +176,8 @@ public class CuasRtParameters { ...@@ -175,6 +176,8 @@ public class CuasRtParameters {
"Item 4 R2 (ruling 3.1: the EMA MUST be gated): update the average only where |LoG-avg| is at most this (post-LoG counts) so slow-apparent-motion targets are never absorbed. <=0 = UNGATED (loud warning; experiments only)."); "Item 4 R2 (ruling 3.1: the EMA MUST be gated): update the average only where |LoG-avg| is at most this (post-LoG counts) so slow-apparent-motion targets are never absorbed. <=0 = UNGATED (loud warning; experiments only).");
gd.addStringField("RT LoG stack for detection (A/B)", this.det_rt_log_file, 60, // By Claude on 07/19/2026 (item 4 R3) gd.addStringField("RT LoG stack for detection (A/B)", this.det_rt_log_file, 60, // By Claude on 07/19/2026 (item 4 R3)
"Item 4 R3 detector A/B: path to a pose-RT run's -CUAS-RT-LOG stack (or a directory holding one). Non-empty = the offline detector consumes these RT detection frames instead of its own subtract-avg+LoG; with the merged stack present and subtract-average on, the offline frames are also computed and compared (RELATIVE tol). Outputs get -RTLOG in the name. Empty = normal offline path."); "Item 4 R3 detector A/B: path to a pose-RT run's -CUAS-RT-LOG stack (or a directory holding one). Non-empty = the offline detector consumes these RT detection frames instead of its own subtract-avg+LoG; with the merged stack present and subtract-average on, the offline frames are also computed and compared (RELATIVE tol). Outputs get -RTLOG in the name. Empty = normal offline path.");
gd.addStringField("Merged-CUAS stack for detection (A/B)", this.det_merged_file, 60, // By Claude on 07/20/2026 (item 4 R3)
"Explicit merged-CUAS stack for the offline detector (a directory = its newest *-CUAS-MERGED-CUAS.tiff) - lets an A/B use another version dir's stack while STAYING in the current version dir (switching x3d versions rebuilds all pre-curt files). Empty = scan the model dir as before. Outputs still land in the model dir.");
gd.addCheckbox ("Pose test lean correlation (B)", this.pose_lean, // By Claude on 07/05/2026 gd.addCheckbox ("Pose test lean correlation (B)", this.pose_lean, // By Claude on 07/05/2026
"Phase B measurement: TD-average the 16 sensors, then ONE conj-multiply vs the virtual-center TD -> FZ-normalize -> PD -> argmax+eigen -> 3-angle LMA. v1 has NO motion-blur compensation (compare vs the NOMB baseline)."); "Phase B measurement: TD-average the 16 sensors, then ONE conj-multiply vs the virtual-center TD -> FZ-normalize -> PD -> argmax+eigen -> 3-angle LMA. v1 has NO motion-blur compensation (compare vs the NOMB baseline).");
...@@ -402,6 +405,7 @@ public class CuasRtParameters { ...@@ -402,6 +405,7 @@ public class CuasRtParameters {
this.det_ema_rate = gd.getNextNumber(); // By Claude on 07/19/2026 (item 4 R2) this.det_ema_rate = gd.getNextNumber(); // By Claude on 07/19/2026 (item 4 R2)
this.det_ema_gate = gd.getNextNumber(); // By Claude on 07/19/2026 (item 4 R2) this.det_ema_gate = gd.getNextNumber(); // By Claude on 07/19/2026 (item 4 R2)
this.det_rt_log_file = gd.getNextString().trim();// By Claude on 07/19/2026 (item 4 R3) this.det_rt_log_file = gd.getNextString().trim();// By Claude on 07/19/2026 (item 4 R3)
this.det_merged_file = gd.getNextString().trim();// By Claude on 07/20/2026 (item 4 R3)
this.pose_lean = gd.getNextBoolean(); // By Claude on 07/05/2026 this.pose_lean = gd.getNextBoolean(); // By Claude on 07/05/2026
this.pose_full = gd.getNextBoolean(); // By Claude on 07/04/2026 this.pose_full = gd.getNextBoolean(); // By Claude on 07/04/2026
this.pose_corr_save = gd.getNextBoolean(); // By Claude on 07/04/2026 this.pose_corr_save = gd.getNextBoolean(); // By Claude on 07/04/2026
...@@ -524,6 +528,7 @@ public class CuasRtParameters { ...@@ -524,6 +528,7 @@ public class CuasRtParameters {
properties.setProperty(prefix+"det_ema_rate", this.det_ema_rate+""); // double // By Claude on 07/19/2026 (item 4 R2) properties.setProperty(prefix+"det_ema_rate", this.det_ema_rate+""); // double // By Claude on 07/19/2026 (item 4 R2)
properties.setProperty(prefix+"det_ema_gate", this.det_ema_gate+""); // double // By Claude on 07/19/2026 (item 4 R2) properties.setProperty(prefix+"det_ema_gate", this.det_ema_gate+""); // double // By Claude on 07/19/2026 (item 4 R2)
properties.setProperty(prefix+"det_rt_log_file", this.det_rt_log_file); // String // By Claude on 07/19/2026 (item 4 R3) properties.setProperty(prefix+"det_rt_log_file", this.det_rt_log_file); // String // By Claude on 07/19/2026 (item 4 R3)
properties.setProperty(prefix+"det_merged_file", this.det_merged_file); // String // By Claude on 07/20/2026 (item 4 R3)
properties.setProperty(prefix+"pose_lean", this.pose_lean+""); // boolean // By Claude on 07/05/2026 properties.setProperty(prefix+"pose_lean", this.pose_lean+""); // boolean // By Claude on 07/05/2026
properties.setProperty(prefix+"pose_full", this.pose_full+""); // boolean // By Claude on 07/04/2026 properties.setProperty(prefix+"pose_full", this.pose_full+""); // boolean // By Claude on 07/04/2026
properties.setProperty(prefix+"pose_corr_save", this.pose_corr_save+""); // boolean // By Claude on 07/04/2026 properties.setProperty(prefix+"pose_corr_save", this.pose_corr_save+""); // boolean // By Claude on 07/04/2026
...@@ -646,6 +651,7 @@ public class CuasRtParameters { ...@@ -646,6 +651,7 @@ public class CuasRtParameters {
if (properties.getProperty(prefix+"det_ema_rate")!=null) this.det_ema_rate=Double.parseDouble(properties.getProperty(prefix+"det_ema_rate")); // By Claude on 07/19/2026 (item 4 R2) if (properties.getProperty(prefix+"det_ema_rate")!=null) this.det_ema_rate=Double.parseDouble(properties.getProperty(prefix+"det_ema_rate")); // By Claude on 07/19/2026 (item 4 R2)
if (properties.getProperty(prefix+"det_ema_gate")!=null) this.det_ema_gate=Double.parseDouble(properties.getProperty(prefix+"det_ema_gate")); // By Claude on 07/19/2026 (item 4 R2) if (properties.getProperty(prefix+"det_ema_gate")!=null) this.det_ema_gate=Double.parseDouble(properties.getProperty(prefix+"det_ema_gate")); // By Claude on 07/19/2026 (item 4 R2)
if (properties.getProperty(prefix+"det_rt_log_file")!=null) this.det_rt_log_file=properties.getProperty(prefix+"det_rt_log_file").trim(); // By Claude on 07/19/2026 (item 4 R3) if (properties.getProperty(prefix+"det_rt_log_file")!=null) this.det_rt_log_file=properties.getProperty(prefix+"det_rt_log_file").trim(); // By Claude on 07/19/2026 (item 4 R3)
if (properties.getProperty(prefix+"det_merged_file")!=null) this.det_merged_file=properties.getProperty(prefix+"det_merged_file").trim(); // By Claude on 07/20/2026 (item 4 R3)
if (properties.getProperty(prefix+"pose_lean")!=null) this.pose_lean=Boolean.parseBoolean(properties.getProperty(prefix+"pose_lean")); // By Claude on 07/05/2026 if (properties.getProperty(prefix+"pose_lean")!=null) this.pose_lean=Boolean.parseBoolean(properties.getProperty(prefix+"pose_lean")); // By Claude on 07/05/2026
if (properties.getProperty(prefix+"pose_full")!=null) this.pose_full=Boolean.parseBoolean(properties.getProperty(prefix+"pose_full")); // By Claude on 07/04/2026 if (properties.getProperty(prefix+"pose_full")!=null) this.pose_full=Boolean.parseBoolean(properties.getProperty(prefix+"pose_full")); // By Claude on 07/04/2026
if (properties.getProperty(prefix+"pose_corr_save")!=null) this.pose_corr_save=Boolean.parseBoolean(properties.getProperty(prefix+"pose_corr_save")); // By Claude on 07/04/2026 if (properties.getProperty(prefix+"pose_corr_save")!=null) this.pose_corr_save=Boolean.parseBoolean(properties.getProperty(prefix+"pose_corr_save")); // By Claude on 07/04/2026
...@@ -771,6 +777,7 @@ public class CuasRtParameters { ...@@ -771,6 +777,7 @@ public class CuasRtParameters {
cp.det_ema_rate = this.det_ema_rate; // By Claude on 07/19/2026 (item 4 R2) cp.det_ema_rate = this.det_ema_rate; // By Claude on 07/19/2026 (item 4 R2)
cp.det_ema_gate = this.det_ema_gate; // By Claude on 07/19/2026 (item 4 R2) cp.det_ema_gate = this.det_ema_gate; // By Claude on 07/19/2026 (item 4 R2)
cp.det_rt_log_file = this.det_rt_log_file; // By Claude on 07/19/2026 (item 4 R3) cp.det_rt_log_file = this.det_rt_log_file; // By Claude on 07/19/2026 (item 4 R3)
cp.det_merged_file = this.det_merged_file; // By Claude on 07/20/2026 (item 4 R3)
cp.pose_lean = this.pose_lean; cp.pose_lean = this.pose_lean;
cp.pose_full = this.pose_full; // By Claude on 07/04/2026 cp.pose_full = this.pose_full; // By Claude on 07/04/2026
cp.pose_corr_save = this.pose_corr_save; // By Claude on 07/04/2026 cp.pose_corr_save = this.pose_corr_save; // By Claude on 07/04/2026
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment