Commit Graph

517 Commits

Author SHA1 Message Date
microproofs
a5a0734629 fix: casting a field type to Data with expect and traces on was assuming the raw Data was of type constr 2024-03-27 15:52:23 -04:00
microproofs
61936cb91e fix(codegen): Add tracing when checking for a constr vs another primitive 2024-03-17 16:25:17 -04:00
KtorZ
37627e3527 Fix indentation of pipelines. 2024-03-09 20:44:51 +01:00
microproofs
c7dcb2c256 Add tests for zero arg cyclic functions and renamed function aliases 2024-03-09 13:23:27 -05:00
KtorZ
d6cc9bdfbe Allow implicit discard when right-hand side is Void.
This is the most intuitive/expected behavior. Otherwise, it forces a pointless let-binding to 'Void' or into a discard.
2024-03-09 01:28:29 +01:00
microproofs
c906501836 add one more test 2024-03-08 12:25:26 -05:00
microproofs
eb07365e73 fix tests 2024-03-08 00:12:44 -05:00
microproofs
ae396c0224 Fix opaque type destructuring in code gen 2024-03-08 00:12:44 -05:00
microproofs
a3fbe6c155 fix tests 2024-03-06 23:27:10 -05:00
rvcas
25ebdc2527 fix: validator args unexpectedly unbound
closes #852
2024-03-06 14:15:00 -05:00
microproofs
c9dd281b45 disable assert that was blocking issue #844 2024-03-04 11:48:22 -05:00
microproofs
27eb1a3e04 Change all uses of interning besides the uplc parser to use the new CodeGenInterner 2024-03-04 11:03:23 -05:00
microproofs
e14f091b86 add back test 93 2024-03-04 10:52:56 -05:00
KtorZ
775a34bc47 Remove acceptance_test 095, now done directly from Rust.' 2024-03-03 19:33:26 +01:00
KtorZ
93347d8e7b Add Fuzzer to the prelude. 2024-03-03 19:33:25 +01:00
KtorZ
5b4fedd084 Add PRNG to the Prelude. 2024-03-03 19:33:25 +01:00
KtorZ
bfcfc5c41b Implement reification from Maps. 2024-03-03 19:33:25 +01:00
KtorZ
5272f5ecee Adjust order in which Bool's constructors are declared in the prelude
True corresponds to Constr=1 and False corresponds to Constr=0; their position in the vector shall reflect that. Note that while this would in principle impact codegen for any other type, it doesn't for bool since we likely never looked up this type definition since it is well-known. It does now as the 'reify' function relies on this. Whoopsie.
2024-03-03 19:33:25 +01:00
KtorZ
14f1025f0b Display counterexamples as Aiken values instead of raw UPLC. 2024-03-03 19:33:24 +01:00
KtorZ
c29d163900 Rename acceptance_test_093 -> acceptance_test_095 2024-03-03 19:33:24 +01:00
KtorZ
a703db4d14 Borrow integrated shrinking approach from MiniThesis. 2024-03-03 19:33:24 +01:00
KtorZ
3762473a60 Add preliminary plumbing to run property test through the CLI.
This is very very rough at the moment. But it does a couple of thing:

  1. The 'ArgVia' now contains an Expr/TypedExpr which should unify to a Fuzzer. This is to avoid having to introduce custom logic to handle fuzzer referencing. So this now accepts function call, field access etc.. so long as they unify to the right thing.

  2. I've done quite a lot of cleanup in aiken-project mostly around the tests and the naming surrounding them. What we used to call 'Script' is now called 'Test' and is an enum between UnitTest (ex-Script) and PropertyTest. I've moved some boilerplate and relevant function under those module Impl.

  3. I've completed the end-to-end pipeline of:
     - Compiling the property test
     - Compiling the fuzzer
     - Generating an initial seed
     - Running property tests sequentially, threading the seed through each step.

   An interesting finding is that, I had to wrap the prop test in a similar wrapper that we use for validator, to ensure we convert primitive types wrapped in Data back to UPLC terms. This is necessary because the fuzzer return a ProtoPair (and soon an Array) which holds 'Data'.

  At the moment, we do nothing with the size, though the size should ideally grow after each iteration (up to a certain cap).

  In addition, there are a couple of todo/fixme that I left in the code as reminders of what's left to do beyond the obvious (error and success reporting, testing, etc..)
