Commit Graph

557 Commits

Author SHA1 Message Date
rvcas
cac119338d feat(blueprint): a memoized program that only runs code gen every other time 2024-04-08 14:30:07 -04:00
rvcas
aa3896e92a feat(export): allow trace levels to be controlled 2024-04-08 14:30:07 -04:00
rvcas
dac3308620 feat(Project::export): use Export::from_function and transpose
Co-authored-by: Kasey White <kwhitemsg@gmail.com>
2024-04-08 14:30:07 -04:00
rvcas
8ed930ac5a feat: implement Export object based on blueprint
Co-authored-by: Kasey White <kwhitemsg@gmail.com>
2024-04-08 14:30:07 -04:00
rvcas
3cdb21ad6b feat(blueprint): make a helper public 2024-04-08 14:30:07 -04:00
rvcas
a11b1fa56a chore: cleanup validator creator method 2024-04-08 14:30:07 -04:00
rvcas
9322020a5e feat(blueprint): re-export Error 2024-04-08 14:30:07 -04:00
rvcas
f50f7e42db feat(project): create export type
Co-authored-by: Kasey White <kwhitemsg@gmail.com>
2024-04-08 14:30:07 -04:00
rvcas
1d462314c4 feat: use new generate_raw function 2024-04-08 14:30:07 -04:00
rvcas
7d67f1497c feat(export): implement basic command functionality 2024-04-08 14:30:07 -04:00
microproofs
a6003c3be9 chore: push changes in blueprint snapshot test 2024-03-27 15:57:29 -04:00
rvcas
075668b52e chore: Release 2024-03-25 22:09:37 -04:00
KtorZ
4e8042fd06 chore: Release 2024-03-22 16:10:17 +01:00
microproofs
8495f98c1d remove print 2024-03-17 16:26:10 -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
d1ba8db889 Do not generate documentation for empty modules. 2024-03-15 21:40:57 +01:00
KtorZ
6515efeb73 Implementing remaining shrinking strategies.
This makes the search for counterexample slower in some cases by 30-40% with the hope of finding better counterexamples. We might want to add a flag '--simplification-level' to the command-line to let users decide on the level of simplifications.
2024-03-15 13:36:05 +01:00
Matthias Benkort
b09e0316fa Merge pull request #877 from aiken-lang/dependencies-pruning
Only compile modules the project depends on
2024-03-15 00:25:00 +01:00
KtorZ
9986bc6bfd Remove duplication between docs & compile
And move some logic out of project/lib to be near the CheckedModule
  instead. The project API is already quite heavy and long, so making it
  more lightweight is generally what we want to tend to.
2024-03-15 00:05:39 +01:00
KtorZ
1caed3e87c Use BTreeSet instead of HashSet whenever possible. 2024-03-14 23:08:39 +01:00
Matthias Benkort
3f254dbe6b Merge pull request #875 from aiken-lang/rvcas/expect_opaque
block expects on opaque types
2024-03-14 19:43:47 +01:00
KtorZ
fd50473a32 Only compile modules the project depends on
This changes ensure that we only compile modules from dependencies
  that are used (or transitively used) in the project. This allows to
  discard entire compilation steps at a module level, for modules that
  we do not use.

  The main goal of this change isn't performances. It's about making
  dependencies management slightly easier in the time we decide whether
  and how we want to manage transitive dependencies in Aiken.

  A concrete case here is aiken-lang/stdlib, which will soon depend on
  aiken-lang/fuzz. However, we do not want to require every single
  project depending on stdlib to also require fuzz. So instead, we want
  to seggregate fuzz API from stdlib in separate module, and only
  compile those if they appear in the pruned dependency graph.

  While the goal isn't performances, here are some benchmarks analyzing
  the performances of deps pruning on a simple project depends on a few
  modules from stdlib:

	Benchmark 1: ./aiken-without-deps-pruning check scratchpad
	  Time (mean ± σ):     190.3 ms ± 101.1 ms    [User: 584.5 ms, System: 14.2 ms]
	  Range (min … max):   153.0 ms … 477.7 ms    10 runs

	Benchmark 2: ./aiken-with-deps-pruning check scratchpad
	  Time (mean ± σ):     162.3 ms ±  46.3 ms    [User: 572.6 ms, System: 14.0 ms]
	  Range (min … max):   142.8 ms … 293.7 ms    10 runs

  As we can see, this change seems to have an overall positive impact on
  the compilation time.
2024-03-14 19:41:50 +01:00
KtorZ
038c5b2d34 Rewrite run_n_times to not be recursive but mutates arguments.
We reach a stack-overflow for n > 2000 otherwise. Mutation works well here and is a valid use-case.
2024-03-14 14:18:38 +01:00
KtorZ
0343aeca34 Fix remaining insta snapshots. 2024-03-14 11:06:53 +01:00
rvcas
7af4ef53ab feat: block expects on opaque types 2024-03-13 20:17:54 -04: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
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
80a9393db7 Add --include-dependencies to 'aiken docs'
Fixes #867.
2024-03-09 22:35:38 +01:00
KtorZ
6ba74125c7 Remove extra newlines in test report and only print coverage on success. 2024-03-09 20:32:42 +01:00
KtorZ
22b86a5f82 Add --max-success for running more or less prop runs on demand. 2024-03-09 19:17:57 +01: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
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
rvcas
cb0ae0c074 feat: impl some conversion methods on CheckedModule 2024-03-08 19:19:07 -05:00
rvcas
2b5ed95df5 feat: serialize as cbor 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
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
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
microproofs
eb07365e73 fix tests 2024-03-08 00:12:44 -05:00
microproofs
275db2fd11 update tests 2024-03-08 00:12:44 -05:00
rvcas
fab6d5aff7 chore: fix fmt 2024-03-07 19:32:33 -05:00
KtorZ
8e558d893f Only reify unit tests assertions on failure. 2024-03-07 19:07:55 +01:00
KtorZ
0d599f7e2d re-add missing newline after test blocks. 2024-03-07 18:28:21 +01:00