Commit Graph

247 Commits

Author SHA1 Message Date
Alex Ozdemir
5fc57d6664 ckpt2, also parse/serialize for Computation, Functions 2022-05-30 15:38:27 -07:00
Alex Ozdemir
a2e98bcc98 ckpt 2022-05-29 11:11:21 -07:00
Clive2312
3a2658a264 need to scalarize array term 2022-05-27 08:07:52 +00:00
Clive2312
050b5b5ae7 updated C frontend to generate correct IR 2022-05-27 07:43:07 +00:00
Clive2312
51dc75c83a cleaning 2022-05-27 00:05:59 +00:00
Clive2312
7e7aa20b16 uncleaned with lots of print statements 2022-05-26 23:35:10 +00:00
Clive2312
7337bd4023 test 2022-05-26 17:15:19 +00:00
Edward Chen
f01c7e8fb6 test 2022-05-26 13:13:12 -04:00
Clive2312
42bee8b299 merged from pull 2022-05-26 07:38:01 +00:00
Edward Chen
7c3ffacb1d merged master 2022-05-25 10:04:39 -04:00
Edward Chen
1821dc7721 merged master 2022-05-25 09:44:23 -04:00
Edward Chen
199da498ae why such large output 2022-05-25 02:48:10 -04:00
Edward Chen
8a9fd407d3 test 2022-05-25 02:45:21 -04:00
Edward Chen
01d5b3bcfa updated tuple pass 2022-05-25 02:42:24 -04:00
Edward Chen
f29eec8d7b fixed return type for calls 2022-05-24 21:32:42 -04:00
Edward Chen
094b45e76b test 2022-05-23 15:06:58 -04:00
Edward Chen
e36957bbc1 minor 2022-05-23 01:34:29 -04:00
Edward Chen
a801eb98cc test 2022-05-21 00:17:13 -04:00
Edward Chen
573326904e timing opt 2022-05-20 15:14:53 -04:00
Edward Chen
03bd078b67 minor 2022-05-20 14:19:43 -04:00
Edward Chen
7693d30975 Updates to C Frontend (#67)
Supporting:
- structs
- ptrs
- n-dimension arrays
- nested structs
- typedef
- sizeof
- shift operations

Benchmarks:
- Original HyCC kmeans testcase (without recursion).
- Original HyCC gauss testcase.

Co-authored-by: Alex Ozdemir <aozdemir@hmc.edu>
Co-authored-by: Ubuntu <ubuntu@neptune2.maas>
2022-05-20 02:20:36 -04:00
Edward Chen
ee43df20e2 memory explosion 2022-05-19 22:47:11 -04:00
Edward Chen
4a2255c0e5 testing calls 2022-05-18 13:17:52 -04:00
Edward Chen
03b1ed7fc1 function calls with stack pointers work! 2022-05-17 22:53:20 -04:00
Alex Ozdemir
c1293464d2 Precomputations (or, as-known-for-proofs, witness extension) (#80)
Co-authored-by: Riad S. Wahby <rsw@jfet.org>
2022-05-17 08:54:04 -07:00
Edward Chen
341204d59e playground update 2022-05-16 11:25:57 -04:00
Edward Chen
45f077f59e stuck 2022-05-14 18:24:47 -04:00
Edward Chen
4d0923847f checkpoint 2022-05-14 17:31:04 -04:00
Edward Chen
f7995c5a8b merge with master 2022-05-04 17:33:50 -04:00
Riad S. Wahby
a3fa232ba2 improve memory consumption ; add Z# strict unary op, ternary ?:, and type aliases (#77)
* update TODO

* add quiet mode to zxc

* Drop and garbage collection

This commit adds Drop instances and related functionality that force
garbage collection at life cycle end of various structs that contain
Terms.

I didn't implement Drop for Computation because its Terms are generally
moved into a converter. This means that back-ends are responsible for
garbage collecting (see new functionality in ILP, R1cs, and ABY).

* collect the cfold table, too

* prevent double-panic as a result of garbage_collect()

* z# parser: zx is a default extension too

* update Cargo.lock

* strictness un-op #()

also added err messages for asserts and ?: ternary support from ZoK upstream

* for assignments, strict rhs => strict lhs

* zsharp: type definitions WIP

Still missing monomorphization.

* type defns: generic inference

* struct monomorphization for type aliased structs

* different approach: no monomorphization, just canonicalize aliases

* canonicalize struct names

* typedef tests

things work except that importing an alias and not its referent breaks typechecking

* add error message about needing to import referent structs

* update hashconsing pointer in Cargo.toml

* maybe_garbage_collect should also return early when panicking

Co-authored-by: Alex Ozdemir <aozdemir@hmc.edu>
2022-05-04 10:08:23 -07:00
Edward Chen
c9ec54bc1a broken test case 2022-04-28 23:37:27 -04:00
Edward Chen
4e49788723 broken playground 2022-04-27 21:17:16 -04:00
Edward Chen
a8b9e9f11d db test case works 2022-04-27 02:10:24 -04:00
Edward Chen
b6932d1dbf adding db test case 2022-04-23 17:27:50 -04:00
Edward Chen
3158539b86 mnist test 2022-04-21 17:19:43 -04:00
Edward Chen
5a10303dc5 updated constant folding parameterization 2022-04-21 12:20:52 -04:00
Edward Chen
3586f31c48 working gauss testcase for c frontend 2022-04-21 11:52:08 -04:00
Edward Chen
99e1b11a2e updated cfold and gauss test case 2022-04-21 00:03:32 -04:00
Edward Chen
67624c723a merged master 2022-04-19 15:55:19 -04:00
Edward Chen
2ea11543c1 can't return struct 2022-04-19 15:52:24 -04:00
Alex Ozdemir
0b42f26089 Improve non-recursive type-checking (#74)
In *non-recursive* type-checking, perhaps better called *type computing*
we perform a minimal traversal in order to compute the type of a term,
without recursively type-checking it. Informally, we assume it is well
typed, and do the minimal amount of work needed to compute its type.

Two improvements:
1. No longer implemented with recursion.
2. Caches all intermediate results.

Implementation:
* `check_dependencies(Term) -> Vec<Term>`: maps a terms to the immediate
  children of it whose types are needed to compute its type.
* `check_raw_step(Term, TypeTable) -> Sort`: assumes those children have
  their types in the table, and computes this term's type.
* `check_raw`: glues the two above functions together into a suitable
  traversal. Similar to `rec_check_raw`, but the traversal isn't total.

Significance:

Previously, we had a non-recursive implementation for array stores that
*didn't cache intermediate results* which could cause quadratic
type-checking time (if the type-check callee was doing a top-down
traversal). Edward sent me a benchmark that was experiencing this,
resulting in 74.1% of total compilation time being spent type-checking.
Now it's down to 0.4% of total compilation time.
2022-04-11 11:41:02 -07:00
Edward Chen
1e1bc176a6 working on gauss test case 2022-04-06 23:51:57 -04:00
Edward Chen
63e3bea1b8 Adding benchmark scripts and logging for ABY backend (#72) 2022-04-06 04:04:52 -04:00
Edward Chen
0c5d1e74d4 testing gauss 2022-04-01 16:58:40 -04:00
Edward Chen
fa01772ef5 typedef 2022-03-31 13:41:32 -04:00
Riad S. Wahby
8c8e704914 field flexibility ; add limit for linearity reduction (#66)
Co-authored-by: Alex Ozdemir <aozdemir@hmc.edu>
2022-03-25 15:03:09 -07:00
Edward Chen
dd353e62b1 ptr stores 2022-03-24 11:12:46 -04:00
Edward Chen
740a2851fe working kmeans test case and c_frontend 2022-03-24 03:39:18 -04:00
Edward Chen
e0a2ec838a minor 2022-03-23 16:55:01 -04:00
Edward Chen
9111b6f49b merge with remote 2022-03-23 03:19:52 -04:00