Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module Constants #127

Merged
merged 17 commits into from
Jun 3, 2024
Merged

Module Constants #127

merged 17 commits into from
Jun 3, 2024

Conversation

JulianGCalderon
Copy link
Contributor

@JulianGCalderon JulianGCalderon commented May 7, 2024

closes #75

Adds support for simple literal constants:

mod Example {
	const foo: i32 = 10;
	const var: i64 = 5;

	fn main() -> i32 {
		let vix: i32 = foo + 5;
		return vix + (var as i32); // returns 20
	}
}

The constant reference is resolved in the IR, by replacing it by the constant value.

@JulianGCalderon JulianGCalderon changed the base branch from main to fix_main May 7, 2024 18:38
Copy link

github-actions bot commented May 7, 2024

Benchmarking factorial

Compiling factorial (factorial.con)
Finished release in 30.102087ms
Running 5000000 iterations
Using input value: 20
Concrete Result = 2432902008176640000 Time taken : 62.82 ms
Rust Result = 2432902008176640000 Time taken : 61.87 ms

Benchmarking fib

Compiling fib (fib.con)
Finished release in 25.490309ms
Running 5000 iterations
Using input value: 20
Concrete Result = 6765 Time taken : 135.98 ms
Rust Result = 6765 Time taken : 85.26 ms

@codecov-commenter
Copy link

codecov-commenter commented May 7, 2024

Codecov Report

Attention: Patch coverage is 68.88889% with 28 lines in your changes are missing coverage. Please review.

Project coverage is 62.39%. Comparing base (bc72356) to head (350d3f6).

Files Patch % Lines
crates/concrete_ir/src/lowering.rs 68.88% 28 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #127      +/-   ##
==========================================
+ Coverage   61.97%   62.39%   +0.41%     
==========================================
  Files          25       25              
  Lines        4610     4696      +86     
==========================================
+ Hits         2857     2930      +73     
- Misses       1753     1766      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Base automatically changed from fix_main to main May 8, 2024 10:00
@JulianGCalderon JulianGCalderon force-pushed the module-constants branch 3 times, most recently from 6f655d1 to b2f12bd Compare May 9, 2024 15:01
@JulianGCalderon JulianGCalderon changed the base branch from main to fix-examples May 9, 2024 20:03
Base automatically changed from fix-examples to main May 10, 2024 10:48
@JulianGCalderon JulianGCalderon marked this pull request as ready for review May 10, 2024 14:40
@igaray igaray added this pull request to the merge queue Jun 3, 2024
Merged via the queue into main with commit dceb27e Jun 3, 2024
6 checks passed
@igaray igaray deleted the module-constants branch June 3, 2024 20:41
kenarab added a commit to kenarab/concrete that referenced this pull request Jun 3, 2024
kenarab added a commit to kenarab/concrete that referenced this pull request Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Codegen] Implement Module level Constants
4 participants