Skip to content

Commit

Permalink
Renamed tests for ParseResults. Modified check to occur when accessin…
Browse files Browse the repository at this point in the history
…g ParseResults.context and removed checks in constructor
  • Loading branch information
christopherngutierrez committed Aug 2, 2024
1 parent 2b8112a commit 389b39b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ by the regulated industries and government.
Most of the FHE schemes of today perform the computation using very large
polynomial rings, thus requiring considerable compute power and data
movement between main memory and the CPU's registers. HERACLES improves
the performance of FHE by accelerating the computation over the large
the performance of FHE by accelerating the computation over the large
polynomials and optimizing the data movement involved in the computation.

HERACLES introduces a new Polynomial Data type which does not exist in
Expand All @@ -30,10 +30,10 @@ new implementations of FHE schemes and also integrate with existing libraries.

<p>
<img src="docs/images/HERACLES_SDK_Integration_3rd_Party.png" align="left" width="600" />

The Encrypted Computing SDK (or HERACLES SDK) will realize a multistage
transformation (compiler) pipeline, inspired by the
[LLVM Compiler Infrastructure](https://llvm.org/). We have adopted a
[LLVM Compiler Infrastructure](https://llvm.org/). We have adopted a
modular approach based on language independent intermediate
representations (IR) that promotes the separation of concerns at each
stage of the pipeline and allowing for dedicated transformations and
Expand Down Expand Up @@ -64,21 +64,21 @@ transpilers.

We are currently at Phase 1, more specifically developing the P-ISA Tools
component which comprises three main tools, a) Kernel Generator, b) Program
Mapper, and c) Functional Modeler Simulator.
Mapper, and c) Functional Modeler Simulator.
Each tool in this repo is self contained and has its own local README.

Current development is focussed on the Kernel Generator.
Follow the instructions [here](./kerngen) to start experimenting with it.

# Contributing
Intel P-ISA Tools project welcomes external contributions through pull
Intel P-ISA Tools project welcomes external contributions through pull
requests to the `main` branch.

Please refer to the [Contributing](CONTRIBUTING.md) and
[Code of Conduct](CODE_OF_CONDUCT) documents for additional information on
the contribution acceptance guidelines.

We use signed commits, please remember to sign your commits before making a
We use signed commits, please remember to sign your commits before making a
pull request. See instructions
[here](https://docs.github.com/en/github/authenticating-to-github/managing-commit-signature-verification/signing-commits)
for how to sign commits.
Expand All @@ -90,7 +90,7 @@ pre-commit install
pre-commit run --all-files
```

Please run the tests provided in each of the components and make sure
Please run the tests provided in each of the components and make sure
the tests pass.

# Feedback
Expand Down
9 changes: 1 addition & 8 deletions kerngen/high_parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ParseResults:
"""Queryable class about parse results"""

def __init__(self, iterable, symbols_map):
self._commands = ParseResults._validate_commands(list(iterable))
self._commands = list(iterable)
self._symbols_map = symbols_map

@staticmethod
Expand All @@ -46,13 +46,6 @@ def _get_context_from_commands_list(commands):
)
return context_list[0]

@staticmethod
def _validate_commands(commands):
"""Validate commands. Raises a LookupError if context is missing."""
ParseResults._get_context_from_commands_list(commands)
# Todo: add other checks here
return commands

@property
def context(self):
"""Return found context"""
Expand Down
10 changes: 6 additions & 4 deletions kerngen/tests/test_kerngen.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,23 +98,25 @@ def test_invalid_scheme(kerngen_path):
assert result.returncode != 0


def test_parse_results_missing_context_in_constructor():
def test_parse_results_missing_context():
"""Test ParseResults constructor for missing context"""
with pytest.raises(LookupError) as e:
ParseResults([], {})
parse_results = ParseResults([], {})
print(parse_results.context) # will generate a lookup error
assert "No Context found for commands list for ParseResults" in str(e.value)


def test_parse_results_multiple_context_in_constructor():
def test_parse_results_multiple_context():
"""Test ParseResults constructor for multiple context"""
with pytest.raises(LookupError) as e:
ParseResults(
parse_results = ParseResults(
[
Context(scheme="BGV", poly_order=8192, max_rns=1),
Context(scheme="CKKS", poly_order=8192, max_rns=1),
],
{},
)
print(parse_results.context) # will raise a LookupError
assert "Multiple Context found in commands list for ParseResults" in str(e.value)


Expand Down

0 comments on commit 389b39b

Please sign in to comment.