# waynehacking8/inference-perf-gate architecture

> Architecture diagram of the GitHub repository waynehacking8/inference-perf-gate, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/waynehacking8/inference-perf-gate
- Repository: https://github.com/waynehacking8/inference-perf-gate

## Overview

inference-perf-gate is a GitHub Action that runs or consumes benchmark measurements, compares them with a committed baseline using per-metric direction and tolerance, then reports a verdict and can block a pull request. Its main runtime entrypoint owns input loading, optional benchmark execution, comparison, outputs, and GitHub comment updates; the pure comparison module classifies metrics and renders the report. README documents the self-hosted GPU workflow and check behavior; implementation edges below are grounded in the sampled source.

Main entry points: [`src/index.ts`](https://github.com/waynehacking8/inference-perf-gate/blob/main/src/index.ts) (Action entrypoint), [`src/compare.ts`](https://github.com/waynehacking8/inference-perf-gate/blob/main/src/compare.ts) (Metric comparison)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Action runtime"]
  node_results["Measured results"]
  node_baseline["Committed baseline"]
  node_specs["Metric specifications"]
  node_entry["Action entrypoint<br/>[index.ts]"]
end

subgraph group_compare["Comparison engine"]
  node_engine["Metric comparison<br/>[compare.ts]"]
  node_renderer["Markdown renderer<br/>[compare.ts]"]
end

subgraph group_reporting["GitHub reporting"]
  node_outputs["Action outputs<br/>[index.ts]"]
  node_github["GitHub API"]
  node_comment["PR comment"]
  node_check["Check verdict"]
end

node_pr(("Pull request"))
node_runner["Self-hosted runner"]
node_benchmark["Benchmark command"]

node_pr -->|"triggers"| node_runner
node_runner -->|"runs"| node_benchmark
node_benchmark -->|"writes"| node_results
node_runner -->|"invokes"| node_entry
node_entry -->|"executes optionally"| node_benchmark
node_entry -->|"loads"| node_results
node_entry -->|"loads"| node_baseline
node_entry -->|"loads"| node_specs
node_entry -->|"compares"| node_engine
node_entry -->|"renders"| node_renderer
node_entry -->|"sets"| node_outputs
node_entry -->|"calls"| node_github
node_github -->|"creates or updates"| node_comment
node_entry -->|"fails on regression"| node_check

click node_entry "https://github.com/waynehacking8/inference-perf-gate/blob/main/src/index.ts"
click node_engine "https://github.com/waynehacking8/inference-perf-gate/blob/main/src/compare.ts"
click node_renderer "https://github.com/waynehacking8/inference-perf-gate/blob/main/src/compare.ts"
click node_outputs "https://github.com/waynehacking8/inference-perf-gate/blob/main/src/index.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_results,node_baseline,node_specs,node_entry toneBlue
class node_engine,node_renderer toneAmber
class node_outputs,node_github,node_comment,node_check,node_pr toneMint
class node_runner,node_benchmark toneIndigo
```

## Components

### Action runtime

- **Measured results**
- **Committed baseline**
- **Metric specifications**
- [Action entrypoint](https://github.com/waynehacking8/inference-perf-gate/blob/main/src/index.ts): `src/index.ts`

### Comparison engine

- [Metric comparison](https://github.com/waynehacking8/inference-perf-gate/blob/main/src/compare.ts): `src/compare.ts`
- [Markdown renderer](https://github.com/waynehacking8/inference-perf-gate/blob/main/src/compare.ts): `src/compare.ts`

### GitHub reporting

- [Action outputs](https://github.com/waynehacking8/inference-perf-gate/blob/main/src/index.ts): `src/index.ts`
- **GitHub API**
- **PR comment**
- **Check verdict**

### Other components

- **Pull request**
- **Self-hosted runner**
- **Benchmark command**

## Connections

- Pull request → Self-hosted runner: triggers (evidence: `README.md`)
- Self-hosted runner → Benchmark command: runs (evidence: `README.md`)
- Benchmark command → Measured results: writes (evidence: `README.md`)
- Self-hosted runner → Action entrypoint: invokes (evidence: `README.md`)
- Action entrypoint → Benchmark command: executes optionally (evidence: `src/index.ts`)
- Action entrypoint → Measured results: loads (evidence: `src/index.ts`)
- Action entrypoint → Committed baseline: loads (evidence: `src/index.ts`)
- Action entrypoint → Metric specifications: loads (evidence: `src/index.ts`)
- Action entrypoint → Metric comparison: compares (evidence: `src/index.ts`)
- Action entrypoint → Markdown renderer: renders (evidence: `src/index.ts`)
- Action entrypoint → Action outputs: sets (evidence: `src/index.ts`)
- Action entrypoint → GitHub API: calls (evidence: `src/index.ts`)
- GitHub API → PR comment: creates or updates
- Action entrypoint → Check verdict: fails on regression (evidence: `src/index.ts`)
