Commit Graph

2563 Commits

Author SHA1 Message Date
Matthias Benkort
f02b9b0f0c Merge pull request #871 from aiken-lang/backpassing
Backpassing
2024-03-11 01:06:17 +01:00
KtorZ
4fbb4fe2db Handle fuzzer failing unexpected
We shouldn't panic here but bubble the error up to the user to inform
  them about a possibly ill-formed fuzzer.

  Fixes #864.
2024-03-11 01:04:46 +01:00
KtorZ
7e8e959251 Fix spans and error reporting for backpassing. 2024-03-11 00:20:29 +01:00
KtorZ
a57dcf3307 Allow backpassing with expect. 2024-03-11 00:20:29 +01:00
KtorZ
435dd0d213 Refactor AssignmentKind to allow backpassing on both let and expect.
The 3rd kind of assignment kind (Bind) is gone and now reflected through a boolean parameter. Note that this parameter is completely erased by the type-checker so that the rest of the pipeline (i.e. code-generation) doesn't have to make any assumption. They simply can't see a backpassing let or expect.
2024-03-11 00:16:23 +01:00
KtorZ
df898bf239 Rework monadic-bind into function backpassing.
This is more holistic and less awkward than having monadic bind working only with some pre-defined type. Backpassing work with _any_ function, and can be implemented relatively easily by rewriting the AST on-the-fly.

  Also, it is far easier to explain than trying to explain what a monadic bind is, how its behavior differs from type to type and why it isn't generally available for any monadic type.
