Skip to main content

Semantic compatibility analysis and configurable quality gates for SystemRDL specifications

Project description

PeakRDL-check

SystemRDL

Semantic compatibility analysis and configurable quality gates for SystemRDL specifications. Detects firmware-breaking register changes, produces CI reports and provides scalable exploration of large register maps.

PeakRDL-check is local-first and complements — not replaces — your existing flow around systemrdl-compiler and PeakRDL: point it at the same .rdl sources, get an indexed, instantly searchable register map and a reviewer-grade semantic diff that classifies interface changes by impact.

Why PeakRDL-check

  • It reviews meaning, not text. A textual diff can't tell a 200-line harmless refactor from a one-line change that silently moves hundreds of registers. PeakRDL-check compares the elaborated register models and classifies every change by impact — breaking, behavioural, compatible, documentation, or uncertain — with a stable rule ID, an explanation, and before/after values. When a match is ambiguous it says so instead of guessing.
  • Quality gates you control. --fail-on picks the severity that fails CI, and a policy JSON reclassifies any rule to match your team's rules (e.g. treat reset-value changes as release-blocking). Reports come as text, JSON, Markdown or SARIF, and a reusable GitHub Action posts job summaries and inline annotations.
  • It stays fast when register maps get huge. One SQLite index file instead of tens of thousands of HTML files, a virtualized viewer that only loads what you look at, second-scale incremental rebuilds after local edits, and millisecond queries — measured at 800,000 registers.
  • Every number is a measurement, not a slogan. The benchmark summary below and the full evidence dossier in PROOF.md are generated from raw, preserved run records (benchmarks/raw-results/, failures and all) — nothing is typed by hand, and one script reproduces the lot.

Measured performance

On an 800,000-register specification (Apple M4 Pro, medians of 3 runs each, identical fixtures — full tables and environment in PROOF.md):

Operation PeakRDL-check PeakRDL-html 2.12.2
Cold build (raw source → browsable) 285 s 1390 s (4.9× slower)
Output 1 file, 338 MB 85,216 files, 1098 MB
Index generation from an already-elaborated model 10 s n/a (regenerates everything)
Incremental rebuild after a one-line block edit 33 s n/a (full rebuild)
Open existing index (server ready / first page) 105 ms / 107 ms static files, but 51.8 MB transferred up front
Search p95 / exact-lookup p95 10.4 ms / 0.6 ms in-browser over the fully-loaded model

Semantic diff: 47/47 curated scenarios pass (12/12 breaking detected, 10/10 formatting-only suppressed); 240 generated mutation trials at recall 1.0, precision 1.0.

What a semantic diff looks like

$ peakrdl-check diff --base main/uart.rdl --head pr/uart.rdl

Semantic diff: 2 breaking, 1 documentation  (policy 1.0.0)

✖ [BREAKING     ] REG-ADDRESS-CHANGED        uart.status
    reg 'uart.status' address changed from 0x4 to 0x40.
    before: 0x4    after: 0x40
    at pr/uart.rdl:9
✖ [BREAKING     ] ENUM-VALUE-CHANGED         uart.ctrl.baud
    Enum member 'B115200' in field 'baud' changed value from 0x2 to 0x4;
    existing encodings break.
✎ [DOCUMENTATION] DESC-CHANGED               uart.ctrl
    Description wording changed on 'uart.ctrl'.

The corpus in diff-corpus/ demonstrates the other direction too: a 203-line textual refactor (file splits, reordering, hex renumbering, typedef extraction) that produces zero semantic changes, and a one-line parameter edit that changes hundreds of elaborated registers. Ambiguous renames are reported as MATCH-UNCERTAIN — the tool never silently guesses.

Five-minute quick start

python -m pip install peakrdl-check

# build an index and browse it
peakrdl-check build your_design.rdl --output build/design
peakrdl-check serve build/design         # opens http://127.0.0.1:<port>

# review a change
peakrdl-check diff --base main/design.rdl --head pr/design.rdl \
    --format markdown --output diff.md

# CI gate (exit 1 on breaking changes)
peakrdl-check check --base main/design.rdl --head pr/design.rdl \
    --fail-on breaking

# optionally install the PeakRDL host and use the registered subcommand
python -m pip install "peakrdl-check[peakrdl]"
peakrdl check pr/design.rdl --base main/design.rdl --fail-on breaking

For an editable source checkout, benchmark tooling, and the test suite, see CONTRIBUTING.md.

A reusable GitHub Action lives in action/; an example workflow is in examples/.github/workflows/register-review.yml.

Supported input

  • SystemRDL 2.0 via systemrdl-compiler 1.32.2 (parameters, arrays, dynamic assignments, aliases, `include / `define preprocessing).
  • Not supported (yet): IP-XACT, register editing, language-server features. PeakRDL-check is a review surface, not an editor (see ADR-0009).

Architecture in one paragraph

systemrdl-compiler parses and elaborates; a thin adapter walks the elaborated tree once (arrays kept folded) and emits a canonical model with content-hash-deduplicated definitions and lightweight instances; that streams into a single SQLite file with FTS5 search. A localhost stdlib server exposes a paginated JSON API; the viewer is one static HTML+JS file with virtualized rendering, so browser state stays proportional to what you actually look at. The semantic diff engine compares two canonical models through separated stages (matching → detection → versioned severity policy → explanation → text/JSON/Markdown/SARIF). Incremental rebuilds re-elaborate only block types from changed files and splice their subtrees into the existing index — proven byte-equivalent to a clean rebuild. Details: docs/architecture.md.

Known limitations

  • Incremental rebuilds operate at defining-file granularity.
  • The register-map viewer requires a local server; static browser-only mode is not currently supported.
  • Input is limited to SystemRDL 2.0. IP-XACT and register editing are outside the current scope.

See the complete limitations list.

Documentation

Architecture · Diff rules · Benchmarks and evidence · ADRs · Contributing · Security

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

peakrdl_check-0.1.0.tar.gz (67.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

peakrdl_check-0.1.0-py3-none-any.whl (62.7 kB view details)

Uploaded Python 3

File details

Details for the file peakrdl_check-0.1.0.tar.gz.

File metadata

  • Download URL: peakrdl_check-0.1.0.tar.gz
  • Upload date:
  • Size: 67.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for peakrdl_check-0.1.0.tar.gz
Algorithm Hash digest
SHA256 724254431cda02d715e31cc9584452a77ec9d7ba90c25db83ec40dbe6505a9c2
MD5 5235147fd73f6f76510c09c58d9341d3
BLAKE2b-256 e1834eab5b9893a459bd8fa247c99615e9989cd816d74941ea7cc2f6828cfbc8

See more details on using hashes here.

Provenance

The following attestation bundles were made for peakrdl_check-0.1.0.tar.gz:

Publisher: release.yml on chrismcdev/PeakRDL-check

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file peakrdl_check-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: peakrdl_check-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 62.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for peakrdl_check-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 027991a6573110d041562d49a86aa71a22784e365d8b784aa5d50ef0a50b96eb
MD5 bb969ab7b7fa5e819246bcc7332d297b
BLAKE2b-256 8b2147c42f16c774d1a4dab0cae9db391e61faff54f617ae2590c03ab6400f40

See more details on using hashes here.

Provenance

The following attestation bundles were made for peakrdl_check-0.1.0-py3-none-any.whl:

Publisher: release.yml on chrismcdev/PeakRDL-check

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page