-
Notifications
You must be signed in to change notification settings - Fork 14
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
Couldn't fix QuixBugs lis bugs #15
Comments
Hi :), thanks for reaching us. |
Hello, I tried to run your scripts. It just hangs at program.py exec_cmd() code: |
Then could you please try it with the recent version of pyggi? |
OK, which branch I should use? I used master branch in https://github.com/coinse/pyggi |
I merged a PR into the master branch yesterday, so you can use the current master branch! |
I just pulled the latest version. But it's still hanging on Popen. I think def exec_cmd(self, cmd, timeout=15): |
Oh, right. The StatusCode class is changed into RunResult class (21b1fbc), so the pyggi-quixbug script should be revised. Sorry for the inconvenience.
|
|
Are you using Windows? |
No I am using Mac |
that's weird... what is the value of |
I just printed cmd. It's None. Because |
I just found that the quixbug script on GitHub is completely not compatible with the current version of pyggi.
def run(self, timeout=10):
try_compile = self.exec_cmd(COMPILE_COMMAND.format(self.algo.upper()), timeout)
if try_compile.stderr:
result = self.__class__.Result(
status_code=StatusCode.PARSE_ERROR,
elapsed_time=try_compile.elapsed_time,
stdout=try_compile.stdout,
stderr=try_compile.stderr)
else:
failing = 0
elapsed_time = 0
for test in self.tests:
test_in, test_out = test
algo_input = ['"'+json.dumps(arg)+'"' for arg in copy.deepcopy(test_in)]
try_test = self.exec_cmd(TEST_COMMAND.format(self.algo, ' '.join(algo_input)), timeout)
#print(TEST_COMMAND.format(self.algo, ' '.join(algo_input)))
#print(try_test.stdout.strip(), str(test_out))
if try_test.stdout is None or try_test.stdout.rstrip() != str(test_out):
failing += 1
elapsed_time += try_test.elapsed_time if try_test.elapsed_time else timeout
result = self.__class__.Result(
status_code=StatusCode.NORMAL,
elapsed_time=elapsed_time,
stdout=str(failing),
stderr='')
return result
def evaluate_patch(self, patch, timeout=15):
# apply + run
self.apply(patch)
return_code, stdout, stderr, elapsed_time = self.exec_cmd(self.test_command, timeout)
if return_code is None: # timeout
return RunResult('TIMEOUT')
else:
result = RunResult('SUCCESS', None)
self.compute_fitness(result, return_code, stdout, stderr, elapsed_time)
assert not (result.status == 'SUCCESS' and result.fitness is None)
return result To use the current pyggi version, Instead of overriding ex) class MyLineProgram(LineProgram):
def evaluate_patch(self, patch, timeout=15):
# apply the patch
self.apply(patch)
# try compile
return_code, stdout, stderr, elapsed_time = self.exec_cmd(COMPILE_COMMAND.format(self.algo.upper()), timeout)
if stderr:
return RunResult('Compile Error')
else:
failing = 0
elapsed_time = 0
for test in self.tests: # self.tests is defined in the __main__ function
test_in, test_out = test
algo_input = ['"'+json.dumps(arg)+'"' for arg in copy.deepcopy(test_in)]
return_code, stdout, stderr, elapsed_time = self.exec_cmd(TEST_COMMAND.format(self.algo, ' '.join(algo_input)), timeout)
if stdout is None or stdout.rstrip() != str(test_out):
failing += 1
elapsed_time += elapsed_time if elapsed_time else timeout
return RunResult('<something>', fitness=failing) I haven't run this code, so it may have some minor issues, but I think you'll get the idea. |
Hello, we saw in your paper that your code could fix bugs in QuixBugs lis with line mode with java. I wonder what parameters we should set to get the results? Currently we ran with epoch 30 and iter 100. We got no patch found. If we ran with 50 epochs, we met with infinite loop and the program just went frozen. Thank you very much!
The text was updated successfully, but these errors were encountered: