-
Notifications
You must be signed in to change notification settings - Fork 150
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
Adding --proof-hint
flag to PyK KRun
#4532
Conversation
Co-authored-by: Tamás Tóth <tothtamas28@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me post revision but let @tothtamas28 review before you merge!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've left a few comments for the current approach (i.e. (3) from the list). However, I personally think (1) is a better solution, which you can implement as follows:
def run_proof_hint(...) -> bytes:
args = _build_arg_list(...)
...
proc_res = subprocess.run(args, text=False, stdout=subprocess.PIPE, ...)
return proc_res.stdout
This is easy to implement and test, gives you a better interface, and does not prevent us from dropping run_process
later.
The problem with that approach is that we have to have almost all logic duplicated just to get a different way to output the program instead of only modifying the function that outputs the result itself. I can understand that this makes things more coupled right now for a possible future refactoring, but I'm sure that in future refactoring, we'll not need to have hundreds of code duplicated. |
I don't think there's a lot to duplicate honestly, the interesting part is
That's a significant difference in my opinion.
It'd be awesome if we could do
That's my point, I'd rather have some code duplication than dependency to deprecated code. I'm going to be able deal with |
My 2c is that this is a perfectly legitimate duplication to introduce. The proof hints pipeline behaves very differently to the other ways that krun works, so it's legitimate to fully separate their python entrypoints. |
Waiting for final approval from Tamas on design choices
@tothtamas28, can you please take a new look at this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add an integration test for run_proof_hint
.
@tothtamas28 It Wouldn't be good to already support |
I'd like to keep these two APIs separate because
|
I don't see why that'd be the case: you can use the proof hints feature by calling |
making `run_proof_hint` even more generic regarding arguments list
Hey @tothtamas28, I believe I've addressed all your comments. Can you please take a new look at it? |
…ng the argument explicit in `_krun` callsite
This PR aims to add the
--proof-hint
krun's flag to PyK infrastructure so we can use it in semantics that currently relies on PyK for building itself and execute programs.Fixes: https://github.com/Pi-Squared-Inc/pi2/issues/1725