2024-03-03 19:33:24 +01:00
KtorZ
4ff11f4229 Fix acceptance test 087 following BigInt seralization fix. 2024-03-02 14:11:22 +01:00
KtorZ
2b8e99a1b8 Fix CI script for acceptance tests, and have them run in parallel. 2024-03-02 14:11:22 +01:00
KtorZ
46c357df7b Fix Int/BigInt pivot
We've been wrongly representing large ints as BigInt, causing them to
  behave differently in the VM through builtins like 'serialise_data'.

  Indeed, we expect anything that fits in 8 bytes to be encoded as Major
  Type 0 or 1. But we were switching to encoding as Major type 6
  (tagged, PosBigInt, NegBigInt) for much smaller values! Anything
  outside of the range [-2^32, 2^32-1] would be treated as big int
  (positive or negative).

  Why? Because we checked whether a value i would fit in an i64, and if
  it didn't we treated it as big int. But the reality is more subtle...
  Fortunately, Rust has i128 and the minicbor library implements TryFrom
  which enforces that the value fits in a range of [-2^64, 2^64 - 1], so
  we're back on track easily.
2024-02-25 14:09:56 -05:00
rvcas
9e3f348c6c chore: commit artifacts from acceptance tests 2024-02-13 21:29:46 -05:00
rvcas
0ccfe60072 feat: support nested void matching 2024-02-13 21:29:24 -05:00
microproofs
d8cdeba6fd chore: lastest acceptance test lock and plutus.json files 2024-01-31 00:07:43 -05:00
microproofs
444bccf19c fix: change list_access_to_uplc to properly handle list discards 2024-01-30 23:53:33 -05:00
microproofs
ede6c22267 remove traces from test 89 2024-01-25 14:24:21 -05:00
microproofs
78d2049d7b fix: Using the wrong match string for discards in FieldsExpose
Also need to return a lambda wrapped term from list_access_to_uplc under all conditions
2024-01-25 14:18:36 -05:00
microproofs
b15e6c296b Add a few more expect cases to test 40 2024-01-24 16:29:40 -05:00
KtorZ
b50e4ab63a Re-format and re-run all acceptance tests. 2024-01-20 10:44:16 +01:00
KtorZ
50ebfc6090 remove wrongly committed acceptance test blueprints
Actually copy-pasted from 090
2024-01-20 10:38:40 +01:00
KtorZ
bf96c3afd2 Add more tests & rename 'Invalid' -> 'Unfinished' 2024-01-20 10:26:33 +01:00
KtorZ
8a90e9eda0 Improve behavior and reporting of tests expected to fail
Fixes #786.
2024-01-19 18:20:58 +01:00
KtorZ
0e2b8ae251 Bump pallas dependencies to include flat bigint patch
Fixes #796.
2024-01-18 18:26:21 +01:00
microproofs
c7af27a6ba fix: generic edge case with tuples that allowed 2 tuples and 3 tuples to use the same monomorphized function.
Also massively reduced the space taken up by generics in scripts when using generics with list and tuples
2024-01-13 17:46:32 -05:00
microproofs
394cac86b8 feat: expect on a type now can take in a msg when in trace mode 2024-01-04 16:03:51 -05:00
rvcas
b17b7f287c chore: update to pallas v0.20.0 2023-12-04 21:44:19 -05:00
rvcas
7c4cabada9 chore: add latest acceptance artifacts 2023-12-04 21:10:55 -05:00
rvcas
abd18656e3 fix: unable to have newline after expect bool shortcut 2023-11-20 11:44:16 -05:00
rvcas
7118253401 fix: if branches, final_else, and anon fns should all be "top level" 2023-11-20 11:44:16 -05:00
microproofs
446ef11606 chore: finishing acceptance test 29
and updating acceptance test lock files
2023-11-08 14:31:44 -05:00
microproofs
7d319077e6 chore: clean up validator comments and
commit script context test lockfile
2023-11-06 15:49:13 -05:00
microproofs
5d56d41a68 chore: update lock files for acceptance tests 2023-11-06 15:37:04 -05:00
microproofs
598ec5eaef Use a better algorithm for inlining single occurrences 2023-11-06 15:37:04 -05:00
microproofs
68d9a21c6a commit current lock files 2023-10-07 19:42:24 -04:00
KtorZ
524d0dadf5 Add compiler's version to blueprint. 2023-10-06 14:17:55 +02:00
rvcas
135dbd8335 feat: handle pipe fn infer TODOs
This improves error messages for `a |> b(x)`.

We need to do a special check when looping over the args
and unifying. This information is within a function that does not belong
to pipe typer so I used a closure to forward along a way to add
metadata to the error when the first argument in the loop has a
unification error. Simply adding the metadata at the pipe typer
level is not good enough because then we may annotate regular
unification errors from the args.
2023-10-03 01:17:15 -04:00