fix: resolve false-positive run failures#154
Open
coketaste wants to merge 1 commit into
Open
Conversation
…rmance metrics are valid The post-run log scanner greps the entire run log, including a model's own generated stdout, so a generative benchmark (e.g. an LLM writing "ValueError:" in a code sample) could flip an otherwise-successful run to FAILURE. Since the scan can't distinguish framework diagnostics from model output, valid extracted performance metrics now take priority over a pattern match; the match is still surfaced (in yellow) for triage instead of silently dropped. Fixes ROCM-27774. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Pull request overview
This PR adjusts post-run status determination so that when valid performance metrics are extracted, a log error-pattern match no longer flips the run to FAILURE (the match is still surfaced for triage). This mitigates false failures when generative model output includes error-like substrings.
Changes:
- Introduces
resolve_run_status()to centralize status/reason selection with the new “performance wins” priority. - Updates
ContainerRunnerstatus logic to useresolve_run_status()and print SUCCESS-with-error-match in yellow. - Adds unit tests and updates documentation to reflect the revised log-scan behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/unit/test_container_runner_helpers.py | Adds unit tests covering the new status resolution rules. |
| src/madengine/execution/container_runner.py | Refactors status assignment/printing to use resolve_run_status() and implement the new priority. |
| src/madengine/execution/container_runner_helpers.py | Adds resolve_run_status() helper with documented precedence rules. |
| docs/configuration.md | Updates documentation for log error pattern scan behavior when performance metrics are present. |
Comments suppressed due to low confidence (1)
src/madengine/execution/container_runner.py:1876
- has_performance calls performance_value.strip() twice and will raise if performance_value is not a string. Computing the stripped value once (and guarding type) avoids duplicate work and makes status determination more robust.
has_performance = bool(
performance_value
and performance_value.strip()
and performance_value.strip() != "N/A"
)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1887
to
+1889
| skip_perf_collection = bool( | ||
| self.additional_context.get("skip_perf_collection", False) | ||
| ) |
Comment on lines
+188
to
+192
| return ( | ||
| "SUCCESS", | ||
| "performance metrics found; error pattern also matched in logs " | ||
| "(likely model-generated output, not treated as failure)", | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
log for error substrings, including a model's own generated stdout. A
generative benchmark (e.g. an LLM writing
ValueError:inside a codesample it generated) could flip an otherwise fully-passing run to
FAILUREeven though valid performance metrics were already recorded.Since the scan can't distinguish framework/harness diagnostics from model
output, valid extracted performance metrics now take priority over a
pattern match. The match is still printed (in yellow) for triage
visibility instead of being silently dropped.
Test plan
tests/unit/test_container_runner_helpers.py— newTestResolveRunStatuscases covering the performance-vs-error-pattern priority (ROCM-27774)
pytest tests/unit -q)