2024-03-11 00:16:22 +01:00
KtorZ
1f530f3b24 Experiment with monadic bind. 2024-03-11 00:16:22 +01:00
KtorZ
0e0bed3c9d Collect traces from last prop-test run on failure 2024-03-10 19:24:25 +01:00
KtorZ
d4069148c7 Remove UnitTestResult's output field
Dead-code. Also renamed 'logs' to 'traces'.
2024-03-10 19:00:01 +01:00
KtorZ
be7d07fa99 Always show test traces (unless manually turned off with flag)
On both failures and success.
2024-03-10 18:53:11 +01:00
KtorZ
c169596c76 preserve type-aliases from annotations on calls. 2024-03-10 00:38:03 +01:00
KtorZ
191e4d47b3 Remove dead-code: 'Layer' 2024-03-09 23:14:44 +01:00
Matthias Benkort
ec18127191 Merge pull request #869 from aiken-lang/non-serialisable-types
Forbid non-serializable inhabitants in compound data-types.
2024-03-09 22:39:41 +01:00
KtorZ
80a9393db7 Add --include-dependencies to 'aiken docs'
Fixes #867.
2024-03-09 22:35:38 +01:00
KtorZ
ee54266d1f Forbid non-serializable inhabitants in compound data-types. 2024-03-09 22:25:51 +01:00
KtorZ
37627e3527 Fix indentation of pipelines. 2024-03-09 20:44:51 +01:00
KtorZ
6ba74125c7 Remove extra newlines in test report and only print coverage on success. 2024-03-09 20:32:42 +01:00
microproofs
cf86a20256 update Changelog 2024-03-09 13:27:32 -05:00
microproofs
c7dcb2c256 Add tests for zero arg cyclic functions and renamed function aliases 2024-03-09 13:23:27 -05:00
KtorZ
22b86a5f82 Add --max-success for running more or less prop runs on demand. 2024-03-09 19:17:57 +01:00
KtorZ
d581183cc6 Fix formatter discarding nul bytes. 2024-03-09 18:59:35 +01:00
microproofs
b761d6a76d fix: function aliases were leading to free uniques 2024-03-09 12:46:12 -05:00
microproofs
bffa678178 fix: mutually recursive zero arg functions needed to have their function bodies delayed 2024-03-09 10:04:30 -05:00
Matthias Benkort
7f0df40b4e Merge pull request #862 from SundaeSwap-finance/pi/summary-check-count
Include the number of tests / checks run as part of the summary
2024-03-09 13:10:16 +01:00
microproofs
c51741cc35 fix: mutually recursive zero arg function calls were reaching an unreachable 2024-03-08 22:58:03 -05:00
Pi Lanningham
ebd6c3a56e Cargo fmt 2024-03-08 20:43:27 -05:00
Pi Lanningham
ace58e368c Correctly report the checks count
It might be slightly cleaner and more extensible to change  to return a summary, potentially even making  track the tests, coverage, etc. so it can be serialized to JSON. But, for now, this is much simpler, and the approach that KtorZ suggested.
2024-03-08 20:40:50 -05:00
KtorZ
77faee672e cargo fmt --all 2024-03-09 01:28:48 +01:00
KtorZ
bbe7c0bc01 report prop test coverage labels on success. 2024-03-09 01:28:29 +01:00
KtorZ
96da70149d Count labels in properties.
We'll piggyback on the tracing capabilities of the VM to provide labelling for prop tests. To ensure we do not interfere with normal traces, we only count traces that starts with a NUL byte as label. That convention is assumed to be known of the companion fuzz library that should then provide the labelling capabilities as a dedicated function.
2024-03-09 01:28:29 +01: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
rvcas
d73f8fd6c2 chore: update changelog 2024-03-08 19:19:07 -05:00
rvcas
cb0ae0c074 feat: impl some conversion methods on CheckedModule 2024-03-08 19:19:07 -05:00
rvcas
d55b7844f0 feat: impl serde for TypeAliasAnnotation 2024-03-08 19:19:07 -05:00
rvcas
2b5ed95df5 feat: serialize as cbor 2024-03-08 19:19:07 -05:00
rvcas
836e853827 fix: bring back vec1 2024-03-08 19:19:07 -05:00
rvcas
9d99b509b2 chore: this should be gone 2024-03-08 19:19:07 -05:00
rvcas
fe6710935d feat: impl serde on errythang 2024-03-08 19:19:07 -05:00
Pi Lanningham
e944f10372 Add an optional check count; when we run a command that runs tests, we can set this to Some(x) and it'll print in the summary 2024-03-08 17:36:32 -05:00
rvcas
49ca7e1f75 chore: update changelog 2024-03-08 16:21:48 -05:00
KtorZ
a9d596f4cb Memoize simplification steps during property-based shrinking.
I've been benchmarking that through the shrink of 'large' lists, and the cache brings about 1.5x speed increase. For small and simple cases, the cache as no visible effects (positive or negative).
2024-03-08 18:58:51 +01:00
microproofs
c906501836 add one more test 2024-03-08 12:25:26 -05:00
microproofs
64f580bb82 one more change to the changelog 2024-03-08 12:19:18 -05:00
microproofs
9636a4de03 update changelog 2024-03-08 11:18:50 -05:00
Matthias Benkort
bc161f761b Merge pull request #860 from aiken-lang/preserve-type-aliases
Preserve type-aliases in (pretty-printed) type annotations
2024-03-08 16:41:44 +01:00
KtorZ
a578728a94 Resolve type aliases based on inferred types.
Before this commit, we would always show the 'declared form' of type aliases, with their generic, non-instantiated parameters. This now tries to unify the annotation with the underlying inferred type to provide even better alias pretty printing.
2024-03-08 16:01:21 +01:00
KtorZ
ed9f5c6ef7 Preserve TypeAlias in types for better context/feedback. 2024-03-08 15:59:33 +01:00
KtorZ
877d10ef22 Use inferred Fuzzer inner type for unify error when possible. 2024-03-08 15:57:41 +01:00
microproofs
eb07365e73 fix tests 2024-03-08 00:12:44 -05:00
microproofs
94f383762c step up the optimizations a bit more by inlining a small function 2024-03-08 00:12:44 -05:00