Skip to content

sync upstream -> midstream#104

Merged
saichandrapandraju merged 3 commits intoopendatahub-io:mainfrom
trustyai-explainability:main
Apr 14, 2026
Merged

sync upstream -> midstream#104
saichandrapandraju merged 3 commits intoopendatahub-io:mainfrom
trustyai-explainability:main

Conversation

@saichandrapandraju
Copy link
Copy Markdown
Collaborator

@saichandrapandraju saichandrapandraju commented Apr 14, 2026

Summary by CodeRabbit

  • Bug Fixes

    • Updated attack success rate metrics to display as ratios (0–1) instead of percentages, providing consistent metric representation across evaluations.
  • Tests

    • Updated evaluation tests to verify the new metric ratio format.

saichandrapandraju and others added 3 commits April 14, 2026 14:27
Changed the representation of attack success rate metrics from percentage to ratio in the GarakAdapter class.
- Extract _pct_to_ratio() helper to avoid duplicating round(v/100, 4)
- Clarify log message with "(ratio)" so operators know 0.25 means 25%
- Add metric_type == "ratio" assertions in both _parse_results tests

Made-with: Cursor
fix: normalize evalhub metrics to 0-1 ratio scale for UI compatibility
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 14, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

The pull request refactors attack success rate (ASR) metrics from percentage representation to ratio representation (0–1 scale). A new helper method _pct_to_ratio() converts percentage values (0–100) to normalized ratios by dividing by 100 and rounding to 4 decimal places. This conversion is applied to attack_success_rate and per-probe ASR metrics during result parsing, and to overall score normalization. The success log output format is updated to label the result as a ratio instead of appending a percentage symbol. Corresponding test assertions are updated to expect ratio-type metrics and converted numeric values.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Issues

Input validation gap in _pct_to_ratio(): The private method accepts any float without validating that input values fall within expected bounds (0–100). Negative or excessively large values will produce nonsensical ratios. Add range validation or document the assumption that inputs are pre-validated.

🚥 Pre-merge checks | ✅ 1 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'sync upstream -> midstream' is vague and does not clearly describe the actual changes made to the codebase. Replace with a specific title describing the core change, e.g., 'Convert ASR metrics from percentage to ratio representation' or 'Normalize attack success rate to 0-1 ratio format'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@saichandrapandraju saichandrapandraju changed the title sync upstream -> downstream sync upstream -> midstream Apr 14, 2026
@saichandrapandraju saichandrapandraju merged commit ae9ebd7 into opendatahub-io:main Apr 14, 2026
5 of 7 checks passed
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