Skip to content

[bugfix] ci: fail the daily benchmark on a missing required measurement - #232

Merged
kunkunblueberry merged 1 commit into
mainfrom
fix/nightly-benchmark-incomplete
Nov 9, 2026
Merged

kunkunblueberry merged 1 commit into
mainfrom
fix/nightly-benchmark-incomplete

Conversation

@kunkunblueberry

Copy link
Copy Markdown
Collaborator

Follow-up to #216 (already merged). Fixes the [P2] raised by @hsliuustc0106 on that PR: a required measurement missing from a sample that otherwise parsed never reached the failure decision.

What was wrong

build_report recorded a missing measurement in missing and then ignored it. notify only looked at regressions, suite, and ui_required and ui_unavailable (which is ui is None), so a sample that parsed but carried no measurement stayed green.

Reproduced against 2f35c78e by calling build_report directly with storage samples that are all ok: true:

input missing notify summary tail
ui = {"drag": {}, "render": {}}, ui_required=True both ui.drag.*.frameP95 False within threshold
storage sample with cold-open.data.open removed storage.coldOpen.open False ... 400.0ms/FAILED ... within threshold

The second row is the worst shape: the summary itself printed FAILED for that clause while the lane exited 0.

What changed

  • required_metric_ids() makes the requirement explicit: storage metrics always, drag metrics only while --ui-required is passed. An advisory run whose UI lane never ran keeps its current behaviour.
  • build_report computes incomplete = [id for id in missing if id in required], feeds it to format_summary, and adds it to notify. The artifact carries it as incomplete ([] in failure_report, so the document shape stays stable).
  • The one-line summary names the gap as INCOMPLETE <ids> and no longer appends within threshold when one exists.

Docs and workflow comments that stated the failure condition (docs/development/validation.md, .github/workflows/nightly.yml) now include the incomplete case.

Validation

python -m pytest tests/test_daily_benchmark.py -q --noconftest
16 passed (13 existing + 3 new)

The three new tests are the reproductions above plus the guard that a partial UI sample without --ui-required still stays advisory:

  • test_empty_ui_sample_is_incomplete_when_the_lane_requires_it
  • test_storage_sample_missing_a_required_field_is_incomplete
  • test_partial_ui_sample_stays_advisory_while_the_lane_is_optional

yaml.safe_load on the edited workflow parses, and the daily-benchmark job keeps its 8 steps with the renamed failure step.

Not covered here

test_storage_bench_emits_the_fields_the_suite_tracks runs the real storage bench, but no new test executes the whole workflow; the lane's own nightly run is the end-to-end check.

Refs: #216

## summary

- A sample that parsed but lost a required measurement was recorded in
  `missing` and then ignored by the failure decision: an empty `drag`
  block under `--ui-required`, or a storage sample missing a tracked
  field, ended the summary in `within threshold` and left the lane
  green while the same summary printed `FAILED` for that clause.
- Required measurements now decide `notify`: storage metrics always,
  drag metrics only while the lane requires the UI sample, so an
  advisory run without `--ui-required` keeps its current behaviour.
- Name the gap explicitly as `INCOMPLETE <ids>` in the one-line
  summary and stop claiming `within threshold` when one exists. The
  artifact carries the same list as `incomplete`.

## validation

- python -m pytest tests/test_daily_benchmark.py -q --noconftest
  (16 passed, 3 new: empty-but-parsed UI sample, storage sample with a
  removed field, partial UI sample that stays advisory)
- build_report with `{'drag': {}, 'render': {}}` and ui_required=True:
  notify True, `INCOMPLETE ui.drag.node.frameP95,ui.drag.pan.frameP95`,
  exit 1
- build_report with `cold-open.data.open` removed: notify True,
  `INCOMPLETE storage.coldOpen.open`, exit 1
- Same inputs without ui_required still notify False

Refs: #216
@kunkunblueberry
kunkunblueberry merged commit 095ecbb into main Nov 9, 2026
1 check passed
@FayeSpica FayeSpica added area:ci Continuous integration and checks type:bug Something is broken labels Nov 10, 2026 — with ChatGPT Codex Connector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci Continuous integration and checks type:bug Something is broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants