Commit f8a7a972 authored by Andrey Filippov's avatar Andrey Filippov

CLAUDE: TEMP probe — print gpu_clt_ref stats after first ref convert (JNA)

Diagnostic for the CORR2D-all-NaN numeric divergence: after the first
ref_scene=true convert, read back gpu_clt_ref (tp_proc_get_clt use_ref=1) and
print NaN%/nonzero/min/max once. Confirms whether the reference convert
populates gpu_clt_ref at all (vs scene gpu_clt which is correct -> SOURCE).

Prints one "PROBE gpu_clt_ref[cam0]: ..." line to System.out (captured in the
per-scene -SYSTEM_OUT.log). TEMP — remove after the divergence is fixed.
Co-Authored-By: 's avatarClaude Opus 4.8 (1M context) <noreply@anthropic.com>
parent ae4bf02f
...@@ -249,11 +249,26 @@ public class GpuQuadJna extends GpuQuad { ...@@ -249,11 +249,26 @@ public class GpuQuadJna extends GpuQuad {
} }
// ---- direct CLT conversion (+ the fragile no_kernels / use_center_image / erase_clt / ref_scene paths) ---- // ---- direct CLT conversion (+ the fragile no_kernels / use_center_image / erase_clt / ref_scene paths) ----
// TEMP PROBE flag (By Claude 06/26/2026): print gpu_clt_ref stats once after the first ref_scene convert,
// to confirm whether the reference convert actually populates gpu_clt_ref (CORR2D-all-NaN divergence).
// REMOVE after the reference-CLT divergence is fixed.
private boolean clt_ref_probed = false;
@Override public void execConvertDirect(boolean ref_scene, int[] wh, int erase_clt, boolean no_kernels, boolean use_center_image) { @Override public void execConvertDirect(boolean ref_scene, int[] wh, int erase_clt, boolean no_kernels, boolean use_center_image) {
boolean skip_kernels = rectilinear || no_kernels; boolean skip_kernels = rectilinear || no_kernels;
if (!skip_kernels) setConvolutionKernels(false); if (!skip_kernels) setConvolutionKernels(false);
if (!rectilinear) setBayerImages(false, use_center_image); if (!rectilinear) setBayerImages(false, use_center_image);
lib.tp_proc_exec_convert_direct(proc, ref_scene ? 1 : 0, erase_clt, no_kernels ? 1 : 0); lib.tp_proc_exec_convert_direct(proc, ref_scene ? 1 : 0, erase_clt, no_kernels ? 1 : 0);
if (ref_scene && !clt_ref_probed) { // TEMP PROBE — remove after fix
clt_ref_probed = true;
int sz = getCltSize(true);
float[] clt = new float[sz];
lib.tp_proc_get_clt(proc, 0, 1, clt);
int nan = 0, nz = 0; float mn = Float.POSITIVE_INFINITY, mx = Float.NEGATIVE_INFINITY;
for (float v : clt) { if (Float.isNaN(v)) nan++; else { if (v != 0f) nz++; if (v < mn) mn = v; if (v > mx) mx = v; } }
System.out.println(String.format(
"PROBE gpu_clt_ref[cam0]: size=%d NaN=%.1f%% nonzero=%d finite[min=%g max=%g] (erase_clt=%d)",
sz, 100.0 * nan / Math.max(sz, 1), nz, (nz > 0 ? mn : 0f), (nz > 0 ? mx : 0f), erase_clt));
}
} }
// ---- inverse CLT -> RBG ---- // ---- inverse CLT -> RBG ----
......
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