         }
     }
 
-    private func inheritValue(forKeyPath keyPath: String?) {
-        guard let keyPath = keyPath else { return }
-        setValue(observee.value(forKeyPath: keyPath), forKeyPath: keyPath)
-    }
-
-    // MARK: - Derived values
-
-    override func cancel() {
-        observee.cancel()
-    }
-
-    override func pause() {
-        observee.pause()
-    }
-
-    @available(macOS 10.11, iOS 9.0, watchOS 2.0, tvOS 9.0, *)
-    override func resume() {
-        observee.resume()
-    }
-
-    @objc static var keyPathsForValuesAffectingUserInfo: Set<String> {
-        return [ #keyPath(observee.userInfo) ]
-    }
-
-    override var userInfo: [ProgressUserInfoKey: Any] {
-        return observee.userInfo
-    }
-
-    override func setUserInfoObject(_ objectOrNil: Any?, forKey key: ProgressUserInfoKey) {
-        observee.setUserInfoObject(objectOrNil, forKey: key)
-    }
-
-    // MARK: - KVO babysitting
-
     /// A side-table object to weakify the progress observer and prevent
     /// delivery of notifications after deinit.
-    private final class Observation: NSObject {
-        private static var cancelledContext = false
-        private static var pausedContext = false
-        private static var attributesContext = false
-        private static let attributes = [
-            #keyPath(Progress.completedUnitCount),
-            #keyPath(Progress.totalUnitCount),
+    final class Observation: NSObject {
+        static var fractionContext = false
+        static var attributesContext = false
+        static var cancelledContext = false
+        static var pausedContext = false
+
+        static let fractionKeyPaths = [
+            #keyPath(Progress.fractionCompleted),
+            #keyPath(Progress.isIndeterminate)
+        ]
+
+        static let attributesKeyPaths = [
             #keyPath(Progress.localizedDescription),
             #keyPath(Progress.localizedAdditionalDescription),
             #keyPath(Progress.cancellable),

            guard !oldState.isStrictSuperset(of: .cancellable) else { return }
            bnr_atomic_fetch_or(&state, State.cancelled.rawValue, .relaxed)

            for key in Observation.attributes {
                observee.removeObserver(self, forKeyPath: key, context: &Observation.attributesContext)
            }
            observee.removeObserver(self, forKeyPath: #keyPath(Progress.cancelled), context: &Observation.cancelledContext)
            observee.removeObserver(self, forKeyPath: #keyPath(Progress.paused), context: &Observation.pausedContext)
        }

        override func observeValue(forKeyPath keyPath: String?, of _: Any?, change _: [NSKeyValueChangeKey: Any]?, context: UnsafeMutableRawPointer?) {
            let state = State(rawValue: bnr_atomic_load(&self.state, .relaxed))
            guard state.contains(.ready), let observer = observer else { return }
            // This would be prettier as a switch.
            // https://bugs.swift.org/browse/SR-7877
            if context == &Observation.cancelledContext {
                observer.inheritCancelled()
            } else if context == &Observation.pausedContext {
                observer.inheritPaused()
            } else if context == &Observation.attributesContext {
                observer.inheritValue(forKeyPath: keyPath)
            }
        }
    }

/// tree.
private final class ProxyProgress: Progress {

    @objc dynamic let observee: Progress
    lazy var token = Observation(forUpdating: self)

    init(attachingTo observee: Progress) {
        self.observee = observee
        super.init(parent: .current())
        totalUnitCount = 100
        token.activate(observing: observee)
    }

    deinit {
        token.invalidate(observing: observee)
    }

    // MARK: - Derived values

    override func cancel() {
        observee.cancel()
    }

    override func pause() {
        observee.pause()
    }

    @available(macOS 10.11, iOS 9.0, watchOS 2.0, tvOS 9.0, *)
    override func resume() {
        observee.resume()
    }

    @objc static let keyPathsForValuesAffectingUserInfo: Set<String> = [
        #keyPath(observee.userInfo)
    ]

    override var userInfo: [ProgressUserInfoKey: Any] {
        return observee.userInfo
    }

    override func setUserInfoObject(_ objectOrNil: Any?, forKey key: ProgressUserInfoKey) {
        observee.setUserInfoObject(objectOrNil, forKey: key)
    }

    // MARK: - KVO babysitting

    func inheritFraction() {
        completedUnitCount = observee.isIndeterminate ? -1 : Int64(observee.fractionCompleted * Double(totalUnitCount))
    }

    func inheritAttribute(_ value: Any?, forKeyPath keyPath: String) {
        setValue(value, forKeyPath: keyPath)
    }

    func inheritCancelled() {
        if observee.isCancelled {
            super.cancel()
        }
    }

    func inheritPaused() {
        if observee.isPaused {
            super.pause()
        } else if #available(macOS 10.11, iOS 9.0, watchOS 2.0, tvOS 9.0, *) {
