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.1.tar.gz (67.4 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.1-py3-none-any.whl (62.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: peakrdl_check-0.1.1.tar.gz
  • Upload date:
  • Size: 67.4 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.1.tar.gz
Algorithm Hash digest
SHA256 ceadb71a68b4f78cfbfa4653e78a0fe2d6bbc9c572e522fce61259ec9ea37efb
MD5 98bbaeacbf8fd2396f04e27ff12f17dd
BLAKE2b-256 96326f21dbdb561e4aad7e2f2cd372f2201e44e06ae081b98536be885b226082

See more details on using hashes here.

Provenance

The following attestation bundles were made for peakrdl_check-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: peakrdl_check-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2768ddb828672e642e9feaa101609241d0ad5bb902b3a8297f7bfbe2f312f70f
MD5 200f2e0afe87c3e06cb02b5672bd7321
BLAKE2b-256 140615e872445f82afeb43d82fcd46ff75383516946091e3881d0c03d73c773a

See more details on using hashes here.

Provenance

The following attestation bundles were made for peakrdl_check-0.1.1-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