   (when subsuming-sp (summaries/connect! child (tree-summarizer subsuming-sp) true)))
 
 
-;; TODO: subsumption links should be to tree su, not stub ? 
 ;; Note: this is double-stage to lazily generate children.  Could be simpler single-stage.
 (defn- make-atomic-stub [subsuming-sp inp-set function-set]
-;  (println "Making atomic stub" inp-set (fs/fs-name function-set))
   (let [state (atom :ready) ;; set to [out-set reward] after first eval, then :go after second.
         ret
         (traits/reify-traits

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;       Watchers      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defprotocol OutputWatched
  (add-watcher!   [s w] "Add a watcher to be notified of all outputs to this.
                         A watcher is just a fn of [watched-sp/stub new-subproblem]."))

(defprotocol SimpleWatched
  (add-output! [sw o])
  (add-forward! [sw child-sw]))

;; TODO: remove the ;doall seq pairs --
;; these work around a concurrent modification exception, which is indicative of a bug ?!

(traits/deftrait simple-watched
  [] [^ArrayList watchers (ArrayList.)
      ^ArrayList outputs (ArrayList.)
      ^ArrayList forwards (ArrayList.)] []
  OutputWatched
  (add-watcher! [sw w]
    (.add watchers w)
    (doseq [o outputs] (w sw o))
    (doseq [f forwards] (add-watcher! f w)))
  
  SimpleWatched
  (add-output! [sw o]
;   (assert (satisfies? Subproblem o))
    (.add outputs o)
    (doseq [w watchers] (w sw o))
    #_           (let [i (rand-int 10000)]     (println i sw o)
    
                    (println "DONE!" i sw)))
  (add-forward! [sw child-sw]
    (.add forwards child-sw)
    (doseq [w watchers] (add-watcher! child-sw w))))

    ret))

;; TODO: figure out if transient increases can be solved (is there better semantics for inner)?
;; Stub to wait for left to be evaluated
;; Left-stub will always be atomic stub, which always has a single output.
;; TODO: this seems to not always be true -- someitmes get multiple outputs for left-stub !
