Skip to content

test: carry a resource difference beyond the Loki window when it adds nothing new against Loki - #911

Merged
szibis merged 1 commit into
mainfrom
test/visual-carry-resources
Oct 28, 2026
Merged

szibis merged 1 commit into
mainfrom
test/visual-carry-resources

Conversation

@szibis

@szibis szibis commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Bench-only (bench/visual): no CHANGELOG entry, no release, no product change, so the e2e, visual, A/B and load proofs do not apply.

Problem

At a range Loki does not hold (6h) a base-vs-PR difference passes only when every difference on the row is a query the same page proved at a shorter range (#897). A resource request (no query id, e.g. Explore's /resources/index/stats?query=...) was never carried, deliberately. Every page that shows a selector fix also changes index/stats, so those pages could not be captured at 6h (the explore-*-multivalue-regexp pages of #909 had to be pinned to 15m and 1h).

Rule

A resource difference at such a range is carried when

  • (a) at every shorter Loki-held range of the page the same resource (same path and query, start/end/from/to/time/since/until/step/interval/ts ignored) shows up, and the PR adds nothing new against Loki on it: its vs-Loki differences are a subset of the base's (compare.py's loki_new holds none for it), or it has none; and
  • (b) the page proved at least one query.

A resource that differs from Loki in a new way on the PR at a shorter range, one that does not show up at a shorter range, and one on a page with no proven query are not carried. Every other failure condition and base-vs-PR at the same range are unchanged.

Change

  • visual_comment.py: resource_id / resource_ids (identity without time parameters; the diff text carries the URL cut at 90 characters, a trailing partial parameter is dropped), proven_resources (per page and Loki-held range: resources seen and resources new against Loki), resource_carried; carried and assess take the new resources argument, evaluate passes it. A row without loki_new counts every vs-Loki difference as new.
  • Tests: the deliberate test_a_resource_difference_at_6h_is_never_carried is renamed test_a_resource_with_a_new_difference_from_loki_is_never_carried, plus: the fix: regexp label matchers select what Loki selects, on selectors and label filters #909 shape carries; a resource new vs Loki at 1h is not carried; a resource absent at the shorter ranges (nowhere, or at 1h only) is not carried; a resource the PR brought to Loki is carried; a page with no proven query is not carried; a carried resource does not carry a new one next to it; resource identity ignores time parameters and a cut parameter.
  • bench/visual/README.md: one paragraph.

Replay of recorded runs

