Repository navigation
Check QoR as a checkout of the recorded commit - #4604
migueldalberto wants to merge 8 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the QoR metrics check to compare runs against the master build at their merge base by default, rather than the latest master build. It also introduces support for new environment variables and command-line arguments (--api-url, --commit, and --branch), filters out non-finite metrics to prevent dashboard errors, and adds a helper to resolve the current git branch. The review feedback highlights a potential issue where cleaning the commit SHA using a simple regular expression can corrupt it when ref prefixes or git describe tags are present, and suggests a more robust parsing approach.
The dashboard resolves inline checks in two ways. A request that names a pipeline (JobName or PipelineId) is a build of that pipeline and follows its CI branch rules. Any other request is a checkout: the dashboard searches its default baseline pipelines and takes a master build that has the design, at the commit's merge base or else the latest one before the commit. So the script no longer sends IsLocal or a default job name. Without --job-name it sends just the commit metadata.json records (--commit / DASHBOARD_COMMIT overrides it, and must be a full 40-character SHA: the dashboard matches it exactly and falls back to the latest master build on a miss). With --job-name it sends that name and the branch, from --branch / DASHBOARD_BRANCH or git, as CI does. A --base-commit pin no longer needs a job name. A run whose metadata.json records no commit is compared against the latest master build, and the report now says so. --api-url / DASHBOARD_API_URL picks the deployment and takes precedence over --beta. The report names the pipeline that provided the baseline. Also drop non-finite metric values before sending: json.dumps renders them as bare Infinity/NaN, and the dashboard rejects the whole request. Signed-off-by: Miguel Dalberto Pedro <miguel.pedro@precisioninno.com>
f0ec759 to
e767be4
Compare
🔍 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. |
vvbandeira
left a comment
There was a problem hiding this comment.
Items 1 and 2 should be addressed before merge; 3-7 are small items and nits that you can address or ignore.
- A commit the dashboard does not know falls back to current master without a warning.
When the dashboard has no record of the commit, it uses the current time as the cutoff and returnslatest-master.
render_runwarns about that only when no commit was sent (checkQorMetrics.py:410).
So a local commit that is not pushed is compared against today's master.
If its base is older, upstream changes show up as false regressions or hide real ones, and the result changes as master moves.
Metrics.md:55-56, the module docstring and theutils.mkcomment say the opposite.
Please warn onlatest-masterwhenever it is returned, suggest--base-commitfor an exact baseline, and fix the docs.
Also update theMetrics.mdintro (lines 11-12), which still says "the latest master build by default". - No tests.
Payload modes,--commitvalidation, branch resolution and non-finite filtering decide which baseline is used.
Aflow/test/test_checkQorMetrics.pythat stubsurlopenand checks the request, report and exit code would run in the existing util-test workflow. - A bad
--commitreturns beforewrite_log(line 723), so a previous sweep'sinline-check.logstays. - Non-finite metrics:
- they are listed before the
--only-prefixfilter (line 203), sometadata-check-synthwarns about metrics it never sends; - the warning is lost on the
no_baselinepath (line 391); - a file with only non-finite values reports "no numeric metrics" without naming them.
- they are listed before the
DASHBOARD_JOB_NAMEused to be the way to pick a private pipeline (e.g.OpenROAD-flow-scripts-Private).
It now selects CI branch rules.
Please say what private users should do now.--base-commitis not checked for a full SHA, while--commitis.- Nits:
- a detached
HEADis logged as INFO, while an empty branch warns; --branchwithout--job-nameis ignored silently;- docstring lines 8 and 164 need re-wrapping.
- a detached
The dashboard finds a checkout's merge base through GitHub, so it cannot find one for a commit that was never pushed. It then compares against the latest master build, which may be newer than the commit's base: changes merged since then read as regressions or hide real ones, and the result moves with master. The report said nothing about it, and the docs claimed the opposite. When no remote branch in the checkout contains the run's commit, the check now computes its merge base with --merge-base (DASHBOARD_MERGE_BASE, default origin/master) and pins the baseline to it. A commit on a remote, or not in the checkout at all, such as a downloaded CI artifact, is still resolved by the dashboard. The pin is skipped with --base-commit or --job-name, since CI checkouts often fetch no remote branches. none turns it off. Every latest-master result now warns and points at --base-commit, which DASHBOARD_BASE_COMMIT now sets so that make metadata-check can reach it. The docs, the module docstring and the utils.mk comment describe the fallback as it is. Signed-off-by: Miguel Dalberto Pedro <miguel.pedro@precisioninno.com>
The payload mode, --commit validation, branch resolution, the local merge base pin and the metric filter decide which baseline a run is compared against, and nothing covered them. The tests call run_check() with urlopen replaced by a stub that records each request and replays canned replies, and check the payload, the report and the exit code. The merge base cases run in a temporary repository with a fake origin/master, so the state of the checkout running the tests does not matter. Signed-off-by: Miguel Dalberto Pedro <miguel.pedro@precisioninno.com>
A --commit that is not a full SHA returned before the sweep log was written, so reports/inline-check.log kept the previous sweep's report, possibly a PASS for a check that never ran. The error now replaces it. A checkout without a reports/ directory still gets no log, since there is nothing to go stale. Signed-off-by: Miguel Dalberto Pedro <miguel.pedro@precisioninno.com>
The non-finite metrics were listed before the --only-prefix filter, so metadata-check-synth warned about finish__ metrics it never sends. They are now split off after it. The warning also reaches the no_baseline report, which returned before printing it. A file whose values are all non-finite said "no numeric metrics", which sends the reader looking for an empty metadata.json; the error now names the non-finite metrics. A prefix that matches nothing says so, too. Signed-off-by: Miguel Dalberto Pedro <miguel.pedro@precisioninno.com>
DASHBOARD_JOB_NAME used to be how a local run picked the pipeline holding a private platform's baseline. It now checks the run as a CI build, with that pipeline's branch rules, and turns off the local merge base pin. The default baseline pipelines include the private ones, visible to a caller with a key, so a local run needs only DASHBOARD_API_KEY. The docs, the module docstring and the --job-name help now say so. Signed-off-by: Miguel Dalberto Pedro <miguel.pedro@precisioninno.com>
The dashboard matches the pinned commit exactly, so a short or uppercase --base-commit found no build and reported no baseline: an inconclusive run that exits 0, which quietly turns the gate off. It is now checked like --commit, lowercased and rejected with exit 1 unless it is a full SHA, and DASHBOARD_BASE_COMMIT with it. Signed-off-by: Miguel Dalberto Pedro <miguel.pedro@precisioninno.com>
With --job-name, a detached HEAD is resolved as a feature branch, just as an empty branch is, but only the empty branch warned. Both warn now. A --branch (or DASHBOARD_BRANCH) without --job-name is ignored by design, and the report now says so instead of dropping it silently. Also shortens an overlong docstring line. Signed-off-by: Miguel Dalberto Pedro <miguel.pedro@precisioninno.com>
|
Thanks for the thorough review. I've addressed every point, one commit each.
|
checkQorMetrics.py(make metadata-check) used to sendIsLocal: truewith a fixed default job name and compare against that pipeline's latest master build.The dashboard now splits inline checks in two. This PR moves the script onto that contract.
Default: a checkout. The script sends the commit
metadata.jsonrecords (--commit/DASHBOARD_COMMIToverrides it), with noJobName, noIsLocaland no branch. The dashboard searches its default baseline pipelines in order. In each, it takes a master build that has the design:--job-name/DASHBOARD_JOB_NAME: a build of that pipeline. The script sends the name plus the branch, from--branch/DASHBOARD_BRANCHorgit rev-parse --abbrev-ref HEAD. The dashboard applies that pipeline's CI rules: previous build on a trunk branch, merge base otherwise. CI takes this path and passes the branch and commit.--base-commit: still pins the baseline. It no longer needs a job name, because the dashboard searches its default pipelines for the pinned build.Other changes
--api-url/DASHBOARD_API_URLpicks the deployment and takes precedence over--beta.json.dumpsrendered them as bareInfinity/NaN, which the dashboard rejects with HTTP 400 for the whole request.