Skip to content

Add inspection tests to Replicator.elim and V.{make,elim} #367

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

Merged
merged 2 commits into from
Feb 10, 2022

Conversation

tbagrel1
Copy link
Member

@tbagrel1 tbagrel1 commented Feb 7, 2022

Replicator.elim, V.make, and V.elim are implemented with classes so as to enable inlining. With inspection testing, we need to ensure that their final Core form are the same as a manually unrolled recursion.

@tbagrel1 tbagrel1 marked this pull request as ready for review February 9, 2022 14:21
@tbagrel1 tbagrel1 requested a review from aspiwack February 9, 2022 14:54
@tbagrel1
Copy link
Member Author

tbagrel1 commented Feb 9, 2022

For consistency, I added INLINABLE pragmas on every function that should either be inlined in both {elim,make} and manual{Elim,Make}, or not inlined in both contexts.

test/Main.hs Outdated
Comment on lines 29 to 30
vInspectionTests,
replicatorInspectionTests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Divide this list in two testGroups one for data structure tests, and one for inspection tests.

[$(inspectTest $ 'elim3 === 'manualElim3)]

elim3 :: (a %1 -> a %1 -> a %1 -> [a]) %1 -> Replicator a %1 -> [a]
elim3 f r = Replicator.elim f r
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next PR, let's make sure that we can remove the f and the r and still have the inspection test pass.

Tests are now split into "Functional" and "Inspection" groups
@tbagrel1 tbagrel1 force-pushed the tbagrel1/inspection-testing-make-elim branch 2 times, most recently from 14ccb7e to 7bfd57f Compare February 10, 2022 15:19
@tbagrel1 tbagrel1 force-pushed the tbagrel1/inspection-testing-make-elim branch from 7bfd57f to 83b9184 Compare February 10, 2022 15:20
@tbagrel1 tbagrel1 merged commit 409c49f into master Feb 10, 2022
@tbagrel1 tbagrel1 deleted the tbagrel1/inspection-testing-make-elim branch February 10, 2022 16:36
@tbagrel1 tbagrel1 mentioned this pull request Feb 11, 2022
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.

2 participants