Skip to content

fix(report): report eval reads a golden id prefix with a hyphen as golden (#1585) - #1587

Merged
antonwolfy merged 2 commits into
intel:mainfrom
antonwolfy:fix/golden-prefix-hyphen
Dec 3, 2026
Merged

antonwolfy merged 2 commits into
intel:mainfrom
antonwolfy:fix/golden-prefix-hyphen

Conversation

@antonwolfy

@antonwolfy antonwolfy commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

report eval tells golden (static) questions from generated ones by id only: detect_static_prefix took the first id matching ^([a-zA-Z]+-Q)\d+$. A golden set whose prefix has a hyphen never matched, so all its questions were reported as generated. With three golden questions <prefix>001..003 (80/60) and three generated gen-1..3 (50/50):

Prefix Golden (static) on main Generated (dynamic) on main
onetbb-Q 3, 80.0 / 60.0, +20.0 3, 50.0 / 50.0, +0.0
intel-performance-skills-Q 0, — 6, 65.0 / 55.0, +10.0

The Dynamic vs Static breakdown, the agreement line and the Q&A JSON source field compared the wrong groups. The pattern is now ^(.+-Q)\d+$, the first option of the issue. The other option, a golden marker carried from the questions file into the eval record, changes a persisted format and every writer, so it is not part of this PR.

A generated id must not match: none of the id generators in dokimi/dokimi/ emits an id ending in -Q<digits> (git grep -n 'Q[0-9]' finds only a comment), and gen-1 has no such suffix.

Closes #1585

Changes

  • dokimi/dokimi/report/eval_report.py: detect_static_prefix matches ^(.+-Q)\d+$, compiled once at module level as _STATIC_ID_RE (re is imported at module level instead of inside the loop). The ASK handling (a non-ASK match wins over an ASK one) is unchanged. single_condition_report.py calls the same function and needs no change.
  • dokimi/tests/test_report_golden_prefix.py: generate_report on the issue's input for onetbb-Q and intel-performance-skills-Q (summary rows and Q&A source), the one-condition page's source, and detect_static_prefix on both ids and on non-matching ids.
  • Changelog fragment (Fixed).

Risk

An id ending in -Q<digits> with any non-empty prefix is now golden, where only a letters-only prefix was. An eval file whose generated ids end that way would now count them as golden; none of dokimi's generators writes such ids. The report eval output for a letters-only prefix is unchanged.

Open #1523 changes eval_report.py too, in generate_report and a sidecar helper, not in detect_static_prefix. It conflicts with main alone in that file, so it is its own to rebase; this branch adds no conflict of its own with it.

Testing

On a Linux review host, at 574759b7 (on main badfd39):

  • make ci-local: 38 passed, 0 failed, 16 skipped (steps that need another job's matrix, micromamba, semgrep, docker or the network). 34480 tests passed, 28 skipped.
  • On main's code the new test file gives 3 failed, 5 passed; the first failure is the Q&A source of intel-performance-skills-Q001: 'dynamic' where 'static' is expected.
  • Mutants: dropping the \d+$ of the pattern fails the detect_static_prefix cases intel-performance-skills-Qx and intel-performance-skills-Q (2 failed); a pattern ^(.+-?)\d+$ fails the cases gen-1, onetbb-Q001 and intel-performance-skills-Q001 (3 failed).
  • The summary-row assertions read the row cell by cell (count, both means, delta as numbers); with the old letters-only pattern restored, 3 tests of the file fail (the two hyphenated-prefix cases and the one-condition page).
  • Not run: Python 3.11, 3.12 and 3.14.

Open questions

None.

Revert

A plain revert restores the letters-only pattern. Nothing is stored.

Checklist

  • Tests added/updated and pytest passes
  • ruff, mypy, and schema checks pass
  • Docs updated (or N/A) — see the docs-drift checklist in CONTRIBUTING.md
  • Self-reviewed per "Before opening a PR" in AGENTS.md
  • Each new raise/exit and test names the doc, contract or issue it traces to
  • No ad-hoc run artifacts committed
  • New files carry the SPDX license header (or are exempt in .github/.licenserc.yaml)

…lden (intel#1585)

detect_static_prefix matched only `^([a-zA-Z]+-Q)\d+$`, so a golden set such as `intel-performance-skills-Q001` never matched: all its questions were counted as generated, the Golden (static) row was 0, and the Dynamic vs Static breakdown and agreement line compared the wrong groups.

The pattern is now `^(.+-Q)\d+$`, compiled once at module level, so any id ending in `-Q<digits>` is golden and its prefix is everything before the Q. Generated ids (`gen-1`) have no such suffix and stay generated; no generator in dokimi/dokimi emits one. The ASK handling is unchanged. single_condition_report.py shares the function and gets the fix.

Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
@antonwolfy
antonwolfy requested a review from a team as a code owner December 3, 2026 11:43
@antonwolfy antonwolfy self-assigned this Dec 3, 2026
Copilot AI balanced review requested due to automatic review settings December 3, 2026 11:43
@exai-bot

exai-bot commented Dec 3, 2026 •

Copy link
Copy Markdown

✅ OpenCodeReview: Review complete: 0 finding(s) across 3 selected item(s).

CI at 574759b: 21 passing, 4 skipped.

Review details
  • Commit reviewed: 574759b against merge base badfd39
  • Coverage: 3 files in 1 groups
  • Engine: OpenCodeReview v1.13.5-exai.4.8f73eada, us.openai.gpt-6.1-sol
  • Usage: 75k tokens (37k from cache), 12s
  • Tool calls: 8 (4 file_read, 1 ci_status, 1 code_search, 1 linked_items, 1 local_check_results)
  • small change set: 3 files

@codecov-commenter

codecov-commenter commented Dec 3, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.49%. Comparing base (badfd39) to head (574759b).
⚠️ Report is 1 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1587      +/-   ##
==========================================
- Coverage   96.50%   96.49%   -0.01%     
==========================================
  Files         539      539              
  Lines       72177    72178       +1     
  Branches    12445    12445              
==========================================
- Hits        69655    69649       -6     
- Misses       1545     1549       +4     
- Partials      977      980       +3     
Files with missing lines Coverage Δ
dokimi/dokimi/report/eval_report.py 95.35% <100.00%> (+0.01%) ⬆️

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

3 open issues
What changed in this PR

Fixes report eval misclassifying golden/static questions when the golden ID prefix contains a hyphen (e.g., intel-performance-skills-Q001), by broadening static-prefix detection and adding regression tests.

Changes:

  • Update detect_static_prefix to match hyphenated prefixes via a module-level compiled regex.
  • Add tests covering report splitting + Q&A JSON source for hyphenated and non-hyphenated golden sets.
  • Add a changelog fragment documenting the fix.
File Description
dokimi/​dokimi/​report/​eval_report.py Broadens static ID detection and avoids per-iteration regex compilation.
dokimi/​tests/​test_report_golden_prefix.py Adds regression coverage for golden-prefix detection and report/Q&A outputs.
dokimi/​changelog.d/​20261203_140000_golden-prefix-hyphen.md Documents the behavior change in report eval.

Review effort: Lite

Comment thread dokimi/dokimi/report/eval_report.py Resolved
…ract, read table cells in the test

Settles the three review threads on the PR. The compiled pattern is renamed _STATIC_ID_RE. The changelog fragment now states the contract as the regex `^(.+-Q)\d+$`: a non-empty prefix, then `-Q` and digits. The summary-row assertions of the test parse the row into cells and compare numbers, so a change of spacing or bolding does not fail it.

Signed-off-by: Anton Volkov <antonwolfy@gmail.com>

@napetrov napetrov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change class: LOCAL (head 574759b)

  • Contract: none
  • Responsibility: none
  • Dependency: none
  • Review depth: skim: local change, check diff + tests
  • Coverage gaps: none

No merge-blocking findings.

Checked ordinary and hyphenated golden sets, the Markdown split and the JSON sidecar. Ran 24 focused tests successfully. Two unrelated task harness tests failed identically on the merge base in the offline container. Required CI passed.

@antonwolfy
antonwolfy merged commit 755668e into intel:main Dec 3, 2026
25 checks passed
@antonwolfy
antonwolfy deleted the fix/golden-prefix-hyphen branch December 3, 2026 16:04
@antonwolfy antonwolfy added the testing-strategy Part of #1595: checks for the bug classes behind our fix series, their sweeps and research label Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing-strategy Part of #1595: checks for the bug classes behind our fix series, their sweeps and research

Projects

None yet

Development

Successfully merging this pull request may close these issues.

report eval counts a golden set whose id prefix has a hyphen as generated questions

5 participants