Commit 3ac0fa08 authored by Andrey Filippov's avatar Andrey Filippov

CLAUDE: item-4 R3c - timestamp matching keys on canonical sec_usec prefix...

CLAUDE: item-4 R3c - timestamp matching keys on canonical sec_usec prefix (merged labels carry -N suffix)

First A/B run 07/20 00:22 failed loud: merged-stack slice labels are
'<ts>-0' while -CUAS-RT-LOG labels are bare '<ts>' - exact match missed
all 497. tsKey() takes the leading digits/underscore run from both sides.
Co-Authored-By: 's avatarClaude Fable 5 <noreply@anthropic.com>
parent 3b039760
...@@ -296,6 +296,14 @@ public class CuasDetectRT { ...@@ -296,6 +296,14 @@ public class CuasDetectRT {
return; return;
} }
/** Canonical scene key: the leading digits/underscore run of a slice label ("1773135467_917220-0"
* and "1773135467_917220" -> "1773135467_917220"). Item 4 R3 timestamp matching. By Claude on 07/20/2026 */
private static String tsKey(String label) {
int n = 0;
while ((n < label.length()) && (Character.isDigit(label.charAt(n)) || (label.charAt(n) == '_'))) n++;
return label.substring(0, n);
}
public static String d2s(double d, int maxDecimalsPlaces) { public static String d2s(double d, int maxDecimalsPlaces) {
String fmt = String.format("%%.%df", maxDecimalsPlaces); String fmt = String.format("%%.%df", maxDecimalsPlaces);
String s = String.format(fmt, d); String s = String.format(fmt, d);
...@@ -1126,19 +1134,22 @@ public class CuasDetectRT { ...@@ -1126,19 +1134,22 @@ public class CuasDetectRT {
QuadCLTCPU.saveImagePlusInDirectory(imp_conv2d, getModelDirectory()); QuadCLTCPU.saveImagePlusInDirectory(imp_conv2d, getModelDirectory());
} }
// item 4 R3: canonical scene key = the leading "<sec>_<usec>" digits of a slice label.
// The merged stack suffixes its labels (e.g. "1773135467_917220-0") while -CUAS-RT-LOG labels
// are bare scene names - exact string match missed all 497 (found 07/20 first A/B run). By Claude on 07/20/2026
if (!rt_log_primary && (rt_log_pixels != null)) { // item 4 R3: compare the offline conditioned frames vs the RT stream, then SWAP the RT frames in // By Claude on 07/19/2026 if (!rt_log_primary && (rt_log_pixels != null)) { // item 4 R3: compare the offline conditioned frames vs the RT stream, then SWAP the RT frames in // By Claude on 07/19/2026
// RELATIVE tol tier (ruling 3.3): offline = LoG(frame - whole-sequence union mean), RT = GPU LoG(frame) - base // RELATIVE tol tier (ruling 3.3): offline = LoG(frame - whole-sequence union mean), RT = GPU LoG(frame) - base
// (prior-run average LoG'd in Java double, + gated EMA if enabled). Equal by LINEARITY only when the bases match // (prior-run average LoG'd in Java double, + gated EMA if enabled). Equal by LINEARITY only when the bases match
// (RT run with det_avg_file = the SAME sequence's -CUAS-RT-AVG and det_ema_rate = 0) and except at NaN-substitution // (RT run with det_avg_file = the SAME sequence's -CUAS-RT-AVG and det_ema_rate = 0) and except at NaN-substitution
// edges; the compare REPORTS (no hard gate) - the verdict is Andrey's per 3.3. // edges; the compare REPORTS (no hard gate) - the verdict is Andrey's per 3.3.
final java.util.HashMap<String, float[]> rt_map = new java.util.HashMap<String, float[]>(); final java.util.HashMap<String, float[]> rt_map = new java.util.HashMap<String, float[]>();
for (int i = 0; i < rt_log_ts.length; i++) rt_map.put(rt_log_ts[i], rt_log_pixels[i]); for (int i = 0; i < rt_log_ts.length; i++) rt_map.put(tsKey(rt_log_ts[i]), rt_log_pixels[i]);
final boolean cmp = clt_parameters.curt.subtract_avg; // without SUBAVG the offline frames have no background subtracted - numbers would be apples-to-oranges final boolean cmp = clt_parameters.curt.subtract_avg; // without SUBAVG the offline frames have no background subtracted - numbers would be apples-to-oranges
int matched = 0; int matched = 0;
java.util.ArrayList<String> missing = new java.util.ArrayList<String>(); java.util.ArrayList<String> missing = new java.util.ArrayList<String>();
double worst_rel = 0.0, sum_rel = 0.0; int worst_i = -1; long nan_mm_total = 0; double worst_rel = 0.0, sum_rel = 0.0; int worst_i = -1; long nan_mm_total = 0;
for (int i = 0; i < dpixels_log.length; i++) { for (int i = 0; i < dpixels_log.length; i++) {
float [] rt = rt_map.get(time_stamps[i]); float [] rt = rt_map.get(tsKey(time_stamps[i]));
if (rt == null) { missing.add(time_stamps[i]); continue; } if (rt == null) { missing.add(time_stamps[i]); continue; }
matched++; matched++;
if (cmp) { if (cmp) {
......
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