Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bench/macro/lsm-tree-bench-bloomfilter.hs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ benchInBatches !b !rng0 !action =
go !rng !n
| n <= 0 = ()
| otherwise =
let (!rng'', !rng') = split rng
let (!rng'', !rng') = splitGen rng
ks :: VP.Vector Word256
!ks = VP.unfoldrExactN b uniform rng'
ks' :: V.Vector SerialisedKey
Expand Down
2 changes: 1 addition & 1 deletion bench/macro/lsm-tree-bench-lookups.hs
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ genLookupBatch !rng0 !n0
!res <- V.unsafeFreeze mres
pure (res, rng)
| otherwise = do
let (!k, !rng') = uniform @StdGen @UTxOKey rng
let (!k, !rng') = uniform @UTxOKey @StdGen rng
!sk = serialiseKey k
VM.write mres i $! sk
go rng' (i+1) mres
Expand Down
4 changes: 2 additions & 2 deletions bench/micro/Bench/Database/LSMTree/Internal/Lookup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ lookupsEnv ::
, V.Vector SerialisedKey
)
lookupsEnv g nentries npos nneg = do
let (g1, g') = R.split g
(g2, g3) = R.split g'
let (g1, g') = R.splitGen g
(g2, g3) = R.splitGen g'
let (keys, negLookups) = splitAt nentries
$ uniformWithoutReplacement @UTxOKey g1 (nentries + nneg)
posLookups = sampleUniformWithReplacement g2 npos keys
Expand Down
16 changes: 8 additions & 8 deletions bench/micro/Bench/Database/LSMTree/Internal/Merge.hs
Original file line number Diff line number Diff line change
Expand Up @@ -340,22 +340,22 @@ defaultConfig = Config {

configWord64 :: Config
configWord64 = defaultConfig {
randomKey = first serialiseKey . uniform @_ @Word64
, randomValue = first serialiseValue . uniform @_ @Word64
randomKey = first serialiseKey . uniform @Word64 @_
, randomValue = first serialiseValue . uniform @Word64 @_
, randomBlob = first serialiseBlob . R.randomByteStringR (0, 0x2000) -- up to 8 kB
}

configUTxO :: Config
configUTxO = defaultConfig {
randomKey = first serialiseKey . uniform @_ @UTxOKey
, randomValue = first serialiseValue . uniform @_ @UTxOValue
randomKey = first serialiseKey . uniform @UTxOKey @_
, randomValue = first serialiseValue . uniform @UTxOValue @_
}

configUTxOStaking :: Config
configUTxOStaking = defaultConfig {
fmupserts = 1
, randomKey = first serialiseKey . uniform @_ @UTxOKey
, randomValue = first serialiseValue . uniform @_ @Word64
, randomKey = first serialiseKey . uniform @UTxOKey @_
, randomValue = first serialiseValue . uniform @Word64 @_
, mergeResolve = Just (onDeserialisedValues ((+) @Word64))
}

Expand Down Expand Up @@ -401,7 +401,7 @@ randomRuns hasFS hasBlockIO config@Config {..} rng0 = do
zipWith
(randomRunData config)
nentries
(List.unfoldr (Just . R.split) rng0)
(List.unfoldr (Just . R.splitGen) rng0)

-- | Generate keys and entries to insert into the write buffer.
-- They are already serialised to exclude the cost from the benchmark.
Expand All @@ -416,7 +416,7 @@ randomRunData Config {..} runentries g0 =
(R.withoutReplacement g1 runentries randomKey)
(R.withReplacement g2 runentries randomEntry)
where
(g1, g2) = R.split g0
(g1, g2) = R.splitGen g0

randomEntry :: Rnd (Entry SerialisedValue SerialisedBlob)
randomEntry = R.frequency
Expand Down
8 changes: 4 additions & 4 deletions bench/micro/Bench/Database/LSMTree/Internal/WriteBuffer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,14 @@ defaultConfig = Config {

configWord64 :: Config
configWord64 = defaultConfig {
randomKey = first serialiseKey . uniform @_ @Word64
, randomValue = first serialiseValue . uniform @_ @Word64
randomKey = first serialiseKey . uniform @Word64 @_
, randomValue = first serialiseValue . uniform @Word64 @_
}

configUTxO :: Config
configUTxO = defaultConfig {
randomKey = first serialiseKey . uniform @_ @UTxOKey
, randomValue = first serialiseValue . uniform @_ @UTxOValue
randomKey = first serialiseKey . uniform @UTxOKey @_
, randomValue = first serialiseValue . uniform @UTxOValue @_
}

envInputKOps :: Config -> InputKOps
Expand Down
3 changes: 1 addition & 2 deletions cabal.project.release
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
index-state:
-- Bump this if you need newer packages from Hackage
-- current date: ghc-9.12 and data-elevator
, hackage.haskell.org 2025-03-10T07:49:31Z
, hackage.haskell.org 2025-05-01T00:00:00Z

packages:
.
Expand Down
2 changes: 1 addition & 1 deletion src-extras/Database/LSMTree/Extras/Random.hs
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ frequency xs0 g
randomByteStringR :: (Int, Int) -> StdGen -> (BS.ByteString, StdGen)
randomByteStringR range g =
let (!l, !g') = uniformR range g
in R.genByteString l g'
in R.uniformByteString l g'
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import Database.LSMTree.Extras.Random
import qualified Database.LSMTree.Internal.Entry as LSMT
import Database.LSMTree.Internal.RunAcc (RunBloomFilterAlloc (..),
falsePositiveRate, newMBloom)
import System.Random
import System.Random hiding (Seed)
import Test.QuickCheck
import Test.QuickCheck.Gen
import Test.Tasty (TestTree, testGroup)
Expand Down