← Back to Pull requests

CI: make pyperf-suite example executable #16

Closed
unknown closed this pull request without merging on Nov 28, 2026 14:53 UTC
View on GitHub
unknown unknown commented on Nov 12, 2026 19:08 UTC
Author

closes gh-14

Make the examples' README files executable. The end goal is to satisfy:

  • to keep README examples current, they execute on CI.

  • examples are in human-readable markdown, and can be read from the terminal.

  • the full output can be seen from the CI logs;

  • examples can be transformed to html and placed on the web documentation.
  • For running on CI, there will be two runs:

  • In this repository, the CI runs on each PR,against the benchx from pypi;

  • In the benchx repository, the same README executes on CI for each benchx PR using the main branch of benchx_examples
  • This PR starts the process from the pyperf-suite example (which actually already drifted): it adds a CI workflow to execute examples/pyperf-suire/README.md. Two sets of moving parts:

  • a reusable workflow. This sets scaffolding to run the same workflow here and in benchx CI with minimal duplication;

  • the executable markdown format. A classic tool is jupytext with MYST-markdown, but for now I'm using a simpler tech: markdown-it-py to parse executable blocks from a markdown file + an ad-hoc script to parse it with the following rules for markdown fences:
  • bash
    this is a bash command
    `
    ``
    executes a shell command.

    python
    here is python code

    executes python code

    text
    this is output

    is an example output. The first text fence which follows a sh, bash or python fence is replaced by the actual output; other fences or unfenced triple backticks are preserved as is:


    this looks like code, but it is never run
    `

    ---------------

    While I'm not loving a 300-odd LOC python script for parsing markdown, it seems simple enough to not use a blunt general-purpose tool that MYST-markdown is. If it runs out of steam going forward, reusing MYST is easy enough.
    FWIW, what I like of the current DIY solution is that it's easy to keep things readable in terminal (Myst-markdown is geared towards full-fledged jupyter notebooks and strips all output)

    Diff: 258 lines (+193 / -65) across 3 files Reviewer: rok Review duration: 22784m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 258 lines diff across 3 files
    0.39
    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.332
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #16"
    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.2% (MEDIUM) · Higher = larger blast radius
    39.2%
    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.5% · Safe to merge
    15.5%