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

Fix tracing function for ParTs #461

Merged
merged 4 commits into from
Jun 16, 2016

Conversation

kikofernandez
Copy link
Contributor

This commit fixes the tracing function for the sequence and extract combinators at the compiler level and runtime level (fixes #393 ).

  • in the ParT runtime library, the sequence combinator was using the wrong runtime type, which has been fixed.
  • this PR removes support of the extract combinator, since the issue closure built after get is subject to stale context #434 affects directly to this combinator. As soon as that issue has been solved, the extract combinator will be re-introduced.
  • the extract combinator has been removed from the documentation until it can be used again!
  • tests have been refactored to work without the use of extract. In order to trigger errors when tracing, most of the tests that rely on futures are run 100 000 times to get enough interaction with the system and trigger the GC often enough

-- assertTrue(this.check_arr[0], "Expected 'true' value in array with index: 0");
-- assertTrue(this.check_arr[this.size],
-- "Exprected 'true' value in array with index: {}", this.size);
-- }
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you need commented codes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

they are not used and will be as soon as the extract is added back

Copy link
Contributor

Choose a reason for hiding this comment

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

Should it be marked as an intentional comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can add a TODO that says TODO: add back as soon as extract combinator works and #434 has been resolved. Is that what you mean?

@@ -42,7 +42,7 @@ This section introduces the Encore grammar by using the BNF-grammar notation and
@(encore/keyword party_par "||")
@(encore/keyword party_seq ">>")
@(encore/keyword party_join "join")
@(encore/keyword party_extract "extract")
@; (encore/keyword party_extract "extract")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should it be marked as an intentional comment?

Kiko Fernandez Reyes added 3 commits May 31, 2016 18:00
the tracing function for the ParT types was not correctly generated and
caused runtime errors. The issues that have been fixed are shown below
and this closes #393:

- fix >> combinator with correct trace function
  the generated trace function was not correct, causing runtime crashes

- fix trace function for extract combinator was not correct and was
  tracing array_types. the trace function of the extract combinator was
  always set to be an array; this is not the case, as that trace
  function is used to indicate the trace function of the returned array.
  the function function gets the runtime base type of party, e.g. `Par
  t` has runtime type `t` and a `Par (Par t)` has runtime type `Par t`,
  since the array will contain `Par t`s.

- fix join combinator. removed assertion. In the following scenario
  (P p1 p2), an assertion tests that the tracing function of p1 and p2
  should be the same. this is not true, as p1 may be a (V 32) and p2 may
  be a (F f), which should have different tracing functions.
refactor tests in ParT to avoid the use of the `extract` function. this
is due to an issue (#434) related to futures. the sequence test omits
the use of extract, and the liftf test has been re-written to avoid that
as well. tests that cannot avoid the use of `extract` have been disabled
and will be re-enable as soon as this works.
@kikofernandez
Copy link
Contributor Author

@PhucVH888 I have added some details to the comments so that others know that the code should not be removed and just needs to be uncommented when #434 is fixed

@kikofernandez
Copy link
Contributor Author

let me know if there is something more to fix

@kikofernandez
Copy link
Contributor Author

@PhucVH888 any other issue regarding this PR?

@kikofernandez
Copy link
Contributor Author

@PhucVH888 what is the status for this PR? Anything to fix?

@kikofernandez
Copy link
Contributor Author

I have been told (by @PhucVH888) that he won't be able to look at this PR this month. I need someone to step up and take a look. Ideally, I would like to fix it, if necessary, before the holidays (this week)


-- TODO: Add this keyword as soon as as issue #434 is fixed
-- ,"extract"

Copy link
Contributor

Choose a reason for hiding this comment

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

If possible, try to avoid having these as reserved keywords as it prevents e.g. methods called extract. We should (in my opinion) strive for the illusion that the combinators are normal functions.

Copy link
Contributor

Choose a reason for hiding this comment

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

(note that you can still write reserved "extract" even though it's not a reserved keyword)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, you are right. Ideally, some of these keywords will disappear once I have time to fix the parametric functions :)

@kikofernandez kikofernandez assigned EliasC and unassigned PhucVH888 Jun 13, 2016
@EliasC
Copy link
Contributor

EliasC commented Jun 15, 2016

I think this looks good, but it is of course hard to verify that everything is actually being traced as intended. The changes do look like proper bug fixes though, so I will merge this tomorrow if no one objects.

@kikofernandez
Copy link
Contributor Author

ping @EliasC

@EliasC EliasC merged commit fc13afe into parapluu:development Jun 16, 2016
@EliasC EliasC deleted the tracing/party branch June 16, 2016 12:55
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.

Error tracing ParTs
3 participants