52 compare.json artifacts (50 earlier visual-smoke runs, the #909 run, the #736 run; 1076 captures) evaluated with the base gate and the new gate, each with the run's own plan.json, pixeldiff.json and flipped list from meta.json. For the 50 earlier runs the base gate's exit equals the CI conclusion of that run (46 success = exit 0, 4 failure = exit 1), so the replay is faithful. Every capture verdict is unchanged except the two 6h captures of the #909 run, the only 6h rows with a resource difference:

run capture before after
#909 explore-logs-multivalue-regexp 6h fail pass (improved, note)
#909 explore-volume-multivalue-regexp 6h fail pass (improved, note)
50 earlier runs + #736 all other captures unchanged unchanged

The #909 run's own exit stays 1 for an unrelated reason: its fix proof profiles/label-filter-regexp-anchoring is "still differs" (index/stats differs from Loki on both builds), which this change does not touch.

Known limit

The resource identity comes from the difference text, which carries the URL cut at 90 characters (about 37 encoded characters of an index/stats selector). Two selectors of one page sharing that prefix would be treated as one resource. Follow-up: have compare.py tag resource differences with their full normalised id, as it does for qid.

Changelog (Required)

None: bench-only, no releasable change (the changelog gate reports "skipped (no releasable changes detected)").

Validation

  • python3 -m unittest discover -s bench/visual/tests: 144 tests ok; the new tests fail on the base gate where they should (carry cases) and pass where they should not carry.
  • python3 scripts/ci/check_conformance.py: conformance gate ok. Registry: none (bench-only).
  • Replay of the 52 recorded runs as above.

Update: rebased onto main after #909

  • explore-logs-multivalue-regexp and explore-volume-multivalue-regexp cover 6h again: the "ranges": ["15m", "1h"] pin from fix: regexp label matchers select what Loki selects, on selectors and label filters #909 is removed, so this PR's own visual-smoke is their first live 6h run under the new rule. The README sentence that told authors to pin such pages now describes the carry instead.
  • fix: regexp label matchers select what Loki selects, on selectors and label filters #909's test_an_index_stats_difference_beside_a_proven_query_is_not_carried_to_6h pinned the old rule. It is now ..._carries_to_6h and expects the carry, since the PR adds nothing new against Loki on index/stats at 15m and 1h.
  • The adjacent string literals in the test file's lists are joined with an explicit +, as the code-quality review asked.
  • python3 -m unittest discover -s bench/visual/tests runs 146 tests, OK. plan.py --check passes, and the conformance gate passes.

@github-actions github-actions Bot added size/L Large change scope/docs Documentation labels Oct 28, 2026
… nothing new against Loki

A base-vs-PR difference at a range Loki does not hold (6h) passed only when
every difference on the row was a query the page proved at a shorter range. A
resource request (Explore's /resources/index/stats?query=...) has no query id,
so it was never carried, and every page showing a selector fix also changes
index/stats: the explore multivalue-regexp pages of the selector fix had to be
pinned to 15m and 1h.

A resource difference at such a range is now carried when the page proved at
least one query and, at every shorter range Loki holds, the same resource (path
and query, time parameters ignored) shows up and the PR adds no difference from
Loki on it that the base did not have (compare.py's loki_new). A resource that
differs from Loki in a new way on the PR, one that does not show up at a shorter
range, and one on a page with no proven query stay uncarried. Base vs PR at the
same range stays exact.

Replayed over 52 recorded runs (1076 captures): the only changed verdicts are the
two 6h captures of the selector-fix run (explore-logs-multivalue-regexp and
explore-volume-multivalue-regexp, fail -> improved); all other verdicts are equal.
@szibis
szibis force-pushed the test/visual-carry-resources branch from 9b49b81 to 661b19e Compare October 28, 2026 14:54
@github-actions github-actions Bot added size/L Large change and removed size/L Large change labels Oct 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ Visual smoke: passed

Base da8820025c vs PR 661b19e5ed, Grafana through the proxy builds and Loki on one fresh stack; run.
Core set: 5 capture(s) at 1h. Detailed set: 2 entries (explore-logs-multivalue-regexp, explore-volume-multivalue-regexp). 11 capture(s), 15m/1h/6h, 24h and 7d stay out of PR runs.

page range set base = PR (data) vs Loki (PR) pixel diff result
dd-fields 1h core ✅ identical identical (4 explained, 1 history-dependent) 0.11% ✅
dd-landing 1h core ✅ identical identical (3 explained) 0.14% ✅
dd-service-logs 1h core ✅ identical identical (3 explained, 1 history-dependent) 0.11% ✅
explore-logs-plain 1h core ✅ identical identical (1 explained) 0.07% ✅
explore-metric-plain 1h core ✅ identical identical (1 explained) 0.04% ✅
explore-logs-multivalue-regexp 15m detailed ✅ identical 1 difference(s), 1 on base too 0.07% ✅
explore-logs-multivalue-regexp 1h detailed ✅ identical 1 difference(s), 1 on base too 0.07% ✅
explore-logs-multivalue-regexp 6h detailed ✅ identical n/a (beyond the Loki window) 0.07% ✅
explore-volume-multivalue-regexp 15m detailed ✅ identical 1 difference(s), 1 on base too 0.04% ✅
explore-volume-multivalue-regexp 1h detailed ✅ identical 1 difference(s), 1 on base too 0.04% ✅
explore-volume-multivalue-regexp 6h detailed ✅ identical n/a (beyond the Loki window) 0.04% ✅

Gate: a base-vs-PR data difference passes when the PR is closer to Loki, and fails when the PR diverges from Loki or Loki cannot decide it (at a range Loki does not hold, a difference passes when the same page proved that query to answer like Loki at a shorter range; otherwise label the pull request visual-change-expected to accept an intended change). Also failing: a panel empty on the PR but not on the base, an error banner, panel error, error answer or new "No data" panel on the PR, a PR side that never settled, a difference that did not reproduce on the recapture. Pixel differences only warn.

Core set montages (5): base | PR | Loki

dd-fields-1h

dd-fields-1h

dd-landing-1h

dd-landing-1h

dd-service-logs-1h

dd-service-logs-1h

explore-logs-plain-1h

explore-logs-plain-1h

explore-metric-plain-1h

explore-metric-plain-1h

All montages of this run: pr-visuals/pr-911.

@github-actions

Copy link
Copy Markdown
Contributor

PR Quality Report

Compared against base branch main.

Coverage and tests

Signal Base PR Delta
Test count 18090 18090 0
Coverage 88.7% 88.7% 0.0% (stable)

Compatibility

Track Base PR Delta
Loki API 100.0% 11/11 (100.0%) 0.0% (stable)
Logs Drilldown 100.0% 17/17 (100.0%) 0.0% (stable)
VictoriaLogs 100.0% 11/11 (100.0%) 0.0% (stable)

Performance smoke

Performance smoke was skipped for this PR because no perf-sensitive paths changed.

State

  • Coverage, compatibility, and sampled performance are reported here from the same PR workflow.
  • This is a delta report, not a release gate by itself. Required checks still decide merge safety.
  • Performance smoke was intentionally skipped because no perf-sensitive paths changed in this PR.
  • Delta states use the same noise guards as the quality gate (percent + absolute + low-baseline checks), so report labels match merge-gate behavior.

@szibis
szibis merged commit a12c35e into main Oct 28, 2026
72 checks passed
@szibis
szibis deleted the test/visual-carry-resources branch October 28, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/docs Documentation size/L Large change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant