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

Bug in Timing/Frame Dependencies #75

Closed
kalzoo opened this issue Jun 2, 2022 · 6 comments · Fixed by #76
Closed

Bug in Timing/Frame Dependencies #75

kalzoo opened this issue Jun 2, 2022 · 6 comments · Fixed by #76
Labels

Comments

@kalzoo
Copy link
Contributor

kalzoo commented Jun 2, 2022

Hot on the heels of #73 , another bug has been found in how frame blocking is calculated. Two examples are given here, with further explanation below. Can you spot the bug?

Example 1

Hint: there is an additional frame defined in the program, 0 1 "cz", which is not used by any of the instructions.

graphviz (4)

Example 2

graphviz (5)

The problem here is that the change in #73 properly fixed how dependencies are calculated after a blocking instruction, but that blocking instruction must itself block on previous instructions which overlap in frames, and that is not happening.

Specifically/formally:

  1. An instruction which uses a frame must depend on the most-recent user and blockers of the frame, if any. Doing so clears all blockers of the frame and this instruction becomes the most-recent user.
  2. An instruction which blocks but does not use a frame must depend on the most-recent user of the frame. Doing so leaves the most-recent user in place and adds this instruction to a list of most-recent blockers.

Blocking prevents simultaneous use but allows simultaneous blocking.

This approach is akin to a single-writer, multiple-reader lock or queue, where blocking:reading::using:writing.

@notmgsk
Copy link
Contributor

notmgsk commented Jun 6, 2022

Just seeing if I understand the issue:

  • In example 1, the problem is the frame dependency between the start and [1] PULSE 1 "rf" nodes?
  • In example 2, the problem is the missing frame dependency between nodes [1] and [3]?

@kalzoo
Copy link
Contributor Author

kalzoo commented Jun 6, 2022

Example 1 - yep. Example 2 - close! Dependency missing between 1 & 2

@notmgsk
Copy link
Contributor

notmgsk commented Jun 6, 2022

Oh -- 2 is your issue with the quil-spec?

@notmgsk
Copy link
Contributor

notmgsk commented Jun 6, 2022

Admittedly, I didn't think of that problem because I have come to see NONBLOCKING as having an effect on the following instructions.

@kalzoo
Copy link
Contributor Author

kalzoo commented Jun 6, 2022

Oh -- 2 is your issue with the quil-spec?

It’s similar but not quite the same because they do in fact share the used frame. (That being said, I think that might have been a typo in building this example, so in reality yes that might be what I meant to illustrate).

@github-actions
Copy link

github-actions bot commented Jun 8, 2022

🎉 This issue has been resolved in version 0.11.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants