Skip to content

fix(xtest): show the faster-tail p-value beside an improvement - #643

Merged
dmihalcik-virtru merged 2 commits into
mainfrom
DSPX-4372-fix-report-p-tail
Oct 14, 2026
Merged

dmihalcik-virtru merged 2 commits into
mainfrom
DSPX-4372-fix-report-p-tail

Conversation

@dmihalcik-virtru

@dmihalcik-virtru dmihalcik-virtru commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Problem

The benchmark report's p (BH) column always showed the slower-tail p-value (p_adjusted / p_value). For a real speedup that tail is ~1, so an IMPROVED row read e.g. ratio 0.50 … p 1.000 … IMPROVED — the p-value contradicted the verdict on the same row. The verdict itself was correct (it already used p_adjusted_faster); only the rendering was wrong.

Fix

_p_cell now shows the one-sided tail in the direction of the observed ratio: the faster tail when ratio < 1, the slower tail otherwise, each preferring the BH-adjusted value and falling back to unadjusted (controls stay outside the BH families). The table footer notes that p is one-sided.

Ported from the closed #621 branch. Stage-1 follow-up to #625 (DSPX-4372).

Tests

New offline xtest/test_bench_report.py (added to the check.yml harness list): improvement → faster tail, slowdown/no-change → slower tail, unadjusted fallback, <0.001 floor, NaN → -.

Note: the check.yml list edit touches the same lines as #640 (which adds test_bench_config.py); whichever lands second needs a trivial rebase.

Summary by CodeRabbit

  • Bug Fixes
    • Performance reports now show the p-value for the observed direction of change: faster for improvements and slower for regressions or no change. The footer clarifies that p-values are one-sided.
  • Tests
    • Added offline coverage for report p-values, including adjusted and unadjusted values, very small values, and empty comparisons.
    • Expanded the offline test run to include benchmark measurement, runner, and report tests.

@dmihalcik-virtru
dmihalcik-virtru requested review from a team as code owners October 8, 2026 19:41
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0801e246-cba1-4444-929f-c684e1c40765
📥 Commits

Reviewing files that changed from the base of the PR and between 9c8fd0e and fc70592.

📒 Files selected for processing: 3
  • .github/workflows/check.yml
  • xtest/perf/report.py
  • xtest/test_bench_report.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The report now selects a one-sided p-value based on the observed ratio. New offline tests cover p-value selection and formatting, and the workflow runs those tests.

Changes: P-value reporting

Layer / File(s) Summary
P-value display and validation
xtest/perf/report.py, xtest/test_bench_report.py, .github/workflows/check.yml
The report selects the faster-tail p-value when the ratio is below 1 and the slower-tail value otherwise. Tests cover tail selection, fallback values, tiny values, and empty comparisons. The offline workflow includes the report tests.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: elizabethhealy

Merge Risk: ⚪ Minimal · up to fc705

The supplied evidence identifies no issue that should block merging; complete the normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 2 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: displaying the faster-tail p-value for benchmark improvements.
Linked Issues check Passed The only directly linked issue is #621. Issue #621 is closed and supplies historical context only. No active directly linked issue provides coding requirements for this pull request.
Out of Scope Changes check Passed The changes stay within the stated benchmark-report scope. xtest/perf/report.py selects the one-sided tail and adds the footer note. xtest/test_bench_report.py tests the rendering cases. `.github/…
Full details: Docstring Coverage

Explanation

Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 2 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A rabbit checks the p-value line
One tail for ratios under one
Another when they rise above
Tests hop through each fallback case
The workflow runs them in the sun

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

@dmihalcik-virtru
dmihalcik-virtru force-pushed the DSPX-4372-fix-report-p-tail branch from 1d7ca04 to d9609b0 Compare October 13, 2026 14:01
@sonarqubecloud

Copy link
Copy Markdown

@dmihalcik-virtru
dmihalcik-virtru merged commit 0e556f9 into main Oct 14, 2026
22 checks passed
@dmihalcik-virtru
dmihalcik-virtru deleted the DSPX-4372-fix-report-p-tail branch October 14, 2026 10:58
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