← Back to Pull requests

package_core: deduplicate `llext-edk` headers in core packages #694

Closed
unknown closed this pull request without merging on Oct 20, 2026 15:14 UTC
View on GitHub
unknown unknown commented on Oct 13, 2026 15:31 UTC
Author

Every board variant ships its own llext-edk/include tree, and most of those headers are byte-identical across boards. This PR moves the shared headers into a single variants/include directory when packaging in CI, which makes each core package much smaller.

Changes

  • extra/dedupe_includes.py (new): takes two or more variant names and finds the files that are byte-identical at the same path in every variant's llext-edk/include. It moves one copy of each to variants/<common-dir> and deletes the duplicates. Each variant's includes.txt is updated to match:

  • - an include directory that ends up empty is repointed to the common directory and removed;
    - an include directory that keeps some files gets an extra entry for the common directory, after the original, so the variant's own headers are still found first.

    --dry-run only reports what would be done.

  • extra/package_core.sh: runs the dedup on the included variants that have an EDK, then adds variants/include/ to the archive. It is skipped if fewer than 2 such variants are left. It only runs when GITHUB_ACTIONS is set, because it changes the working tree in place (each packaging job starts from a fresh checkout).

  • platform.txt: the -imacros files (zephyr/autoconf.h, zephyr/toolchain/zephyr_stdint.h) are now found through the include path instead of a fixed {build.variant.path}/llext-edk/... path. zephyr_stdint.h is the same on every board, so it gets moved. Every variant's includes.txt already has the right directories, so this works whether or not the headers were deduplicated.
  • Results (zephyr_unoq, 2 boards)

  • 2926 of about 3080 headers are shared, which removes about 24.8 MB of uncompressed duplicates.

  • Packaged archive: 10.6 MB.
  • Testing

  • Packaged zephyr_unoq with GITHUB_ACTIONS=1 and checked that every -iwithprefixbefore path in the unpacked package resolves.

  • Compiled a test sketch (Wire, SPI, GPIO) for UNO Q and Ventuno Q with both the deduplicated package and the normal working tree. The outputs are byte-identical, and the dependency files show autoconf.h coming from each variant's own directory.

  • Checked that a local run (no GITHUB_ACTIONS) leaves the working tree untouched.

  • Not tested: zephyr_main and zephyr_contrib packages, and boards other than the two Q boards.
  • Diff: 294 lines (+220 / -74) across 3 files Reviewer: facchinm Review duration: 10063m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 294 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.340
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #694"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.9% (MEDIUM) · Higher = larger blast radius
    39.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.8% · Safe to merge
    15.8%