diff --git a/plutus-benchmark/memory-analysis/data/.gitignore b/plutus-benchmark/memory-analysis/data/.gitignore new file mode 100644 index 00000000000..756b22fa2df --- /dev/null +++ b/plutus-benchmark/memory-analysis/data/.gitignore @@ -0,0 +1 @@ +*.svg diff --git a/plutus-benchmark/memory-analysis/data/README.md b/plutus-benchmark/memory-analysis/data/README.md new file mode 100644 index 00000000000..7b03f705cd0 --- /dev/null +++ b/plutus-benchmark/memory-analysis/data/README.md @@ -0,0 +1 @@ +# Directory to host generated plot images locally (ignored by git) diff --git a/plutus-benchmark/memory-analysis/src/Main.hs b/plutus-benchmark/memory-analysis/src/Main.hs new file mode 100644 index 00000000000..9a5de885ce5 --- /dev/null +++ b/plutus-benchmark/memory-analysis/src/Main.hs @@ -0,0 +1,13 @@ +module Main (main) where + +import PlutusBenchmark.MemoryAnalysis qualified as Analysis + +main :: IO () +main = do + measurements <- Analysis.generateMeasurements + -- Validation experiments (document design decisions) + Analysis.analyzeValueHeapPredictors measurements + Analysis.analyzeDataHeapPredictors measurements + Analysis.analyzeStructurePreservation measurements + -- Production model (coefficients used in ExMemoryUsage.hs) + Analysis.analyzeCrossConversionModels measurements diff --git a/plutus-benchmark/memory-analysis/src/PlutusBenchmark/MemoryAnalysis.hs b/plutus-benchmark/memory-analysis/src/PlutusBenchmark/MemoryAnalysis.hs new file mode 100644 index 00000000000..685ef3a57d0 --- /dev/null +++ b/plutus-benchmark/memory-analysis/src/PlutusBenchmark/MemoryAnalysis.hs @@ -0,0 +1,26 @@ +{-| Memory analysis for Value/Data conversions. +This module has been refactored into submodules for better organization. -} +module PlutusBenchmark.MemoryAnalysis + ( -- * Experiments + generateMeasurements + , analyzeValueHeapPredictors + , analyzeDataHeapPredictors + , analyzeStructurePreservation + , analyzeCrossConversionModels + + -- * Types + , MeasurementActual (..) + + -- * Generators + , generateUniformValue + , generateWorstCaseValue + + -- * Utilities + , countNodes + , countValueNodes + ) where + +import PlutusBenchmark.MemoryAnalysis.Experiments +import PlutusBenchmark.MemoryAnalysis.Generators (generateUniformValue, generateWorstCaseValue) +import PlutusBenchmark.MemoryAnalysis.Helpers (countNodes, countValueNodes) +import PlutusBenchmark.MemoryAnalysis.Types (MeasurementActual (..)) diff --git a/plutus-benchmark/memory-analysis/src/PlutusBenchmark/MemoryAnalysis/Experiments.hs b/plutus-benchmark/memory-analysis/src/PlutusBenchmark/MemoryAnalysis/Experiments.hs new file mode 100644 index 00000000000..d7afffda399 --- /dev/null +++ b/plutus-benchmark/memory-analysis/src/PlutusBenchmark/MemoryAnalysis/Experiments.hs @@ -0,0 +1,364 @@ +{-# LANGUAGE BlockArguments #-} + +module PlutusBenchmark.MemoryAnalysis.Experiments + ( generateMeasurements + , analyzeValueHeapPredictors + , analyzeDataHeapPredictors + , analyzeStructurePreservation + , analyzeCrossConversionModels + ) where + +import Prelude + +import Data.Function ((&)) +import Data.Functor ((<&>)) +import PlutusBenchmark.MemoryAnalysis.Generators (generateUniformValue, generateWorstCaseValue) +import PlutusBenchmark.MemoryAnalysis.Helpers + ( computeR2 + , computeSSE + , countNodes + , countValueNodes + , measureGraphWords + , memU + , printSectionHeader + ) +import PlutusBenchmark.MemoryAnalysis.Types (MeasurementActual (..), MeasurementRaw (..)) +import PlutusBenchmark.Plotting (savePredictionPlot) +import PlutusBenchmark.RegressionInteger (integerBestFit) +import PlutusCore.Value qualified as Value +import Text.Printf (printf) + +-------------------------------------------------------------------------------- +-- Measurement Generation ------------------------------------------------------ + +{-| Generate measurements for all experiments. +This is the shared data collection pass used by all analysis functions. -} +generateMeasurements :: IO [MeasurementActual] +generateMeasurements = do + printSectionHeader "Memory Analysis Experiments" + + let testSizes = [1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24, 32, 40, 48, 64, 80, 96, 128] + + putStrLn "Generating test Values and measuring memory usage..." + putStrLn "" + + -- Collect raw measurements using uniform distribution + let measurementsRaw = + [ (numPolicies, tokensPerPolicy) + | numPolicies <- testSizes + , tokensPerPolicy <- testSizes + ] + <&> \(numPolicies, tokensPerPolicy) -> + let value = generateUniformValue numPolicies tokensPerPolicy + data' = Value.valueData value + valueMem = memU value + dataMem = memU data' + in MeasurementRaw + { mrNumPolicies = numPolicies + , mrTokensPerPolicy = tokensPerPolicy + , mrValueMem = valueMem + , mrDataMem = dataMem + , mrTotalSize = Value.totalSize value + , mrRatio = + if valueMem > 0 + then fromIntegral dataMem / fromIntegral valueMem + else 0 + , mrOuterSize = numPolicies + , mrValue = value + , mrData = data' + , mrValueNodeCount = countValueNodes value + , mrDataNodeCount = countNodes data' + } + + -- Second pass: measure actual graph sizes + measurementsRaw & mapM \mr -> do + actualValueMem <- measureGraphWords (mrValue mr) + actualDataMem <- measureGraphWords (mrData mr) + + pure + MeasurementActual + { maNumPolicies = mrNumPolicies mr + , maTokensPerPolicy = mrTokensPerPolicy mr + , maValueMem = mrValueMem mr + , maDataMem = mrDataMem mr + , maTotalSize = toInteger (mrTotalSize mr) + , maRatio = mrRatio mr + , maOuterSize = mrOuterSize mr + , maActualValueMem = actualValueMem + , maData = mrData mr + , maValueNodeCount = mrValueNodeCount mr + , maDataNodeCount = mrDataNodeCount mr + , maActualDataMem = actualDataMem + } + +-------------------------------------------------------------------------------- +-- Value Heap Predictors ------------------------------------------------------- + +{-| Compare totalSize vs nodeCount as predictors for Value heap memory. +FUTURE REFERENCE: Shows nodeCount achieves higher R² for real-case structure. +Currently using totalSize for simplicity; keep this for potential future switch. -} +analyzeValueHeapPredictors :: [MeasurementActual] -> IO () +analyzeValueHeapPredictors measurements = do + printSectionHeader "Value Heap Memory: totalSize vs nodeCount" + + -- Data points: (predictor, actualValueHeap) + let totalSizePoints = [(maTotalSize m, maActualValueMem m) | m <- measurements] + nodeCountPoints = [(toInteger (maValueNodeCount m), maActualValueMem m) | m <- measurements] + + -- Fit linear models + let (totalSizeSlope, totalSizeIntercept) = integerBestFit totalSizePoints + (nodeCountSlope, nodeCountIntercept) = integerBestFit nodeCountPoints + + -- Compute SSE and R² for each model + let totalSizeSSE = computeSSE totalSizeSlope totalSizeIntercept totalSizePoints + nodeCountSSE = computeSSE nodeCountSlope nodeCountIntercept nodeCountPoints + totalSizeR2 = computeR2 totalSizeSSE totalSizePoints + nodeCountR2 = computeR2 nodeCountSSE nodeCountPoints + + putStrLn "Model 1: ValueHeap = slope * totalSize + intercept" + printf " Coefficients: slope=%d, intercept=%d\n" totalSizeSlope totalSizeIntercept + printf " SSE: %.2f\n" totalSizeSSE + printf " R²: %.6f\n" totalSizeR2 + putStrLn "" + + putStrLn "Model 2: ValueHeap = slope * nodeCount + intercept" + printf " Coefficients: slope=%d, intercept=%d\n" nodeCountSlope nodeCountIntercept + printf " SSE: %.2f\n" nodeCountSSE + printf " R²: %.6f\n" nodeCountR2 + putStrLn "" + + let winner = if nodeCountR2 > totalSizeR2 then "nodeCount" else "totalSize" + printf "Better predictor: %s (higher R²)\n" winner + + -- Generate comparison plots + savePredictionPlot + "value_heap_totalsize_predictor.svg" + (printf "Value Heap vs totalSize (R²=%.4f)" totalSizeR2) + "totalSize" + "Value Heap Memory (words)" + totalSizePoints + (totalSizeSlope, totalSizeIntercept) + + savePredictionPlot + "value_heap_nodecount_predictor.svg" + (printf "Value Heap vs nodeCount (R²=%.4f)" nodeCountR2) + "nodeCount" + "Value Heap Memory (words)" + nodeCountPoints + (nodeCountSlope, nodeCountIntercept) + + putStrLn "Plot saved as 'plutus-benchmark/memory-analysis/data/value_heap_totalsize_predictor.svg'" + putStrLn "Plot saved as 'plutus-benchmark/memory-analysis/data/value_heap_nodecount_predictor.svg'" + +-------------------------------------------------------------------------------- +-- Data Heap Predictors -------------------------------------------------------- + +{-| Compare totalSize vs nodeCount as predictors for Data heap memory. +FUTURE REFERENCE: Shows nodeCount achieves higher R² for real-case structure. +Currently using totalSize for ValueData; keep this for potential future switch. -} +analyzeDataHeapPredictors :: [MeasurementActual] -> IO () +analyzeDataHeapPredictors measurements = do + printSectionHeader "Data Heap Memory: totalSize vs nodeCount" + + -- Data points: (predictor, actualDataHeap) + let totalSizePoints = [(maTotalSize m, maActualDataMem m) | m <- measurements] + nodeCountPoints = [(toInteger (maDataNodeCount m), maActualDataMem m) | m <- measurements] + + -- Fit linear models + let (totalSizeSlope, totalSizeIntercept) = integerBestFit totalSizePoints + (nodeCountSlope, nodeCountIntercept) = integerBestFit nodeCountPoints + + -- Compute SSE and R² for each model + let totalSizeSSE = computeSSE totalSizeSlope totalSizeIntercept totalSizePoints + nodeCountSSE = computeSSE nodeCountSlope nodeCountIntercept nodeCountPoints + totalSizeR2 = computeR2 totalSizeSSE totalSizePoints + nodeCountR2 = computeR2 nodeCountSSE nodeCountPoints + + putStrLn "Model 1: DataHeap = slope * totalSize + intercept" + printf " Coefficients: slope=%d, intercept=%d\n" totalSizeSlope totalSizeIntercept + printf " SSE: %.2f\n" totalSizeSSE + printf " R²: %.6f\n" totalSizeR2 + putStrLn "" + + putStrLn "Model 2: DataHeap = slope * nodeCount + intercept" + printf " Coefficients: slope=%d, intercept=%d\n" nodeCountSlope nodeCountIntercept + printf " SSE: %.2f\n" nodeCountSSE + printf " R²: %.6f\n" nodeCountR2 + putStrLn "" + + let winner = if nodeCountR2 > totalSizeR2 then "nodeCount" else "totalSize" + printf "Better predictor: %s (higher R²)\n" winner + + -- Generate comparison plots + savePredictionPlot + "data_heap_totalsize_predictor.svg" + (printf "Data Heap vs totalSize (R²=%.4f)" totalSizeR2) + "totalSize" + "Data Heap Memory (words)" + totalSizePoints + (totalSizeSlope, totalSizeIntercept) + + savePredictionPlot + "data_heap_nodecount_predictor.svg" + (printf "Data Heap vs nodeCount (R²=%.4f)" nodeCountR2) + "nodeCount" + "Data Heap Memory (words)" + nodeCountPoints + (nodeCountSlope, nodeCountIntercept) + + putStrLn "Plot saved as 'plutus-benchmark/memory-analysis/data/data_heap_totalsize_predictor.svg'" + putStrLn "Plot saved as 'plutus-benchmark/memory-analysis/data/data_heap_nodecount_predictor.svg'" + +-------------------------------------------------------------------------------- +-- Structure Preservation ------------------------------------------------------ + +{-| Compare worst-case (flattened) vs real-case (structure-preserving). +DOCUMENTATION: Validates the worst-case assumption used in ValueData costing. +Shows that totalSize gives perfect R²=1.0 when structure is flattened. -} +analyzeStructurePreservation :: [MeasurementActual] -> IO () +analyzeStructurePreservation measurements = do + printSectionHeader "Structure Preservation Comparison" + + putStrLn "Real-case (uniform): Each policy gets tokensPerPolicy tokens" + putStrLn "Worst-case (flattened): Each policy gets exactly 1 token" + putStrLn "" + + -- Generate worst-case measurements with flattened structure + let testSizes = [1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24, 32, 40, 48, 64, 80, 96, 128] + + putStrLn "Generating worst-case Values and measuring..." + worstCaseMeasurements <- + testSizes & mapM \totalSize -> do + let value = generateWorstCaseValue totalSize + data' = Value.valueData value + actualValueMem <- measureGraphWords value + actualDataMem <- measureGraphWords data' + + pure (totalSize, actualValueMem, actualDataMem, countValueNodes value, countNodes data') + + -- Compare totalSize predictor for both approaches + let realCasePoints = [(maTotalSize m, maActualValueMem m) | m <- measurements] + worstCasePoints = [(toInteger ts, vm) | (ts, vm, _, _, _) <- worstCaseMeasurements] + + -- Fit models + let (realSlope, realIntercept) = integerBestFit realCasePoints + (worstSlope, worstIntercept) = integerBestFit worstCasePoints + + -- Compute SSE and R² + let realSSE = computeSSE realSlope realIntercept realCasePoints + worstSSE = computeSSE worstSlope worstIntercept worstCasePoints + realR2 = computeR2 realSSE realCasePoints + worstR2 = computeR2 worstSSE worstCasePoints + + putStrLn "Real-case (uniform): ValueHeap = slope * totalSize + intercept" + printf " Coefficients: slope=%d, intercept=%d\n" realSlope realIntercept + printf " SSE: %.2f, R²: %.6f\n" realSSE realR2 + putStrLn "" + + putStrLn "Worst-case (flattened): ValueHeap = slope * totalSize + intercept" + printf " Coefficients: slope=%d, intercept=%d\n" worstSlope worstIntercept + printf " SSE: %.2f, R²: %.6f\n" worstSSE worstR2 + putStrLn "" + + printf "Worst-case R² should be ≈1.0 (structure is deterministic given totalSize)\n" + + -- Generate comparison plot + savePredictionPlot + "value_heap_worstcase.svg" + (printf "Value Heap (Worst-case) vs totalSize (R²=%.4f)" worstR2) + "totalSize" + "Value Heap Memory (words)" + worstCasePoints + (worstSlope, worstIntercept) + + putStrLn "Plot saved as 'plutus-benchmark/memory-analysis/data/value_heap_worstcase.svg'" + +-------------------------------------------------------------------------------- +-- Cross-Conversion Models ----------------------------------------------------- + +{-| PRODUCTION MODEL: Derive cross-conversion coefficients for ExMemoryUsage. + +ValueData builtin (Value → Data): + Uses totalSize with worst-case (flattened) structure assumption + Perfect fit (R²=1.0), slightly pessimistic + Used by: ValueTotalSizeToDataHeap wrapper in ExMemoryUsage.hs + +UnValueData builtin (Data → Value): + Counts INPUT Data nodes → predicts OUTPUT Value heap + Model: ValueHeap = 6 * dataNodeCount + 27 (R²=0.973) + Used by: DataNodeCountToValueHeap wrapper in ExMemoryUsage.hs + +See plutus-core/plutus-core/src/PlutusCore/Evaluation/Machine/ExMemoryUsage.hs -} +analyzeCrossConversionModels :: [MeasurementActual] -> IO () +analyzeCrossConversionModels measurements = do + printSectionHeader "Cross-Conversion Models (PRODUCTION)" + + putStrLn "ValueData: Input Value → Output Data" + putStrLn "UnValueData: Input Data → Output Value" + putStrLn "" + + -- Generate worst-case measurements for ValueData model + let testSizes = [1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24, 32, 40, 48, 64, 80, 96, 128] + + putStrLn "Generating worst-case Values for ValueData model..." + worstCaseMeasurements <- + testSizes & mapM \totalSize -> do + let value = generateWorstCaseValue totalSize + data' = Value.valueData value + actualDataMem <- measureGraphWords data' + + pure (totalSize, actualDataMem) + + -- ValueData: Input Value totalSize → Output Data actual heap (worst-case) + let valueDataPoints = [(toInteger ts, dm) | (ts, dm) <- worstCaseMeasurements] + (vdSlope, vdIntercept) = integerBestFit valueDataPoints + vdSSE = computeSSE vdSlope vdIntercept valueDataPoints + vdR2 = computeR2 vdSSE valueDataPoints + + putStrLn "ValueData: OutputDataHeap = slope * inputTotalSize + intercept (worst-case)" + printf " Coefficients: slope=%d, intercept=%d\n" vdSlope vdIntercept + printf " SSE: %.2f, R²: %.6f\n" vdSSE vdR2 + putStrLn "" + + -- UnValueData: Input Data nodeCount → Output Value actual heap + let unValueDataPoints = [(toInteger (maDataNodeCount m), maActualValueMem m) | m <- measurements] + (uvdSlope, uvdIntercept) = integerBestFit unValueDataPoints + uvdSSE = computeSSE uvdSlope uvdIntercept unValueDataPoints + uvdR2 = computeR2 uvdSSE unValueDataPoints + + putStrLn "UnValueData: OutputValueHeap = slope * inputDataNodeCount + intercept" + printf " Coefficients: slope=%d, intercept=%d\n" uvdSlope uvdIntercept + printf " SSE: %.2f, R²: %.6f\n" uvdSSE uvdR2 + putStrLn "" + + putStrLn "These are the PRODUCTION models for the ExMemoryUsage wrappers:" + printf + " ValueTotalSizeToDataHeap: %d * totalSize + %d (predicts output Data heap, R²=%.3f)\n" + vdSlope + vdIntercept + vdR2 + printf + " DataNodeCountToValueHeap: %d * dataNodeCount + %d (predicts output Value heap, R²=%.3f)\n" + uvdSlope + uvdIntercept + uvdR2 + + -- Generate plots + savePredictionPlot + "valuedata_production_model.svg" + (printf "ValueData Model: OutputDataHeap = %d*totalSize + %d (R²=%.4f)" vdSlope vdIntercept vdR2) + "Input Value totalSize" + "Output Data Heap (words)" + valueDataPoints + (vdSlope, vdIntercept) + + savePredictionPlot + "unvaluedata_production_model.svg" + (printf "UnValueData Model: OutputValueHeap = %d*dataNodeCount + %d (R²=%.4f)" uvdSlope uvdIntercept uvdR2) + "Input Data nodeCount" + "Output Value Heap (words)" + unValueDataPoints + (uvdSlope, uvdIntercept) + + putStrLn "Plot saved as 'plutus-benchmark/memory-analysis/data/valuedata_production_model.svg'" + putStrLn "Plot saved as 'plutus-benchmark/memory-analysis/data/unvaluedata_production_model.svg'" diff --git a/plutus-benchmark/memory-analysis/src/PlutusBenchmark/MemoryAnalysis/Generators.hs b/plutus-benchmark/memory-analysis/src/PlutusBenchmark/MemoryAnalysis/Generators.hs new file mode 100644 index 00000000000..2b4bdbb0dc4 --- /dev/null +++ b/plutus-benchmark/memory-analysis/src/PlutusBenchmark/MemoryAnalysis/Generators.hs @@ -0,0 +1,89 @@ +module PlutusBenchmark.MemoryAnalysis.Generators + ( generateUniformValue + , generateWorstCaseValue + , indexToKey + ) where + +import Prelude + +import Data.ByteString qualified as BS +import Data.Map.Strict qualified as Map +import Data.Word (Word8) +import PlutusCore.Value (K, Value) +import PlutusCore.Value qualified as Value + +{-| Generate unique key for given index (deterministic, no randomness). +Encodes index as variable-length ByteString to guarantee uniqueness. +Keys must be unique and not minimal (may need >1 byte for large indices). -} +indexToKey :: Int -> K +indexToKey idx = + let + -- Encode index as bytes (little-endian for simplicity) + bytes = + if idx < 256 + then [fromIntegral idx :: Word8] + else + let b0 = fromIntegral (idx `mod` 256) :: Word8 + b1 = fromIntegral ((idx `div` 256) `mod` 256) :: Word8 + b2 = fromIntegral ((idx `div` 65536) `mod` 256) :: Word8 + b3 = fromIntegral ((idx `div` 16777216) `mod` 256) :: Word8 + in filter (/= 0) [b3, b2, b1, b0] ++ [fromIntegral (idx `mod` 256) :: Word8] + bs = BS.pack bytes + in + case Value.k bs of + Just k -> k + Nothing -> error $ "indexToKey: invalid key for index " ++ show idx + +{-| Generate Value with uniform token distribution. +totalSize = numPolicies × tokensPerPolicy +Used for: real-case memory analysis, lookup benchmarks -} +generateUniformValue + :: Int -- numPolicies + -> Int -- tokensPerPolicy + -> Value +generateUniformValue numPolicies tokensPerPolicy = + let + -- Use quantity=1 to avoid normalization removal + qty = case Value.quantity 1 of + Just q -> q + Nothing -> error "generateUniformValue: invalid quantity" + + -- Generate unique policy IDs + policyIds = [indexToKey (i * 1000) | i <- [0 .. numPolicies - 1]] + + -- For each policy, generate tokensPerPolicy unique token names + nestedMap = + [ ( policyId + , Map.fromList + [ (indexToKey (policyIdx * 1000 + tokenIdx), qty) + | tokenIdx <- [1 .. tokensPerPolicy] + ] + ) + | (policyIdx, policyId) <- zip [0 ..] policyIds + ] + in + Value.pack (Map.fromList nestedMap) + +{-| Generate worst-case Value for memory costing (flattened structure). +Each policy has exactly 1 token (singleton inner map). +totalSize = numPolicies = numTokens +Used for: worst-case memory model derivation (ValueData costing) +Maximizes outer map overhead relative to totalSize. -} +generateWorstCaseValue + :: Int -- totalSize (= numPolicies = numTokens) + -> Value +generateWorstCaseValue totalSize = + let + -- Use quantity=1 to avoid normalization removal + qty = case Value.quantity 1 of + Just q -> q + Nothing -> error "generateWorstCaseValue: invalid quantity" + + -- Each policy gets a unique ID and contains exactly one token + -- Policy i has token (i+1000) to ensure distinct keys + nestedMap = + [ (indexToKey i, Map.singleton (indexToKey (i + 1000)) qty) + | i <- [0 .. totalSize - 1] + ] + in + Value.pack (Map.fromList nestedMap) diff --git a/plutus-benchmark/memory-analysis/src/PlutusBenchmark/MemoryAnalysis/Helpers.hs b/plutus-benchmark/memory-analysis/src/PlutusBenchmark/MemoryAnalysis/Helpers.hs new file mode 100644 index 00000000000..6b0a577c68a --- /dev/null +++ b/plutus-benchmark/memory-analysis/src/PlutusBenchmark/MemoryAnalysis/Helpers.hs @@ -0,0 +1,85 @@ +module PlutusBenchmark.MemoryAnalysis.Helpers + ( memU + , measureGraphWords + , countNodes + , countValueNodes + , printSectionHeader + , computeSSE + , computeR2 + ) where + +import Prelude + +import Control.DeepSeq (NFData, force) +import Control.Exception (evaluate) +import Data.Map.Strict qualified as Map +import Data.SatInt (fromSatInt) +import GHC.DataSize qualified as DS +import PlutusCore.Data qualified as PLC (Data (..)) +import PlutusCore.Evaluation.Machine.CostStream (sumCostStream) +import PlutusCore.Evaluation.Machine.ExMemoryUsage (ExMemoryUsage (..), flattenCostRose) +import PlutusCore.Value (Value) +import PlutusCore.Value qualified as Value + +-------------------------------------------------------------------------------- +-- Memory Measurement ---------------------------------------------------------- + +-- | Memory usage calculation via ExMemoryUsage +memU :: ExMemoryUsage a => a -> Integer +memU x = fromSatInt (sumCostStream (flattenCostRose (memoryUsage x))) + +-- | Measure size by walking the object graph in 64-bit words; resistant to heap churn +measureGraphWords :: NFData a => a -> IO Integer +measureGraphWords x = do + x' <- evaluate (force x) + sz <- DS.recursiveSize x' + pure (fromIntegral sz `div` 8) + +-------------------------------------------------------------------------------- +-- Node Counting --------------------------------------------------------------- + +-- | Count nodes in a Data structure (all constructors including B and I leaves) +countNodes :: PLC.Data -> Int +countNodes (PLC.Constr _ ds) = 1 + sum (map countNodes ds) +countNodes (PLC.Map pairs) = 1 + sum (map (\(k, v) -> countNodes k + countNodes v) pairs) +countNodes (PLC.List ds) = 1 + sum (map countNodes ds) +countNodes (PLC.I _) = 1 +countNodes (PLC.B _) = 1 + +{-| Count nodes in a Value structure by traversing nested maps. +Counts: 1 (root) + 1 per policy (outer map entry) + 1 per token (inner map entry) +This matches the CostRose traversal pattern used in ExMemoryUsage. -} +countValueNodes :: Value -> Int +countValueNodes v = + let nested = Value.unpack v + in 1 + sum [1 + Map.size inner | inner <- Map.elems nested] + +-------------------------------------------------------------------------------- +-- Regression Statistics ------------------------------------------------------- + +-- | Compute sum of squared errors +computeSSE :: Integer -> Integer -> [(Integer, Integer)] -> Double +computeSSE slope intercept pts = + sum + [ (fromIntegral y - (fromIntegral slope * fromIntegral x + fromIntegral intercept)) ** 2 + | (x, y) <- pts + ] + +-- | Compute R-squared statistic +computeR2 :: Double -> [(Integer, Integer)] -> Double +computeR2 sse pts = + let meanY = fromIntegral (sum (map snd pts)) / fromIntegral (length pts) + ssTot = sum [(fromIntegral y - meanY) ** 2 | (_, y) <- pts] + in 1 - sse / ssTot + +-------------------------------------------------------------------------------- +-- Output Formatting ----------------------------------------------------------- + +-- | Print a standardized section header used by the main analysis flow +printSectionHeader :: String -> IO () +printSectionHeader title = do + putStrLn "" + putStrLn "==========================================" + putStrLn title + putStrLn "==========================================" + putStrLn "" diff --git a/plutus-benchmark/memory-analysis/src/PlutusBenchmark/MemoryAnalysis/Types.hs b/plutus-benchmark/memory-analysis/src/PlutusBenchmark/MemoryAnalysis/Types.hs new file mode 100644 index 00000000000..e79670b2de6 --- /dev/null +++ b/plutus-benchmark/memory-analysis/src/PlutusBenchmark/MemoryAnalysis/Types.hs @@ -0,0 +1,38 @@ +module PlutusBenchmark.MemoryAnalysis.Types + ( MeasurementActual (..) + , MeasurementRaw (..) + ) where + +import PlutusCore.Data qualified as PLC (Data) +import PlutusCore.Value (Value) + +-- | Raw measurement record captured directly from generators (before actual measurements) +data MeasurementRaw = MeasurementRaw + { mrNumPolicies :: Int + , mrTokensPerPolicy :: Int + , mrValueMem :: Integer -- ExMemoryUsage-based Value memory + , mrDataMem :: Integer -- ExMemoryUsage-based Data memory + , mrTotalSize :: Int + , mrRatio :: Double + , mrOuterSize :: Int + , mrValue :: Value + , mrData :: PLC.Data -- Output of valueData (Value → Data) + , mrValueNodeCount :: Int -- Node count for Value + , mrDataNodeCount :: Int -- Node count for Data + } + +-- | Measurement record for values produced after the first pass +data MeasurementActual = MeasurementActual + { maNumPolicies :: Int + , maTokensPerPolicy :: Int + , maValueMem :: Integer + , maDataMem :: Integer + , maTotalSize :: Integer + , maRatio :: Double + , maOuterSize :: Int + , maActualValueMem :: Integer + , maData :: PLC.Data + , maValueNodeCount :: Int -- Node count for Value (1 + policies + tokens) + , maDataNodeCount :: Int -- Node count for Data (all nodes including B/I) + , maActualDataMem :: Integer -- Actual Data heap (measureGraphWords on mrData) + } diff --git a/plutus-benchmark/memory-analysis/src/PlutusBenchmark/Plotting.hs b/plutus-benchmark/memory-analysis/src/PlutusBenchmark/Plotting.hs new file mode 100644 index 00000000000..7d9d46d3e6b --- /dev/null +++ b/plutus-benchmark/memory-analysis/src/PlutusBenchmark/Plotting.hs @@ -0,0 +1,121 @@ +module PlutusBenchmark.Plotting + ( dataOutDir + , savePredictionPlot + , saveScatterPlot + , generateScatterPlot + , ensureDataDir + ) where + +import Prelude + +import Data.Colour.SRGB (sRGB24) +import Graphics.Rendering.Chart.Backend.Diagrams (toFile) +import Graphics.Rendering.Chart.Easy +import System.Directory (createDirectoryIfMissing) + +-- Directory where generated plots are written +dataOutDir :: FilePath +dataOutDir = "plutus-benchmark/memory-analysis/data" + +ensureDataDir :: IO () +ensureDataDir = createDirectoryIfMissing True dataOutDir + +-- Save a prediction plot: model line (slope/intercept) + actual points +savePredictionPlot + :: FilePath -- filename (relative, will be placed under dataOutDir) + -> String -- title + -> String -- x title + -> String -- y title + -> [(Integer, Integer)] -- actual points (x,y) + -> (Integer, Integer) -- (slope, intercept) + -> IO () +savePredictionPlot filename title xTitle yTitle actualPoints (slope, intercept) = do + ensureDataDir + let outPath = dataOutDir ++ "/" ++ filename + actualD = + map + ( \(x, y) -> + ( fromIntegral x :: Double + , fromIntegral y :: Double + ) + ) + actualPoints + predicted = + [ ( fromIntegral x :: Double + , fromIntegral slope * fromIntegral x + fromIntegral intercept + ) + | (x, _) <- actualPoints + ] + toFile def outPath $ do + layout_title .= title + layout_x_axis . laxis_title .= xTitle + layout_y_axis . laxis_title .= yTitle + setColors [opaque (sRGB24 255 0 0), opaque (sRGB24 0 0 255)] + plot $ line "Predicted (model)" [predicted] + plot $ points "Actual" actualD + +-- Save a scatter plot with fitted model line computed at same x values +saveScatterPlot + :: FilePath + -> String + -> String + -> String + -> [(Integer, Integer)] + -> Integer -- slope + -> Integer -- intercept + -> IO () +saveScatterPlot filename title xTitle yTitle plotData slope intercept = do + ensureDataDir + let outPath = dataOutDir ++ "/" ++ filename + plotDataD = + map + ( \(x, y) -> + ( fromIntegral x :: Double + , fromIntegral y :: Double + ) + ) + plotData + slopeD = fromIntegral slope :: Double + interceptD = fromIntegral intercept :: Double + predictedPoints = + [ ( x + , slopeD * x + interceptD + ) + | (x, _) <- plotDataD + ] + toFile def outPath $ do + layout_title .= title + layout_x_axis . laxis_title .= xTitle + layout_y_axis . laxis_title .= yTitle + plot $ points "Data Points" plotDataD + setColors [opaque (sRGB24 255 0 0)] + plot $ line "Predicted (model)" [predictedPoints] + +-- Generate scatter plot of Value memory vs Data memory (kept for compatibility) +generateScatterPlot + :: String + -> String + -> String + -> FilePath + -> [(Integer, Integer)] + -> Integer + -> Integer + -> IO () +generateScatterPlot title xTitle yTitle filename plotData slope intercept = do + let plotDataD :: [(Double, Double)] + plotDataD = map (\(x, y) -> (fromIntegral x :: Double, fromIntegral y :: Double)) plotData + slopeD = fromIntegral slope :: Double + interceptD = fromIntegral intercept :: Double + + ensureDataDir + let outPath = dataOutDir ++ "/" ++ filename + + toFile def outPath $ do + layout_title .= title + layout_x_axis . laxis_title .= xTitle + layout_y_axis . laxis_title .= yTitle + plot $ points "Memory Usage" plotDataD + -- Compute model predictions at the same X values as the provided plot data + let predictedPoints = [(x, slopeD * x + interceptD) | x <- map fst plotDataD] + setColors [opaque (sRGB24 255 0 0)] + plot $ line "Predicted (model)" [predictedPoints] diff --git a/plutus-benchmark/memory-analysis/src/PlutusBenchmark/RegressionInteger.hs b/plutus-benchmark/memory-analysis/src/PlutusBenchmark/RegressionInteger.hs new file mode 100644 index 00000000000..a45de3f71b7 --- /dev/null +++ b/plutus-benchmark/memory-analysis/src/PlutusBenchmark/RegressionInteger.hs @@ -0,0 +1,121 @@ +module PlutusBenchmark.RegressionInteger (integerBestFit) where + +import Data.List (minimumBy) +import Data.Maybe (catMaybes) +import Data.Ord (comparing) + +-------------------------------------------------------------------------------- +-- Constrained Linear Regression ----------------------------------------------- + +{-| Find best integer (slope, intercept) with non-negativity constraints. +Uses constrained OLS with overestimation bias, then refines with integer search. +Underestimation is penalized more heavily to ensure safe memory costing. -} +integerBestFit :: [(Integer, Integer)] -> (Integer, Integer) +integerBestFit pts + | null pts = (0, 0) + | otherwise = + let ptsD = [(fromIntegral x, fromIntegral y) | (x, y) <- pts] + penalty = 2.0 -- Underestimation errors weighted 4x more + (sD, iD) = constrainedOLS penalty ptsD -- Already non-negative + + -- Search neighborhood in non-negative space + baseS = round sD + baseI = round iD + deltaS = max 3 baseS + 5 + deltaI = max 10 (baseI `div` 2) + 10 + + -- Only non-negative candidates (neighborhood bounded by 0) + slopes = [max 0 (baseS - deltaS) .. baseS + deltaS] + intercepts = [max 0 (baseI - deltaI) .. baseI + deltaI] + + lossFor s i = asymmetricLoss penalty ptsD (fromIntegral s, fromIntegral i) + + candidates = [(s, i, lossFor s i) | s <- slopes, i <- intercepts] + (bestS, bestI, _) = + minimumBy (comparing (\(_, _, loss) -> loss)) candidates + in (bestS, bestI) -- Already guaranteed non-negative + +{-| Compute asymmetric loss with underestimation penalty. +Underestimation (predicted < actual) is penalized more heavily than overestimation. +This biases the regression toward safe overestimation for memory costing. -} +asymmetricLoss :: Double -> [(Double, Double)] -> (Double, Double) -> Double +asymmetricLoss penalty pts (slope, intercept) = + sum + [ let predicted = slope * x + intercept + err = y - predicted + in if err > 0 -- underestimation (predicted < actual) - DANGEROUS + then (penalty * err) ** 2 + else err ** 2 -- overestimation (predicted >= actual) - SAFE + | (x, y) <- pts + ] + +{-| Non-negative constrained ordinary least squares with asymmetric loss. +Finds best (slope, intercept) with slope ≥ 0 and intercept ≥ 0. +Considers four cases and chooses the one with minimum asymmetric loss: + 1. Unconstrained OLS (if both coefficients are non-negative) + 2. Through origin: intercept = 0, slope = Σ(xy)/Σ(x²) + 3. Horizontal line: slope = 0, intercept = mean(y) + 4. Both at boundary: (0, 0) - always valid fallback -} +constrainedOLS :: Double -> [(Double, Double)] -> (Double, Double) +constrainedOLS penalty pts + | null pts = (0, 0) + | otherwise = + let + -- Try unconstrained OLS first + (sOLS, iOLS) = continuousOLS pts + + -- Helper: compute asymmetric loss for given coefficients + lossFor s i = asymmetricLoss penalty pts (s, i) + + -- Case 1: Unconstrained (if both non-negative) + case1 = + if sOLS >= 0 && iOLS >= 0 + then Just (sOLS, iOLS, lossFor sOLS iOLS) + else Nothing + + -- Case 2: Through origin (intercept = 0, slope free) + sOrigin = + let numerator = sum [x * y | (x, y) <- pts] + denominator = sum [x * x | (x, _) <- pts] + in if denominator == 0 then 0 else numerator / denominator + case2 = + if sOrigin >= 0 + then Just (sOrigin, 0, lossFor sOrigin 0) + else Nothing + + -- Case 3: Horizontal line (slope = 0, intercept = mean(y)) + iHoriz = sum (map snd pts) / fromIntegral (length pts) + case3 = (0, iHoriz, lossFor 0 iHoriz) + + -- Case 4: Both at boundary (always valid) + case4 = (0, 0, lossFor 0 0) + + -- Choose case with minimum asymmetric loss + validCases = catMaybes [case1, case2] ++ [case3, case4] + (bestS, bestI, _) = minimumBy (comparing (\(_, _, loss) -> loss)) validCases + in + (bestS, bestI) + +-------------------------------------------------------------------------------- +-- Unconstrained OLS ----------------------------------------------------------- + +{-| Standard unconstrained ordinary least squares. +May produce negative coefficients. -} +continuousOLS :: [(Double, Double)] -> (Double, Double) +continuousOLS pts + | null pts = (0, 0) + | otherwise = + let xs = map fst pts + ys = map snd pts + n = fromIntegral (length xs) + sx = sum xs + sy = sum ys + sxx = sum (map (\x -> x * x) xs) + sxy = sum (zipWith (*) xs ys) + denom = n * sxx - sx * sx + in if denom == 0 + then (0, sy / n) + else + let a = (n * sxy - sx * sy) / denom + b = (sy - a * sx) / n + in (a, b) diff --git a/plutus-benchmark/plutus-benchmark.cabal b/plutus-benchmark/plutus-benchmark.cabal index f6e1f821bba..a3ddb8fec0e 100644 --- a/plutus-benchmark/plutus-benchmark.cabal +++ b/plutus-benchmark/plutus-benchmark.cabal @@ -863,6 +863,34 @@ test-suite cardano-loans-test , plutus-tx:plutus-tx-testlib , tasty +executable memory-analysis + import: lang, ghc-version-support, os-support + main-is: Main.hs + hs-source-dirs: memory-analysis/src + other-modules: + PlutusBenchmark.MemoryAnalysis + PlutusBenchmark.MemoryAnalysis.Experiments + PlutusBenchmark.MemoryAnalysis.Generators + PlutusBenchmark.MemoryAnalysis.Helpers + PlutusBenchmark.MemoryAnalysis.Types + PlutusBenchmark.Plotting + PlutusBenchmark.RegressionInteger + + default-extensions: BlockArguments + ghc-options: -Wno-unused-packages + build-depends: + , base >=4.9 && <5 + , bytestring + , Chart >=1.9 + , Chart-diagrams >=1.9 + , colour + , containers + , deepseq + , directory + , ghc-datasize + , plutus-core ^>=1.56 + , random + benchmark flat-decode import: lang, ghc-version-support, os-support type: exitcode-stdio-1.0 diff --git a/plutus-core/cost-model/budgeting-bench/Benchmarks/Values.hs b/plutus-core/cost-model/budgeting-bench/Benchmarks/Values.hs index 051c6a11ac1..1842a1dc6e4 100644 --- a/plutus-core/cost-model/budgeting-bench/Benchmarks/Values.hs +++ b/plutus-core/cost-model/budgeting-bench/Benchmarks/Values.hs @@ -21,7 +21,8 @@ import GHC.Stack (HasCallStack) import PlutusCore (DefaultFun (LookupCoin, UnValueData, ValueContains, ValueData)) import PlutusCore.Builtin (BuiltinResult (BuiltinFailure, BuiltinSuccess, BuiltinSuccessWithLogs)) import PlutusCore.Evaluation.Machine.ExMemoryUsage - ( ValueLogOuterSizeAddLogMaxInnerSize (..) + ( DataNodeCount (..) + , ValueLogOuterSizeAddLogMaxInnerSize (..) , ValueTotalSize (..) ) import PlutusCore.Value (K, Value) @@ -203,14 +204,23 @@ valueContainsArgs gen = runStateGen_ gen \g -> do -- ValueData --------------------------------------------------------------------------------------- valueDataBenchmark :: StdGen -> Benchmark -valueDataBenchmark gen = createOneTermBuiltinBench ValueData [] (generateTestValues gen) +valueDataBenchmark gen = + createOneTermBuiltinBenchWithWrapper + ValueTotalSize + ValueData + [] + (generateTestValues gen) ---------------------------------------------------------------------------------------------------- -- UnValueData ------------------------------------------------------------------------------------- unValueDataBenchmark :: StdGen -> Benchmark unValueDataBenchmark gen = - createOneTermBuiltinBench UnValueData [] (Value.valueData <$> generateTestValues gen) + createOneTermBuiltinBenchWithWrapper + DataNodeCount + UnValueData + [] + (Value.valueData <$> generateTestValues gen) ---------------------------------------------------------------------------------------------------- -- Value Generators -------------------------------------------------------------------------------- diff --git a/plutus-core/cost-model/data/benching-conway.csv b/plutus-core/cost-model/data/benching-conway.csv index 0956ee65988..b0d1055b8e5 100644 --- a/plutus-core/cost-model/data/benching-conway.csv +++ b/plutus-core/cost-model/data/benching-conway.csv @@ -13646,208 +13646,6 @@ ValueContains/22/700,2.4478931383948077e-5,2.4333325650709424e-5,2.4630409458300 ValueContains/22/800,2.729406120709784e-5,2.721133296981561e-5,2.741879695599528e-5,3.341080199468252e-7,2.108784487707779e-7,4.945836081459654e-7 ValueContains/22/900,3.062798195469118e-5,3.057996138319739e-5,3.072454044668139e-5,2.0352022613010493e-7,1.188811255104868e-7,3.6371038298386564e-7 ValueContains/22/1000,3.3378737178185836e-5,3.3266394877600226e-5,3.3539143232295374e-5,4.549400509795307e-7,3.037083223254624e-7,6.323656824826394e-7 -ValueData/0,8.710485632131557e-7,8.700861025607539e-7,8.720239922156882e-7,3.1188044496968687e-9,2.8063275610386308e-9,3.579847947736182e-9 -ValueData/36147,8.632341064822607e-7,8.617101447050511e-7,8.647559906191668e-7,5.251939305759032e-9,4.376950958277811e-9,6.536853377189768e-9 -ValueData/50873,8.671553198002992e-7,8.664008098779421e-7,8.678536759806774e-7,2.40108066252214e-9,2.1085783923235204e-9,2.8261680630113626e-9 -ValueData/35662,8.645429850252597e-7,8.622968791984218e-7,8.667815376401808e-7,7.35304976240463e-9,6.3871248707442195e-9,8.206184957515865e-9 -ValueData/18671,8.64295290538386e-7,8.635433173839028e-7,8.652995390119846e-7,2.8055437615023395e-9,2.309668190874072e-9,3.584203092132299e-9 -ValueData/47613,8.66404976860002e-7,8.65096781069438e-7,8.677436186179715e-7,4.442681038340011e-9,3.6485234735818993e-9,5.400015906460056e-9 -ValueData/9147,8.661441995291099e-7,8.651260191935222e-7,8.669426014936654e-7,3.1140788315391763e-9,2.537803734247984e-9,4.324426273673444e-9 -ValueData/27857,8.64909021214624e-7,8.639561246957778e-7,8.659497461679588e-7,3.3021671146873394e-9,2.6312473361559152e-9,4.397715775530746e-9 -ValueData/59633,8.710375281357509e-7,8.699696466555313e-7,8.719903842620085e-7,3.3295468904623397e-9,2.485425395853196e-9,4.76495644914738e-9 -ValueData/9131,8.621095518021842e-7,8.612469766161328e-7,8.627300820330293e-7,2.4262372855808275e-9,1.7524859282091251e-9,3.2801116532721096e-9 -ValueData/7884,8.668661114843852e-7,8.661847342330218e-7,8.677498705440476e-7,2.5953648093077794e-9,2.073941994589909e-9,3.8055691681938e-9 -ValueData/2848,8.657766889859493e-7,8.649332515232446e-7,8.66934283246134e-7,3.2648050160814037e-9,2.732931136312029e-9,3.864951046262696e-9 -ValueData/30953,8.714506306821229e-7,8.700874121280152e-7,8.73018172164978e-7,5.047669986357539e-9,4.360332011131273e-9,5.991335597195433e-9 -ValueData/44240,8.66032863333637e-7,8.644871172433358e-7,8.674185805185667e-7,4.857360705622676e-9,3.5003169239095303e-9,6.320648641371104e-9 -ValueData/2613,8.676959847229541e-7,8.671776158950962e-7,8.684341081300367e-7,2.008509639375119e-9,1.6158472204528824e-9,2.648900126146881e-9 -ValueData/35536,8.589426761262676e-7,8.575768329713602e-7,8.601514727837791e-7,4.249367768462652e-9,2.4806641494282657e-9,6.9526505522693664e-9 -ValueData/27906,8.659061116880208e-7,8.648241968777438e-7,8.669642097116522e-7,3.764415974631546e-9,2.86504669330081e-9,5.191083202251303e-9 -ValueData/52839,8.631612310926805e-7,8.619535070883974e-7,8.645975706426008e-7,4.377244843294824e-9,3.2984111196929704e-9,5.4324257605990584e-9 -ValueData/1722,8.653743132446568e-7,8.645134286358609e-7,8.665062329123961e-7,3.2173928619757797e-9,2.4774625849819613e-9,5.043378798966605e-9 -ValueData/25315,8.649979124356167e-7,8.640802603495364e-7,8.658916617477737e-7,2.9861397199212724e-9,2.4836880964531686e-9,3.562891200025133e-9 -ValueData/18807,8.618819473951175e-7,8.611813985708116e-7,8.625895568062682e-7,2.266283688671824e-9,1.901403802010727e-9,2.7963430141631e-9 -ValueData/3694,8.614220508605818e-7,8.606909741354421e-7,8.620841592590956e-7,2.134499994591508e-9,1.8110367197639829e-9,2.567776094501191e-9 -ValueData/10883,8.689568664268266e-7,8.681162229746977e-7,8.697852744607611e-7,2.8453257563476108e-9,2.4280189873141486e-9,3.4444660949439344e-9 -ValueData/6168,8.635880866731386e-7,8.62742542716563e-7,8.644580975345604e-7,2.9698720485699863e-9,2.653599812447553e-9,3.350812639303596e-9 -ValueData/32270,8.604626805407581e-7,8.584218907899687e-7,8.619899728887005e-7,6.031721541142835e-9,4.399008917985365e-9,7.928593426503092e-9 -ValueData/39512,8.666858745870145e-7,8.6477552696065e-7,8.683419099604352e-7,6.14692792526387e-9,5.703094713914783e-9,6.704280683531013e-9 -ValueData/54976,8.613671160495384e-7,8.607577045841799e-7,8.623341027383324e-7,2.4833544810003436e-9,1.714246785432944e-9,4.208161062505836e-9 -ValueData/21167,8.655246402646709e-7,8.641671388492571e-7,8.671800740735059e-7,5.0457915999134164e-9,3.920921794051803e-9,6.32461333819163e-9 -ValueData/14276,8.626079992425088e-7,8.614193712001023e-7,8.639570213577007e-7,4.2138068939583044e-9,3.005330419555982e-9,6.120556918439024e-9 -ValueData/14020,8.654794151541039e-7,8.64669122342485e-7,8.663939084418724e-7,2.951539347678291e-9,2.346474444924355e-9,3.6561150983858018e-9 -ValueData/75038,8.642644869092455e-7,8.628106358378951e-7,8.659600864780404e-7,5.185032421753124e-9,4.355859538296316e-9,6.769423565992887e-9 -ValueData/8360,8.646827424149125e-7,8.638755597018772e-7,8.655049473721303e-7,2.8325355456772803e-9,2.3544792696894137e-9,3.3836888726768202e-9 -ValueData/33108,8.647533313776367e-7,8.632279199259107e-7,8.661625621529516e-7,4.84131077884301e-9,3.876673468620757e-9,6.246344674777637e-9 -ValueData/3478,8.620635034802975e-7,8.60803164062124e-7,8.633645844892183e-7,4.282434368215184e-9,3.76581500221236e-9,4.929688199793626e-9 -ValueData/2880,8.606293410401497e-7,8.597576271958508e-7,8.614620276482818e-7,2.8710880054551875e-9,2.2940448484247594e-9,3.981432085333321e-9 -ValueData/16627,8.746736494372443e-7,8.728919876014504e-7,8.764846204072507e-7,5.792935277693027e-9,5.097764101700181e-9,6.588455521011086e-9 -ValueData/28413,8.718309439084893e-7,8.704370846721746e-7,8.733901264050053e-7,5.0161793183324715e-9,4.0290465068542626e-9,7.336482286224887e-9 -ValueData/22019,8.657641715709112e-7,8.64760997380576e-7,8.667452570416686e-7,3.3466861332771085e-9,2.8853544544809316e-9,3.900145894964753e-9 -ValueData/4055,8.700479735312278e-7,8.687325297061432e-7,8.714376966516096e-7,4.628279509882725e-9,4.0469276355130126e-9,6.267375554264088e-9 -ValueData/50694,8.657480955185278e-7,8.647538288917629e-7,8.670843113186186e-7,3.6465692944604537e-9,2.8238501965125205e-9,4.828026339772711e-9 -ValueData/11343,8.640823102282194e-7,8.633040579996908e-7,8.662865424609648e-7,3.882777575166098e-9,1.4624424763697384e-9,8.280248200927208e-9 -ValueData/22176,8.660652883037811e-7,8.6512028122366e-7,8.667772758686382e-7,2.5681450700342252e-9,2.0787429515884712e-9,3.3417015804439315e-9 -ValueData/34524,8.632823799040462e-7,8.62056859648558e-7,8.654730504878058e-7,5.613667760719777e-9,3.894371468858732e-9,9.237927161928375e-9 -ValueData/62744,8.688099403769822e-7,8.678023299694609e-7,8.697819299983125e-7,3.459416630132732e-9,2.8624080537553773e-9,4.248128482754399e-9 -ValueData/8007,8.601251398401066e-7,8.578935724345623e-7,8.623944859875958e-7,7.672131398791312e-9,6.219477433596809e-9,1.005448221087949e-8 -ValueData/8284,8.614829812099593e-7,8.597232250747901e-7,8.626862542751927e-7,4.770631282603911e-9,3.4234068981116833e-9,6.451513125104548e-9 -ValueData/7334,8.639374768020249e-7,8.623898847733929e-7,8.679994859957914e-7,7.563142597668665e-9,2.892309677870039e-9,1.5097252727388756e-8 -ValueData/1085,8.684795686117765e-7,8.670850998391403e-7,8.701908303046905e-7,5.25912363321876e-9,4.061195670485024e-9,6.541086897803133e-9 -ValueData/43009,8.65742368256514e-7,8.641893858375118e-7,8.69124759094881e-7,7.072643930369097e-9,3.5287290224641196e-9,1.3498581297110605e-8 -ValueData/6007,8.644645089032763e-7,8.639118042852963e-7,8.649257852988627e-7,1.5925367790010782e-9,1.3189523344977407e-9,1.907932419526307e-9 -ValueData/12352,8.659828283494087e-7,8.648944630794859e-7,8.680839600554042e-7,4.74999488299362e-9,2.900999948400728e-9,8.056323922871253e-9 -ValueData/13428,8.687987122986276e-7,8.681387191168145e-7,8.697709031255118e-7,2.7471469878853004e-9,2.058341799952547e-9,3.760918714059321e-9 -ValueData/36256,8.675846385929682e-7,8.659291771053332e-7,8.711700660314911e-7,7.966362980841501e-9,4.553106846270652e-9,1.4170058641166947e-8 -ValueData/20987,8.649643752590172e-7,8.64013746794923e-7,8.658901768508749e-7,2.909726706507934e-9,2.4251584548382835e-9,3.475331304902277e-9 -ValueData/9748,8.655312083359654e-7,8.639646031164286e-7,8.715870726659391e-7,8.954892498272094e-9,1.7323954380213458e-9,1.8441025237070712e-8 -ValueData/17336,8.635800803941854e-7,8.629431131649093e-7,8.642883242761917e-7,2.217891333756781e-9,1.8471598023766466e-9,2.6732256292302014e-9 -ValueData/4271,8.630922421330841e-7,8.62216687092136e-7,8.638877899632615e-7,2.8151591260904194e-9,2.3725791399995347e-9,3.6906010528328136e-9 -ValueData/12924,8.599239739247619e-7,8.593449213219517e-7,8.604676658816029e-7,1.9247398337158454e-9,1.6038396353587104e-9,2.486022275087497e-9 -ValueData/11874,8.610136861809038e-7,8.602785729905441e-7,8.618213966331537e-7,2.5341056008858797e-9,2.093174514684568e-9,3.1393698201857534e-9 -ValueData/8719,8.650139724360654e-7,8.635855119079045e-7,8.669290342030833e-7,5.7181477925381256e-9,4.764834917090491e-9,6.904031019912677e-9 -ValueData/2491,8.654128200708863e-7,8.644387289302885e-7,8.662332683982597e-7,3.05989929737715e-9,2.556410324754587e-9,3.891149665959818e-9 -ValueData/14464,8.726442170340377e-7,8.709000922247479e-7,8.74396164720016e-7,6.0429443891921305e-9,5.576642770870628e-9,6.591801797349787e-9 -ValueData/1129,8.660534770497365e-7,8.651075974734256e-7,8.669512412108428e-7,3.306131873999607e-9,2.5691769284761296e-9,4.756068320713634e-9 -ValueData/19725,8.684615749594441e-7,8.678576641658198e-7,8.691929170762665e-7,2.2729635088189256e-9,1.941889426437394e-9,2.7743269502074446e-9 -ValueData/20613,8.645266311625155e-7,8.636896130174139e-7,8.654230789863962e-7,2.8691661982265462e-9,2.4558080289973406e-9,3.3742483731893996e-9 -ValueData/5225,8.700637138357328e-7,8.695029797624593e-7,8.70769381031305e-7,2.002591715542537e-9,1.6845381063849003e-9,2.5873892809533685e-9 -ValueData/2438,8.632192693740009e-7,8.623734255271132e-7,8.64184537641262e-7,2.9877907013311457e-9,2.539203344664423e-9,3.623805035356082e-9 -ValueData/26146,8.637439367847397e-7,8.623727640726274e-7,8.64769206769067e-7,4.044754814682763e-9,3.103494866738637e-9,5.412979772489751e-9 -ValueData/28764,8.622909824025013e-7,8.609729710434461e-7,8.634748946828009e-7,4.254641406274228e-9,3.804675439068966e-9,5.007200419451267e-9 -ValueData/22011,8.604680445450237e-7,8.597738256112919e-7,8.610090411752228e-7,2.0955107144712e-9,1.683027525897693e-9,2.8064466721181298e-9 -ValueData/4181,8.578866537344148e-7,8.572147060715399e-7,8.584985733177865e-7,2.1647889981408558e-9,1.7792506899660902e-9,2.6425299452961584e-9 -ValueData/21427,8.560401127181391e-7,8.552419763813747e-7,8.56772216172053e-7,2.5795006795481544e-9,2.126575751304862e-9,3.2623720557346062e-9 -ValueData/6919,8.626271322897469e-7,8.616196530883573e-7,8.632440195021831e-7,2.588757697931686e-9,1.8142082942021614e-9,4.018595203190465e-9 -ValueData/65864,8.638879198638591e-7,8.628328550960359e-7,8.64970794838178e-7,3.66352052899998e-9,3.2221046574588374e-9,4.293258379965169e-9 -ValueData/7544,8.675212199127952e-7,8.665719266991362e-7,8.684387918756596e-7,3.022081472628144e-9,2.5537127709678203e-9,3.751440084073598e-9 -ValueData/3264,8.628267800974912e-7,8.622672752529092e-7,8.633242858992999e-7,1.7276230640961962e-9,1.427879195950518e-9,2.144307486096304e-9 -ValueData/48785,8.614959186299402e-7,8.59958746510074e-7,8.635806238322014e-7,6.070124566470808e-9,4.933883775423345e-9,7.271831087099631e-9 -ValueData/37527,8.628170424211815e-7,8.621914266490053e-7,8.635397557447443e-7,2.1884700909625667e-9,1.8994817995431054e-9,2.5422782998125566e-9 -ValueData/65675,8.6204756777233e-7,8.601604613454503e-7,8.636190943322863e-7,5.646677894957179e-9,4.8154458827805716e-9,6.559470636028541e-9 -ValueData/2523,8.675040022634743e-7,8.668942267463373e-7,8.681022312390663e-7,1.956251270528725e-9,1.647162426568021e-9,2.4215240681044266e-9 -ValueData/2328,8.62576434041337e-7,8.617412982508568e-7,8.634267607382427e-7,2.886722284103669e-9,2.440742518918934e-9,3.4639238630765118e-9 -ValueData/18898,8.619508665864805e-7,8.60244737508771e-7,8.640098288459005e-7,6.244968613757716e-9,5.43667009314026e-9,7.199959116403294e-9 -ValueData/7040,8.624478733344216e-7,8.612029756228657e-7,8.637689559076443e-7,4.343863865689326e-9,3.664451337885834e-9,5.1525064667199164e-9 -ValueData/30656,8.687754079485142e-7,8.672066995441335e-7,8.702499098834567e-7,5.03704439030528e-9,4.520681720483525e-9,5.634359327612364e-9 -ValueData/51073,8.638114496405635e-7,8.633583089616676e-7,8.643376839819542e-7,1.6601961878797503e-9,1.4221522717210629e-9,1.965496317063434e-9 -ValueData/35227,8.647983716020382e-7,8.639906967986185e-7,8.656063987410277e-7,2.768005596575842e-9,2.2311300002581696e-9,3.570960978528489e-9 -ValueData/32132,8.623204314017119e-7,8.614256241402169e-7,8.632680828827085e-7,3.018101459919012e-9,2.4395362060369486e-9,3.769269085682149e-9 -ValueData/12348,8.684892657656482e-7,8.66971895552691e-7,8.698763753511235e-7,4.743963274736382e-9,4.154434362304273e-9,5.582039937711769e-9 -ValueData/17017,8.620176792077615e-7,8.6061285824218e-7,8.628187230529303e-7,3.38509752173183e-9,1.9677366087296004e-9,5.4985322897640435e-9 -ValueData/46698,8.580423015306384e-7,8.565640074746423e-7,8.591786311583767e-7,4.2237912755616775e-9,3.314096180668368e-9,5.349861053025058e-9 -ValueData/76922,8.65872214935049e-7,8.648257190802525e-7,8.669388660773849e-7,3.7850564000004536e-9,3.1530543226516844e-9,5.304157644419327e-9 -ValueData/21337,8.644131054927571e-7,8.632707526451672e-7,8.653703028105276e-7,3.539981421657502e-9,2.7078447488985125e-9,4.855546782789615e-9 -ValueData/10908,8.628017361174256e-7,8.61926509461992e-7,8.642313414619051e-7,3.6272376700108643e-9,2.7170996063820842e-9,4.888029047440819e-9 -ValueData/12859,8.615461064925317e-7,8.599635044805449e-7,8.637792268376643e-7,5.940018947432184e-9,5.246184079517566e-9,6.70728472731172e-9 -ValueData/45315,8.671656967192168e-7,8.66024027338903e-7,8.686189343828349e-7,4.374902828551117e-9,3.63713426260381e-9,5.055541489040935e-9 -ValueData/45689,8.591903628085148e-7,8.587143444807827e-7,8.598379728980446e-7,1.8053537580945262e-9,1.282322481092573e-9,2.886254062840733e-9 -ValueData/2469,8.644446297452091e-7,8.63582829096331e-7,8.65380817595254e-7,2.985745642468539e-9,2.5274708409272357e-9,3.5724214710788566e-9 -ValueData/16515,8.643205558812502e-7,8.633128529373927e-7,8.654606107475668e-7,3.4923075340258255e-9,2.9699888503810714e-9,4.222326469107409e-9 -ValueData/31066,8.604644789699009e-7,8.593661533036615e-7,8.614207263774928e-7,3.4632488290554805e-9,2.3724814521462174e-9,5.0908020176501694e-9 -ValueData/8312,8.616469353671208e-7,8.605629863472544e-7,8.626256412161111e-7,3.498932432098194e-9,2.8499075632798237e-9,4.356265170697762e-9 -ValueData/5315,8.611752856119565e-7,8.602651244523189e-7,8.621634087622845e-7,2.9265829764050876e-9,2.1203507922979454e-9,4.019805955794643e-9 -UnValueData/4,9.364401810336664e-7,9.354428769834361e-7,9.374605170753677e-7,3.5901293127549394e-9,2.892633745801445e-9,4.508621368370694e-9 -UnValueData/903679,3.492557424157588e-2,3.299364597348645e-2,3.908893062625227e-2,5.57566949625829e-3,2.376174478399002e-3,9.9812163838835e-3 -UnValueData/1271829,5.040529093586783e-2,4.74244875183382e-2,5.4521201898836566e-2,6.53654454418347e-3,4.50744322631603e-3,8.151543827618983e-3 -UnValueData/891554,3.611051560634673e-2,3.4527647530983266e-2,3.8331919128907245e-2,3.962527532285533e-3,2.5340678380716738e-3,6.379573126658399e-3 -UnValueData/466731,1.5311868654275458e-2,1.471734176570153e-2,1.662711856803577e-2,1.974464720204719e-3,7.378538980947233e-4,3.0787924770091383e-3 -UnValueData/1190329,4.601576971791055e-2,4.367285520568652e-2,4.911586781094147e-2,5.209856290827428e-3,3.1331221515272087e-3,6.750317479693444e-3 -UnValueData/228583,6.328541802057824e-3,6.1212777591724355e-3,6.868166253431236e-3,8.55022105523687e-4,7.319779601454703e-5,1.584089258951306e-3 -UnValueData/696429,2.3733461419905205e-2,2.2977678287353684e-2,2.5425446524731235e-2,2.459591134083003e-3,1.326622771109472e-3,3.464167889759782e-3 -UnValueData/1490829,5.905411832900619e-2,5.6825701402322876e-2,6.211077823795171e-2,4.899600808907923e-3,3.5219513238820927e-3,6.1456786647689325e-3 -UnValueData/228279,6.372509817147301e-3,6.250058063924048e-3,6.763654385045918e-3,6.253861787378503e-4,1.262348681102506e-4,1.2982906248199316e-3 -UnValueData/196996,5.2303296333490595e-3,5.161035223356649e-3,5.500744451896032e-3,3.843629121793336e-4,3.950302585485984e-5,8.039025613627355e-4 -UnValueData/71192,1.675895647793506e-3,1.6461991403543396e-3,1.7999360093954898e-3,1.4813858288134854e-4,1.2955473330769586e-5,3.1313204447072754e-4 -UnValueData/773829,3.0078329299620336e-2,2.8306416334838793e-2,3.1795546400546444e-2,3.9058508353383495e-3,3.1084586789903927e-3,5.502658300761966e-3 -UnValueData/1106004,4.2629383728599354e-2,4.066404172063547e-2,4.557526847082418e-2,4.729797975028194e-3,2.9276352209406534e-3,6.3720132933716735e-3 -UnValueData/65317,1.4684501735166742e-3,1.4527010950724883e-3,1.5301839696376465e-3,1.0063548285944915e-4,4.442949276831928e-6,2.143878571658937e-4 -UnValueData/888392,3.6421771573686375e-2,3.409810669384912e-2,3.924868953634157e-2,5.339681993597097e-3,3.7252846208586416e-3,8.196528228999342e-3 -UnValueData/697630,2.7957649008712164e-2,2.6804677073507657e-2,2.971438093295224e-2,2.996225449709026e-3,1.7003556077225003e-3,5.115258441411499e-3 -UnValueData/1320979,5.6310576457920446e-2,5.3606011182597925e-2,5.9597744852660145e-2,5.6969592842291295e-3,3.2899645836346257e-3,7.445049993726806e-3 -UnValueData/43030,8.75111655932409e-4,8.737755353433379e-4,8.765228929055752e-4,4.708257537909129e-6,4.028386941149915e-6,5.43615029986069e-6 -UnValueData/632879,2.3087969338136827e-2,2.2048148540635304e-2,2.4327383447888245e-2,2.6431430138599272e-3,2.099203461704386e-3,3.6321500670216827e-3 -UnValueData/470155,1.7295114027880983e-2,1.6890436607269303e-2,1.8124935008027167e-2,1.354819372945737e-3,7.674036489393545e-4,2.2023236778570877e-3 -UnValueData/92102,2.261807887263458e-3,2.207321479279178e-3,2.4165781169839824e-3,2.7882041761886597e-4,2.236315999452123e-5,5.391299170211828e-4 -UnValueData/272055,7.986835076407866e-3,7.751999401777588e-3,8.510922479014135e-3,9.558896940871572e-4,4.920032652745457e-4,1.5788944908903906e-3 -UnValueData/154132,4.035340510631868e-3,3.946290066979662e-3,4.28452256948196e-3,4.139314370908965e-4,1.9068561527368e-4,8.011470250382773e-4 -UnValueData/806742,3.1979103171320605e-2,3.0426992319337143e-2,3.381168900451929e-2,3.326441841803406e-3,2.223376272084196e-3,5.0385094186688704e-3 -UnValueData/987792,3.719619862461564e-2,3.5764708369970324e-2,3.9925375992760144e-2,3.933112686612217e-3,2.653624294844532e-3,5.814340785212553e-3 -UnValueData/1374404,5.9428111357869066e-2,5.637568796564547e-2,6.133080784929917e-2,4.6807977451128495e-3,1.8724145937375962e-3,6.563126187709704e-3 -UnValueData/529143,1.71869007626547e-2,1.6579446352255542e-2,1.8093412065019812e-2,1.7487598237967703e-3,1.124659378833665e-3,2.212738414994595e-3 -UnValueData/356856,1.0940263726481773e-2,1.0654935965364617e-2,1.158447006197089e-2,1.0515372242454672e-3,5.936851224084922e-4,1.7289681116286126e-3 -UnValueData/350504,1.0647943513972377e-2,1.030611948407166e-2,1.1148632668309708e-2,1.096298641551523e-3,7.458805189007796e-4,1.450891423698172e-3 -UnValueData/1875954,8.252262121014711e-2,7.769257297894608e-2,8.916915552742365e-2,9.40120360960948e-3,7.625809954306498e-3,1.1673381946634597e-2 -UnValueData/208956,5.732486717990699e-3,5.5986528536091824e-3,6.050199587577532e-3,6.003351008456936e-4,2.48707551266249e-4,1.0096868740293809e-3 -UnValueData/827704,3.406971789512953e-2,3.308049312208335e-2,3.596789829183968e-2,2.950911640701901e-3,1.0136127091546166e-3,5.605173140852426e-3 -UnValueData/86810,2.1030181267482455e-3,2.0557985434939497e-3,2.2285101795528174e-3,2.3634370086763376e-4,8.927375481842999e-5,4.2897205400170134e-4 -UnValueData/71980,1.6795193000404144e-3,1.6434937839780895e-3,1.8238508885798943e-3,1.847615268062452e-4,7.678055433998568e-6,4.006451373930955e-4 -UnValueData/415667,1.4060277248277018e-2,1.3491843779116781e-2,1.4902031620033838e-2,1.6515863661898903e-3,1.1350505403619224e-3,2.1406501930255725e-3 -UnValueData/710317,2.6226109113868974e-2,2.472870965433211e-2,2.7948177223105258e-2,3.484724289242919e-3,2.557526001425296e-3,4.3657533864728815e-3 -UnValueData/550479,2.0066126432418018e-2,1.9226013901359057e-2,2.107548754567069e-2,2.193248886485381e-3,1.6117514338788344e-3,3.1989892261444428e-3 -UnValueData/101319,2.5110520276841676e-3,2.453046954853557e-3,2.6598620420693786e-3,2.967968014524075e-4,1.0881167542915594e-4,5.691375935014474e-4 -UnValueData/1267354,5.1013373304937354e-2,4.827145914455037e-2,5.4477723242620575e-2,5.52247528908226e-3,4.043798720157589e-3,7.615861926713582e-3 -UnValueData/283519,8.304329091757495e-3,8.031728812706081e-3,8.780684553266822e-3,9.922862576619903e-4,5.159833021466959e-4,1.5554142912143475e-3 -UnValueData/554380,1.9873323192618527e-2,1.9080035969179898e-2,2.0934631629585428e-2,2.150586470282535e-3,1.6950817544440033e-3,2.9064652289481304e-3 -UnValueData/863104,3.395117754954766e-2,3.203075789076845e-2,3.617110789775671e-2,4.302538248539181e-3,3.1253513667772307e-3,6.395705768115052e-3 -UnValueData/1568604,6.477775269870444e-2,6.250393305938516e-2,6.840376705354588e-2,4.8939017132075355e-3,2.709874895168353e-3,7.44983644181036e-3 -UnValueData/200131,5.393807158382391e-3,5.275281401731067e-3,5.714710294552429e-3,5.508390073265879e-4,3.056147964080417e-4,9.668602666266891e-4 -UnValueData/207104,5.66794180897198e-3,5.541211714644394e-3,5.906314616367238e-3,5.503548191832989e-4,3.0598341104736207e-4,8.488742283787194e-4 -UnValueData/183354,4.925267034480147e-3,4.819283781307624e-3,5.1318585086185435e-3,4.652920541031746e-4,2.542096256779052e-4,7.313354012823773e-4 -UnValueData/27129,5.281938119970314e-4,5.279994920520601e-4,5.283885898223443e-4,6.467936940184178e-7,5.466798945762067e-7,7.712462423587168e-7 -UnValueData/1075229,4.10815396689821e-2,3.949960033914988e-2,4.311951127072627e-2,3.5047915192552162e-3,2.789892661680491e-3,4.395604765911602e-3 -UnValueData/150143,3.8843052994177027e-3,3.813927426519164e-3,4.037338963460031e-3,3.128797944381212e-4,1.562115899547993e-4,5.292465139294027e-4 -UnValueData/308744,9.541062542654313e-3,9.321532870852706e-3,9.929201138070583e-3,7.947134716417071e-4,4.616977083911662e-4,1.1471232983802095e-3 -UnValueData/335644,9.962183534479207e-3,9.678276705382807e-3,1.044895163572522e-2,1.0306611890463706e-3,6.324256171302246e-4,1.6276637215878777e-3 -UnValueData/906392,3.3957935537931735e-2,3.249781687015652e-2,3.589086775974775e-2,3.5755018087453854e-3,3.077909142597555e-3,4.264393809340898e-3 -UnValueData/524679,1.6347329070554983e-2,1.600666004652838e-2,1.6856289570596532e-2,1.0400085458705354e-3,7.455346411370493e-4,1.4091001816684346e-3 -UnValueData/243656,6.8354872291145384e-3,6.7001484577399895e-3,7.077268276367507e-3,5.441807889624658e-4,3.459032916004859e-4,8.948325478051318e-4 -UnValueData/433404,1.3520429097839874e-2,1.3193915007269486e-2,1.3998687375576515e-2,1.0173101629575947e-3,7.497912082380378e-4,1.3970830058948258e-3 -UnValueData/106779,2.696666493753001e-3,2.649254095804763e-3,2.8092957062321173e-3,2.203358808063366e-4,1.2390708329615007e-4,3.7974494958505723e-4 -UnValueData/323092,1.0020872321612672e-2,9.707833641745836e-3,1.0381245355611173e-2,9.431024171859077e-4,6.968883435445412e-4,1.4632498091252163e-3 -UnValueData/296854,8.54506480683721e-3,8.356922398612923e-3,8.882783468920866e-3,6.598701759868406e-4,4.771156345955093e-4,9.627807578465196e-4 -UnValueData/217979,6.117429501650354e-3,5.9895551368524536e-3,6.322392270240584e-3,4.8416480805686955e-4,2.9952630316931397e-4,8.067209224765548e-4 -UnValueData/62147,1.3846812756138536e-3,1.3691948251471344e-3,1.4230099802581089e-3,7.660744977781937e-5,3.619571260363019e-5,1.4258068703826784e-4 -UnValueData/361580,1.1589239974502006e-2,1.1293461700035244e-2,1.2019665401396592e-2,9.769938926927756e-4,7.236575552004618e-4,1.399626942057337e-3 -UnValueData/27941,5.422051075026015e-4,5.417881034214729e-4,5.427031266172056e-4,1.6057540298443031e-6,1.283599998177857e-6,1.9750044859925636e-6 -UnValueData/493093,1.7878804172664683e-2,1.722099385598067e-2,1.856019885380522e-2,1.6119455511122e-3,1.1564833754477578e-3,2.3411924582281227e-3 -UnValueData/515305,1.7682360048503407e-2,1.70455718963228e-2,1.851185024046597e-2,1.774542904992473e-3,1.3989784898061947e-3,2.3429971986842586e-3 -UnValueData/130533,3.326693622712483e-3,3.265929989435481e-3,3.4328956720497505e-3,2.565099389324083e-4,1.4509365390429448e-4,4.260422861024474e-4 -UnValueData/60822,1.358084132643997e-3,1.343753807332366e-3,1.3958016387536736e-3,7.386028732593303e-5,2.9968852368287614e-5,1.3666129779432747e-4 -UnValueData/653642,2.285922412596983e-2,2.2286711498651447e-2,2.3491304486135404e-2,1.4009596584558246e-3,1.008730131817229e-3,1.8684826688750427e-3 -UnValueData/719092,2.5916872069502703e-2,2.487972883479986e-2,2.719303763650669e-2,2.5505868104547737e-3,2.122440866587406e-3,3.019650483638633e-3 -UnValueData/550255,1.9118512950265138e-2,1.8285833036252024e-2,2.0024496276610175e-2,2.0603116077043985e-3,1.7227502435843967e-3,2.5673078975372047e-3 -UnValueData/104313,2.58157958417875e-3,2.537553350967725e-3,2.6813479901569622e-3,2.1087194358423544e-4,1.2330236879698884e-4,3.7733434275153235e-4 -UnValueData/535679,1.8062052051142276e-2,1.761112210169042e-2,1.8669393481966032e-2,1.3297842719334372e-3,1.017218733104355e-3,2.0067795650106496e-3 -UnValueData/172967,4.532626691412976e-3,4.452789633930505e-3,4.672166966804566e-3,3.206337410424648e-4,1.9207303042793701e-4,5.34019031892925e-4 -UnValueData/1646604,7.132523022118037e-2,6.886653922612823e-2,7.386683529171036e-2,4.426924329108357e-3,3.4092748422821836e-3,5.936999085176369e-3 -UnValueData/188520,5.013717062804228e-3,4.926843963046985e-3,5.166436349173911e-3,3.425586821781218e-4,2.1443245839265e-4,5.370735224885395e-4 -UnValueData/81376,1.9883148039466845e-3,1.9557543541000285e-3,2.0709929311295986e-3,1.6380987755438013e-4,1.0093561038732446e-4,2.687733746232029e-4 -UnValueData/1219629,5.0605554115499066e-2,4.848270793198377e-2,5.250867211737193e-2,3.978333167197464e-3,2.9780488350127105e-3,5.486559222318984e-3 -UnValueData/938179,3.4102237279496385e-2,3.3537558892195826e-2,3.4992547091143904e-2,1.4438705701968729e-3,8.564330312935994e-4,2.3728302153055466e-3 -UnValueData/1641879,7.024136197601878e-2,6.873586208408201e-2,7.244503258191276e-2,3.2759101014711556e-3,1.6227420800086544e-3,4.918876562140325e-3 -UnValueData/63007,1.4197873704582115e-3,1.4025544004541296e-3,1.4569064996782569e-3,7.763112276201692e-5,4.11042024115434e-5,1.456301566381978e-4 -UnValueData/57940,1.2719074940653954e-3,1.2598711091090862e-3,1.2995104223749456e-3,5.968420595934136e-5,2.639109924389801e-5,1.1025500778475378e-4 -UnValueData/472454,1.6501339515325612e-2,1.5926669969122127e-2,1.705727677883541e-2,1.4117385371220082e-3,1.1216415413007725e-3,1.722299676740259e-3 -UnValueData/175992,4.756879776531598e-3,4.686541480894005e-3,4.9076185841059996e-3,3.0083442146777224e-4,2.0577128036053496e-4,4.7290885438825445e-4 -UnValueData/766404,2.821035936201269e-2,2.721850884461625e-2,2.9477592469049425e-2,2.581797854500801e-3,1.9120018181542778e-3,3.5813375371518603e-3 -UnValueData/1276829,5.493024968121742e-2,5.218970026000447e-2,5.7456636620271534e-2,4.701489302037451e-3,3.248288477317787e-3,7.3063327145061014e-3 -UnValueData/880667,3.327109396686794e-2,3.243986208413151e-2,3.4131006856951564e-2,1.7680762617498908e-3,1.191027337404221e-3,2.718955311013811e-3 -UnValueData/803304,2.9915721161630354e-2,2.8645447081372538e-2,3.1269075978902966e-2,2.9033169416030646e-3,2.162881023208067e-3,3.825427578558879e-3 -UnValueData/308692,9.368746559782561e-3,9.171546647285289e-3,9.57294836397989e-3,5.479241173205995e-4,4.230343205428992e-4,8.270074658504372e-4 -UnValueData/425393,1.384681425332448e-2,1.3475909364733465e-2,1.439223849170967e-2,1.1521856217644585e-3,7.294820100851784e-4,1.9689659313820553e-3 -UnValueData/1167442,4.7150454072676255e-2,4.6126673203439286e-2,4.793198608388168e-2,1.8103729604192057e-3,1.3079416318840912e-3,2.404108570862885e-3 -UnValueData/1923054,8.486650003290305e-2,8.305760068552834e-2,8.739325895713317e-2,3.732448390746552e-3,2.6514792273452307e-3,5.0945360851794175e-3 -UnValueData/533429,1.8276840268944404e-2,1.7818272850585973e-2,1.8751659376240345e-2,1.1235285865163229e-3,8.926432374012793e-4,1.4198889178363419e-3 -UnValueData/272632,7.934613131026873e-3,7.839228869360913e-3,8.100549829038243e-3,3.61688194317094e-4,2.081734775276929e-4,5.972204464590521e-4 -UnValueData/321479,9.839996045704364e-3,9.68420645317525e-3,1.0091371962016843e-2,5.331555573503446e-4,3.457676568709492e-4,8.047596216667424e-4 -UnValueData/1132879,4.648422989945368e-2,4.564922242089924e-2,4.845670662622919e-2,2.394237880086589e-3,9.817644337021109e-4,4.210116628491542e-3 -UnValueData/1142229,4.399125733204357e-2,4.366133824220016e-2,4.459567508527595e-2,9.020857086094265e-4,3.156268909536755e-4,1.5252705633572033e-3 -UnValueData/61705,1.383801547047648e-3,1.376047995743407e-3,1.3940170500073468e-3,2.95949548970749e-5,2.2853323894228366e-5,3.995123911101485e-5 -UnValueData/412867,1.3166747527591775e-2,1.3082024215468108e-2,1.324791147126348e-2,2.0431004990958187e-4,1.524410737404198e-4,2.989887793267042e-4 -UnValueData/776654,2.8487753904240923e-2,2.8036121373395666e-2,2.8757052513114095e-2,7.252962005680862e-4,4.287560096066987e-4,9.916237637599408e-4 -UnValueData/207792,5.840104747957926e-3,5.81915523684363e-3,5.8598929780729675e-3,5.954758551382322e-5,4.1147386890903474e-5,8.892605307874207e-5 -UnValueData/132675,3.493081060886254e-3,3.485945506272664e-3,3.512431012076418e-3,3.6518521957764796e-5,1.698311387585691e-5,7.004969746008085e-5 ListToArray/1075,2.2562429641142587e-5,2.249261875772505e-5,2.2610172757489353e-5,1.8968439449763931e-7,1.5502427588214502e-7,2.1677135503646137e-7 ListToArray/1266,2.795137615374999e-5,2.7901176375742542e-5,2.8010388574189e-5,1.8752601318490968e-7,1.5265634972264646e-7,2.1881535013168976e-7 ListToArray/4372,1.0125957160010097e-4,1.0085826278158969e-4,1.0161902384035529e-4,1.2984479733336162e-6,1.1363845792275218e-6,1.4745049972640941e-6 @@ -13948,3 +13746,205 @@ ListToArray/1443,2.9346282364025285e-5,2.9325772202614526e-5,2.9391706769781166e ListToArray/4181,7.441304302057385e-5,7.439159112614982e-5,7.44395995968166e-5,7.740722676333549e-8,6.214978245193033e-8,9.51104279423442e-8 ListToArray/3110,5.926637260695039e-5,5.906816987450401e-5,5.942384419039519e-5,6.232147039585826e-7,5.38165486823948e-7,7.040505131156698e-7 ListToArray/4015,7.035933606851938e-5,7.015831820022106e-5,7.049682767876397e-5,5.728845093287018e-7,3.9839333333091796e-7,7.843817482596103e-7 +ValueData/0,8.377136211858912e-7,8.373304115445387e-7,8.381046702640861e-7,1.3418932205822029e-9,1.1476735650708911e-9,1.5319412454059067e-9 +ValueData/54978,8.370675758014747e-7,8.365378260299356e-7,8.376215066578977e-7,1.7839684037793195e-9,1.4731548869274836e-9,2.26350722195894e-9 +ValueData/39537,8.344382853950327e-7,8.337544904584405e-7,8.352134221403107e-7,2.5262308811763237e-9,1.9805810616509528e-9,3.279746559271019e-9 +ValueData/410,8.405776465702471e-7,8.393124411970799e-7,8.413797564415905e-7,3.4944330211717383e-9,2.61759026315188e-9,5.3786890688983455e-9 +ValueData/34907,8.371946120539469e-7,8.361819326653592e-7,8.380171268441349e-7,3.040742084995521e-9,2.3819755305075384e-9,4.099211810553828e-9 +ValueData/35934,8.350978581609415e-7,8.33644089974887e-7,8.365575819277381e-7,4.863715302398346e-9,4.131383445542153e-9,5.9477665470572245e-9 +ValueData/6970,8.354124310631824e-7,8.347921612822811e-7,8.363235290254174e-7,2.490000673393943e-9,1.99039579570257e-9,3.890191652478678e-9 +ValueData/1822,8.388483278545889e-7,8.382172392172984e-7,8.395082489698128e-7,2.067269946936319e-9,1.7795408762584268e-9,2.444680487698871e-9 +ValueData/20656,8.346998013641812e-7,8.335169985348335e-7,8.356963577255955e-7,3.553481338160221e-9,2.8187630459746046e-9,5.3972778544298205e-9 +ValueData/83445,8.300258107825616e-7,8.286893733516709e-7,8.3117291361886e-7,4.1481893702926125e-9,3.4075993293697635e-9,4.945583805295775e-9 +ValueData/12813,8.322391851419034e-7,8.309634519719963e-7,8.338730431678196e-7,4.862827579374383e-9,3.3326271687798365e-9,7.969610970438173e-9 +ValueData/38476,8.366850809928021e-7,8.360609080937079e-7,8.374050052650089e-7,2.370003726222306e-9,1.9690323207975748e-9,2.941419133568398e-9 +ValueData/45966,8.343559117587065e-7,8.334704665331665e-7,8.354925114060724e-7,3.2998355471168383e-9,2.4023688657293132e-9,4.37834855185655e-9 +ValueData/40835,8.402906085266478e-7,8.388821284768288e-7,8.415609895636296e-7,4.58002646803848e-9,3.661022333605179e-9,5.612444502093004e-9 +ValueData/51000,8.342835137372319e-7,8.334706985032315e-7,8.349447542890037e-7,2.454133260521783e-9,1.880533935336332e-9,3.0432423308404074e-9 +ValueData/24034,8.365437389328809e-7,8.360948459751086e-7,8.369353402127361e-7,1.4671401842800405e-9,1.1911553019582126e-9,1.9455756892803213e-9 +ValueData/40227,8.35202002462747e-7,8.344629141012037e-7,8.364522793508605e-7,3.1115788812456026e-9,2.142651943994569e-9,4.730907587990905e-9 +ValueData/12961,8.338354752320199e-7,8.330584511738922e-7,8.345713236461153e-7,2.5450678856400833e-9,2.2131541147318084e-9,3.014372097824921e-9 +ValueData/2186,8.373949431106551e-7,8.360781970828152e-7,8.385965720551768e-7,4.2861723627445866e-9,3.803782548655266e-9,4.890432230803296e-9 +ValueData/12509,8.333253577908956e-7,8.325422856993397e-7,8.340814547260659e-7,2.4823001007973294e-9,2.152235568181555e-9,2.857000319679268e-9 +ValueData/61397,8.334336702160599e-7,8.324604213569143e-7,8.344228239383189e-7,3.535952475100323e-9,2.9309086132643963e-9,4.390648409430792e-9 +ValueData/1546,8.42045264757015e-7,8.413097540667727e-7,8.42797250649178e-7,2.5405387382738074e-9,1.972430903634704e-9,3.558067656754383e-9 +ValueData/14459,8.302026292393818e-7,8.295168114914289e-7,8.309259084611909e-7,2.406128697511162e-9,2.0458008317689223e-9,2.867384372074495e-9 +ValueData/30161,8.339912735174209e-7,8.331100615059021e-7,8.349382861622859e-7,3.1164394988261516e-9,2.4414645632453604e-9,4.318363421611697e-9 +ValueData/32168,8.352567757975748e-7,8.34462236588409e-7,8.359468717313281e-7,2.4929497462197636e-9,2.1806239599226732e-9,2.8595204441793432e-9 +ValueData/8836,8.33450908191291e-7,8.325808506147578e-7,8.344110611332112e-7,3.001629916591811e-9,2.6301678416519005e-9,3.4849791441861113e-9 +ValueData/61216,8.319129248870315e-7,8.303080629464209e-7,8.333030915615478e-7,5.094917572237138e-9,4.282410405826247e-9,5.981319830818873e-9 +ValueData/14025,8.322413929581882e-7,8.316838540969013e-7,8.333482077597477e-7,2.6349439943598756e-9,1.504357173231818e-9,5.132397925613259e-9 +ValueData/3965,8.322002872763328e-7,8.30950529721133e-7,8.333730113787436e-7,4.287129768665429e-9,3.6644157411450852e-9,5.06900376356071e-9 +ValueData/49058,8.324684810196417e-7,8.310965733407636e-7,8.335243522754318e-7,4.120131607413022e-9,3.2753371591738957e-9,5.834631365396355e-9 +ValueData/9951,8.382276939258877e-7,8.374291264354875e-7,8.390555964240405e-7,2.8701802700685425e-9,2.4032460456444936e-9,3.4618213299224567e-9 +ValueData/14604,8.33160598616725e-7,8.324616393114185e-7,8.33945070204482e-7,2.6064827077392465e-9,2.0769679520611665e-9,3.3031174463342044e-9 +ValueData/5473,8.346026944226184e-7,8.337793886513394e-7,8.356304574870435e-7,3.129515856132948e-9,2.6566074156808906e-9,3.806069384637841e-9 +ValueData/59099,8.368051505507977e-7,8.36098802062338e-7,8.382416256256451e-7,3.226594609870686e-9,1.865236509145685e-9,6.336418538410819e-9 +ValueData/8758,8.317011430460796e-7,8.310629397352516e-7,8.323981419513184e-7,2.257894093383664e-9,1.830567811980456e-9,2.89224356423159e-9 +ValueData/25704,8.282560794070981e-7,8.272141879354956e-7,8.292107251882635e-7,3.2169563147995905e-9,2.352879384148449e-9,4.6574628957349826e-9 +ValueData/49609,8.394457139905395e-7,8.388268418306316e-7,8.400331805612365e-7,1.981067824121554e-9,1.7176270258531624e-9,2.284915744966062e-9 +ValueData/66243,8.354601735937573e-7,8.346427590320737e-7,8.36517025528269e-7,3.236550623005862e-9,2.384425680687083e-9,5.441018212682577e-9 +ValueData/597,8.328546024654422e-7,8.323210412039786e-7,8.333387942996597e-7,1.717287981934102e-9,1.4111521931465798e-9,2.1075772065371457e-9 +ValueData/42933,8.328165398051367e-7,8.313169754631354e-7,8.340848933856004e-7,4.595330617285116e-9,3.5838446997372194e-9,6.491651515072452e-9 +ValueData/4177,8.346583918750896e-7,8.340499147282678e-7,8.352512403510053e-7,2.1187057957390367e-9,1.793215886110686e-9,2.5823700690783977e-9 +ValueData/55482,8.27812593808718e-7,8.262108844112692e-7,8.29615447641784e-7,5.524609566652834e-9,3.865453556490689e-9,9.005607638698939e-9 +ValueData/46694,8.345334929387747e-7,8.339530142890032e-7,8.351609843230282e-7,2.0107425676835606e-9,1.6458728805379183e-9,2.4627621389007765e-9 +ValueData/1377,8.319616284335727e-7,8.31082450183381e-7,8.328098211419371e-7,2.772440802577566e-9,2.1996317174785053e-9,3.554563059987943e-9 +ValueData/3841,8.355344782527052e-7,8.349619031262646e-7,8.360658889007051e-7,1.938360723632017e-9,1.6345469901579046e-9,2.323684463351883e-9 +ValueData/71327,8.361116297436422e-7,8.350064694806314e-7,8.370683916438308e-7,3.4324707072968762e-9,2.8645656741095877e-9,4.14770285410342e-9 +ValueData/9211,8.357489960509013e-7,8.347962829307453e-7,8.371420498198175e-7,3.742640192888015e-9,2.795079466062967e-9,4.879130381133039e-9 +ValueData/66416,8.355210879427854e-7,8.341165380741065e-7,8.366897407739278e-7,4.074505908701945e-9,3.4608338870392887e-9,4.9395611957463815e-9 +ValueData/22940,8.337926820319943e-7,8.3331179662906e-7,8.343272329258478e-7,1.7560658162546508e-9,1.4010862541488238e-9,2.3372099267862953e-9 +ValueData/61078,8.344002430266066e-7,8.335094436655622e-7,8.353875899948732e-7,3.031619346618865e-9,2.6032202946811696e-9,3.5495383605640506e-9 +ValueData/5390,8.306915170368683e-7,8.298370295983147e-7,8.317455063749564e-7,3.142763105724729e-9,2.287733256279243e-9,4.472259139392705e-9 +ValueData/779,8.359963697220775e-7,8.349564123568547e-7,8.369859283229891e-7,3.314282174552145e-9,2.929371337476311e-9,3.864067426336718e-9 +ValueData/973,8.353620459766811e-7,8.341501312984829e-7,8.365424426661366e-7,3.742436729013639e-9,3.059913823874277e-9,4.863910509730962e-9 +ValueData/81574,8.338592425972728e-7,8.325884506003755e-7,8.347800099533224e-7,3.6827254976780097e-9,3.0830589289968192e-9,4.492339658799384e-9 +ValueData/13453,8.370138824272273e-7,8.361215366347288e-7,8.380355826186565e-7,3.3092157143561883e-9,2.8990102787308964e-9,3.826791283837143e-9 +ValueData/70932,8.347231220104517e-7,8.336451773155398e-7,8.356612981342975e-7,3.429401746293805e-9,3.004841715372405e-9,4.11453107573746e-9 +ValueData/2040,8.324611376306801e-7,8.314470899470728e-7,8.336893341266905e-7,3.775627527131937e-9,2.9356405818126746e-9,5.027623788547723e-9 +ValueData/28880,8.364922401261866e-7,8.356794562380878e-7,8.37122390272293e-7,2.412899853644416e-9,2.0698385954439917e-9,2.8965522913549102e-9 +ValueData/526,8.33101282666315e-7,8.324786283646331e-7,8.340747007849139e-7,2.61152099422796e-9,1.8328817825183566e-9,4.20269773829508e-9 +ValueData/58565,8.326476332343037e-7,8.322458042228777e-7,8.330308904321726e-7,1.3572937449386288e-9,1.1405426849353661e-9,1.653362748146104e-9 +ValueData/2334,8.324497892004585e-7,8.318757858651401e-7,8.334363986941614e-7,2.3513279299305645e-9,1.5165877112723628e-9,4.060994246647257e-9 +ValueData/23355,8.308872199600943e-7,8.299159829981238e-7,8.316731057917622e-7,3.127562250329901e-9,2.4652544170334497e-9,4.583960825900948e-9 +ValueData/1250,8.337214979676871e-7,8.331319519481756e-7,8.345933689841891e-7,2.332070416083403e-9,1.8443188388062676e-9,3.4548764643989493e-9 +ValueData/14262,8.309990704730232e-7,8.300429255789441e-7,8.318673979994239e-7,3.0887527352178843e-9,2.440322873609408e-9,4.000844409989332e-9 +ValueData/3995,8.325035951115953e-7,8.314722900341102e-7,8.337058898690551e-7,3.9000929638663976e-9,3.1062828239426285e-9,5.121708166962454e-9 +ValueData/13902,8.341928742335138e-7,8.3284019706223e-7,8.357951241402222e-7,5.069463296079803e-9,3.5922727638873758e-9,9.014117220171448e-9 +ValueData/25546,8.311725621826939e-7,8.304109168591826e-7,8.319809045914994e-7,2.6651484410832593e-9,2.2213566269603622e-9,3.266292182965984e-9 +ValueData/24276,8.391039705548097e-7,8.380736784269972e-7,8.400205051389208e-7,3.3716956260380663e-9,2.731051825019328e-9,3.980959749149192e-9 +ValueData/48597,8.320984114796693e-7,8.312528665825942e-7,8.330991691715947e-7,2.9336857269038876e-9,2.269543240074265e-9,4.420122604628811e-9 +ValueData/20003,8.31495678964243e-7,8.300690036962086e-7,8.324699062821066e-7,3.741873075600105e-9,3.095425059553114e-9,4.379042269331777e-9 +ValueData/2213,8.336898692686445e-7,8.330574683164104e-7,8.345573897683443e-7,2.4843258192473395e-9,1.9714418066050857e-9,3.003950577821306e-9 +ValueData/19120,8.323631866246632e-7,8.316936769906084e-7,8.3299891238697e-7,2.1216474765120142e-9,1.8267815069847276e-9,2.548337448114344e-9 +ValueData/30260,8.330939311234758e-7,8.325234040528594e-7,8.338314487535386e-7,2.0927483409097286e-9,1.6333518891813847e-9,2.8721853715762324e-9 +ValueData/8354,8.388270301688717e-7,8.377298384360299e-7,8.397570643787156e-7,3.504426545426807e-9,3.0356802520542237e-9,4.0626724704143025e-9 +ValueData/4206,8.30703114279944e-7,8.297632966466726e-7,8.318846736955577e-7,3.498048408313958e-9,2.8937686121621586e-9,4.668978545705726e-9 +ValueData/3048,8.346258530800834e-7,8.340963934963015e-7,8.351938749652979e-7,1.765510172490598e-9,1.5228783601990006e-9,2.096463319552377e-9 +ValueData/10346,8.343671696059767e-7,8.336335247908136e-7,8.355378052873791e-7,3.1685711379474953e-9,1.9764280960242215e-9,5.457391438289418e-9 +ValueData/179,8.307759902102411e-7,8.299668281527285e-7,8.315885683792456e-7,2.7282518388065722e-9,2.309394319936683e-9,3.2047468945823144e-9 +ValueData/9338,8.325130897676489e-7,8.309831009474182e-7,8.338384904784124e-7,4.624517795736861e-9,3.791124021855624e-9,5.576056823361887e-9 +ValueData/6082,8.343105292068713e-7,8.333294673582706e-7,8.350032654293953e-7,2.877325930239695e-9,2.441050326191461e-9,3.6464569073669566e-9 +ValueData/73573,8.323877882315527e-7,8.316715651206618e-7,8.334840559673277e-7,2.97473585119688e-9,2.033970819969591e-9,5.022857266009937e-9 +ValueData/10600,8.361646358877628e-7,8.35770500916043e-7,8.366200641399069e-7,1.4426380204857208e-9,1.1136862150008744e-9,2.1208167037533274e-9 +ValueData/3250,8.314105022056945e-7,8.301593537860229e-7,8.327381990248594e-7,4.7566139345960195e-9,3.92317365603347e-9,5.82084966720651e-9 +ValueData/5832,8.327667529337512e-7,8.322785551636133e-7,8.332171427542558e-7,1.6184495400464608e-9,1.3698372004450608e-9,1.9430497124476568e-9 +ValueData/6456,8.322324885283191e-7,8.303839020149641e-7,8.339707667978225e-7,5.999355213242991e-9,4.993718024251158e-9,8.123516001362686e-9 +ValueData/22705,8.356411354064812e-7,8.346289621437866e-7,8.365619772847295e-7,3.2193873560614513e-9,2.6820108703032083e-9,3.7822092724436054e-9 +ValueData/9297,8.348216580292827e-7,8.340422184706473e-7,8.363188874229766e-7,3.5869076657200456e-9,2.1321224274716072e-9,6.513798034482614e-9 +ValueData/28128,8.395910892195649e-7,8.385691627494786e-7,8.405874809795482e-7,3.316711307920286e-9,2.8216076612743074e-9,3.883190082793342e-9 +ValueData/50618,8.310040545537059e-7,8.30400086776298e-7,8.314814833334256e-7,1.7906077539140336e-9,1.4548379708081531e-9,2.283546728534893e-9 +ValueData/62766,8.406093590525205e-7,8.39945972884222e-7,8.415315573702276e-7,2.6467769871079465e-9,1.7728803896510138e-9,3.654723244648623e-9 +ValueData/76110,8.362084684275555e-7,8.357582824684487e-7,8.366700172935132e-7,1.5138933435992645e-9,1.1885211320163599e-9,2.123810120310208e-9 +ValueData/5072,8.347272307171809e-7,8.341851594052263e-7,8.352813146187644e-7,1.9093848311718003e-9,1.6214636580484593e-9,2.279370485561767e-9 +ValueData/11494,8.342451070633487e-7,8.337331291768738e-7,8.346405069501292e-7,1.5098294645724625e-9,1.2827100713310748e-9,1.8595493032685546e-9 +ValueData/9764,8.408644878532547e-7,8.403211615146616e-7,8.4150312694745e-7,1.909323367394887e-9,1.5754825782441757e-9,2.4906327598438457e-9 +ValueData/4008,8.322511683917953e-7,8.313168996052e-7,8.331053677184013e-7,2.939162224020731e-9,2.41930787722841e-9,3.867851567775478e-9 +ValueData/70106,8.35047990477264e-7,8.342378128296351e-7,8.35914334278274e-7,2.9027145140142813e-9,2.5140569133568825e-9,3.3956663030740635e-9 +ValueData/26933,8.381599968672654e-7,8.376260264859613e-7,8.386994796326764e-7,1.8455837853307392e-9,1.6002890953580872e-9,2.133749956831499e-9 +ValueData/77198,8.351600536741794e-7,8.34432525497182e-7,8.359950267174213e-7,2.5192038135180905e-9,1.8252566943424105e-9,3.498616934391167e-9 +ValueData/88386,8.33357911083004e-7,8.329241420308694e-7,8.339344414895643e-7,1.602592071680944e-9,1.3784179483315956e-9,1.9483152548454283e-9 +ValueData/8816,8.331742887272382e-7,8.326452797449877e-7,8.33757609927762e-7,1.9443558083899242e-9,1.6850954391385702e-9,2.3417649622859187e-9 +ValueData/47511,8.38018604971018e-7,8.37358644775545e-7,8.386586327981056e-7,2.2797318967784865e-9,1.8729666686314924e-9,2.812342639381714e-9 +UnValueData/1,9.112190404674668e-7,9.103977081304458e-7,9.119675656690452e-7,2.62075170132651e-9,2.107091093575871e-9,3.235040710097915e-9 +UnValueData/219913,6.0988013044336986e-2,5.717995460968314e-2,7.008531227530468e-2,1.078206792366388e-2,3.8704835198263583e-3,1.862673595257913e-2 +UnValueData/158149,4.0059423800227395e-2,3.8719935897176e-2,4.317763816799527e-2,3.783830198534752e-3,1.093412528343325e-3,5.6478962658375225e-3 +UnValueData/1555,1.827861305321309e-4,1.825848538775086e-4,1.830414776699329e-4,7.581404572572452e-7,5.683122297456356e-7,8.995035882567745e-7 +UnValueData/139629,3.3339378235456796e-2,3.223433225292376e-2,3.5566847760293806e-2,3.3201503370994885e-3,1.8455643579275267e-3,5.587205615093207e-3 +UnValueData/143737,3.280737950300434e-2,3.160009343923952e-2,3.524612911814262e-2,3.4194925726754154e-3,3.062804114100275e-4,5.741089477768193e-3 +UnValueData/27881,4.864390826264895e-3,4.766744191527757e-3,5.222877932182545e-3,5.324454675132961e-4,7.87689588279566e-5,1.1056810749703208e-3 +UnValueData/7287,9.978377176215818e-4,9.972391298983547e-4,9.987055314982485e-4,2.3982473381752885e-6,1.7734050976294505e-6,3.4695402317328672e-6 +UnValueData/82623,1.9138634682018544e-2,1.832105619058851e-2,1.9985260393288524e-2,2.0566152948652463e-3,1.5832138641968122e-3,2.8678041334483637e-3 +UnValueData/333781,9.530358830568704e-2,8.992055836306126e-2,0.10189762408327725,9.742546698611288e-3,7.698489844176128e-3,1.1931040580657385e-2 +UnValueData/51251,9.748251433834034e-3,9.465501855301674e-3,1.04292693600457e-2,1.0465295918698414e-3,5.3232441434318415e-5,1.8324168440163565e-3 +UnValueData/153905,3.8239822064672455e-2,3.609959376502841e-2,4.133773110971931e-2,5.446568735334564e-3,3.730945411391299e-3,8.420928958990246e-3 +UnValueData/183865,4.478164286887492e-2,4.3163591341960114e-2,4.74106962537515e-2,3.864310850123237e-3,1.7643253964682317e-3,5.618886386812654e-3 +UnValueData/163341,3.986272445670951e-2,3.854351956902601e-2,4.2951353076317776e-2,4.0867549146468745e-3,2.1733717080626037e-3,6.6842689935693814e-3 +UnValueData/204001,5.617063832038677e-2,5.342308994224263e-2,6.0220731155233014e-2,6.290211839293736e-3,4.3540424501287605e-3,8.423012815941213e-3 +UnValueData/96137,2.1931733745422927e-2,2.0996533922293947e-2,2.374749185492523e-2,2.9000509611784853e-3,1.6295533228692957e-3,4.267712907090269e-3 +UnValueData/160907,3.7401131815833724e-2,3.627252087126046e-2,3.969409285094401e-2,3.1227456423799913e-3,1.2349878027530837e-3,5.016754236664178e-3 +UnValueData/51837,1.0194230089723184e-2,9.91354860236796e-3,1.0882760673481071e-2,1.1282024908708986e-3,6.873289509739702e-4,2.0831137494941284e-3 +UnValueData/8717,1.2667783228966982e-3,1.255627467362539e-3,1.3095916927090433e-3,7.070718452994632e-5,3.4219324305717933e-6,1.5021809120339366e-4 +UnValueData/50037,9.527836790850076e-3,9.280264095691049e-3,1.013134621005179e-2,9.947765514049778e-4,1.587566021577537e-4,1.9550540044915698e-3 +UnValueData/245589,6.673731546788902e-2,6.275086278071651e-2,7.42762611598357e-2,9.144002921083933e-3,5.74690985162018e-3,1.2484645444370914e-2 +UnValueData/6183,8.56549710460132e-4,8.527886323707541e-4,8.60890092965452e-4,1.4743861322553592e-5,1.3228784084345912e-5,1.7260253701531775e-5 +UnValueData/57837,1.112409338472619e-2,1.0824449016413476e-2,1.1786710951021923e-2,1.082818686170681e-3,5.7558822035350034e-5,1.8444733006512354e-3 +UnValueData/120643,2.70321503549442e-2,2.6116290439478555e-2,2.874116328975437e-2,2.804178268519356e-3,1.5480912772098691e-3,3.8476450048569102e-3 +UnValueData/128673,2.8799391265865962e-2,2.791974597444044e-2,3.0974869942627613e-2,2.6936066401567005e-3,1.3377059719733035e-3,4.614393826082716e-3 +UnValueData/35341,6.339247525973882e-3,6.180528154210074e-3,6.775184712046607e-3,6.774819137813874e-4,6.714206352264522e-5,1.2842388479998375e-3 +UnValueData/244865,6.781597602774651e-2,6.449845642162721e-2,7.354387237379947e-2,7.472034401657617e-3,4.158576491542708e-3,1.0798832330620607e-2 +UnValueData/56095,1.1489891421799726e-2,1.1091274240131371e-2,1.2134957131229602e-2,1.4340304884112906e-3,7.345579498434153e-4,2.5637766927214083e-3 +UnValueData/15831,2.5774147774476745e-3,2.5190445408513275e-3,2.7195473488117812e-3,2.7556005510555233e-4,1.533207866643519e-5,5.152938747188396e-4 +UnValueData/196233,5.7508928569114603e-2,5.453153520486214e-2,6.101908054441449e-2,6.127659117176161e-3,3.409158083155368e-3,9.594353431762745e-3 +UnValueData/39795,7.1639748578598604e-3,6.982906711667345e-3,7.641232345824282e-3,7.954873779076646e-4,3.720739084387655e-4,1.418671391289364e-3 +UnValueData/58411,1.118145089871875e-2,1.0880980289878247e-2,1.1790338472445027e-2,1.1322807439031986e-3,5.329995585571208e-4,1.6764096116331098e-3 +UnValueData/21861,3.6698763752668374e-3,3.582659640341783e-3,3.885114056771543e-3,3.873408570217623e-4,3.934497176337324e-5,7.222682111076793e-4 +UnValueData/236397,6.541953005950259e-2,6.1455324316641906e-2,7.059601658033302e-2,8.444200022649936e-3,6.6267029111393835e-3,1.125805751468611e-2 +UnValueData/35031,6.375929926035674e-3,6.219845441310004e-3,6.838306708882943e-3,6.99790002190746e-4,3.5683134552458073e-4,1.2687198406040778e-3 +UnValueData/102817,2.3312081214596835e-2,2.2627356122819634e-2,2.4168247812621172e-2,1.7843090839617089e-3,1.314058444707696e-3,2.429284221706269e-3 +UnValueData/198437,5.535827491146424e-2,5.237090245249298e-2,5.816497998348854e-2,5.65872685289967e-3,3.8356657768439445e-3,9.468037571353881e-3 +UnValueData/264973,7.845232297208102e-2,7.31869621653228e-2,8.233684438443373e-2,7.3586364112709695e-3,4.5438460782016715e-3,1.1028262458061364e-2 +UnValueData/2369,2.861816301174361e-4,2.85571452681637e-4,2.8896333198515203e-4,3.4779538488100857e-6,1.3189669354313236e-6,7.902769055316896e-6 +UnValueData/171733,4.528780635518304e-2,4.260486276191357e-2,4.7598311356997415e-2,4.7591304238308605e-3,3.8692758209431088e-3,6.3591159175494585e-3 +UnValueData/16705,2.7206757952201966e-3,2.6661872678206593e-3,2.8858579477194163e-3,2.641120181950546e-4,2.2351072005294946e-5,5.184575316673713e-4 +UnValueData/221929,5.9199743722315734e-2,5.621504497834395e-2,6.419697697019046e-2,6.802116638452856e-3,3.985799017378216e-3,1.0908162751220378e-2 +UnValueData/186777,4.7790762830495145e-2,4.499714234603737e-2,5.196997794265915e-2,6.2528356229461755e-3,4.693413916966198e-3,7.284572937087695e-3 +UnValueData/5495,7.302907793422007e-4,7.294823491436236e-4,7.312392686002702e-4,2.9106522776640293e-6,2.35967721385808e-6,4.129342502039106e-6 +UnValueData/15363,2.4620384566100737e-3,2.4043143358845873e-3,2.603137565645612e-3,2.857720944589332e-4,1.2224812595308754e-4,5.483315008039077e-4 +UnValueData/285309,7.82695385645188e-2,7.585509798356464e-2,8.268373765051365e-2,5.618247510588495e-3,3.622283791451413e-3,8.143489258615773e-3 +UnValueData/36837,6.648632266726716e-3,6.484453551878168e-3,6.980188597311753e-3,6.511810771240304e-4,3.1961165906183286e-4,1.0119042898973007e-3 +UnValueData/265665,7.714337727932642e-2,7.342579198454348e-2,8.169326568894683e-2,7.277966335371467e-3,4.8360483934572025e-3,1.065895304057841e-2 +UnValueData/91761,1.9438171143793325e-2,1.8845381650386888e-2,2.0223434041664372e-2,1.6743952581747305e-3,1.0998630211695635e-3,2.0232939054858974e-3 +UnValueData/244313,6.35667789304793e-2,6.0991830606427454e-2,6.760520805022847e-2,5.548151656780435e-3,3.5798188601651663e-3,7.985225324307645e-3 +UnValueData/21561,3.5727561363542736e-3,3.5140866409316017e-3,3.728827726869608e-3,2.7884036806175776e-4,1.3746708882295092e-4,5.276187809180692e-4 +UnValueData/3115,3.854778939990122e-4,3.851294211686272e-4,3.860152784937958e-4,1.4376806759886267e-6,9.381127777501594e-7,2.620382261968034e-6 +UnValueData/3889,4.995890025101611e-4,4.993306817515761e-4,4.998950208627768e-4,9.547605358396456e-7,6.884583994547613e-7,1.3364189573698623e-6 +UnValueData/326297,9.356628987491394e-2,8.904543043667783e-2,9.913479120321113e-2,8.127050234358666e-3,6.000792078494438e-3,1.027839755606695e-2 +UnValueData/53805,1.0302153024347482e-2,1.0106151048807866e-2,1.0698940251850657e-2,7.799168844228313e-4,4.59687082659273e-4,1.3437031308827648e-3 +UnValueData/283729,7.900330475649782e-2,7.533582035969529e-2,8.342912753230877e-2,6.8966574751633605e-3,5.160460007032383e-3,9.570109705794293e-3 +UnValueData/8161,1.166497268761503e-3,1.1601440244634789e-3,1.1897772351120676e-3,3.762374160481887e-5,7.2832233139380485e-6,7.94506469434986e-5 +UnValueData/115521,2.6942951155988697e-2,2.572590208033399e-2,2.844608355015033e-2,3.1028177003710575e-3,2.556851215249305e-3,4.088307760106048e-3 +UnValueData/1957,2.3179340711687913e-4,2.31507852340433e-4,2.3217292752979692e-4,1.0888572671143644e-6,8.606822563836566e-7,1.324800842186906e-6 +UnValueData/234261,6.569300214945097e-2,6.2467088471747714e-2,6.9600651358811e-2,6.810529057862165e-3,4.39667369532426e-3,1.0403797849762425e-2 +UnValueData/9319,1.3697852944905206e-3,1.3571183728866745e-3,1.4071445556771247e-3,6.91763551962477e-5,1.3149729529878875e-5,1.321794525652531e-4 +UnValueData/93421,2.023335730035628e-2,1.9587453242524394e-2,2.1078472163187176e-2,1.782188697775279e-3,1.3511933474311872e-3,2.1600587852229377e-3 +UnValueData/4971,6.49827621559083e-4,6.492922562466971e-4,6.504570130660236e-4,1.87373060110748e-6,1.522997851050305e-6,2.5592136029457313e-6 +UnValueData/57041,1.152732150473673e-2,1.1274031974871654e-2,1.1885799527563549e-2,8.1914270500936e-4,5.502065033106756e-4,1.2523007190568297e-3 +UnValueData/15959,2.5887831452988358e-3,2.541838579104629e-3,2.674955212699479e-3,2.0132550949402076e-4,1.0856109215021028e-4,3.7162575189421854e-4 +UnValueData/55609,1.1224524168332563e-2,1.0848234958796802e-2,1.1756228214727658e-2,1.1284732873267363e-3,8.293339338155198e-4,1.6124160310521862e-3 +UnValueData/102181,2.4047912019984883e-2,2.274292646118102e-2,2.5324374313054874e-2,2.832246983979603e-3,2.4941703028842003e-3,3.3216746262689167e-3 +UnValueData/97103,2.0926833231297355e-2,2.036436798178188e-2,2.1799521283296607e-2,1.6093283504693386e-3,1.251089377055145e-3,1.9416350366587584e-3 +UnValueData/194389,5.1426144935646026e-2,4.87595240413622e-2,5.489077640964184e-2,5.491976449252403e-3,4.055482525718816e-3,7.556719354033896e-3 +UnValueData/80013,1.7305341072026078e-2,1.6817577551626817e-2,1.7989761463960318e-2,1.3566858916212584e-3,1.0579292478526093e-3,1.8077870416700877e-3 +UnValueData/8853,1.2771574435822444e-3,1.2649075146809149e-3,1.3081354096553888e-3,6.044572233944183e-5,2.5767708948063313e-5,1.2183427242769995e-4 +UnValueData/76481,1.587389679406186e-2,1.555613465848507e-2,1.637003793192999e-2,9.870155989175153e-4,7.236206662874647e-4,1.3534626098611027e-3 +UnValueData/121039,2.8375156401747436e-2,2.7262083561635227e-2,2.9738962457083015e-2,2.627038649357899e-3,2.1620464018712857e-3,3.2412418256710595e-3 +UnValueData/33401,5.8749583569847755e-3,5.768092146953857e-3,6.082365312206173e-3,4.061480117571994e-4,2.5629811574318686e-4,6.312150094347357e-4 +UnValueData/16817,2.745755839853395e-3,2.7002810299409023e-3,2.853251146794669e-3,2.071291944657282e-4,1.1339290444616521e-4,3.5053686721654747e-4 +UnValueData/12155,1.9167571237958972e-3,1.882753519712755e-3,1.997912597559424e-3,1.609795131709365e-4,8.408735182968734e-5,2.8383200339723006e-4 +UnValueData/41383,7.582568733458178e-3,7.447676790556299e-3,7.79866159600653e-3,4.944117147063563e-4,3.543637551476857e-4,7.567484664632304e-4 +UnValueData/545,6.274378976633361e-5,6.271600180042969e-5,6.280484841489441e-5,1.3382333636201904e-7,8.43764818774449e-8,2.26446001081104e-7 +UnValueData/37341,6.600632762852007e-3,6.481744369029131e-3,6.811822890761561e-3,4.4042371420189604e-4,3.116603973505156e-4,6.459754874637047e-4 +UnValueData/24329,4.111015088210913e-3,4.045752111218822e-3,4.242006161119214e-3,2.849397881464998e-4,1.8949858714901755e-4,4.313533332249848e-4 +UnValueData/294293,8.7968809820549e-2,8.386210103984923e-2,9.199555068949444e-2,6.952801569809038e-3,4.904575719982261e-3,1.0215276147651157e-2 +UnValueData/42401,7.874492325882177e-3,7.738993009846275e-3,8.09714758927903e-3,5.096588853132781e-4,3.717918806812773e-4,7.493981559248644e-4 +UnValueData/12999,2.074016853236119e-3,2.03893234832643e-3,2.1399514983842195e-3,1.5817627577931206e-4,9.188214681057411e-5,2.6534090853849734e-4 +UnValueData/23323,3.826230017822367e-3,3.7722295769410203e-3,3.945285728557549e-3,2.3461309559656593e-4,1.394455432076811e-4,4.021832121001105e-4 +UnValueData/25823,4.450526111589667e-3,4.3723056273580665e-3,4.5855226677863365e-3,3.003373316536013e-4,1.9252144869096052e-4,5.42072692642724e-4 +UnValueData/90817,1.9448765029262988e-2,1.907634249147023e-2,1.990815289800473e-2,9.91788678737861e-4,7.24445662223523e-4,1.5713825737418466e-3 +UnValueData/37181,6.785167030235881e-3,6.66898396609834e-3,6.965108237687492e-3,4.344572939705948e-4,3.1010810713040683e-4,7.223704987653717e-4 +UnValueData/112513,2.579392474850799e-2,2.4863625273958544e-2,2.6974777960458177e-2,2.4037358134072454e-3,1.991582524446148e-3,2.9990764879409995e-3 +UnValueData/202473,5.405500371964664e-2,5.213677649001085e-2,5.6698363051936346e-2,4.10492546399237e-3,2.9430826675558145e-3,5.140846012370703e-3 +UnValueData/251065,6.990888007459829e-2,6.804918461959018e-2,7.323574112271557e-2,4.319886854400614e-3,2.2590054837203083e-3,6.988684403943558e-3 +UnValueData/304441,8.68383825780262e-2,8.409360563825993e-2,9.092585569306735e-2,5.821480957250336e-3,3.5166769261654124e-3,9.485549642774923e-3 +UnValueData/20285,3.353852029880796e-3,3.3106510837155453e-3,3.435245677153433e-3,1.798932601884925e-4,1.329037954420417e-4,2.646141059775295e-4 +UnValueData/45967,8.896665566186124e-3,8.760582432619365e-3,9.134111499032092e-3,5.180026279316683e-4,3.739533652993588e-4,8.165859873510026e-4 +UnValueData/39043,7.113888974763073e-3,7.017357328566728e-3,7.2583251350539215e-3,3.410644067675557e-4,2.3100756576140987e-4,5.596296396421918e-4 +UnValueData/16033,2.6040515937858165e-3,2.5679134169373946e-3,2.6619446060376327e-3,1.5182350485803e-4,1.0678348260135533e-4,2.6081738010876894e-4 +UnValueData/280425,7.897341438162599e-2,7.735334418100556e-2,8.405314247641298e-2,4.384368507661023e-3,1.077197130147767e-3,7.569584047445385e-3 +UnValueData/107731,2.5768359959110802e-2,2.5290096149537918e-2,2.6272293511845624e-2,1.1042237795375854e-3,8.323131913170173e-4,1.7134680956155898e-3 +UnValueData/308793,8.926632766382739e-2,8.783881898171135e-2,9.187296460693081e-2,3.2278083953847943e-3,1.2425563142414793e-3,5.133389491641594e-3 +UnValueData/353545,0.10947658345357858,0.10460143739405224,0.1117854573915021,5.485560328017188e-3,2.0618942611422726e-3,9.02689579870939e-3 +UnValueData/35265,6.3863929614644925e-3,6.344980600631582e-3,6.421299316687318e-3,1.1244007171542924e-4,8.571715573730515e-5,1.6719542325517565e-4 +UnValueData/190045,4.795612586508444e-2,4.6754731295672855e-2,4.86696758342943e-2,1.6810295367030964e-3,9.385226837022953e-4,2.6711431865196742e-3 diff --git a/plutus-core/cost-model/data/builtinCostModelA.json b/plutus-core/cost-model/data/builtinCostModelA.json index eddf7c7da81..c2c91968047 100644 --- a/plutus-core/cost-model/data/builtinCostModelA.json +++ b/plutus-core/cost-model/data/builtinCostModelA.json @@ -1234,25 +1234,31 @@ }, "valueData": { "cpu": { - "arguments": 194713, + "arguments": 164434, "type": "constant_cost" }, "memory": { - "arguments": 1, - "type": "constant_cost" + "arguments": { + "intercept": 6, + "slope": 38 + }, + "type": "linear_in_x" } }, "unValueData": { "cpu": { "arguments": { "intercept": 1000, - "slope": 43200 + "slope": 290658 }, "type": "linear_in_x" }, "memory": { - "arguments": 1, - "type": "constant_cost" + "arguments": { + "intercept": 0, + "slope": 8 + }, + "type": "linear_in_x" } } } diff --git a/plutus-core/cost-model/data/builtinCostModelB.json b/plutus-core/cost-model/data/builtinCostModelB.json index 579f90d755a..6bea96c256f 100644 --- a/plutus-core/cost-model/data/builtinCostModelB.json +++ b/plutus-core/cost-model/data/builtinCostModelB.json @@ -1234,25 +1234,31 @@ }, "valueData": { "cpu": { - "arguments": 194713, + "arguments": 164434, "type": "constant_cost" }, "memory": { - "arguments": 1, - "type": "constant_cost" + "arguments": { + "intercept": 6, + "slope": 38 + }, + "type": "linear_in_x" } }, "unValueData": { "cpu": { "arguments": { "intercept": 1000, - "slope": 43200 + "slope": 290658 }, "type": "linear_in_x" }, "memory": { - "arguments": 1, - "type": "constant_cost" + "arguments": { + "intercept": 0, + "slope": 8 + }, + "type": "linear_in_x" } } } diff --git a/plutus-core/cost-model/data/builtinCostModelC.json b/plutus-core/cost-model/data/builtinCostModelC.json index 956bb15876a..46372f3c0c7 100644 --- a/plutus-core/cost-model/data/builtinCostModelC.json +++ b/plutus-core/cost-model/data/builtinCostModelC.json @@ -1252,25 +1252,31 @@ }, "valueData": { "cpu": { - "arguments": 194713, + "arguments": 164434, "type": "constant_cost" }, "memory": { - "arguments": 1, - "type": "constant_cost" + "arguments": { + "intercept": 6, + "slope": 38 + }, + "type": "linear_in_x" } }, "unValueData": { "cpu": { "arguments": { "intercept": 1000, - "slope": 43200 + "slope": 290658 }, "type": "linear_in_x" }, "memory": { - "arguments": 1, - "type": "constant_cost" + "arguments": { + "intercept": 0, + "slope": 8 + }, + "type": "linear_in_x" } } } diff --git a/plutus-core/plutus-core/src/PlutusCore/Default/Builtins.hs b/plutus-core/plutus-core/src/PlutusCore/Default/Builtins.hs index 1e6fa8f29f7..17f3ebde123 100644 --- a/plutus-core/plutus-core/src/PlutusCore/Default/Builtins.hs +++ b/plutus-core/plutus-core/src/PlutusCore/Default/Builtins.hs @@ -24,7 +24,8 @@ import PlutusCore.Default.Universe import PlutusCore.Evaluation.Machine.BuiltinCostModel import PlutusCore.Evaluation.Machine.ExBudgetStream (ExBudgetStream) import PlutusCore.Evaluation.Machine.ExMemoryUsage - ( ExMemoryUsage + ( DataNodeCount (..) + , ExMemoryUsage , IntegerCostedLiterally (..) , NumBytesCostedAsNumWords (..) , ValueLogOuterSizeAddLogMaxInnerSize (..) @@ -1926,7 +1927,7 @@ instance uni ~ DefaultUni => ToBuiltinMeaning uni DefaultFun where let listToArrayDenotation :: SomeConstant uni [a] -> BuiltinResult (Opaque val (Vector a)) listToArrayDenotation (SomeConstant (Some (ValueOf uniListA xs))) = case uniListA of - DefaultUniList uniA -> + DefaultUniList uniA -> pure $ fromValueOf (DefaultUniArray uniA) $ Vector.fromListN (length xs) xs _ -> throwError $ structuralUnliftingError "Expected a list but got something else" {-# INLINE listToArrayDenotation #-} @@ -1992,15 +1993,15 @@ instance uni ~ DefaultUni => ToBuiltinMeaning uni DefaultFun where valueContainsDenotation (runCostingFunTwoArguments . paramValueContains) toBuiltinMeaning _semvar ValueData = - let valueDataDenotation :: Value -> Data - valueDataDenotation = Value.valueData + let valueDataDenotation :: ValueTotalSize -> Data + valueDataDenotation (ValueTotalSize v) = Value.valueData v {-# INLINE valueDataDenotation #-} in makeBuiltinMeaning valueDataDenotation (runCostingFunOneArgument . paramValueData) toBuiltinMeaning _semvar UnValueData = - let unValueDataDenotation :: Data -> BuiltinResult Value - unValueDataDenotation = Value.unValueData + let unValueDataDenotation :: DataNodeCount -> BuiltinResult Value + unValueDataDenotation (DataNodeCount d) = Value.unValueData d {-# INLINE unValueDataDenotation #-} in makeBuiltinMeaning unValueDataDenotation diff --git a/plutus-core/plutus-core/src/PlutusCore/Default/Universe.hs b/plutus-core/plutus-core/src/PlutusCore/Default/Universe.hs index c95d7fc2dbd..0b7237992a9 100644 --- a/plutus-core/plutus-core/src/PlutusCore/Default/Universe.hs +++ b/plutus-core/plutus-core/src/PlutusCore/Default/Universe.hs @@ -51,7 +51,8 @@ import PlutusCore.Crypto.BLS12_381.G2 qualified as BLS12_381.G2 import PlutusCore.Crypto.BLS12_381.Pairing qualified as BLS12_381.Pairing import PlutusCore.Data (Data) import PlutusCore.Evaluation.Machine.ExMemoryUsage - ( IntegerCostedLiterally (..) + ( DataNodeCount (..) + , IntegerCostedLiterally (..) , NumBytesCostedAsNumWords (..) , ValueLogOuterSizeAddLogMaxInnerSize (..) , ValueTotalSize (..) @@ -709,6 +710,21 @@ instance readKnown = readKnownCoerce @Value {-# INLINE readKnown #-} +deriving newtype instance + KnownTypeAst tyname DefaultUni DataNodeCount +instance + KnownBuiltinTypeIn DefaultUni term Value + => MakeKnownIn DefaultUni term DataNodeCount + where + makeKnown = makeKnownCoerce @Data + {-# INLINE makeKnown #-} +instance + KnownBuiltinTypeIn DefaultUni term Value + => ReadKnownIn DefaultUni term DataNodeCount + where + readKnown = readKnownCoerce @Data + {-# INLINE readKnown #-} + deriving newtype instance KnownTypeAst tyname DefaultUni ValueLogOuterSizeAddLogMaxInnerSize instance @@ -768,12 +784,12 @@ instance AnnotateCaseBuiltin DefaultUni where annotateCaseBuiltin ty branches = case ty of TyBuiltin _ (SomeTypeIn DefaultUniUnit) -> case branches of - [x] -> Right $ [(x, [])] + [x] -> Right [(x, [])] _ -> Left "Casing on unit only allows exactly one branch" TyBuiltin _ (SomeTypeIn DefaultUniBool) -> case branches of - [f] -> Right $ [(f, [])] - [f, t] -> Right $ [(f, []), (t, [])] + [f] -> Right [(f, [])] + [f, t] -> Right [(f, []), (t, [])] _ -> Left "Casing on bool requires exactly one branch or two branches" TyBuiltin _ (SomeTypeIn DefaultUniInteger) -> Right $ map (,[]) branches @@ -786,7 +802,7 @@ instance AnnotateCaseBuiltin DefaultUni where case branches of [f] -> Right [(f, [lTyArg, rTyArg])] _ -> Left "Casing on pair requires exactly one branch" - _ -> Left $ display (() <$ ty) <> " isn't supported in 'case'" + _ -> Left $ display (void ty) <> " isn't supported in 'case'" instance CaseBuiltin DefaultUni where caseBuiltin someVal@(Some (ValueOf uni x)) branches = case uni of diff --git a/plutus-core/plutus-core/src/PlutusCore/Evaluation/Machine/ExMemoryUsage.hs b/plutus-core/plutus-core/src/PlutusCore/Evaluation/Machine/ExMemoryUsage.hs index 7f8b32c7c2c..681bffeffe9 100644 --- a/plutus-core/plutus-core/src/PlutusCore/Evaluation/Machine/ExMemoryUsage.hs +++ b/plutus-core/plutus-core/src/PlutusCore/Evaluation/Machine/ExMemoryUsage.hs @@ -1,6 +1,11 @@ -- editorconfig-checker-disable-file +{-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE BlockArguments #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE InstanceSigs #-} +{-# LANGUAGE KindSignatures #-} +{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} @@ -14,6 +19,8 @@ module PlutusCore.Evaluation.Machine.ExMemoryUsage , IntegerCostedLiterally (..) , ValueTotalSize (..) , ValueLogOuterSizeAddLogMaxInnerSize (..) + , DataNodeCount (..) + , countNodesRoseScaled ) where import PlutusCore.Crypto.BLS12_381.G1 as BLS12_381.G1 @@ -455,6 +462,31 @@ mlResultElementCost = singletonRose . unsafeToSatInt $ BLS12_381.Pairing.mlResul {-# OPAQUE mlResultElementCost #-} instance ExMemoryUsage BLS12_381.Pairing.MlResult where - memoryUsage _ = mlResultElementCost + memoryUsage _ = mlResultElementCost -- Should be 72 + +{-| A wrapper for 'Data' whose 'ExMemoryUsage' counts nodes via lazy traversal. +Used by UnValueData builtin: measures INPUT Data node count. +The actual memory formula (slope × nodeCount + intercept) is applied in the JSON cost model. -} +newtype DataNodeCount = DataNodeCount Data + +instance ExMemoryUsage DataNodeCount where + -- Just count nodes without applying coefficients. + -- The JSON cost model applies: 8 * nodeCount + 0 + -- See MemoryAnalysis analyzeCrossConversionModels experiment for derivation. + memoryUsage (DataNodeCount dat) = + countNodesRoseScaled 1 dat + {-# INLINE memoryUsage #-} --- Should be 72 +-- Helper function to count nodes in a Data object, returning a lazy CostRose +-- with the slope applied per node. The intercept is applied once at the root +-- in the ExMemoryUsage instance. +countNodesRoseScaled :: CostingInteger -> Data -> CostRose +countNodesRoseScaled s = go + where + -- Each node contributes `s` (slope) to the cost + go d = CostRose s case d of + Constr _ ds -> ds <&> go + Map pairs -> pairs >>= \(d1, d2) -> [d1, d2] <&> go + List ds -> ds <&> go + I _ -> [] + B _ -> [] diff --git a/plutus-core/plutus-core/test/CostModelSafety/Spec.hs b/plutus-core/plutus-core/test/CostModelSafety/Spec.hs index 82feb43ed7e..3fe97d01111 100644 --- a/plutus-core/plutus-core/test/CostModelSafety/Spec.hs +++ b/plutus-core/plutus-core/test/CostModelSafety/Spec.hs @@ -38,7 +38,8 @@ import PlutusCore.Evaluation.Machine.ExBudget (ExBudget (ExBudget)) import PlutusCore.Evaluation.Machine.ExBudgetStream (sumExBudgetStream) import PlutusCore.Evaluation.Machine.ExBudgetingDefaults (cekCostModelForVariant) import PlutusCore.Evaluation.Machine.ExMemoryUsage - ( IntegerCostedLiterally + ( DataNodeCount (..) + , IntegerCostedLiterally , NumBytesCostedAsNumWords , ValueLogOuterSizeAddLogMaxInnerSize , ValueTotalSize @@ -128,6 +129,7 @@ smallConstant tr | Just HRefl <- eqTypeRep tr (typeRep @BS.ByteString) = SomeConst $ BS.pack [] | Just HRefl <- eqTypeRep tr (typeRep @Text) = SomeConst ("" :: Text) | Just HRefl <- eqTypeRep tr (typeRep @Data) = SomeConst $ I 0 + | Just HRefl <- eqTypeRep tr (typeRep @DataNodeCount) = SomeConst $ I 0 | Just HRefl <- eqTypeRep tr (typeRep @BLS12_381.G1.Element) = SomeConst $ BLS12_381.G1.offchain_zero | Just HRefl <- eqTypeRep tr (typeRep @BLS12_381.G2.Element) = diff --git a/plutus-core/plutus-core/test/TypeSynthesis/Golden/Signatures/DefaultFun/UnValueData.golden.sig b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Signatures/DefaultFun/UnValueData.golden.sig index cabd96f47b2..9e7751e384a 100644 --- a/plutus-core/plutus-core/test/TypeSynthesis/Golden/Signatures/DefaultFun/UnValueData.golden.sig +++ b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Signatures/DefaultFun/UnValueData.golden.sig @@ -1 +1 @@ -Data -> BuiltinResult Value \ No newline at end of file +DataNodeCount -> BuiltinResult Value \ No newline at end of file diff --git a/plutus-core/plutus-core/test/TypeSynthesis/Golden/Signatures/DefaultFun/ValueData.golden.sig b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Signatures/DefaultFun/ValueData.golden.sig index 6e2a52cd410..3deaf2b67c1 100644 --- a/plutus-core/plutus-core/test/TypeSynthesis/Golden/Signatures/DefaultFun/ValueData.golden.sig +++ b/plutus-core/plutus-core/test/TypeSynthesis/Golden/Signatures/DefaultFun/ValueData.golden.sig @@ -1 +1 @@ -Value -> Data \ No newline at end of file +ValueTotalSize -> Data \ No newline at end of file diff --git a/plutus-core/testlib/PlutusCore/Generators/Hedgehog/Builtin.hs b/plutus-core/testlib/PlutusCore/Generators/Hedgehog/Builtin.hs index 9c3f29d5675..f0b0f629d02 100644 --- a/plutus-core/testlib/PlutusCore/Generators/Hedgehog/Builtin.hs +++ b/plutus-core/testlib/PlutusCore/Generators/Hedgehog/Builtin.hs @@ -19,7 +19,8 @@ import PlutusCore.Crypto.BLS12_381.G2 qualified as BLS12_381.G2 import PlutusCore.Crypto.BLS12_381.Pairing qualified as BLS12_381.Pairing import PlutusCore.Data (Data (..)) import PlutusCore.Evaluation.Machine.ExMemoryUsage - ( IntegerCostedLiterally + ( DataNodeCount + , IntegerCostedLiterally , NumBytesCostedAsNumWords , ValueLogOuterSizeAddLogMaxInnerSize , ValueTotalSize @@ -107,6 +108,7 @@ genConstant tr | Just HRefl <- eqTypeRep tr (typeRep @BS.ByteString) = genArbitraryBuiltin @BS.ByteString | Just HRefl <- eqTypeRep tr (typeRep @Text) = genArbitraryBuiltin @Text | Just HRefl <- eqTypeRep tr (typeRep @Data) = genArbitraryBuiltin @Data + | Just HRefl <- eqTypeRep tr (typeRep @DataNodeCount) = genArbitraryBuiltin @Data | Just HRefl <- eqTypeRep tr (typeRep @BLS12_381.G1.Element) = genArbitraryBuiltin @BLS12_381.G1.Element | Just HRefl <- eqTypeRep tr (typeRep @BLS12_381.G2.Element) = diff --git a/plutus-ledger-api/src/PlutusLedgerApi/V1/ParamName.hs b/plutus-ledger-api/src/PlutusLedgerApi/V1/ParamName.hs index 2d703b1d75d..5a79309eaed 100644 --- a/plutus-ledger-api/src/PlutusLedgerApi/V1/ParamName.hs +++ b/plutus-ledger-api/src/PlutusLedgerApi/V1/ParamName.hs @@ -325,9 +325,11 @@ data ParamName | ValueContains'cpu'arguments'slope | ValueContains'memory'arguments | ValueData'cpu'arguments - | ValueData'memory'arguments + | ValueData'memory'arguments'intercept + | ValueData'memory'arguments'slope | UnValueData'cpu'arguments'intercept | UnValueData'cpu'arguments'slope - | UnValueData'memory'arguments + | UnValueData'memory'arguments'intercept + | UnValueData'memory'arguments'slope deriving stock (Eq, Ord, Enum, Ix, Bounded, Generic) deriving (IsParamName) via (GenericParamName ParamName) diff --git a/plutus-ledger-api/src/PlutusLedgerApi/V2/ParamName.hs b/plutus-ledger-api/src/PlutusLedgerApi/V2/ParamName.hs index 331d1fe3eca..3ba39aca332 100644 --- a/plutus-ledger-api/src/PlutusLedgerApi/V2/ParamName.hs +++ b/plutus-ledger-api/src/PlutusLedgerApi/V2/ParamName.hs @@ -327,9 +327,11 @@ data ParamName | ValueContains'cpu'arguments'slope | ValueContains'memory'arguments | ValueData'cpu'arguments - | ValueData'memory'arguments + | ValueData'memory'arguments'intercept + | ValueData'memory'arguments'slope | UnValueData'cpu'arguments'intercept | UnValueData'cpu'arguments'slope - | UnValueData'memory'arguments + | UnValueData'memory'arguments'intercept + | UnValueData'memory'arguments'slope deriving stock (Eq, Ord, Enum, Ix, Bounded, Generic) deriving (IsParamName) via (GenericParamName ParamName) diff --git a/plutus-ledger-api/src/PlutusLedgerApi/V3/ParamName.hs b/plutus-ledger-api/src/PlutusLedgerApi/V3/ParamName.hs index 0f5c2e48c8a..d566c1f1b95 100644 --- a/plutus-ledger-api/src/PlutusLedgerApi/V3/ParamName.hs +++ b/plutus-ledger-api/src/PlutusLedgerApi/V3/ParamName.hs @@ -343,9 +343,11 @@ data ParamName | ValueContains'cpu'arguments'slope | ValueContains'memory'arguments | ValueData'cpu'arguments - | ValueData'memory'arguments + | ValueData'memory'arguments'intercept + | ValueData'memory'arguments'slope | UnValueData'cpu'arguments'intercept | UnValueData'cpu'arguments'slope - | UnValueData'memory'arguments + | UnValueData'memory'arguments'intercept + | UnValueData'memory'arguments'slope deriving stock (Eq, Ord, Enum, Ix, Bounded, Generic) deriving (IsParamName) via (GenericParamName ParamName) diff --git a/plutus-ledger-api/test/Spec/CostModelParams.hs b/plutus-ledger-api/test/Spec/CostModelParams.hs index 042550db834..d5608d13cf2 100644 --- a/plutus-ledger-api/test/Spec/CostModelParams.hs +++ b/plutus-ledger-api/test/Spec/CostModelParams.hs @@ -30,9 +30,9 @@ tests = "CostModelParams" "costModelParams" [ embed $ testCase "length" do - 312 @=? length v1_ParamNames - 312 @=? length v2_ParamNames - 330 @=? length v3_ParamNames + 314 @=? length v1_ParamNames + 314 @=? length v2_ParamNames + 332 @=? length v3_ParamNames , embed $ testCase "tripping paramname" do for_ v1_ParamNames \p -> assertBool "tripping v1 cm params failed" $ diff --git a/plutus-ledger-api/test/Spec/Data/CostModelParams.hs b/plutus-ledger-api/test/Spec/Data/CostModelParams.hs index 32016e2a5e2..bc08d1231d0 100644 --- a/plutus-ledger-api/test/Spec/Data/CostModelParams.hs +++ b/plutus-ledger-api/test/Spec/Data/CostModelParams.hs @@ -30,9 +30,9 @@ tests = "CostModelParams" "costModelParams" [ embed $ testCase "length" do - 312 @=? length v1_ParamNames - 312 @=? length v2_ParamNames - 330 @=? length v3_ParamNames + 314 @=? length v1_ParamNames + 314 @=? length v2_ParamNames + 332 @=? length v3_ParamNames , embed $ testCase "tripping paramname" do for_ v1_ParamNames \p -> assertBool "tripping v1 cm params failed" $