Skip to content

Add checkQorMetrics.py inline check script - #4458

Open
migueldalberto wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:add-check-qor-metrics
Open

Add checkQorMetrics.py inline check script#4458
migueldalberto wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:add-check-qor-metrics

Conversation

@migueldalberto

Copy link
Copy Markdown
Contributor

Summary

  • Adds flow/util/checkQorMetrics.py, a local inline check: sweeps reports/<platform>/<design>/<variant>/metadata.json, POSTs each run's numeric metrics to the QoR dashboard's /compare/check/inline endpoint, and reports which rules would fail against the latest baseline build (or a pinned --base-commit).
  • Differs from checkMetadata.py: compares against a real baseline build + the dashboard's live rule_configs thresholds instead of the committed rules-<variant>.json goldens, so metric drift that moves with master doesn't false-positive.
  • Always exits 0 — reports, does not gate a local build on network/dashboard availability.

@migueldalberto migueldalberto self-assigned this Aug 21, 2026

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces a new script, checkQorMetrics.py, designed to validate local flow runs against QoR dashboard rules by posting numeric metrics to an API. The feedback focuses on improving the script's robustness and portability. Key recommendations include wrapping check_run and fmt_value in try-except blocks to handle unexpected API responses or non-numeric values gracefully, and explicitly specifying encoding='utf-8' when reading and writing files to prevent platform-dependent encoding issues.

Comment thread flow/util/checkQorMetrics.py Outdated
Comment thread flow/util/checkQorMetrics.py Outdated
Comment thread flow/util/checkQorMetrics.py Outdated
Comment thread flow/util/checkQorMetrics.py Outdated
@openroad-ci

openroad-ci commented Aug 21, 2026

Copy link
Copy Markdown
Member

🔍 QoR check

Metrics reflect the PR merge build — i.e. what will land on the target branch. Advisory — results are log-only and do not affect build status. The authoritative QoR gate remains the local rules-file check.

Commit 62a23e4 · Jenkins build #4 · Baseline: build

62 design(s) checked — 0 with regression(s), 1 without a comparable baseline.
Design Variant Verdict local vs inline passed / failed / missing
asap7/aes base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/aes-block base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/aes-mbff base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/aes_lvt base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/cva6 base ✅ pass ✅ MATCH 12 / 0 / 0
asap7/ethmac base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/ethmac_lvt base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/gcd-ccs base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/jpeg_lvt base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/mock-alu base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/mock-cpu base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/riscv32i-mock-sram base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/swerv_wrapper base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/uart base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/aes base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/aes-hybrid base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/uart-blocks base ✅ pass ✅ MATCH 25 / 0 / 0
gt2n/aes base ✅ pass ✅ MATCH 25 / 0 / 0
gt2n/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
gt2n/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/aes base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/i2c-gpio-expander base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/ibex base ➖ inconclusive ➖ N/A 0 / 0 / 25
ihp-sg13g2/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/spi base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/aes base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/ariane133 base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/ariane136 base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/black_parrot base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/bp_be_top base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/bp_fe_top base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/bp_multi_top base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/cva6 base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/dynamic_node base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/mempool_group base ✅ pass ✅ MATCH 12 / 0 / 0
nangate45/swerv base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/swerv_wrapper base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/tinyRocket base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/aes base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/chameleon base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/microwatt base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/aes base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0

@maliberty

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Unknown error
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@maliberty

Copy link
Copy Markdown
Member

@codex review

@maliberty

Copy link
Copy Markdown
Member

Needs black format

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b34bf90866

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +436 to +443
if not runs:
for line in header:
print(line)
print(
f"[WARN] No flow run with a {METADATA_FILENAME} "
f"found under {reports_dir}."
)
return 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Clear the saved report when no runs match

When a previous invocation has created reports/inline-check.log and a later invocation finds no runs—for example after cleaning metadata or when a --platform/--design filter matches nothing—this early return leaves the old report intact. Anyone reading the documented log afterward sees stale failures or passes from the earlier sweep rather than the current “nothing checked” result; overwrite or remove the log before returning.

Useful? React with 👍 / 👎.

Sweeps flow/reports for metadata.json files, POSTs metrics to the QoR
dashboard's /compare/check/inline endpoint, and reports which rules a
local change would fail against the latest baseline build. Always
exits 0 since it reports rather than gates.

Signed-off-by: Miguel Dalberto Pedro <miguel.pedro@precisioninno.com>

Send JobName so the local baseline resolves to the right pipeline

Empty PipelineId/BranchName don't leave the baseline "unscoped" as
assumed -- the dashboard's PipelineClassification.Classify("") falls
through to null just like Classify(null), and
ResolveLocalBaselineAsync then filters on PipelineName == null,
matching whatever stale/legacy master build has no pipeline recorded
instead of the real latest master build.

JobName (the canonical Jenkins job-folder name, e.g.
jenkins-ci's utilGetJobFolderName()) takes priority over that
classification and scopes the baseline to the actual pipeline.
Default it to OpenROAD-flow-scripts-Public, the pipeline that
uploads master's dashboard metrics, and let --job-name/
$DASHBOARD_JOB_NAME override it for secure/private branches.

Verified end to end: re-running against the same real Jenkins
artifact that previously reported a bogus FAIL against baseline
build 4 now resolves to the real latest master build and reports
PASS with 0% deltas, matching the actual CI result.

Signed-off-by: Miguel Dalberto Pedro <miguel.pedro@precisioninno.com>

Fix the usage docs and narrow the command-line surface

The docstring claimed a plain `make` leaves a metadata.json behind. It
does not: the default goal stops at `finish`, and only `make metadata`
runs genMetrics.py, so a developer following it found nothing to check.

Drop --reports and --log. The sibling report scripts (genReport.py,
genReportTable.py, uploadMetadata.py) all chdir to flow/ and walk a
literal "reports"; making the root configurable here only let the sweep
diverge from what ingestion sees, and needed an INVOCATION_DIR dance to
keep relative paths meaning what the user typed. The log path is now
fixed and reported as an absolute path -- it was printed relative to
flow/, naming a path that does not exist from where the script was run.

Drop --target/--api-url for a --beta flag over two fixed https URLs. An
arbitrary --api-url could send DASHBOARD_API_KEY over a plaintext hop;
with both URLs baked in, that is structurally impossible rather than
guarded at runtime.

Drop the -v alias: genReport.py reads it as --verbose and genMetrics.py
binds it to the variant, so either meaning surprises half the callers.

Report a run directory with no metadata.json from the caller instead of
from the walk, so the warning respects --platform/--design/--variant and
reaches the log file. A scoped run no longer warns about designs it was
never asked to check.

Retry transient request failures three times with linear backoff. One
blip previously cost a design its entire check across a 61-design sweep.
Non-transient HTTP statuses return at once, since re-sending the same
payload only earns the same answer.

Signed-off-by: Miguel Dalberto Pedro <miguel.pedro@precisioninno.com>
@openroad-ci
openroad-ci force-pushed the add-check-qor-metrics branch from b34bf90 to 89f0280 Compare August 24, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants