             #(set-stub-output! ret %))))
       ret)))
 
-(defmethod get-stub :Pair [[_ left-name right-name :as n] inp subsuming-sp]
-  (assert (nil? subsuming-sp))
-  (make-pair-stub1 n (get-stub left-name inp nil) #(get-stub right-name % nil)))
+(defmethod get-stub :Pair [[_ left-name right-name :as n] inp]
+  (make-pair-stub1 n (get-stub left-name inp) #(get-stub right-name %)))
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


;; TODO: we keep reward for :blocked case
;; Note: weirdly, sometimes ignoring it helps. (not always)
(defn- make-atomic-subproblem [stb out-set reward status subsuming-sp]
  (let [inp-set  (input-set stb)
        ri-fn    (fn [s ri] (get-stub (stub-name stb) ri s))]
    (cond (not (= status :live))
          (make-simple-subproblem
           stb out-set true
           (fn [s] (summary/make-simple-summary (min (summaries/get-bound s) reward) status s)) ri-fn)
          
          (and subsuming-sp (not (terminal? subsuming-sp))) 
          (let [ret (make-simple-subproblem stb out-set false summaries/or-summary ri-fn)]
            (connect-and-watch! ret subsuming-sp
              (fn [sub-out]
                (connect-and-watch-stub-up! ret (refine-input sub-out inp-set) #(add-sp-child! ret %))))
            ret)
          
          :else 
          (let [ret (make-simple-subproblem stb out-set false summaries/or-summary ri-fn)]
            (doseq [child-name (map make-fs-seq-name (fs/child-seqs (second (stub-name stb)) inp-set))]
              (connect-and-watch-stub! ret (get-stub child-name inp-set nil)
                 #(add-sp-child! ret %)))
            ret))))

;; Note: this is double-stage to lazily generate children.  Could be simpler single-stage.
(defn make-atomic-stub [nm inp-set subsuming-sp]
  (let [state (atom :ready)]  ;; set to [out-set reward] after first eval, then :go after second.
    (traits/reify-traits [(simple-stub nm inp-set)]
      summaries/Summarizable



(defn- get-root-summarizer [inp-set fs]
  (tree-summarizer (make-atomic-stub (atomic-name fs) inp-set )))

(def *lazy-cache* false) 
(def *no-subsumption* false)
