 
 (defn parallel-collect-pass
   [thresh]
-  (fn [vertices]
+  (fn [workgroup-size vertices]
     (r/fold
+     workgroup-size
      sub-pass-combine
      (fn [acc v]
        (if (should-collect? v thresh)

              [active sigs (inc colls)])
          [active sigs colls])))))

(defn eager-probabilistic-vertex-processor
  [s-thresh c-thresh]
  (fn [[active sigs colls] v]
    (let [active (conj active v)]

                  (->result :converged i sigs colls t0)))
              (->result :max-iter-reached i sigs colls t0))))))))

(defn default-scheduled-context-opts
  []
  {:collect-thresh 0
   :signal-thresh  0
   :processor      parallel-two-pass-processor
   :scheduler      two-pass-scheduler
   ;;:processor      eager-probabilistic-single-pass-processor
   ;;:scheduler      single-pass-scheduler
   :max-ops        1e6
   :threads        #?(:clj (inc (.availableProcessors (Runtime/getRuntime))) :cljs 1)})

(defn scheduled-execution-context
  [opts]
  (let [ctx       (merge (default-scheduled-context-opts) opts)
        g         (:graph ctx)
        c-thresh  (:collect-thresh ctx)
        s-thresh  (:signal-thresh ctx)
