Commit b5e1fcd9 authored by Andrey Filippov's avatar Andrey Filippov

CLAUDE: lean pose DEBUG: pose_stored - stored poses, no LMA (decouple render from solver)

Per Andrey: static per-tile dx offsets found in -POSE-RT-HYPER (e.g. tile
x=15,y=41: dx mean +0.92 constant over all 497 scenes, far tile disp 0.02;
tile x=71,y=51: dx +0.86 dy +1.91, near tile disp 13.2 - neighbors with
similar disparity are near zero) -> suspect broken per-tile task data.

New checkbox "Pose test stored poses (no LMA)" (curt.pose_stored): every
scene is measured/rendered at its STORED (oracle-vintage) pose, the LMA is
skipped entirely. -POSE-RT-HYPER/-CORR2D/-COMPOSITE come from that single
measurement; CSV rms column = weighted RMS of the measured offsets.
The -POSE-RT-COMPOSITE "real" component must then match the oracle
CUAS-MERGED-CUAS-DBG per-scene renders tile-for-tile (and "virtual" its
[average] slice) - any mismatch localizes the broken tiles in the
task/render/correlation chain, independent of the solver.

Observability only - the fitting paths are unchanged.
Verified: mvn -DskipTests clean package OK.
Co-Authored-By: 's avatarClaude Fable 5 <noreply@anthropic.com>
parent a01a6381
...@@ -663,6 +663,11 @@ public class CuasPoseRT { ...@@ -663,6 +663,11 @@ public class CuasPoseRT {
"TD-average(16) x virtual-center single conj-multiply. NOTE: no MB compensation "+ "TD-average(16) x virtual-center single conj-multiply. NOTE: no MB compensation "+
"in lean v1 - compare against the NOMB baseline"); "in lean v1 - compare against the NOMB baseline");
} }
if (clt_parameters.curt.pose_stored) { // By Claude on 07/04/2026
System.out.println("CuasPoseRT.testPoseSequence(): pose_stored ON (DEBUG) - STORED poses, "+
"NO LMA: measurement/render chain only"+
(clt_parameters.curt.pose_lean ? "" : " (only implemented for the LEAN engine - ignored)"));
}
// DEBUG (pose_corr_save): render per-scene pixel-domain correlations vs the virtual // DEBUG (pose_corr_save): render per-scene pixel-domain correlations vs the virtual
// center (-POSE-RT-CORR2D, z=scenes, last LMA cycle, 16x16 cells per tile) - the same // center (-POSE-RT-CORR2D, z=scenes, last LMA cycle, 16x16 cells per tile) - the same
// visual debugging used on the oracle. Lean only: the oracle engine does not expose // visual debugging used on the oracle. Lean only: the oracle engine does not expose
...@@ -776,7 +781,38 @@ public class CuasPoseRT { ...@@ -776,7 +781,38 @@ public class CuasPoseRT {
if (corr_pd_holder != null) corr_pd_holder[0] = null; // no stale slices on failure // By Claude on 07/04/2026 if (corr_pd_holder != null) corr_pd_holder[0] = null; // no stale slices on failure // By Claude on 07/04/2026
if (img_holder != null) img_holder[0] = null; // By Claude on 07/04/2026 if (img_holder != null) img_holder[0] = null; // By Claude on 07/04/2026
double [][] pose; double [][] pose;
if (clt_parameters.curt.pose_lean) { if (clt_parameters.curt.pose_lean && clt_parameters.curt.pose_stored) {
// DEBUG (pose_stored): measurement/render at the STORED pose, NO LMA - decouples
// the task/render/correlation chain from the solver. The composite must then match
// the oracle CUAS-MERGED-CUAS-DBG renders tile-for-tile. By Claude on 07/04/2026.
final double [][] use_pose = (stored[nscene] != null) ? stored[nscene] : predicted;
if (stored[nscene] == null) {
System.out.println("CuasPoseRT: scene "+nscene+" ("+ts_name+") pose_stored: no stored pose, using prediction");
}
final double [][][] cm = leanMeasure(
clt_parameters, image_dtt_lean, center_CLT, quadCLTs[nscene],
center_disparity, pXpYD_center, reliable_ref,
use_pose[0], use_pose[1], margin,
corr_pd_holder, img_holder, debugLevel - 2);
if (cm != null) {
pose = new double [][] {use_pose[0].clone(), use_pose[1].clone()};
for (int i = 0; (i < coord_motion_rslt.length) && (i < cm.length); i++) {
coord_motion_rslt[i] = cm[i];
}
double sw = 0, s2 = 0; int nm = 0;
for (double [] v : cm[1]) if (v != null) {
sw += v[2];
s2 += v[2]*(v[0]*v[0] + v[1]*v[1]);
nm++;
}
lma_rms[0] = (sw > 0) ? Math.sqrt(s2/sw) : Double.NaN; // weighted RMS of measured offsets
if (lma_rms.length > 2) lma_rms[2] = sw;
if (lma_rms.length > 3) lma_rms[3] = nm;
} else {
pose = null;
fail_reason[0] = 1;
}
} else if (clt_parameters.curt.pose_lean) {
pose = leanFitScene( pose = leanFitScene(
clt_parameters, // CLTParameters clt_parameters, clt_parameters, // CLTParameters clt_parameters,
image_dtt_lean, // ImageDtt image_dtt, image_dtt_lean, // ImageDtt image_dtt,
......
...@@ -27,6 +27,7 @@ public class CuasRtParameters { ...@@ -27,6 +27,7 @@ public class CuasRtParameters {
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
public boolean pose_img_save = false; // DEBUG: save the composite scenes actually correlated - imclt render of the consolidated 16-sensor TD average at the converged pose (-POSE-RT-COMPOSITE: z=scenes; NaN outside task tiles) + the virtual-center reference render (-POSE-RT-CENTER-REF). Lean engine only. // By Claude on 07/04/2026 public boolean pose_img_save = false; // DEBUG: save the composite scenes actually correlated - imclt render of the consolidated 16-sensor TD average at the converged pose (-POSE-RT-COMPOSITE: z=scenes; NaN outside task tiles) + the virtual-center reference render (-POSE-RT-CENTER-REF). Lean engine only. // By Claude on 07/04/2026
public boolean pose_stored = false; // DEBUG: decouple rendering/measurement from the LMA - use the STORED (oracle vintage) pose for every scene, no adjustment; one leanMeasure per scene feeds -POSE-RT-HYPER/-CORR2D/-COMPOSITE. The composite must then match the oracle CUAS-MERGED-CUAS-DBG renders tile-for-tile. Lean engine only. // By Claude on 07/04/2026
public double psf_radius = 1.0; // sensor PSF radius for LoG pre-filter public double psf_radius = 1.0; // sensor PSF radius for LoG pre-filter
public double n_sigma = 4.0; // cutoff LoG kernel array, number of sigmas public double n_sigma = 4.0; // cutoff LoG kernel array, number of sigmas
public int pyramid = 7; // temporal pyramid levels public int pyramid = 7; // temporal pyramid levels
...@@ -106,6 +107,8 @@ public class CuasRtParameters { ...@@ -106,6 +107,8 @@ public class CuasRtParameters {
"DEBUG: save per-scene pixel-domain 2D correlations vs the virtual center (-POSE-RT-CORR2D, z=scenes, last LMA cycle). Lean engine only."); "DEBUG: save per-scene pixel-domain 2D correlations vs the virtual center (-POSE-RT-CORR2D, z=scenes, last LMA cycle). Lean engine only.");
gd.addCheckbox ("Pose test save composite scenes", this.pose_img_save, // By Claude on 07/04/2026 gd.addCheckbox ("Pose test save composite scenes", this.pose_img_save, // By Claude on 07/04/2026
"DEBUG: save the rendered composite (TD-averaged, grid-transformed) scenes correlated against the virtual center (-POSE-RT-COMPOSITE, z=scenes) + the center reference render (-POSE-RT-CENTER-REF). Lean engine only."); "DEBUG: save the rendered composite (TD-averaged, grid-transformed) scenes correlated against the virtual center (-POSE-RT-COMPOSITE, z=scenes) + the center reference render (-POSE-RT-CENTER-REF). Lean engine only.");
gd.addCheckbox ("Pose test stored poses (no LMA)", this.pose_stored, // By Claude on 07/04/2026
"DEBUG: measure/render every scene at its STORED pose, skip the LMA entirely - decouples the task/render/correlation chain from the solver. Lean engine only.");
gd.addMessage("=== LoG prefilter ==="); gd.addMessage("=== LoG prefilter ===");
gd.addNumericField("Optical PSF radius", this.psf_radius, 6,8,"pix", gd.addNumericField("Optical PSF radius", this.psf_radius, 6,8,"pix",
...@@ -240,6 +243,7 @@ public class CuasRtParameters { ...@@ -240,6 +243,7 @@ public class CuasRtParameters {
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
this.pose_img_save = gd.getNextBoolean(); // By Claude on 07/04/2026 this.pose_img_save = gd.getNextBoolean(); // By Claude on 07/04/2026
this.pose_stored = gd.getNextBoolean(); // By Claude on 07/04/2026
this.psf_radius = gd.getNextNumber(); this.psf_radius = gd.getNextNumber();
this.n_sigma = gd.getNextNumber(); this.n_sigma = gd.getNextNumber();
...@@ -318,6 +322,7 @@ public class CuasRtParameters { ...@@ -318,6 +322,7 @@ public class CuasRtParameters {
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
properties.setProperty(prefix+"pose_img_save", this.pose_img_save+""); // boolean // By Claude on 07/04/2026 properties.setProperty(prefix+"pose_img_save", this.pose_img_save+""); // boolean // By Claude on 07/04/2026
properties.setProperty(prefix+"pose_stored", this.pose_stored+""); // boolean // By Claude on 07/04/2026
properties.setProperty(prefix+"psf_radius", this.psf_radius+""); // double properties.setProperty(prefix+"psf_radius", this.psf_radius+""); // double
properties.setProperty(prefix+"n_sigma", this.n_sigma+""); // double properties.setProperty(prefix+"n_sigma", this.n_sigma+""); // double
...@@ -396,6 +401,7 @@ public class CuasRtParameters { ...@@ -396,6 +401,7 @@ public class CuasRtParameters {
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
if (properties.getProperty(prefix+"pose_img_save")!=null) this.pose_img_save=Boolean.parseBoolean(properties.getProperty(prefix+"pose_img_save")); // By Claude on 07/04/2026 if (properties.getProperty(prefix+"pose_img_save")!=null) this.pose_img_save=Boolean.parseBoolean(properties.getProperty(prefix+"pose_img_save")); // By Claude on 07/04/2026
if (properties.getProperty(prefix+"pose_stored")!=null) this.pose_stored=Boolean.parseBoolean(properties.getProperty(prefix+"pose_stored")); // By Claude on 07/04/2026
if (properties.getProperty(prefix+"psf_radius")!=null) this.psf_radius=Double.parseDouble(properties.getProperty(prefix+"psf_radius")); if (properties.getProperty(prefix+"psf_radius")!=null) this.psf_radius=Double.parseDouble(properties.getProperty(prefix+"psf_radius"));
if (properties.getProperty(prefix+"n_sigma")!=null) this.n_sigma=Double.parseDouble(properties.getProperty(prefix+"n_sigma")); if (properties.getProperty(prefix+"n_sigma")!=null) this.n_sigma=Double.parseDouble(properties.getProperty(prefix+"n_sigma"));
...@@ -477,6 +483,7 @@ public class CuasRtParameters { ...@@ -477,6 +483,7 @@ public class CuasRtParameters {
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
cp.pose_img_save = this.pose_img_save; // By Claude on 07/04/2026 cp.pose_img_save = this.pose_img_save; // By Claude on 07/04/2026
cp.pose_stored = this.pose_stored; // By Claude on 07/04/2026
cp.psf_radius = this.psf_radius; cp.psf_radius = this.psf_radius;
cp.n_sigma = this.n_sigma; cp.n_sigma = this.n_sigma;
cp.pyramid = this.pyramid; cp.pyramid = this.pyramid;
......
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