From b63c544b0d260a9e15ad37fde6ee2a0da891ca37 Mon Sep 17 00:00:00 2001 From: effectfully Date: Wed, 26 Jun 2024 20:21:06 +0200 Subject: [PATCH] [Test] Turn off CSE for problematic tests (#6249) --- plutus-tx-plugin/test/AssocMap/Spec.hs | 3 + .../test/Budget/9.6/map1-budget.budget.golden | 4 +- .../test/Budget/9.6/map1.uplc.golden | 201 +++++----- .../test/Budget/9.6/map2-budget.budget.golden | 4 +- .../test/Budget/9.6/map2.uplc.golden | 351 +++++++++--------- .../test/Budget/9.6/map3-budget.budget.golden | 4 +- .../test/Budget/9.6/map3.uplc.golden | 351 +++++++++--------- 7 files changed, 439 insertions(+), 479 deletions(-) diff --git a/plutus-tx-plugin/test/AssocMap/Spec.hs b/plutus-tx-plugin/test/AssocMap/Spec.hs index 2f3982ccf84..04e4f2604c2 100644 --- a/plutus-tx-plugin/test/AssocMap/Spec.hs +++ b/plutus-tx-plugin/test/AssocMap/Spec.hs @@ -11,6 +11,9 @@ {-# LANGUAGE ViewPatterns #-} {-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:context-level=0 #-} {-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:defer-errors #-} +-- CSE is very unstable and produces different output, likely depending on the version of either +-- @unordered-containers@ or @hashable@. +{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:max-cse-iterations=0 #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MonoLocalBinds #-} diff --git a/plutus-tx-plugin/test/Budget/9.6/map1-budget.budget.golden b/plutus-tx-plugin/test/Budget/9.6/map1-budget.budget.golden index b568cd6b113..1227e8caced 100644 --- a/plutus-tx-plugin/test/Budget/9.6/map1-budget.budget.golden +++ b/plutus-tx-plugin/test/Budget/9.6/map1-budget.budget.golden @@ -1,2 +1,2 @@ -({cpu: 306174770 -| mem: 869909}) \ No newline at end of file +({cpu: 306457186 +| mem: 870413}) \ No newline at end of file diff --git a/plutus-tx-plugin/test/Budget/9.6/map1.uplc.golden b/plutus-tx-plugin/test/Budget/9.6/map1.uplc.golden index 9553f47f06b..a27dc965794 100644 --- a/plutus-tx-plugin/test/Budget/9.6/map1.uplc.golden +++ b/plutus-tx-plugin/test/Budget/9.6/map1.uplc.golden @@ -10,110 +10,105 @@ program (\concatBuiltinStrings n -> (\nt -> - (\cse -> - (\nt -> - (\lookup -> - constr 0 - [ (lookup (\i -> iData i) unBData n nt) - , (lookup - (\i -> iData i) - unBData - cse - nt) - , (lookup - (\i -> iData i) - unBData - (addInteger 10 n) - nt) - , (lookup - (\i -> iData i) - unBData - (addInteger 20 n) - nt) - , (lookup - (\i -> iData i) - unBData - cse - nt) ]) - (\`$dToData` - `$dUnsafeFromData` - ds - ds -> - force - (case - ((\k -> - fix1 - (\go - xs -> - force - (force chooseList) - xs - (\ds -> constr 1 []) - (\ds -> - (\hd -> - force - (force - ifThenElse - (equalsData - k + (\nt -> + (\lookup -> + constr 0 + [ (lookup (\i -> iData i) unBData n nt) + , (lookup + (\i -> iData i) + unBData + (addInteger 5 n) + nt) + , (lookup + (\i -> iData i) + unBData + (addInteger 10 n) + nt) + , (lookup + (\i -> iData i) + unBData + (addInteger 20 n) + nt) + , (lookup + (\i -> iData i) + unBData + (addInteger 5 n) + nt) ]) + (\`$dToData` + `$dUnsafeFromData` + ds + ds -> + force + (case + ((\k -> + fix1 + (\go + xs -> + force + (force chooseList) + xs + (\ds -> constr 1 []) + (\ds -> + (\hd -> + force + (force + ifThenElse + (equalsData + k + (force (force - (force - fstPair) - hd)) - (delay - ((\ds -> - constr 0 - [ (force - (force - sndPair) - hd) ]) - (force - tailList - xs))) - (delay - (go - (force - tailList - xs))))) - (force headList - xs)) - (constr 0 [])) - ds) - (`$dToData` ds)) - [ (\a -> - delay - (constr 0 - [ (`$dUnsafeFromData` - a) ])) - , (delay (constr 1 [])) ]))) - ((\k -> - fix1 - (\go xs -> - force (force chooseList) - xs - (\ds -> []) - (\ds -> - (\hd -> - (\tl -> - force - (force ifThenElse - (equalsData - k - (force - (force - fstPair) - hd)) - (delay tl) - (delay - (force mkCons - hd - (go tl))))) - (force tailList xs)) - (force headList xs)) - (constr 0 [])) - nt) - (iData cse))) - (addInteger 5 n)) + fstPair) + hd)) + (delay + ((\ds -> + constr 0 + [ (force + (force + sndPair) + hd) ]) + (force + tailList + xs))) + (delay + (go + (force + tailList + xs))))) + (force headList xs)) + (constr 0 [])) + ds) + (`$dToData` ds)) + [ (\a -> + delay + (constr 0 + [(`$dUnsafeFromData` a)])) + , (delay (constr 1 [])) ]))) + ((\k -> + fix1 + (\go xs -> + force (force chooseList) + xs + (\ds -> []) + (\ds -> + (\hd -> + (\tl -> + force + (force ifThenElse + (equalsData + k + (force + (force fstPair) + hd)) + (delay tl) + (delay + (force mkCons + hd + (go tl))))) + (force tailList xs)) + (force headList xs)) + (constr 0 [])) + nt) + (iData (addInteger 5 n)))) ((\z -> (\go eta -> go eta) diff --git a/plutus-tx-plugin/test/Budget/9.6/map2-budget.budget.golden b/plutus-tx-plugin/test/Budget/9.6/map2-budget.budget.golden index 8efce7611c2..b44d9aacfc8 100644 --- a/plutus-tx-plugin/test/Budget/9.6/map2-budget.budget.golden +++ b/plutus-tx-plugin/test/Budget/9.6/map2-budget.budget.golden @@ -1,2 +1,2 @@ -({cpu: 126454952 -| mem: 394122}) \ No newline at end of file +({cpu: 126689368 +| mem: 394326}) \ No newline at end of file diff --git a/plutus-tx-plugin/test/Budget/9.6/map2.uplc.golden b/plutus-tx-plugin/test/Budget/9.6/map2.uplc.golden index e2e0f98905e..7146b6271d4 100644 --- a/plutus-tx-plugin/test/Budget/9.6/map2.uplc.golden +++ b/plutus-tx-plugin/test/Budget/9.6/map2.uplc.golden @@ -6,134 +6,44 @@ program (\goList n -> (\unsafeFromList -> - (\cse -> - (\cse -> + (\nt -> + (\go -> (\nt -> - (\go -> - (\nt -> - (\nt -> - fix1 - (\go - ds -> - force - (case - ds - [ (delay (constr 0 [])) - , (\x - xs -> - delay - (constr 1 - [ (case - x - [ (\k - v -> - constr 0 - [ k - , (decodeUtf8 - v) ]) ]) - , (go xs) ])) ])) - (go nt)) - ((\rs' -> - (\ls' -> go rs' ls') (go nt)) - (fix1 - (\go - xs -> - force - (force chooseList) - xs - (\ds -> []) - (\ds -> - (\hd -> - (\tl' -> - force - (case - ((\k -> - fix1 - (\go - xs -> - force - (force - chooseList) - xs - (\ds -> - constr 1 - []) - (\ds -> - force - (force - ifThenElse - (equalsData - k - (force - (force - fstPair) - (force - headList - xs))) - (delay - ((\ds -> - constr 0 - [ ]) - (force - tailList - xs))) - (delay - (go - (force - tailList - xs))))) - (constr 0 - [])) - nt) - (force - (force - fstPair) - hd)) - [ (delay tl') - , (delay - (force mkCons - hd - tl')) ])) - (go (force tailList xs))) - (force headList xs)) - (constr 0 [])) - nt))) - (unsafeFromList - (\i -> iData i) - bData - (constr 1 - [ (constr 0 [(addInteger 1 n), #6f6e65]) - , (constr 1 - [ (constr 0 - [(addInteger 2 n), #74776f]) - , (constr 1 - [ (constr 0 [cse, #7468726565]) - , (constr 1 - [ (constr 0 - [cse, #666f7572]) - , (constr 1 - [ (constr 0 - [ (addInteger - 5 - n) - , #66697665 ]) - , (constr 0 - [ ]) ]) ]) ]) ]) ]))) - (fix1 - (\go - xs -> + (\nt -> + fix1 + (\go ds -> force - (force chooseList) - xs - (\ds -> []) - (\ds -> - (\hd -> - (\tl -> - (\v' -> - (\k' -> - force - (case - (fix1 + (case + ds + [ (delay (constr 0 [])) + , (\x xs -> + delay + (constr 1 + [ (case + x + [ (\k v -> + constr 0 + [ k + , (decodeUtf8 + v) ]) ]) + , (go xs) ])) ])) + (go nt)) + ((\rs' -> + (\ls' -> go rs' ls') (go nt)) + (fix1 + (\go + xs -> + force + (force chooseList) + xs + (\ds -> []) + (\ds -> + (\hd -> + (\tl' -> + force + (case + ((\k -> + fix1 (\go xs -> force @@ -143,77 +53,148 @@ program (\ds -> constr 1 []) (\ds -> - (\hd -> - force - (force - ifThenElse - (equalsData - k' - (force - (force - fstPair) - hd)) - (delay - ((\ds -> - constr 0 - [ (force - (force - sndPair) - hd) ]) - (force - tailList - xs))) - (delay - (go - (force - tailList - xs))))) + force (force - headList - xs)) + ifThenElse + (equalsData + k + (force + (force + fstPair) + (force + headList + xs))) + (delay + ((\ds -> + constr 0 + [ ]) + (force + tailList + xs))) + (delay + (go + (force + tailList + xs))))) (constr 0 [])) nt) - [ (\r -> - delay - (force - mkCons - (mkPairData - k' - (bData - (appendByteString - (unBData - v') - (unBData - r)))) - (go tl))) - , (delay - (force mkCons - (mkPairData - k' - v') - (go tl))) ])) - (force (force fstPair) hd)) - (force (force sndPair) hd)) - (force tailList xs)) - (force headList xs)) - (constr 0 [])))) + (force (force fstPair) + hd)) + [ (delay tl') + , (delay + (force mkCons + hd + tl')) ])) + (go (force tailList xs))) + (force headList xs)) + (constr 0 [])) + nt))) (unsafeFromList (\i -> iData i) bData (constr 1 - [ (constr 0 [cse, #5448524545]) + [ (constr 0 [(addInteger 1 n), #6f6e65]) , (constr 1 - [ (constr 0 [cse, #464f5552]) + [ (constr 0 [(addInteger 2 n), #74776f]) , (constr 1 [ (constr 0 - [(addInteger 6 n), #534958]) + [(addInteger 3 n), #7468726565]) , (constr 1 [ (constr 0 - [ (addInteger 7 n) - , #534556454e ]) - , (constr 0 []) ]) ]) ]) ]))) - (addInteger 3 n)) - (addInteger 4 n)) + [ (addInteger 4 n) + , #666f7572 ]) + , (constr 1 + [ (constr 0 + [ (addInteger 5 n) + , #66697665 ]) + , (constr 0 + []) ]) ]) ]) ]) ]))) + (fix1 + (\go + xs -> + force + (force chooseList) + xs + (\ds -> []) + (\ds -> + (\hd -> + (\tl -> + (\v' -> + (\k' -> + force + (case + (fix1 + (\go + xs -> + force + (force chooseList) + xs + (\ds -> constr 1 []) + (\ds -> + (\hd -> + force + (force + ifThenElse + (equalsData + k' + (force + (force + fstPair) + hd)) + (delay + ((\ds -> + constr 0 + [ (force + (force + sndPair) + hd) ]) + (force + tailList + xs))) + (delay + (go + (force + tailList + xs))))) + (force headList + xs)) + (constr 0 [])) + nt) + [ (\r -> + delay + (force + mkCons + (mkPairData + k' + (bData + (appendByteString + (unBData + v') + (unBData + r)))) + (go tl))) + , (delay + (force mkCons + (mkPairData k' v') + (go tl))) ])) + (force (force fstPair) hd)) + (force (force sndPair) hd)) + (force tailList xs)) + (force headList xs)) + (constr 0 [])))) + (unsafeFromList + (\i -> iData i) + bData + (constr 1 + [ (constr 0 [(addInteger 3 n), #5448524545]) + , (constr 1 + [ (constr 0 [(addInteger 4 n), #464f5552]) + , (constr 1 + [ (constr 0 [(addInteger 6 n), #534958]) + , (constr 1 + [ (constr 0 + [(addInteger 7 n), #534556454e]) + , (constr 0 []) ]) ]) ]) ]))) (\`$dToData` `$dToData` -> (\go eta -> goList (go eta)) (fix1 diff --git a/plutus-tx-plugin/test/Budget/9.6/map3-budget.budget.golden b/plutus-tx-plugin/test/Budget/9.6/map3-budget.budget.golden index 8efce7611c2..b44d9aacfc8 100644 --- a/plutus-tx-plugin/test/Budget/9.6/map3-budget.budget.golden +++ b/plutus-tx-plugin/test/Budget/9.6/map3-budget.budget.golden @@ -1,2 +1,2 @@ -({cpu: 126454952 -| mem: 394122}) \ No newline at end of file +({cpu: 126689368 +| mem: 394326}) \ No newline at end of file diff --git a/plutus-tx-plugin/test/Budget/9.6/map3.uplc.golden b/plutus-tx-plugin/test/Budget/9.6/map3.uplc.golden index e2e0f98905e..7146b6271d4 100644 --- a/plutus-tx-plugin/test/Budget/9.6/map3.uplc.golden +++ b/plutus-tx-plugin/test/Budget/9.6/map3.uplc.golden @@ -6,134 +6,44 @@ program (\goList n -> (\unsafeFromList -> - (\cse -> - (\cse -> + (\nt -> + (\go -> (\nt -> - (\go -> - (\nt -> - (\nt -> - fix1 - (\go - ds -> - force - (case - ds - [ (delay (constr 0 [])) - , (\x - xs -> - delay - (constr 1 - [ (case - x - [ (\k - v -> - constr 0 - [ k - , (decodeUtf8 - v) ]) ]) - , (go xs) ])) ])) - (go nt)) - ((\rs' -> - (\ls' -> go rs' ls') (go nt)) - (fix1 - (\go - xs -> - force - (force chooseList) - xs - (\ds -> []) - (\ds -> - (\hd -> - (\tl' -> - force - (case - ((\k -> - fix1 - (\go - xs -> - force - (force - chooseList) - xs - (\ds -> - constr 1 - []) - (\ds -> - force - (force - ifThenElse - (equalsData - k - (force - (force - fstPair) - (force - headList - xs))) - (delay - ((\ds -> - constr 0 - [ ]) - (force - tailList - xs))) - (delay - (go - (force - tailList - xs))))) - (constr 0 - [])) - nt) - (force - (force - fstPair) - hd)) - [ (delay tl') - , (delay - (force mkCons - hd - tl')) ])) - (go (force tailList xs))) - (force headList xs)) - (constr 0 [])) - nt))) - (unsafeFromList - (\i -> iData i) - bData - (constr 1 - [ (constr 0 [(addInteger 1 n), #6f6e65]) - , (constr 1 - [ (constr 0 - [(addInteger 2 n), #74776f]) - , (constr 1 - [ (constr 0 [cse, #7468726565]) - , (constr 1 - [ (constr 0 - [cse, #666f7572]) - , (constr 1 - [ (constr 0 - [ (addInteger - 5 - n) - , #66697665 ]) - , (constr 0 - [ ]) ]) ]) ]) ]) ]))) - (fix1 - (\go - xs -> + (\nt -> + fix1 + (\go ds -> force - (force chooseList) - xs - (\ds -> []) - (\ds -> - (\hd -> - (\tl -> - (\v' -> - (\k' -> - force - (case - (fix1 + (case + ds + [ (delay (constr 0 [])) + , (\x xs -> + delay + (constr 1 + [ (case + x + [ (\k v -> + constr 0 + [ k + , (decodeUtf8 + v) ]) ]) + , (go xs) ])) ])) + (go nt)) + ((\rs' -> + (\ls' -> go rs' ls') (go nt)) + (fix1 + (\go + xs -> + force + (force chooseList) + xs + (\ds -> []) + (\ds -> + (\hd -> + (\tl' -> + force + (case + ((\k -> + fix1 (\go xs -> force @@ -143,77 +53,148 @@ program (\ds -> constr 1 []) (\ds -> - (\hd -> - force - (force - ifThenElse - (equalsData - k' - (force - (force - fstPair) - hd)) - (delay - ((\ds -> - constr 0 - [ (force - (force - sndPair) - hd) ]) - (force - tailList - xs))) - (delay - (go - (force - tailList - xs))))) + force (force - headList - xs)) + ifThenElse + (equalsData + k + (force + (force + fstPair) + (force + headList + xs))) + (delay + ((\ds -> + constr 0 + [ ]) + (force + tailList + xs))) + (delay + (go + (force + tailList + xs))))) (constr 0 [])) nt) - [ (\r -> - delay - (force - mkCons - (mkPairData - k' - (bData - (appendByteString - (unBData - v') - (unBData - r)))) - (go tl))) - , (delay - (force mkCons - (mkPairData - k' - v') - (go tl))) ])) - (force (force fstPair) hd)) - (force (force sndPair) hd)) - (force tailList xs)) - (force headList xs)) - (constr 0 [])))) + (force (force fstPair) + hd)) + [ (delay tl') + , (delay + (force mkCons + hd + tl')) ])) + (go (force tailList xs))) + (force headList xs)) + (constr 0 [])) + nt))) (unsafeFromList (\i -> iData i) bData (constr 1 - [ (constr 0 [cse, #5448524545]) + [ (constr 0 [(addInteger 1 n), #6f6e65]) , (constr 1 - [ (constr 0 [cse, #464f5552]) + [ (constr 0 [(addInteger 2 n), #74776f]) , (constr 1 [ (constr 0 - [(addInteger 6 n), #534958]) + [(addInteger 3 n), #7468726565]) , (constr 1 [ (constr 0 - [ (addInteger 7 n) - , #534556454e ]) - , (constr 0 []) ]) ]) ]) ]))) - (addInteger 3 n)) - (addInteger 4 n)) + [ (addInteger 4 n) + , #666f7572 ]) + , (constr 1 + [ (constr 0 + [ (addInteger 5 n) + , #66697665 ]) + , (constr 0 + []) ]) ]) ]) ]) ]))) + (fix1 + (\go + xs -> + force + (force chooseList) + xs + (\ds -> []) + (\ds -> + (\hd -> + (\tl -> + (\v' -> + (\k' -> + force + (case + (fix1 + (\go + xs -> + force + (force chooseList) + xs + (\ds -> constr 1 []) + (\ds -> + (\hd -> + force + (force + ifThenElse + (equalsData + k' + (force + (force + fstPair) + hd)) + (delay + ((\ds -> + constr 0 + [ (force + (force + sndPair) + hd) ]) + (force + tailList + xs))) + (delay + (go + (force + tailList + xs))))) + (force headList + xs)) + (constr 0 [])) + nt) + [ (\r -> + delay + (force + mkCons + (mkPairData + k' + (bData + (appendByteString + (unBData + v') + (unBData + r)))) + (go tl))) + , (delay + (force mkCons + (mkPairData k' v') + (go tl))) ])) + (force (force fstPair) hd)) + (force (force sndPair) hd)) + (force tailList xs)) + (force headList xs)) + (constr 0 [])))) + (unsafeFromList + (\i -> iData i) + bData + (constr 1 + [ (constr 0 [(addInteger 3 n), #5448524545]) + , (constr 1 + [ (constr 0 [(addInteger 4 n), #464f5552]) + , (constr 1 + [ (constr 0 [(addInteger 6 n), #534958]) + , (constr 1 + [ (constr 0 + [(addInteger 7 n), #534556454e]) + , (constr 0 []) ]) ]) ]) ]))) (\`$dToData` `$dToData` -> (\go eta -> goList (go eta)) (fix1