   (util/assert-is (= (state/current-context s1) (state/current-context s2)) "%s" [s1 s2])
   (= s1 s2))
 
-(defn wrapper? [sp] (#{:OC :SA} (first (sp-name sp))))
+;; Note: must always wrap (at least with SA), or we lose context.
+;; TODO: only :Atomic or :Pair inside, when SA off 
+;;(defn wrapper? [sp] (#{:OC :SA} (first (sp-name sp))))
+;; (comment  (if (wrapper? child-sp) child-sp (make-output-collecting-subproblem fs child-sp)))
+
 
 (defn atomic-name-fs [n] (util/match [[:Atomic ~fs] n] fs))
 (defn log-input [fs inp-set] (if *state-abstraction* (fs/get-logger fs inp-set) inp-set))

                              (get-output-set @right-sp))                     
                     (reset! right?-atom true)
                     (summaries/disconnect! ss (sp-ts @right-sp))
                     (add-child-watcher! left-sp (fn [o c] (throw (RuntimeException. "Solved and children."))))
                     (connect-and-watch! ss @right-sp
                       (fn ignore-output [o] nil)
                       (fn right-child [right-sp right-child]
                         (summaries/summary-changed-local! ss)
                         (add-sp-child! s (make-pair-subproblem left-sp right-child) true))))
                   (summaries/or-summary s)))]    
       (summaries/connect! ret ss)
       (connect-and-watch! ss left-sp
         (fn left-output [left-sp]
           (summaries/summary-changed-local! ss)
           (when (connect-and-watch-ts! ss @right-sp ;; TODO: too eager/ 
                   (fn [right-sp] (summaries/summary-changed-local! ss) (set-output-set! ret (get-output-set! right-sp))))
             (summaries/summary-changed! ret)))
         (fn left-child [left-sp left-child]
           (summaries/summary-changed-local! ss)
           (add-sp-child! ret (make-pair-subproblem left-child right-name #(refine-input @right-sp %)) true)))
       ret)))

    (add-sp-child!* sp child-sp)
    (do (summaries/connect! sp child-sp)
        (add-output-watcher! child-sp
          (fn []
            (summaries/disconnect! sp child-sp)
            (add-sp-child!* sp child-sp)))
        (when up? (summaries/summary-changed! sp)))))
