Repository navigation
Check QoR offline against saved dashboard limits - #4908
vvbandeira wants to merge 4 commits into
Conversation
A site with no network access cannot reach the QoR dashboard, so it cannot run the check at all. The dashboard computes each limit from the baseline build and the rule only, never from the run that it checks. So one reply is enough to judge later runs of the same design. --save-cache writes the limits from each pass or fail reply. --offline-cache judges new runs against them and gives the same report and exit status as the online check. The offline delta divides by the absolute baseline, as the dashboard does. Both options are off by default. DASHBOARD_SAVE_CACHE and DASHBOARD_OFFLINE_CACHE set them for make metadata-check. The cache fixes the baseline of an offline check. So the offline check resolves no local merge base and no pipeline, and it refuses --base-commit, --beta and --api-url. The cache has no rule for a metric that the saved run did not send. A run with such a metric is inconclusive unless a saved rule fails. A save checks each reply before it writes it. A nightly pass with no baseline build keeps the earlier file. A rule that the cache cannot replay also keeps it and fails the save. Signed-off-by: Vitor Bandeira <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request adds offline checking capabilities to the QoR metrics checker, allowing users to save baselines and limits locally and perform checks without network access. It includes a new test suite for the caching mechanism and updates the documentation and Makefiles. The review feedback suggests refactoring the atomic file-writing logic to use a finally block for cleaning up temporary files, preventing potential masking of original exceptions.
🔍 QoR checkMetrics reflect the PR merge build — i.e. what will land on the target branch. Commit 62 design(s) checked — 0 with regression(s), 0 without a comparable baseline. ✅ QoR is compared against the master build at this PR's merge base |
If the removal of the temporary cache file failed, its error replaced the one that stopped the write, so the report named the cleanup and not, for example, a full disk. Remove the temporary file in a finally block and ignore an error from that removal. Signed-off-by: Vitor Bandeira <[email protected]>
A damaged cache could hide a failed rule or replace a valid cache. Validate the cache on save and replay. Name the environment variables that conflict with offline mode and cover the cache CLI paths. Signed-off-by: Vitor Bandeira <[email protected]>
Keep cache validation and replay in one module. Resolve that module when the Bazel Python wrapper launches the checker with runpy. Signed-off-by: Vitor Bandeira <[email protected]>
A site with no network access cannot reach the QoR dashboard, so
make metadata-checkcannot judge its runs.This PR adds two opt-in options to
checkQorMetrics.py:--save-cache DIR(DASHBOARD_SAVE_CACHE) runs the normal online check and also saves the baseline and the per-rule limits from each pass or fail reply toDIR/<platform>/<design>/<variant>.json.--offline-cache DIR(DASHBOARD_OFFLINE_CACHE) judges runs against those saved limits and does not contact the dashboard.The report and the exit status are the same as online.
Both options are off by default.
The online path does not change.
Why one saved reply is enough
The dashboard computes each limit from the baseline build and the rule only, never from the metrics that it checks.
So a saved limit gives the same verdict for a later run of the same design.
The offline check rebuilds the operator from the reply's mode, comparison type, and rule source, as
Threshold.csin the dashboard does.It divides the delta by the absolute baseline, as the dashboard does.
Limits
master.A rule change in the dashboard reaches the cache only when the cache is saved again.
It ignores
DASHBOARD_JOB_NAME,DASHBOARD_BRANCH, andDASHBOARD_MERGE_BASE, and it refuses--base-commit,--beta, and--api-url.So the cache has no rule for a metric that the saved run did not send, for example one that was not finite then.
A later run with such a metric is
INCONCLUSIVEunless a saved rule fails.An outage, a missing API key, a nightly pass with no baseline build, or a failed write keeps the earlier cache file.
A reply with a rule that the offline check cannot replay, for example a new threshold mode, also keeps it and fails the save.
DASHBOARD_OFFLINE_CACHEorDASHBOARD_SAVE_CACHEturns the option off, as for the otherDASHBOARD_*variables.An empty
--offline-cacheor--save-cacheargument is an error.Verification
flow/test/test_checkQorMetrics_cache.pycovers the save and replay round trip, each operator, inclusive limits, negative and zero baselines, non-finite metrics and limits, metrics that the saved run did not send, damaged cache files, atomic writes, kept caches after an outage or a failed save, and the refused or ignored options.A live comparison on the public asap7/gcd baseline (25 rules) gave identical tables and verdicts online and offline, both for a run with metrics fetched from the dashboard and for a copy of that run changed to fail 7 rules.