Commit 4ff201fa authored by Andrey Filippov's avatar Andrey Filippov

CLAUDE: curt.pose_lma_debug - per-inner-step solver logging for the pose LMA

New int knob (0 = quiet): >=2 passes the level into the inner runLma so its
existing per-step line prints (good/done flags, full/pure RMS, lambda), with a
CuasPoseRT header attributing each block to its scene + outer cycle; 3-4 =
the solver's deeper dumps. Shared IntersceneLma untouched.
Co-Authored-By: 's avatarClaude Fable 5 <noreply@anthropic.com>
parent 972bcbda
......@@ -608,6 +608,14 @@ public class CuasPoseRT {
(nlma == 0), // first_run
null, // dbg_prefix
clt_parameters.imp.debug_level); // debug_level
// pose_lma_debug >= 2: per-inner-step solver lines; header attributes them to
// their outer cycle (the solver lines carry no scene/cycle context).
// By Claude on 07/12/2026, from Andrey's request.
final int lma_debug = Math.max(debugLevel, clt_parameters.curt.pose_lma_debug);
if (clt_parameters.curt.pose_lma_debug >= 2) {
System.out.println("CuasPoseRT innerLMA: scene "+scene.getImageName()+
" outer cycle "+nlma+" (lambda0 "+lma_lambda+"):");
}
final int lmaResult = intersceneLma.runLma(
lma_lambda, // curt.pose_lambda override (0 = legacy ilp.ilma_lambda) // By Claude on 07/12/2026
clt_parameters.ilp.ilma_lambda_scale_good,
......@@ -616,7 +624,7 @@ public class CuasPoseRT {
clt_parameters.ilp.ilma_rms_diff,
clt_parameters.imp.max_LMA,
false, // last_run
debugLevel);
lma_debug); // curt.pose_lma_debug boost (inner solver only) // By Claude on 07/12/2026
if (lmaResult < 0) {
System.out.println("leanFitScene(): LMA failed, lmaResult="+lmaResult);
return null;
......
......@@ -31,6 +31,7 @@ public class CuasRtParameters {
public boolean pose_mb_uniform = true; // lean v2 (Andrey's ruling 07/12/2026): ONE uniform motion-blur vector per scene, shared by ALL tiles - under constant-rpm rotation the image flow is uniform across the frame up to the roll flow component (roll rate << azimuth/tilt) and the wobble contribution (second-degree), both ignored. Same Jacobian-times-rates product as the per-tile OpticalFlow.getMotionBlur (identical sign/scale conventions), evaluated at ONE representative point (frame center, mean reference disparity) and broadcast; rates source unchanged (finite differences of predicted poses). OFF = legacy per-tile getMotionBlur (the A/B knob). // By Claude on 07/12/2026
public int pose_cycles = 3; // lean v2 (Andrey's ruling 07/12/2026): run EXACTLY this many LMA measure<->solve cycles per scene, no convergence-based early exit - CUAS scenes are near-identical perturbations of the same view, so the needed count is a constant of the setup (and a fixed count gives the GPU pipeline a static launch shape). The convergence delta is still computed: a QC line flags scenes whose last ATR change misses the legacy imp.exit_change_atr threshold (diagnostic only). 0 = legacy convergence exit (imp.max_cycles cap + exit_change thresholds - for varying-scene/flying-camera applications). // By Claude on 07/12/2026
public double pose_lambda = 0.001; // lean v2 (Andrey 07/12/2026): INITIAL LMA lambda for the inner pose solve, replacing ilp.ilma_lambda (0.1) which restarts every outer measure<->solve cycle. 0.1 + the 0.1%-improvement inner exit = under-relaxation: the inner loop quits while still lambda-limited, the outer cycle re-measures and lambda resets - hence the observed ~0.8/cycle outer decay needing 6-13 cycles. The 3-angle/150-tile problem is heavily overdetermined and near-linear: a near-zero lambda makes the first inner steps ~Gauss-Newton so each outer cycle closes the measurable gap. 0 = legacy (use ilp.ilma_lambda). // By Claude on 07/12/2026
public int pose_lma_debug = 0; // inner-LMA debug level, passed to the inner runLma (max with the run's own debugLevel): 0 = quiet (default); 2 = one line PER INNER STEP ("LMA step N: {good,done} full RMS= ... pure RMS= ... + lambda=...") - the convergence trajectory INSIDE each outer cycle; 3-4 = progressively deeper solver dumps (parameter vectors, matrices). VERBOSE: 2 already prints ~5-25 lines per outer cycle x 6-13 cycles x 497 scenes - use for short investigation runs, not production. // By Claude on 07/12/2026
public boolean rend_test = false; // RT full-render product (CuasRender.testRenderSequence): per scene raw /jp4/ -> conditionSceneToGpu -> virtual-grid render at BORROWED stored pose+ERS rates -> -CUAS-RT-RENDER hyperstack [s00..s15, merged][scenes], comparable to -CUAS-INDIVIDUAL/MERGED-CUAS-DBG. NON-exclusive: runs AFTER the pose stage when both are ON (the pose stage is part of the RT cycle - Andrey 07/06/2026). // By Claude on 07/05/2026
public boolean log_test = false; // LoG A/B with the RT render (CuasRender): also save -CUAS-RT-RENDER-LOG-ORACLE (product convolved with the EXISTING pre-DNN pixel LoG, LINEAR alpha=1) and -CUAS-RT-RENDER-LOG-FOLDED (same render, LoG folded into the GPU aberration kernels via CuasLogFold - no pixel convolution; originals restored). The aberration+LoG kernel-fold validation (RT-seed step 1b). // By Claude on 07/06/2026
public boolean log_ident = false; // LoG ISOLATION test with the RT render (CuasRender): render with IDENTITY kernels (-CUAS-RT-RENDER-ID, aberrations skipped), pixel-LoG it (-ID-LOG-ORACLE), and render with PURE-LoG kernels (-LOG-ONLY). If -LOG-ONLY vs -ID-LOG-ORACLE residual persists, the fold/L0 is wrong; if it collapses to the wrap floor, the aberration-kernel interaction was responsible (Andrey 07/06/2026). // By Claude on 07/06/2026
......@@ -141,6 +142,8 @@ public class CuasRtParameters {
"Lean v2 (CUAS): run EXACTLY this many measure<->solve cycles per scene (near-identical scenes need a constant count; fixed count = static GPU launch shape). A QC line flags scenes missing the legacy exit threshold. 0 = legacy convergence-based exit (imp.max_cycles + exit_change).");
gd.addNumericField("Pose lean initial LMA lambda", this.pose_lambda, 6,8,"", // By Claude on 07/12/2026
"Initial lambda of the INNER pose LMA (restarts every outer cycle). The legacy 0.1 start + 0.1%-improvement inner exit under-relaxes the outer loop (~0.8/cycle decay, 6-13 cycles). Near-zero = ~Gauss-Newton first steps for the near-linear 3-angle problem. 0 = legacy ilp.ilma_lambda.");
gd.addNumericField("Pose lean inner-LMA debug level", this.pose_lma_debug, 0,3,"", // By Claude on 07/12/2026
"0 = quiet; 2 = one line per INNER LMA step (good/done flags, full/pure RMS, lambda) - the trajectory inside each outer cycle; 3-4 = deeper solver dumps. VERBOSE - for short investigation runs.");
gd.addCheckbox ("CUAS RT render (full product)", this.rend_test, // By Claude on 07/05/2026
"Full RT-chain render: raw jp4 -> conditioning -> virtual-grid render at borrowed stored poses/ERS; saves -CUAS-RT-RENDER [s00..s15+merged][scenes], comparable to the -CUAS-*-DBG oracle products. NON-exclusive: runs AFTER the pose stage when both are ON.");
gd.addCheckbox ("RT render LoG A/B (folded kernels)", this.log_test, // By Claude on 07/06/2026
......@@ -322,6 +325,7 @@ public class CuasRtParameters {
this.pose_mb_uniform = gd.getNextBoolean(); // By Claude on 07/12/2026
this.pose_cycles = (int) gd.getNextNumber(); // By Claude on 07/12/2026
this.pose_lambda = gd.getNextNumber(); // By Claude on 07/12/2026
this.pose_lma_debug =(int) gd.getNextNumber(); // By Claude on 07/12/2026
this.rend_test = gd.getNextBoolean(); // By Claude on 07/05/2026
this.log_test = gd.getNextBoolean(); // By Claude on 07/06/2026
this.log_ident = gd.getNextBoolean(); // By Claude on 07/06/2026
......@@ -423,6 +427,7 @@ public class CuasRtParameters {
properties.setProperty(prefix+"pose_mb_uniform", this.pose_mb_uniform+"");// boolean // By Claude on 07/12/2026
properties.setProperty(prefix+"pose_cycles", this.pose_cycles+""); // int // By Claude on 07/12/2026
properties.setProperty(prefix+"pose_lambda", this.pose_lambda+""); // double // By Claude on 07/12/2026
properties.setProperty(prefix+"pose_lma_debug", this.pose_lma_debug+""); // int // By Claude on 07/12/2026
properties.setProperty(prefix+"rend_test", this.rend_test+""); // boolean // By Claude on 07/05/2026
properties.setProperty(prefix+"log_test", this.log_test+""); // boolean // By Claude on 07/06/2026
properties.setProperty(prefix+"log_ident", this.log_ident+""); // boolean // By Claude on 07/06/2026
......@@ -524,6 +529,7 @@ public class CuasRtParameters {
if (properties.getProperty(prefix+"pose_mb_uniform")!=null) this.pose_mb_uniform=Boolean.parseBoolean(properties.getProperty(prefix+"pose_mb_uniform")); // By Claude on 07/12/2026
if (properties.getProperty(prefix+"pose_cycles")!=null) this.pose_cycles=Integer.parseInt(properties.getProperty(prefix+"pose_cycles")); // By Claude on 07/12/2026
if (properties.getProperty(prefix+"pose_lambda")!=null) this.pose_lambda=Double.parseDouble(properties.getProperty(prefix+"pose_lambda")); // By Claude on 07/12/2026
if (properties.getProperty(prefix+"pose_lma_debug")!=null) this.pose_lma_debug=Integer.parseInt(properties.getProperty(prefix+"pose_lma_debug")); // By Claude on 07/12/2026
if (properties.getProperty(prefix+"rend_test")!=null) this.rend_test=Boolean.parseBoolean(properties.getProperty(prefix+"rend_test")); // By Claude on 07/05/2026
if (properties.getProperty(prefix+"log_test")!=null) this.log_test=Boolean.parseBoolean(properties.getProperty(prefix+"log_test")); // By Claude on 07/06/2026
if (properties.getProperty(prefix+"log_ident")!=null) this.log_ident=Boolean.parseBoolean(properties.getProperty(prefix+"log_ident")); // By Claude on 07/06/2026
......@@ -628,6 +634,7 @@ public class CuasRtParameters {
cp.pose_mb_uniform = this.pose_mb_uniform; // By Claude on 07/12/2026
cp.pose_cycles = this.pose_cycles; // By Claude on 07/12/2026
cp.pose_lambda = this.pose_lambda; // By Claude on 07/12/2026
cp.pose_lma_debug = this.pose_lma_debug; // By Claude on 07/12/2026
cp.rend_test = this.rend_test; // By Claude on 07/05/2026
cp.log_test = this.log_test; // By Claude on 07/06/2026
cp.log_ident = this.log_ident; // By Claude on 07/06/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