Commit f4be977b authored by Andrey Filippov's avatar Andrey Filippov

CLAUDE: curt.pose_max_lma (lean inner cap, default 1) + one-line per-scene pose output

- pose_max_lma: inner LMA cap for the lean pose only (0 = legacy imp.max_LMA,
  which stays ~25 for flying-camera applications). 1 validated 07/13: static
  4x1 shape, dstored RMS 0.0350/0.0377/0.0213 == unlimited-inner run.
- Verbosity (Andrey): scene line now carries cyc=N and mb=(x, y); the separate
  'CuasPoseRT cycles:' trace and per-scene uniform-MB lines print only at
  curt.pose_lma_debug >= 1 (investigation closed; QC not-settled line stays).
Co-Authored-By: 's avatarClaude Fable 5 <noreply@anthropic.com>
parent 59f4182d
...@@ -559,6 +559,7 @@ public class CuasPoseRT { ...@@ -559,6 +559,7 @@ public class CuasPoseRT {
final double [][][] coord_motion_rslt, // out [3][][] final double [][][] coord_motion_rslt, // out [3][][]
final double [][][] corr_pd_out, // null or len-1: last-cycle PD correlations // By Claude on 07/04/2026 final double [][][] corr_pd_out, // null or len-1: last-cycle PD correlations // By Claude on 07/04/2026
final float [][] img_out, // null or len-1: last-cycle composite render // By Claude on 07/04/2026 final float [][] img_out, // null or len-1: last-cycle composite render // By Claude on 07/04/2026
final int [] ncyc_out, // null or [1]: outer cycles executed (for the one-line scene report) // By Claude on 07/13/2026
final int debugLevel) { final int debugLevel) {
final IntersceneLma intersceneLma = new IntersceneLma( final IntersceneLma intersceneLma = new IntersceneLma(
clt_parameters.ilp.ilma_thread_invariant, clt_parameters.ilp.ilma_thread_invariant,
...@@ -633,7 +634,10 @@ public class CuasPoseRT { ...@@ -633,7 +634,10 @@ public class CuasPoseRT {
clt_parameters.ilp.ilma_lambda_scale_bad, clt_parameters.ilp.ilma_lambda_scale_bad,
clt_parameters.ilp.ilma_lambda_max, clt_parameters.ilp.ilma_lambda_max,
clt_parameters.ilp.ilma_rms_diff, clt_parameters.ilp.ilma_rms_diff,
clt_parameters.imp.max_LMA, // lean-only inner cap (Andrey 07/13: 1 = validated static shape; the shared
// imp.max_LMA stays high for varying-scene applications). By Claude on 07/13/2026.
(clt_parameters.curt.pose_max_lma > 0) ?
clt_parameters.curt.pose_max_lma : clt_parameters.imp.max_LMA,
false, // last_run false, // last_run
lma_debug); // curt.pose_lma_debug boost (inner solver only) // By Claude on 07/12/2026 lma_debug); // curt.pose_lma_debug boost (inner solver only) // By Claude on 07/12/2026
if (lmaResult < 0) { if (lmaResult < 0) {
...@@ -663,12 +667,14 @@ public class CuasPoseRT { ...@@ -663,12 +667,14 @@ public class CuasPoseRT {
fixed_cycles+" fixed cycles: last ATR change "+last_diff_atr+ fixed_cycles+" fixed cycles: last ATR change "+last_diff_atr+
" >= exit_change_atr "+clt_parameters.imp.exit_change_atr); " >= exit_change_atr "+clt_parameters.imp.exit_change_atr);
} }
if (ncyc_out != null) ncyc_out[0] = ncyc; // for the one-line scene report // By Claude on 07/13/2026
// Per-cycle convergence trajectory (the "why does it take that many cycles" // Per-cycle convergence trajectory (the "why does it take that many cycles"
// investigation, Andrey 07/12/2026): geometric decay = healthy damped iteration, // investigation, Andrey 07/12/2026): geometric decay = healthy damped iteration,
// a stall/plateau = something re-anchoring each cycle (pull term, lambda warm-up, // a stall/plateau = something re-anchoring each cycle (pull term, lambda warm-up,
// prediction). One compact line per scene, both fixed and legacy modes. // prediction). One compact line per scene; gated by pose_lma_debug >= 1 after the
// By Claude on 07/12/2026. // 07/13 verbosity reduction (the investigation is closed - cyc= now rides the
if (debugLevel > -4) { // scene Done line). By Claude on 07/12/2026, gate 07/13.
if ((clt_parameters.curt.pose_lma_debug >= 1) && (debugLevel > -4)) {
final StringBuilder tsb = new StringBuilder(); final StringBuilder tsb = new StringBuilder();
for (int i = 0; i < ncyc; i++) tsb.append(String.format(" %.3g", cycle_datr[i])); for (int i = 0; i < ncyc; i++) tsb.append(String.format(" %.3g", cycle_datr[i]));
final StringBuilder isb = new StringBuilder(); // inner runLma iterations per cycle // By Claude on 07/12/2026 final StringBuilder isb = new StringBuilder(); // inner runLma iterations per cycle // By Claude on 07/12/2026
...@@ -1078,7 +1084,8 @@ public class CuasPoseRT { ...@@ -1078,7 +1084,8 @@ public class CuasPoseRT {
if (mb_vectors_scene == null) { if (mb_vectors_scene == null) {
System.out.println("CuasPoseRT: scene "+ts_name+ System.out.println("CuasPoseRT: scene "+ts_name+
" uniform MB degenerate - falling back to per-tile getMotionBlur"); " uniform MB degenerate - falling back to per-tile getMotionBlur");
} else if (debugLevel > -3) { } else if (clt_parameters.curt.pose_lma_debug >= 1) {
// verbosity reduction 07/13: mb=() now rides the scene Done line
System.out.println(String.format( System.out.println(String.format(
"CuasPoseRT: scene %s uniform MB vector = (%.4f, %.4f) px/s", "CuasPoseRT: scene %s uniform MB vector = (%.4f, %.4f) px/s",
ts_name, mb_vectors_scene[0][0], mb_vectors_scene[1][0])); ts_name, mb_vectors_scene[0][0], mb_vectors_scene[1][0]));
...@@ -1098,6 +1105,7 @@ public class CuasPoseRT { ...@@ -1098,6 +1105,7 @@ public class CuasPoseRT {
} }
} }
fail_reason[0] = 0; fail_reason[0] = 0;
final int [] ncyc_scene = {0}; // outer cycles executed (lean path; 0 = other paths) // By Claude on 07/13/2026
final double [][][] coord_motion_rslt = new double [3][][]; // [centers, vector_XYS, eigen] of the last LMA cycle final double [][][] coord_motion_rslt = new double [3][][]; // [centers, vector_XYS, eigen] of the last LMA cycle
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
...@@ -1154,6 +1162,7 @@ public class CuasPoseRT { ...@@ -1154,6 +1162,7 @@ public class CuasPoseRT {
coord_motion_rslt, // double [][][] coord_motion_rslt (out), coord_motion_rslt, // double [][][] coord_motion_rslt (out),
corr_pd_holder, // double [][][] corr_pd_out (last-cycle PD correlations) // By Claude on 07/04/2026 corr_pd_holder, // double [][][] corr_pd_out (last-cycle PD correlations) // By Claude on 07/04/2026
img_holder, // float [][] img_out (last-cycle composite render) // By Claude on 07/04/2026 img_holder, // float [][] img_out (last-cycle composite render) // By Claude on 07/04/2026
ncyc_scene, // int [] ncyc_out (outer cycles, for the one-line report) // By Claude on 07/13/2026
debugLevel - 2); // int debug_level debugLevel - 2); // int debug_level
if (pose == null) fail_reason[0] = 1; // measurement/LMA if (pose == null) fail_reason[0] = 1; // measurement/LMA
} else { } else {
...@@ -1271,6 +1280,12 @@ public class CuasPoseRT { ...@@ -1271,6 +1280,12 @@ public class CuasPoseRT {
sl.append("CuasPoseRT scene "+nscene+" (of "+quadCLTs.length+") "+ts_name+ sl.append("CuasPoseRT scene "+nscene+" (of "+quadCLTs.length+") "+ts_name+
(ok ? " Done." : " FAILED (coasted).")+ (ok ? " Done." : " FAILED (coasted).")+
String.format(" RMS=%.4f, weight=%.1f, num=%.0f", lma_rms[0], lma_rms[2], lma_rms[3])); String.format(" RMS=%.4f, weight=%.1f, num=%.0f", lma_rms[0], lma_rms[2], lma_rms[3]));
// one-line verbosity (Andrey 07/13): cycles + uniform MB vector fold into the
// scene line (the separate trace/MB lines are now pose_lma_debug >= 1 only)
if (ncyc_scene[0] > 0) sl.append(", cyc="+ncyc_scene[0]);
if ((mb_vectors_scene != null) && clt_parameters.curt.pose_mb_uniform) {
sl.append(String.format(", mb=(%.1f, %.1f)", mb_vectors_scene[0][0], mb_vectors_scene[1][0]));
}
if (st != null) { if (st != null) {
sl.append(" dstored[pix]=["); sl.append(" dstored[pix]=[");
for (int j = 0; j < 3; j++) { for (int j = 0; j < 3; j++) {
......
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