Commit 8449dc7d authored by Andrey Filippov's avatar Andrey Filippov

CLAUDE: C3b - pose_freeze_cycle dialog parameter (keep high accuracy selectable)

Andrey 07/16: better inter-scene accuracy may pay off - keep the opportunity.
New curt.pose_freeze_cycle ('Pose freeze conditioning at cycle'): 0 = never
freeze = per-cycle re-derivation (highest accuracy, pre-C3 behavior); 2 =
default (freeze at the post-first-correction measurement); 1 = falsified.
Runtime-selectable - A/B/revert experiments need no rebuild. Wired via
IntersceneLma.setPoseFreezeCycles from leanFitScene.
Co-Authored-By: 's avatarClaude Fable 5 <noreply@anthropic.com>
parent 9ae13173
...@@ -1086,6 +1086,7 @@ public class CuasPoseRT { ...@@ -1086,6 +1086,7 @@ public class CuasPoseRT {
// GPU from the resident peak buffers; per-cycle H2D = camera state + pose // GPU from the resident peak buffers; per-cycle H2D = camera state + pose
// vector + centers + policy scalars; D2H = the 8-float compact result. The // vector + centers + policy scalars; D2H = the 8-float compact result. The
// packed-index slot/shift are CUAS host policy. By Claude on 07/17/2026. // packed-index slot/shift are CUAS host policy. By Claude on 07/17/2026.
intersceneLma.setPoseFreezeCycles(clt_parameters.curt.pose_freeze_cycle); // C3b runtime policy // By Claude on 07/16/2026
intersceneLma.setPoseLmaPrepareProvider((refCam, sceneCam, refXyz, refAtr, intersceneLma.setPoseLmaPrepareProvider((refCam, sceneCam, refXyz, refAtr,
sceneXyz, sceneAtr, centers, numTiles, useEigen, eigMinSqrt, eigMaxSqrt, sceneXyz, sceneAtr, centers, numTiles, useEigen, eigMinSqrt, eigMaxSqrt,
minConfidence, sameWeights, pullTargets, paramRegweights, light, capture) -> { minConfidence, sameWeights, pullTargets, paramRegweights, light, capture) -> {
......
...@@ -37,6 +37,7 @@ public class CuasRtParameters { ...@@ -37,6 +37,7 @@ public class CuasRtParameters {
public int pose_recenter = 0; // rung-2 frozen GPU contract (Andrey's ruling 07/13/2026): recentering passes for the lean peak measurement - the 15-arg Correlation2d.getMaxXYCmEig cosine-mask refinement (window over the eigen-ellipse, imp.eig_scale_axes*sqrt(lambda)+imp.eig_inc_axes half-axes, re-centroid each pass). 0 = single-pass (today's validated baseline behavior); imp.eig_recenter (2) = the oracle engine's setting - candidate for wide lean peaks, needs its own A/B run. The GPU argmax/centroid/eigen kernel implements the SAME superset contract with this as a runtime parameter. // By Claude on 07/13/2026 public int pose_recenter = 0; // rung-2 frozen GPU contract (Andrey's ruling 07/13/2026): recentering passes for the lean peak measurement - the 15-arg Correlation2d.getMaxXYCmEig cosine-mask refinement (window over the eigen-ellipse, imp.eig_scale_axes*sqrt(lambda)+imp.eig_inc_axes half-axes, re-centroid each pass). 0 = single-pass (today's validated baseline behavior); imp.eig_recenter (2) = the oracle engine's setting - candidate for wide lean peaks, needs its own A/B run. The GPU argmax/centroid/eigen kernel implements the SAME superset contract with this as a runtime parameter. // By Claude on 07/13/2026
public double pose_debias = 0.0; // rung-2 optional envelope de-bias hook (Andrey's ruling 07/13/2026, default OFF): fraction of the MCLT window-autocorr envelope divided out of the pixel-domain correlation BEFORE peak extraction (corr *= envelope^-frac, envelope normalized 1.0 at center). The envelope multiplies the true correlation peak and pulls the centroid toward center - argmax under-reports offsets by alpha ~0.75-0.9 (probed 07/13, the residual per-cycle convergence tax). 0 = off (bit-identical to no hook); 1 = full divide. GPU kernel contract: optional precomputed de-bias array pointer, NULL = off. Enabling needs its own A/B run. // By Claude on 07/13/2026 public double pose_debias = 0.0; // rung-2 optional envelope de-bias hook (Andrey's ruling 07/13/2026, default OFF): fraction of the MCLT window-autocorr envelope divided out of the pixel-domain correlation BEFORE peak extraction (corr *= envelope^-frac, envelope normalized 1.0 at center). The envelope multiplies the true correlation peak and pulls the centroid toward center - argmax under-reports offsets by alpha ~0.75-0.9 (probed 07/13, the residual per-cycle convergence tax). 0 = off (bit-identical to no hook); 1 = full divide. GPU kernel contract: optional precomputed de-bias array pointer, NULL = off. Enabling needs its own A/B run. // By Claude on 07/13/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; ALSO gates the per-scene "CuasPoseRT cycles:" trace line - >=1 to print it); 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 at >=2 - use for short investigation runs, not production. // By Claude on 07/12/2026, trace gate 07/13 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; ALSO gates the per-scene "CuasPoseRT cycles:" trace line - >=1 to print it); 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 at >=2 - use for short investigation runs, not production. // By Claude on 07/12/2026, trace gate 07/13
public int pose_freeze_cycle = 2; // rung C3b: freeze the lean-pose LMA conditioning (weights/eigen/selection/pull/reg) at this FULL prepare count; later cycles run light (fresh offsets only). 0 = never freeze = re-derive every cycle (highest accuracy, the pre-C3 behavior); 1 = freeze at cycle 1 (FAILED its gate: blurriest-pose conditioning, azimuth +48%); 2 = freeze at cycle 2 (post-first-correction measurement ~= converged). Keeps the high-accuracy opportunity selectable at runtime (Andrey 07/16). // By Claude on 07/16/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 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_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 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
...@@ -167,6 +168,8 @@ public class CuasRtParameters { ...@@ -167,6 +168,8 @@ public class CuasRtParameters {
"Fraction of the MCLT window-autocorr envelope divided out of the correlation before peak extraction (argmax under-reports offsets by ~0.75-0.9x through the envelope). 0 = off (default, bit-identical); 1 = full divide. Enabling needs its own A/B run."); "Fraction of the MCLT window-autocorr envelope divided out of the correlation before peak extraction (argmax under-reports offsets by ~0.75-0.9x through the envelope). 0 = off (default, bit-identical); 1 = full divide. Enabling needs its own A/B run.");
gd.addNumericField("Pose lean inner-LMA debug level", this.pose_lma_debug, 0,3,"", // By Claude on 07/12/2026 gd.addNumericField("Pose lean inner-LMA debug level", this.pose_lma_debug, 0,3,"", // By Claude on 07/12/2026
"0 = quiet (also hides the per-scene 'CuasPoseRT cycles:' trace; >=1 shows it); 2 = one line per INNER LMA step (good/done flags, full/pure RMS, lambda); 3-4 = deeper solver dumps. VERBOSE at >=2 - for short investigation runs."); "0 = quiet (also hides the per-scene 'CuasPoseRT cycles:' trace; >=1 shows it); 2 = one line per INNER LMA step (good/done flags, full/pure RMS, lambda); 3-4 = deeper solver dumps. VERBOSE at >=2 - for short investigation runs.");
gd.addNumericField("Pose freeze conditioning at cycle", this.pose_freeze_cycle, 0,3,"", // By Claude on 07/16/2026
"Freeze lean-pose LMA weights/eigen at this full-prepare count; later cycles reuse them (light prepare). 0 = never (re-derive every cycle, highest accuracy); 2 = recommended (post-first-correction measurement); 1 = falsified (blurry cycle-1 conditioning).");
gd.addMessage("=== RT render diagnostics ==="); // By Codex on 07/15/2026 gd.addMessage("=== RT render diagnostics ==="); // By Codex on 07/15/2026
gd.addCheckbox ("CUAS RT render (full product)", this.rend_test, // By Claude on 07/05/2026 gd.addCheckbox ("CUAS RT render (full product)", this.rend_test, // By Claude on 07/05/2026
...@@ -361,6 +364,7 @@ public class CuasRtParameters { ...@@ -361,6 +364,7 @@ public class CuasRtParameters {
this.pose_recenter = (int) gd.getNextNumber(); // By Claude on 07/13/2026 this.pose_recenter = (int) gd.getNextNumber(); // By Claude on 07/13/2026
this.pose_debias = gd.getNextNumber(); // By Claude on 07/13/2026 this.pose_debias = gd.getNextNumber(); // By Claude on 07/13/2026
this.pose_lma_debug =(int) gd.getNextNumber(); // By Claude on 07/12/2026 this.pose_lma_debug =(int) gd.getNextNumber(); // By Claude on 07/12/2026
this.pose_freeze_cycle =(int) gd.getNextNumber(); // By Claude on 07/16/2026
this.rend_test = gd.getNextBoolean(); // By Claude on 07/05/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_test = gd.getNextBoolean(); // By Claude on 07/06/2026
this.log_ident = gd.getNextBoolean(); // By Claude on 07/06/2026 this.log_ident = gd.getNextBoolean(); // By Claude on 07/06/2026
...@@ -469,6 +473,7 @@ public class CuasRtParameters { ...@@ -469,6 +473,7 @@ public class CuasRtParameters {
properties.setProperty(prefix+"pose_recenter", this.pose_recenter+""); // int // By Claude on 07/13/2026 properties.setProperty(prefix+"pose_recenter", this.pose_recenter+""); // int // By Claude on 07/13/2026
properties.setProperty(prefix+"pose_debias", this.pose_debias+""); // double // By Claude on 07/13/2026 properties.setProperty(prefix+"pose_debias", this.pose_debias+""); // double // By Claude on 07/13/2026
properties.setProperty(prefix+"pose_lma_debug", this.pose_lma_debug+""); // int // 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+"pose_freeze_cycle", this.pose_freeze_cycle+""); // int // By Claude on 07/16/2026
properties.setProperty(prefix+"rend_test", this.rend_test+""); // boolean // By Claude on 07/05/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_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 properties.setProperty(prefix+"log_ident", this.log_ident+""); // boolean // By Claude on 07/06/2026
...@@ -577,6 +582,7 @@ public class CuasRtParameters { ...@@ -577,6 +582,7 @@ public class CuasRtParameters {
if (properties.getProperty(prefix+"pose_recenter")!=null) this.pose_recenter=Integer.parseInt(properties.getProperty(prefix+"pose_recenter")); // By Claude on 07/13/2026 if (properties.getProperty(prefix+"pose_recenter")!=null) this.pose_recenter=Integer.parseInt(properties.getProperty(prefix+"pose_recenter")); // By Claude on 07/13/2026
if (properties.getProperty(prefix+"pose_debias")!=null) this.pose_debias=Double.parseDouble(properties.getProperty(prefix+"pose_debias")); // By Claude on 07/13/2026 if (properties.getProperty(prefix+"pose_debias")!=null) this.pose_debias=Double.parseDouble(properties.getProperty(prefix+"pose_debias")); // By Claude on 07/13/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+"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+"pose_freeze_cycle")!=null) this.pose_freeze_cycle=Integer.parseInt(properties.getProperty(prefix+"pose_freeze_cycle")); // By Claude on 07/16/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+"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_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 if (properties.getProperty(prefix+"log_ident")!=null) this.log_ident=Boolean.parseBoolean(properties.getProperty(prefix+"log_ident")); // By Claude on 07/06/2026
...@@ -688,6 +694,7 @@ public class CuasRtParameters { ...@@ -688,6 +694,7 @@ public class CuasRtParameters {
cp.pose_recenter = this.pose_recenter; // By Claude on 07/13/2026 cp.pose_recenter = this.pose_recenter; // By Claude on 07/13/2026
cp.pose_debias = this.pose_debias; // By Claude on 07/13/2026 cp.pose_debias = this.pose_debias; // By Claude on 07/13/2026
cp.pose_lma_debug = this.pose_lma_debug; // By Claude on 07/12/2026 cp.pose_lma_debug = this.pose_lma_debug; // By Claude on 07/12/2026
cp.pose_freeze_cycle = this.pose_freeze_cycle; // By Claude on 07/16/2026
cp.rend_test = this.rend_test; // By Claude on 07/05/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_test = this.log_test; // By Claude on 07/06/2026
cp.log_ident = this.log_ident; // By Claude on 07/06/2026 cp.log_ident = this.log_ident; // By Claude on 07/06/2026
......
...@@ -501,7 +501,8 @@ public class IntersceneLma { ...@@ -501,7 +501,8 @@ public class IntersceneLma {
// the blurriest, pre-correction pose - see C3 gate failure). The instance // the blurriest, pre-correction pose - see C3 gate failure). The instance
// is per-scene, so this naturally resets per scene. By Claude on 07/16/2026. // is per-scene, so this naturally resets per scene. By Claude on 07/16/2026.
final IntersceneLmaFloat.PrepareResidentResult frozen_prepare = final IntersceneLmaFloat.PrepareResidentResult frozen_prepare =
(poseResidentFullPrepares >= 2) ? poseResidentPrepare : null; ((poseFreezeCycles > 0) && (poseResidentFullPrepares >= poseFreezeCycles)) ?
poseResidentPrepare : null; // 0 = never freeze (runtime-selectable accuracy) // By Claude on 07/16/2026
poseResidentPrepare = null; poseResidentPrepare = null;
boolean lean_pose_shape = (num_components == 2) && boolean lean_pose_shape = (num_components == 2) &&
(par_indices.length == IntersceneLmaFloat.NUM_PARAMS); (par_indices.length == IntersceneLmaFloat.NUM_PARAMS);
...@@ -2077,6 +2078,8 @@ public class IntersceneLma { ...@@ -2077,6 +2078,8 @@ public class IntersceneLma {
// essentially converged pose = converged-quality eigen/weights. // essentially converged pose = converged-quality eigen/weights.
// By Claude on 07/16/2026. // By Claude on 07/16/2026.
private int poseResidentFullPrepares = 0; // full resident prepares this scene (instance = per-scene) private int poseResidentFullPrepares = 0; // full resident prepares this scene (instance = per-scene)
private int poseFreezeCycles = 2; // 0 = never freeze (per-cycle re-derivation, highest accuracy) // By Claude on 07/16/2026
public void setPoseFreezeCycles(final int cycles) { poseFreezeCycles = cycles; }
/** Run the resident GPU prepare at the current parameters_vector (mirrors the /** Run the resident GPU prepare at the current parameters_vector (mirrors the
* getFxDerivs head: ERS pokes + setupERS + camera/centers capture). On * getFxDerivs head: ERS pokes + setupERS + camera/centers capture). On
......
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