api7 / api7/aisix

perf(build): train the upstream-TLS path in the PGO profile (v2 training shape)

Open
#973 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement P2
Dominant language
Rust
Stars
157
Forks
32
Avg merge
1h 25m
Merged PRs (30d)
145

Description

Deferred from #967 (2026-08-13 scenario review, option B).

The v1 PGO training matrix drives the gateway against a plaintext local mock, so the TLS client paths (handshake, record encrypt/decrypt on every upstream byte) stay untrained and are laid out as cold code. Production upstreams are HTTPS, making this the largest known divergence between the training profile and real traffic.

What v2 needs:

  • an embedded TLS server in bench/pgo-training/trainer (rustls dependency) plus a committed localhost test certificate (clearly marked test-only)
  • one or two TLS shapes in the matrix (chat non-stream + one streaming shape)
  • a way to measure the benefit: the current probe harness and bench rigs are plaintext, so the gain is unverifiable today — a TLS mock leg for the probe harness is a prerequisite for gating the change
  • holdout re-run per #967 hard gate 3 (training-set change)

Rejected for v1 because the trainer would lose its zero-dependency property and the benefit cannot be measured on current rigs.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in bench/pgo-training/trainer and review the current PGO training matrix, then inspect the probe harness and bench rigs to understand their plaintext assumptions. The work is done when the trainer supports the specified TLS shapes with a committed test-only certificate, the probe harness can measure a TLS mock leg, and the #967 hard gate 3 holdout rerun is complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, performance, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.