2{-# LANGUAGE ConstraintKinds #-}
3{-# LANGUAGE FlexibleContexts #-}
4{-# LANGUAGE FlexibleInstances #-}
5{-# LANGUAGE GeneralizedNewtypeDeriving#-}
6{-# LANGUAGE InstanceSigs #-}
7{-# LANGUAGE LambdaCase #-}
8{-# LANGUAGE MultiParamTypeClasses #-}
9{-# LANGUAGE StandaloneDeriving #-}
10{-# LANGUAGE UndecidableInstances #-} -- XXX
12#ifdef DIAGNOSTICS_VERBOSE
17-- Module : Streamly.Streams.Async
18-- Copyright : (c) 2017 Harendra Kumar
21-- Maintainer : harendra.kumar@gmail.com
22-- Stability : experimental
26module Streamly.Streams.Async
43import Control.Monad (ap)
44import Control.Monad.Base (MonadBase(..), liftBaseDefault)
45import Control.Monad.Catch (MonadThrow, throwM)
46import Control.Concurrent.MVar (newEmptyMVar)
47-- import Control.Monad.Error.Class (MonadError(..))
48import Control.Monad.IO.Class (MonadIO(..))
49import Control.Monad.Reader.Class (MonadReader(..))
50import Control.Monad.State.Class (MonadState(..))
51import Control.Monad.Trans.Class (MonadTrans(lift))
52import Data.Concurrent.Queue.MichaelScott (LinkedQueue, newQ, nullQ, tryPopR)
53import Data.IORef (IORef, newIORef, readIORef)
54import Data.Maybe (fromJust)
55import Data.Semigroup (Semigroup(..))
57import Prelude hiding (map)
58import qualified Data.Set as S
60import Streamly.Streams.SVar (fromSVar)
61import Streamly.Streams.Serial (map)
63import Streamly.Streams.StreamK (IsStream(..), Stream(..), adapt)
64import qualified Streamly.Streams.StreamK as K
67import Control.Concurrent (myThreadId)
70#include "Instances.hs"
72-------------------------------------------------------------------------------
74-------------------------------------------------------------------------------
76{-# INLINE workLoopLIFO #-}
84workLoopLIFO q st sv winfo = run
91 Nothing -> liftIO $ sendStop sv winfo
92 Just m -> unStream m st run single yieldk
95 res <- liftIO $ sendYield sv winfo (ChildYield a)
96 if res then run else liftIO $ sendStop sv winfo
99 res <- liftIO $ sendYield sv winfo (ChildYield a)
101 then unStream r st run single yieldk
106 dequeue = liftIO $ atomicModifyIORefCAS q $ \case
108 x : xs -> (xs, Just x)
110-- We duplicate workLoop for yield limit and no limit cases because it has
111-- around 40% performance overhead in the worst case.
113-- XXX we can pass yinfo directly as an argument here so that we do not have to
114-- make a check every time.
115{-# INLINE workLoopLIFOLimited #-}
118 => IORef [Stream m a]
123workLoopLIFOLimited q st sv winfo = run
130 Nothing -> liftIO $ sendStop sv winfo
132 -- XXX This is just a best effort minimization of concurrency
133 -- to the yield limit. If the stream is made of concurrent
134 -- streams we do not reserve the yield limit in the constituent
135 -- streams before executing the action. This can be done
136 -- though, by sharing the yield limit ref with downstream
137 -- actions via state passing. Just a todo.
138 yieldLimitOk <- liftIO $ decrementYieldLimit sv
141 let stop = liftIO (incrementYieldLimit sv) >> run
142 unStream m st stop single yieldk
143 -- Avoid any side effects, undo the yield limit decrement if we
144 -- never yielded anything.
147 incrementYieldLimit sv
151 res <- liftIO $ sendYield sv winfo (ChildYield a)
152 if res then run else liftIO $ sendStop sv winfo
154 -- XXX can we pass on the yield limit downstream to limit the concurrency
155 -- of constituent streams.
157 res <- liftIO $ sendYield sv winfo (ChildYield a)
158 yieldLimitOk <- liftIO $ decrementYieldLimit sv
159 let stop = liftIO (incrementYieldLimit sv) >> run
160 if res && yieldLimitOk
161 then unStream r st stop single yieldk
163 incrementYieldLimit sv
167 dequeue = liftIO $ atomicModifyIORefCAS q $ \case
169 x : xs -> (xs, Just x)
171-------------------------------------------------------------------------------
173-------------------------------------------------------------------------------
175{-# INLINE workLoopFIFO #-}
178 => LinkedQueue (Stream m a)
183workLoopFIFO q st sv winfo = run
188 work <- liftIO $ tryPopR q
190 Nothing -> liftIO $ sendStop sv winfo
191 Just m -> unStream m st run single yieldk
194 res <- liftIO $ sendYield sv winfo (ChildYield a)
195 if res then run else liftIO $ sendStop sv winfo
198 res <- liftIO $ sendYield sv winfo (ChildYield a)
200 then unStream r st run single yieldk
205{-# INLINE workLoopFIFOLimited #-}
208 => LinkedQueue (Stream m a)
213workLoopFIFOLimited q st sv winfo = run
218 work <- liftIO $ tryPopR q
220 Nothing -> liftIO $ sendStop sv winfo
222 yieldLimitOk <- liftIO $ decrementYieldLimit sv
225 let stop = liftIO (incrementYieldLimit sv) >> run
226 unStream m st stop single yieldk
229 incrementYieldLimit sv
233 res <- liftIO $ sendYield sv winfo (ChildYield a)
234 if res then run else liftIO $ sendStop sv winfo
237 res <- liftIO $ sendYield sv winfo (ChildYield a)
238 yieldLimitOk <- liftIO $ decrementYieldLimit sv
239 let stop = liftIO (incrementYieldLimit sv) >> run
240 if res && yieldLimitOk
241 then unStream r st stop single yieldk
243 incrementYieldLimit sv
247-------------------------------------------------------------------------------
249-- This code belongs in SVar.hs but is kept here for perf reasons
250-------------------------------------------------------------------------------
252-- XXX we have this function in this file because passing runStreamLIFO as a
253-- function argument to this function results in a perf degradation of more
254-- than 10%. Need to investigate what the root cause is.
255-- Interestingly, the same thing does not make any difference for Ahead.
256getLifoSVar :: MonadAsync m => State Stream m a -> IO (SVar Stream m a)
258 outQ <- newIORef ([], 0)
259 outQMv <- newEmptyMVar
261 wfw <- newIORef False
262 running <- newIORef S.empty
264 yl <- case getYieldLimit st of
265 Nothing -> return Nothing
266 Just x -> Just <$> newIORef x
267 rateInfo <- getYieldRateInfo st
274 avgLat <- newIORef (0, NanoSecs 0)
275 maxLat <- newIORef (NanoSecs 0)
276 minLat <- newIORef (NanoSecs 0)
277 stpTime <- newIORef Nothing
282 let isWorkFinished _ = null <$> readIORef q
284 let isWorkFinishedLimited sv = do
286 case remainingWork sv of
290 Nothing -> return False
291 qEmpty <- null <$> readIORef q
292 return $ qEmpty || yieldsDone
294 let getSVar sv readOutput postProc workDone wloop = SVar
297 , maxBufferLimit = getMaxBuffer st
298 , maxWorkerLimit = getMaxThreads st
299 , yieldRateInfo = rateInfo
300 , outputDoorBell = outQMv
301 , readOutputQ = readOutput sv
302 , postProcess = postProc sv
303 , workerThreads = running
304 , workLoop = wloop q st{streamVar = Just sv} sv
305 , enqueue = enqueueLIFO sv q
306 , isWorkDone = workDone sv
307 , isQueueDone = workDone sv
309 , svarStyle = AsyncVar
310 , workerCount = active
311 , accountThread = delThread sv
312 , workerStopMVar = undefined
316 , aheadWorkQueue = undefined
317 , outputHeap = undefined
319 , svarStats = SVarStats
320 { totalDispatches = disp
321 , maxWorkers = maxWrk
322 , maxOutQSize = maxOq
323 , maxHeapSize = maxHs
324 , maxWorkQSize = maxWq
325 , avgWorkerLatency = avgLat
326 , minWorkerLatency = minLat
327 , maxWorkerLatency = maxLat
328 , svarStopTime = stpTime
333 case getStreamRate st of
335 case getYieldLimit st of
336 Nothing -> getSVar sv readOutputQBounded
340 Just _ -> getSVar sv readOutputQBounded
342 isWorkFinishedLimited
345 case getYieldLimit st of
346 Nothing -> getSVar sv readOutputQPaced
350 Just _ -> getSVar sv readOutputQPaced
352 isWorkFinishedLimited
356getFifoSVar :: MonadAsync m => State Stream m a -> IO (SVar Stream m a)
358 outQ <- newIORef ([], 0)
359 outQMv <- newEmptyMVar
361 wfw <- newIORef False
362 running <- newIORef S.empty
364 yl <- case getYieldLimit st of
365 Nothing -> return Nothing
366 Just x -> Just <$> newIORef x
367 rateInfo <- getYieldRateInfo st
374 avgLat <- newIORef (0, NanoSecs 0)
375 maxLat <- newIORef (NanoSecs 0)
376 minLat <- newIORef (NanoSecs 0)
377 stpTime <- newIORef Nothing
382 let isWorkFinished _ = nullQ q
383 let isWorkFinishedLimited sv = do
385 case remainingWork sv of
389 Nothing -> return False
391 return $ qEmpty || yieldsDone
393 let getSVar sv readOutput postProc workDone wloop = SVar
396 , maxBufferLimit = getMaxBuffer st
397 , maxWorkerLimit = getMaxThreads st
398 , yieldRateInfo = rateInfo
399 , outputDoorBell = outQMv
400 , readOutputQ = readOutput sv
401 , postProcess = postProc sv
402 , workerThreads = running
403 , workLoop = wloop q st{streamVar = Just sv} sv
404 , enqueue = enqueueFIFO sv q
405 , isWorkDone = workDone sv
406 , isQueueDone = workDone sv
408 , svarStyle = WAsyncVar
409 , workerCount = active
410 , accountThread = delThread sv
411 , workerStopMVar = undefined
415 , aheadWorkQueue = undefined
416 , outputHeap = undefined
418 , svarStats = SVarStats
419 { totalDispatches = disp
420 , maxWorkers = maxWrk
421 , maxOutQSize = maxOq
422 , maxHeapSize = maxHs
423 , maxWorkQSize = maxWq
424 , avgWorkerLatency = avgLat
425 , minWorkerLatency = minLat
426 , maxWorkerLatency = maxLat
427 , svarStopTime = stpTime
432 case getStreamRate st of
434 case getYieldLimit st of
435 Nothing -> getSVar sv readOutputQBounded
439 Just _ -> getSVar sv readOutputQBounded
441 isWorkFinishedLimited
444 case getYieldLimit st of
445 Nothing -> getSVar sv readOutputQPaced
449 Just _ -> getSVar sv readOutputQPaced
451 isWorkFinishedLimited
455{-# INLINABLE newAsyncVar #-}
456newAsyncVar :: MonadAsync m
457 => State Stream m a -> Stream m a -> m (SVar Stream m a)
459 sv <- liftIO $ getLifoSVar st
462-- XXX Get rid of this?
463-- | Make a stream asynchronous, triggers the computation and returns a stream
464-- in the underlying monad representing the output generated by the original
465-- computation. The returned action is exhaustible and must be drained once. If
466-- not drained fully we may have a thread blocked forever and once exhausted it
467-- will always return 'empty'.
470{-# INLINABLE mkAsync #-}
471mkAsync :: (IsStream t, MonadAsync m) => t m a -> m (t m a)
472mkAsync m = newAsyncVar defState (toStream m) >>= return . fromSVar
474{-# INLINABLE mkAsync' #-}
475mkAsync' :: (IsStream t, MonadAsync m) => State Stream m a -> t m a -> m (t m a)
476mkAsync' st m = newAsyncVar st (toStream m) >>= return . fromSVar
478-- | Create a new SVar and enqueue one stream computation on it.
479{-# INLINABLE newWAsyncVar #-}
480newWAsyncVar :: MonadAsync m
481 => State Stream m a -> Stream m a -> m (SVar Stream m a)
482newWAsyncVar st m = do
483 sv <- liftIO $ getFifoSVar st
486------------------------------------------------------------------------------
487-- Running streams concurrently
488------------------------------------------------------------------------------
490-- Concurrency rate control.
492-- Our objective is to create more threads on demand if the consumer is running
493-- faster than us. As soon as we encounter a concurrent composition we create a
494-- push pull pair of threads. We use an SVar for communication between the
495-- consumer, pulling from the SVar and the producer who is pushing to the SVar.
496-- The producer creates more threads if the SVar drains and becomes empty, that
497-- is the consumer is running faster.
499-- XXX Note 1: This mechanism can be problematic if the initial production
500-- latency is high, we may end up creating too many threads. So we need some
501-- way to monitor and use the latency as well. Having a limit on the dispatches
502-- (programmer controlled) may also help.
504-- TBD Note 2: We may want to run computations at the lower level of the
505-- composition tree serially even when they are composed using a parallel
506-- combinator. We can use 'serial' in place of 'async' and 'wSerial' in
507-- place of 'wAsync'. If we find that an SVar immediately above a computation
508-- gets drained empty we can switch to parallelizing the computation. For that
509-- we can use a state flag to fork the rest of the computation at any point of
510-- time inside the Monad bind operation if the consumer is running at a faster
513-- TBD Note 3: the binary operation ('parallel') composition allows us to
514-- dispatch a chunkSize of only 1. If we have to dispatch in arbitrary
515-- chunksizes we will need to compose the parallel actions using a data
516-- constructor (A Free container) instead so that we can divide it in chunks of
517-- arbitrary size before dispatching. If the stream is composed of
518-- hierarchically composed grains of different sizes then we can always switch
519-- to a desired granularity depending on the consumer speed.
521-- TBD Note 4: for pure work (when we are not in the IO monad) we can divide it
522-- into just the number of CPUs.
524-- | Join two computations on the currently running 'SVar' queue for concurrent
525-- execution. When we are using parallel composition, an SVar is passed around
526-- as a state variable. We try to schedule a new parallel computation on the
527-- SVar passed to us. The first time, when no SVar exists, a new SVar is
528-- created. Subsequently, 'joinStreamVarAsync' may get called when a computation
529-- already scheduled on the SVar is further evaluated. For example, when (a
530-- `parallel` b) is evaluated it calls a 'joinStreamVarAsync' to put 'a' and 'b' on
531-- the current scheduler queue.
533-- The 'SVarStyle' required by the current composition context is passed as one
534-- of the parameters. If the scheduling and composition style of the new
535-- computation being scheduled is different than the style of the current SVar,
536-- then we create a new SVar and schedule it on that. The newly created SVar
537-- joins as one of the computations on the current SVar queue.
539-- Cases when we need to switch to a new SVar:
541-- * (x `parallel` y) `parallel` (t `parallel` u) -- all of them get scheduled on the same SVar
542-- * (x `parallel` y) `parallel` (t `async` u) -- @t@ and @u@ get scheduled on a new child SVar
543-- because of the scheduling policy change.
544-- * if we 'adapt' a stream of type 'async' to a stream of type
545-- 'Parallel', we create a new SVar at the transitioning bind.
546-- * When the stream is switching from disjunctive composition to conjunctive
547-- composition and vice-versa we create a new SVar to isolate the scheduling
550forkSVarAsync :: MonadAsync m
551 => SVarStyle -> Stream m a -> Stream m a -> Stream m a
552forkSVarAsync style m1 m2 = Stream $ \st stp sng yld -> do
554 AsyncVar -> newAsyncVar st (concurrently m1 m2)
555 WAsyncVar -> newWAsyncVar st (concurrently m1 m2)
556 _ -> error "illegal svar type"
557 unStream (fromSVar sv) (rstState st) stp sng yld
559 concurrently ma mb = Stream $ \st stp sng yld -> do
560 liftIO $ enqueue (fromJust $ streamVar st) mb
561 unStream ma st stp sng yld
563{-# INLINE joinStreamVarAsync #-}
564joinStreamVarAsync :: MonadAsync m
565 => SVarStyle -> Stream m a -> Stream m a -> Stream m a
566joinStreamVarAsync style m1 m2 = Stream $ \st stp sng yld -> do
568 Just sv | svarStyle sv == style ->
569 liftIO (enqueue sv m2) >> unStream m1 st stp sng yld
570 _ -> unStream (forkSVarAsync style m1 m2) st stp sng yld
572------------------------------------------------------------------------------
573-- Semigroup and Monoid style compositions for parallel actions
574------------------------------------------------------------------------------
577asyncS :: MonadAsync m => Stream m a -> Stream m a -> Stream m a
578asyncS = joinStreamVarAsync AsyncVar
580-- | Polymorphic version of the 'Semigroup' operation '<>' of 'AsyncT'.
581-- Merges two streams possibly concurrently, preferring the
582-- elements from the left one when available.
586async :: (IsStream t, MonadAsync m) => t m a -> t m a -> t m a
587async m1 m2 = fromStream $ Stream $ \st stp sng yld ->
588 unStream (joinStreamVarAsync AsyncVar (toStream m1) (toStream m2))
594{-# DEPRECATED (<|) "Please use 'async' instead." #-}
596(<|) :: (IsStream t, MonadAsync m) => t m a -> t m a -> t m a
599-- | XXX we can implement it more efficienty by directly implementing instead
600-- of combining streams using async.
601{-# INLINE consMAsync #-}
602consMAsync :: MonadAsync m => m a -> Stream m a -> Stream m a
603consMAsync m r = K.yieldM m `asyncS` r
605------------------------------------------------------------------------------
607------------------------------------------------------------------------------
609-- | Deep async composition or async composition with depth first traversal. In
610-- a left to right 'Semigroup' composition it tries to yield elements from the
611-- left stream as long as it can, but it can run the right stream in parallel
612-- if it needs to, based on demand. The right stream can be run if the left
613-- stream blocks on IO or cannot produce elements fast enough for the consumer.
616-- main = ('toList' . 'asyncly' $ (fromFoldable [1,2]) \<> (fromFoldable [3,4])) >>= print
622-- Any exceptions generated by a constituent stream are propagated to the
623-- output stream. The output and exceptions from a single stream are guaranteed
624-- to arrive in the same order in the resulting stream as they were generated
625-- in the input stream. However, the relative ordering of elements from
626-- different streams in the resulting stream can vary depending on scheduling
627-- and generation delays.
629-- Similarly, the monad instance of 'AsyncT' /may/ run each iteration
630-- concurrently based on demand. More concurrent iterations are started only
631-- if the previous iterations are not able to produce enough output for the
636-- import qualified "Streamly.Prelude" as S
637-- import Control.Concurrent
639-- main = 'runStream' . 'asyncly' $ do
640-- n <- return 3 \<\> return 2 \<\> return 1
642-- threadDelay (n * 1000000)
643-- myThreadId >>= \\tid -> putStrLn (show tid ++ ": Delay " ++ show n)
646-- ThreadId 40: Delay 1
647-- ThreadId 39: Delay 2
648-- ThreadId 38: Delay 3
651-- All iterations may run in the same thread if they do not block.
653-- Note that async composition with depth first traversal can be used to
654-- combine infinite number of streams as it explores only a bounded number of
658newtype AsyncT m a = AsyncT {getAsyncT :: Stream m a}
659 deriving (MonadTrans)
661-- | A demand driven left biased parallely composing IO stream of elements of
662-- type @a@. See 'AsyncT' documentation for more details.
665type Async a = AsyncT IO a
667-- | Fix the type of a polymorphic stream as 'AsyncT'.
670asyncly :: IsStream t => AsyncT m a -> t m a
673instance IsStream AsyncT where
678 {-# SPECIALIZE consM :: IO a -> AsyncT IO a -> AsyncT IO a #-}
679 consM m r = fromStream $ consMAsync m (toStream r)
682 {-# SPECIALIZE (|:) :: IO a -> AsyncT IO a -> AsyncT IO a #-}
685------------------------------------------------------------------------------
687------------------------------------------------------------------------------
689instance MonadAsync m => Semigroup (AsyncT m a) where
692------------------------------------------------------------------------------
694------------------------------------------------------------------------------
696instance MonadAsync m => Monoid (AsyncT m a) where
700------------------------------------------------------------------------------
702------------------------------------------------------------------------------
704instance MonadAsync m => Monad (AsyncT m) where
706 (AsyncT m) >>= f = AsyncT $ K.bindWith asyncS m (getAsyncT . f)
708------------------------------------------------------------------------------
710------------------------------------------------------------------------------
712MONAD_APPLICATIVE_INSTANCE(AsyncT,MONADPARALLEL)
713MONAD_COMMON_INSTANCES(AsyncT, MONADPARALLEL)
715------------------------------------------------------------------------------
717------------------------------------------------------------------------------
719{-# INLINE wAsyncS #-}
720wAsyncS :: MonadAsync m => Stream m a -> Stream m a -> Stream m a
721wAsyncS = joinStreamVarAsync WAsyncVar
723-- | XXX we can implement it more efficienty by directly implementing instead
724-- of combining streams using wAsync.
725{-# INLINE consMWAsync #-}
726consMWAsync :: MonadAsync m => m a -> Stream m a -> Stream m a
727consMWAsync m r = K.yieldM m `wAsyncS` r
729-- | Polymorphic version of the 'Semigroup' operation '<>' of 'WAsyncT'.
730-- Merges two streams concurrently choosing elements from both fairly.
734wAsync :: (IsStream t, MonadAsync m) => t m a -> t m a -> t m a
735wAsync m1 m2 = fromStream $ Stream $ \st stp sng yld ->
736 unStream (wAsyncS (toStream m1) (toStream m2)) st stp sng yld
738-- | Wide async composition or async composition with breadth first traversal.
739-- The Semigroup instance of 'WAsyncT' concurrently /traverses/ the composed
740-- streams using a depth first travesal or in a round robin fashion, yielding
741-- elements from both streams alternately.
744-- main = ('toList' . 'wAsyncly' $ (fromFoldable [1,2]) \<> (fromFoldable [3,4])) >>= print
750-- Any exceptions generated by a constituent stream are propagated to the
751-- output stream. The output and exceptions from a single stream are guaranteed
752-- to arrive in the same order in the resulting stream as they were generated
753-- in the input stream. However, the relative ordering of elements from
754-- different streams in the resulting stream can vary depending on scheduling
755-- and generation delays.
757-- Similarly, the 'Monad' instance of 'WAsyncT' runs /all/ iterations fairly
758-- concurrently using a round robin scheduling.
762-- import qualified "Streamly.Prelude" as S
763-- import Control.Concurrent
765-- main = 'runStream' . 'wAsyncly' $ do
766-- n <- return 3 \<\> return 2 \<\> return 1
768-- threadDelay (n * 1000000)
769-- myThreadId >>= \\tid -> putStrLn (show tid ++ ": Delay " ++ show n)
772-- ThreadId 40: Delay 1
773-- ThreadId 39: Delay 2
774-- ThreadId 38: Delay 3
777-- Unlike 'AsyncT' all iterations are guaranteed to run fairly
778-- concurrently, unconditionally.
780-- Note that async composition with breadth first traversal can only combine a
781-- finite number of streams as it needs to retain state for each unfinished
785newtype WAsyncT m a = WAsyncT {getWAsyncT :: Stream m a}
786 deriving (MonadTrans)
788-- | A round robin parallely composing IO stream of elements of type @a@.
789-- See 'WAsyncT' documentation for more details.
792type WAsync a = WAsyncT IO a
794-- | Fix the type of a polymorphic stream as 'WAsyncT'.
797wAsyncly :: IsStream t => WAsyncT m a -> t m a
800instance IsStream WAsyncT where
801 toStream = getWAsyncT
805 {-# SPECIALIZE consM :: IO a -> WAsyncT IO a -> WAsyncT IO a #-}
806 consM m r = fromStream $ consMWAsync m (toStream r)
809 {-# SPECIALIZE (|:) :: IO a -> WAsyncT IO a -> WAsyncT IO a #-}
812------------------------------------------------------------------------------
814------------------------------------------------------------------------------
816instance MonadAsync m => Semigroup (WAsyncT m a) where
819------------------------------------------------------------------------------
821------------------------------------------------------------------------------
823instance MonadAsync m => Monoid (WAsyncT m a) where
827------------------------------------------------------------------------------
829------------------------------------------------------------------------------
831instance MonadAsync m => Monad (WAsyncT m) where
834 WAsyncT $ K.bindWith wAsyncS m (getWAsyncT . f)
836------------------------------------------------------------------------------
838------------------------------------------------------------------------------
840MONAD_APPLICATIVE_INSTANCE(WAsyncT,MONADPARALLEL)
841MONAD_COMMON_INSTANCES(WAsyncT, MONADPARALLEL)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list