Index: /branches/eam_branches/ipp-20230313/ippTools/src/fftool.c
===================================================================
--- /branches/eam_branches/ipp-20230313/ippTools/src/fftool.c	(revision 42589)
+++ /branches/eam_branches/ipp-20230313/ippTools/src/fftool.c	(revision 42590)
@@ -104,5 +104,8 @@
 }
 
-
+// NOTE: this mode seems to be insufficiently constrained.  It first identifies the
+// set of stackRun/skycalRun entries that lack a fullForceRun match.  But the
+// second stage is selecting all warps only based on (tess_id, skycell_id, filter) without
+// restriction to those which contributed to the stack
 static bool definebyqueryMode(pxConfig *config)
 {
@@ -150,4 +153,6 @@
     }
     PXOPT_COPY_F32(config->args, warpWhereMD, "-select_good_frac_min",  "warpSkyfile.good_frac",   ">=");
+    // XXX the tess_id and filter below can never be used because they are removed above (for stack)
+    // these options should be something like -select_warp_tess_id and -select_warp_filter
     PXOPT_COPY_STR(config->args, warpWhereMD, "-select_tess_id",       "warpRun.tess_id",         "==");
     pxAddLabelSearchArgs(config, warpWhereMD, "-select_filter",        "rawExp.filter",          "LIKE");
@@ -223,4 +228,5 @@
     psString warpQueryTemplate = pxDataGet("fftool_definebyquery_select_warps.sql");
 
+    // NOTE: these allow the set of input warps to be restricted
     whereClause = psDBGenerateWhereConditionSQL(warpWhereMD, NULL);
     psStringAppend(&warpQueryTemplate, "\nAND %s", whereClause);
@@ -339,4 +345,7 @@
 }
 
+// NOTE: this mode and 'definebyquery' seem to be nearly identical except that
+// 'definebyquery' allows for restrictions on the input warps by label, data_group,
+// warp_id, tess_id, filter, good_frac
 static bool defineforstacksMode(pxConfig *config)
 {
