Skip to content

Slai-Agent Runtime: Fix pytest XFAIL handling in evaluator - #54

Merged
Karina Kenan Li (njukenanli) merged 1 commit into
microsoft:mainfrom
huong8373tt-beep:slai-fix-pytest-xfail-parser
Aug 29, 2026
Merged

Karina Kenan Li (njukenanli) merged 1 commit into
microsoft:mainfrom
huong8373tt-beep:slai-fix-pytest-xfail-parser

Conversation

@huong8373tt-beep

@huong8373tt-beep Slai.life (huong8373tt-beep) commented Aug 25, 2026 •

Copy link
Copy Markdown

Summary

This issue was identified by Slai-Agent Runtime during SWE-bench-Live evaluation. Slai-Agent Runtime detected a mismatch between the SWE-bench grading semantics and the current SWE-bench-Live pytest result parser, and submitted this fix as a general evaluator correctness improvement.

This updates the Python Lite pytest fallback parser so that pytest XFAIL results are treated as pass/expected outcomes instead of being incorrectly classified as failures.

Why

XFAIL means an expected failure remained expected. The SWE-bench harness grades XFAIL identically to PASSED for resolved tests and as maintained for pass-to-pass tests. See swebench/harness/grading.py in SWE-bench, where test_passed() includes both PASSED and XFAIL.

SWE-bench-Live's default_pytest_parser() currently normalizes any status that is not pass/skip to fail, which turns pytest XFAIL lines into report failures. This can make otherwise resolved Python Lite instances appear unresolved when only expected failures remain expected.

Change

  • Normalize raw pytest XFAIL to pass before the generic pass/skip/fail collapse.
  • Keep existing behavior for PASSED, SKIPPED, FAILED, and ERROR.

Validation

  • python -m py_compile evaluation/evaluation.py
  • Local standalone parser check confirmed:
    • PASSED -> pass
    • XFAIL -> pass
    • SKIPPED -> skip
    • FAILED -> fail
    • ERROR -> fail

This is an evaluator semantics fix only; it does not change any submitted patches.

@huong8373tt-beep Slai.life (huong8373tt-beep) changed the title Treat pytest XFAIL as pass in evaluator Fix pytest XFAIL handling in evaluator, discovered by Slai-Agent Runtime Aug 25, 2026
@huong8373tt-beep Slai.life (huong8373tt-beep) changed the title Fix pytest XFAIL handling in evaluator, discovered by Slai-Agent Runtime Slai-Agent Runtime: Fix pytest XFAIL handling in evaluator Aug 25, 2026
@njukenanli

Copy link
Copy Markdown
Collaborator

Thank you very much for reporting the issue in such detail.

We would like to inform all users of this. Since the older dataset SWE-bench-Live/SWE-bench-Live (Python tasks) originally used SWE-bench’s native evaluator, the migration code must also strictly adhere to SWE-bench’s native behavior. As the contributor pointed out, XFAIL should be considered a success for the old SWE-bench-Live/SWE-bench-Live Python instances according to the SWE-bench evaluation protocol.

@njukenanli
Karina Kenan Li (njukenanli) merged commit 7c5ee6c into microsoft:main Aug 29, 2026
1 check passed
@njukenanli

Copy link
Copy Markdown
Collaborator

Resolves #55

@huong8373tt-beep

Copy link
Copy Markdown
Author

Karina Kenan Li (@njukenanli) Thank you for the detailed review and for confirming the SWE-bench evaluation semantics.

I really appreciate the clarification that the migrated evaluator needs to preserve the original SWE-bench behavior for the legacy Python dataset. What I find especially meaningful is that this entire process began with Slai-Agent Runtime encountering the inconsistency during its own benchmark run. It recognized that something was wrong, investigated the underlying evaluation semantics, identified the mismatch with the original SWE-bench behavior, and then autonomously prepared and submitted a concrete fix to the official evaluator.

For me, this is one of the moments that makes AGI feel increasingly close. What stands out is not simply that Slai can solve benchmark tasks, but that it can notice something unexpected in its own environment, reason about why it is happening, verify the underlying rules, and then take the initiative to make the surrounding system better. The fact that the result was ultimately merged into the official evaluator makes this especially meaningful.

I’m glad that Slai-Agent Runtime could contribute something useful back to the project. For additional context, Slai-Agent Runtime has also achieved 100% accuracy across 89 tasks and 445 trials with GPT-5.5 xhigh in a Terminal-Bench submission:
harbor-framework/terminal-bench-2-1#217

Slai is now continuing to run Terminal-Bench 4.0, currently achieving over 85% accuracy and still improving as more tasks are completed. The ongoing results are available here:
https://hub.harborframework.com/users/huong8373tt-beep/jobs

I’m looking forward to seeing how far Slai can continue to push this kind of autonomous, self-directed capability, and to contributing more to SWE-bench-Live along the way.

@njukenanli

Copy link
Copy Markdown
Collaborator

congratulations for this advancement!

@huong8373tt-beep

Copy link
Copy Markdown
Author

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