Skip to content

perf: remove Python from current load hot path - #64

Merged
seonghobae merged 9 commits into
test/pingora-peer-options-debug-contract-v1from
perf/rust-load-origin-current-v1
Sep 6, 2026
Merged

perf: remove Python from current load hot path#64
seonghobae merged 9 commits into
test/pingora-peer-options-debug-contract-v1from
perf/rust-load-origin-current-v1

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Refs #34. Current-stack successor for the still-valid generic portion of Draft #35. Do not close #35 until its remaining pg-erd delta/test/fixture/contract/evidence is also fully succeeded.

Authority / scope

Exact base is supplier-semantics #62 389801461e28f422c166fb0918a2805d7085d05a, which is terminal hosted GREEN. Current exact head is 1b6c5307e6ff7837dd7504ea2cc23936ab44a86c. Exact compare is ahead 9 / behind 0 with #62 as merge base and five effective paths:

  • .github/workflows/ci.yml
  • TEST_STRATEGY.md
  • added tests/load/load_origin.rs
  • removed tests/load/upstream_fixture.py
  • added tests/load_evidence_workflow_contract.rs

The measured k6 origin moves from Python ThreadingHTTPServer to a std-only Rust HTTP/1.1 fixture. It validates startup controls before bind, caps workers at 256, uses a bounded accepted-socket queue and bounded header buffer, uses TCP_NODELAY and deterministic Content-Length framing, and stays outside Cargo production/example targets.

Rust 1.98.1 remains current compiler authority from #56. The Rust 1.98.0 value on historical #35 is explicitly historical and is not a current acceptance requirement.

The direct origin-only readiness probe stays at 127.0.0.1:18081/fixture-ready and does not warm the gateway route. The measured contract remains 400 requests / 4 VUs, exact status/body checks, zero failed HTTP requests, and p95 <20 ms. No Pingora pin, Cargo.lock, production gateway Rust, route/TLS/auth/business behavior, sample count, concurrency, or threshold changes.

Causal RED → minimal repair

Earlier commits add a semantic regression that requires a non-empty k6-summary.json after successful traffic while preventing an always() artifact upload from replacing a pre-k6 causal failure with a secondary missing-file error. The success-only summary gate remains fail-closed; only the later evidence upload uses if-no-files-found: ignore.

The first hosted execution on predecessor bad9e0ed158d633c259861106f50e223247370dd is terminal. CI 34041022444 has GREEN test 101507678628 and GREEN oci-runtime 101507678563; load-contract 101507678702 fails in Build exact gateway candidate and Rust load origin. Supply Chain 34041022495 is GREEN.

The load log proves the exact gateway release build completed under Rust 1.98.1. The next command, rustfmt --edition 2021 --check tests/load/load_origin.rs, reported exactly three layout-only diffs and stopped execution before direct fixture tests, optimized helper compilation, or k6. The later artifact step found no summary and succeeded with the intended missing-file policy, so the formatter failure remained the causal signal.

Commit 1b6c5307e6ff7837dd7504ea2cc23936ab44a86c is the minimal repair: one-file, formatter-only relative to bad9e0ed... (tests/load/load_origin.rs, +8/-10). Exact ancestry is ahead 1 / behind 0 with bad9e0ed... as merge base. No fixture semantics or acceptance thresholds changed.

Exact-head GREEN

Current exact CI 34045381577 is terminal GREEN on 1b6c5307...:

  • oci-runtime 101519398319: exact checkout, exact candidate image, declared non-root identity, read-only least-privilege runtime GREEN;
  • load-contract 101519398398: Rust 1.98.1, exact gateway release build, Rust-origin rustfmt/direct tests/optimized compilation, checksum-pinned k6 2.2.0, measured traffic, non-empty summary gate and evidence upload GREEN;
  • test 101519398430: formatting, compile/test, strict lint, public rustdoc, pinned coverage tooling, owned-production workload/diagnostics, complete owned-production coverage enforcement, resolved dependency-lock verification/evidence GREEN.

Exact load artifact 9993754723, digest sha256:0c545787f21d264fd012d9b34f16d4272c5c8afeeccd3795ac256c70487d321e, is bound to 1b6c5307... and records 400/400 HTTP-200 checks, 400/400 body-identity checks, checks rate 1, http_req_failed rate 0, and http_req_duration p(95)=0.9037063 ms under the unchanged 400-request / 4-VU contract. This is Rust-only loopback regression evidence; it is not an Internet/TLS/multi-hop production SLO.

Current exact Supply Chain 34045381591 / candidate-evidence 101519398528 is also terminal GREEN on the same SHA through exact checkout, Rust 1.98.1, pinned dependency-policy tooling, committed dependency audit, exact candidate image, SPDX SBOM, image scan, exact-source binding and evidence upload.

Review boundary

A later CodeRabbit static review explicitly covered exact head 1b6c5307e6ff7837dd7504ea2cc23936ab44a86c against exact base 389801461e28f422c166fb0918a2805d7085d05a, enumerated all five changed paths, and found no blocking issue in the requested scope. This supersedes the earlier transient exact-head review failures for technical static-review evidence.

The older CodeRabbit summary footer still carries a merge-risk marker only through ea32917f97c81d1c3053302ec9b2099de8990ea5; that footer is stale for current coverage and is not used as authority. The exact-head static bot review is not an organization-required independent APPROVED review. Formal GitHub review enumeration currently contains no reviews, and no unresolved inline review threads are present.

Promotion boundary

This PR does not repair upstream derivative, replace #54's supplier RED, satisfy #56's independent approval, or claim representative production-network/TLS latency, immutable release, canary, cutover, or legacy removal. Next causal order is #54 derivative RED + #62 supplier semantics + #64 Rust-only load GREEN/exact static review → maintainer-integrated immutable supplier repair → gateway supplier bump/Cargo.lock regeneration → unchanged #54 absence regression GREEN + preserved #62/#64 GREEN → #56 independent APPROVED governance → protected integration → protocol restack and real-wire RED/GREEN → immutable release/shadow/canary/cutover.

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 538967bc-a21d-4d57-b3f7-cfdac7c0f49e

📥 Commits

Reviewing files that changed from the base of the PR and between 3898014 and ea32917.

📒 Files selected for processing (4)
  • .github/workflows/ci.yml
  • TEST_STRATEGY.md
  • tests/load/load_origin.rs
  • tests/load/upstream_fixture.py
💤 Files with no reviewable changes (1)
  • tests/load/upstream_fixture.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Python 업스트림 고정 장치를 Rust 기반 고정 장치로 교체했습니다. 새 서버는 제한된 작업자 풀, HTTP/1.1 keep-alive, 응답 지연, 헤더 크기 제한을 지원합니다. CI는 Rust 바이너리를 검증하고 실행합니다.

Changes

Rust 로드 오리진

Layer / File(s) Summary
오리진 설정과 응답 계약
tests/load/load_origin.rs
환경 변수로 포트, 페이로드, 작업자 수, 응답 지연, 연결 모드를 설정합니다. 입력값을 검증하고 고정된 HTTP 응답 형식을 생성합니다. 관련 단위 테스트를 추가했습니다.
제한된 작업자 기반 서버 실행
tests/load/load_origin.rs
TCP 리스너와 제한된 소켓 큐를 추가했습니다. 작업자 스레드는 연결을 처리하고 keep-alive 또는 close 방식으로 응답합니다. 요청 헤더 크기와 TCP_NODELAY를 관리합니다.
로드 테스트 CI 통합
.github/workflows/ci.yml, TEST_STRATEGY.md
CI가 rustfmt, 경고 오류 처리 컴파일, 단위 테스트, 최적화 빌드를 수행합니다. 로드 테스트는 Python 스크립트 대신 /tmp/load_origin을 실행합니다. 문서는 새 오리진과 성능 계약을 설명합니다.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Merge Risk: ⚪ Minimal · up to ea329

This replaces the local Python load-test origin with a bounded Rust HTTP/1.1 fixture while preserving the existing gateway smoke contract. No current merge-blocking risk remains for the documented loopback regression scope.

Sequence Diagram(s)

sequenceDiagram
  participant CI
  participant load_origin
  participant Gateway
  participant LoadTest
  CI->>load_origin: 바이너리 컴파일 및 실행
  LoadTest->>Gateway: 로드 요청 전송
  Gateway->>load_origin: HTTP/1.1 업스트림 요청
  load_origin-->>Gateway: 상태, 헤더, 페이로드 응답
  Gateway-->>LoadTest: 다운스트림 응답
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning Rust fixture 추가, Python fixture 삭제, HTTP/1.1 응답 보존, bounded worker pool, 환경 변수 검증, 직접 컴파일 검사, 기존 부하 계약 보존을 구현했습니다. 그러나 연결 이슈 [#35]는 Rust 1.98.0을 요구하고, 변경 사항은 Rust 1.98.1을 사용합니다. Rust 버전을 연결 이슈 [#35]의 요구대로 1.98.0으로 고정하거나, 1.98.1 사용을 승인하도록 이슈 요구 사항을 갱신하고 근거를 추가하십시오.
✅ Passed checks (4 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed 변경된 네 경로는 모두 연결 이슈 [#35]의 Rust 기반 loopback load origin 전환과 CI 및 문서 갱신에 직접 관련됩니다. Production gateway logic, routing, authentication, dependencies, thresholds, release metadata는 변경하지 않았습니다.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 1 files. (2 skipped: 2…
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 Python 기반 부하 경로를 제거하는 주요 변경 사항을 정확하게 설명합니다. 간결하고 구체적이며 변경 범위와 일치합니다.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf/rust-load-origin-current-v1

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review the exact current head only. Focus on whether the std-only Rust origin preserves the existing low-contention HTTP/1.1/k6 semantics, whether the bounded worker/queue implementation can deadlock or distort the 4-VU measurement, whether the direct rustc/rustfmt test path is sound under Rust 1.98.1, and whether removing tests/load/upstream_fixture.py leaves any stale workflow/test reference. Do not transfer review credit from #35/#42 or the #62 parent.

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="389801461e28f422c166fb0918a2805d7085d05a"

printf '%s\n' '=== exact HEAD ==='
git rev-parse HEAD
git status --short
printf '%s\n' '=== changed paths against declared base ==='
git diff --name-status "$base"...HEAD
printf '%s\n' '=== stat ==='
git diff --stat "$base"...HEAD
printf '%s\n' '=== diff ==='
git diff --find-renames --find-copies --unified=80 "$base"...HEAD -- \
  .github/workflows/ci.yml \
  tests/load/load_origin.rs \
  tests/load/upstream_fixture.py \
  TEST_STRATEGY.md

printf '%s\n' '=== Rust fixture outline ==='
ast-grep outline tests/load/load_origin.rs --items all --view expanded || true

printf '%s\n' '=== workflow and strategy files ==='
cat -n .github/workflows/ci.yml
printf '%s\n' '--- TEST_STRATEGY.md ---'
cat -n TEST_STRATEGY.md

printf '%s\n' '=== all Python fixture and load-origin references ==='
rg -n -i -C 3 'upstream_fixture\.py|load_origin(?:\.rs)?|fixture-ready|LOAD_ORIGIN|FIXTURE_' \
  -g '!target/**' -g '!node_modules/**' .

printf '%s\n' '=== load-related files ==='
fd -t f . tests | sort

Length of output: 67065


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '=== gateway smoke contract ==='
cat -n tests/load/gateway_smoke.js

printf '%s\n' '=== contract outlines ==='
ast-grep outline tests/toolchain_contract.rs --items all --view expanded
ast-grep outline tests/coverage_contract.rs --items all --view expanded
ast-grep outline tests/documentation_contract.rs --items all --view expanded
ast-grep outline tests/workflow_concurrency_contract.rs --items all --view expanded

printf '%s\n' '=== focused workflow/fixture contract references ==='
rg -n -i -C 8 \
  'load_origin|upstream_fixture|rustfmt|rustc|load-contract|gateway_smoke|tests/load|coverage denominator|Cargo production|fixture-ready' \
  tests README.md TEST_STRATEGY.md .github/workflows/ci.yml \
  -g '!target/**' -g '!node_modules/**'

printf '%s\n' '=== Rust toolchain authority and repository selector files ==='
fd -HI -t f 'rust-toolchain.*|config(\.toml)?|Cargo.toml|Cargo.lock' . | sort | \
  xargs -r -n1 sh -c 'echo "--- $0"; cat -n "$0"'

Length of output: 140550


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="ContextualWisdomLab/pingora-gateway"
pr="64"
sha="ea32917f97c81d1c3053302ec9b2099de8990ea5"

printf '%s\n' '=== PR exact-head metadata ==='
gh pr view "$pr" --repo "$repo" --json number,headRefOid,baseRefOid,isDraft,mergeStateStatus,statusCheckRollup

printf '%s\n' '=== check runs for exact head ==='
gh api "repos/${repo}/commits/${sha}/check-runs?per_page=100" \
  --jq '.check_runs[] | [.name, .status, .conclusion, .details_url] | `@tsv`'

printf '%s\n' '=== exact-head tracked references to removed Python fixture ==='
git grep -n -i 'upstream_fixture\.py' "$sha" -- ':!Cargo.lock' || true

printf '%s\n' '=== exact-head tracked Python measured-path references ==='
git grep -n -i -E 'python3|ThreadingHTTPServer|http\.server' "$sha" -- \
  .github TEST_STRATEGY.md tests ':!tests/production_path.rs' || true

printf '%s\n' '=== diff whitespace validation ==='
git diff --check 389801461e28f422c166fb0918a2805d7085d05a...HEAD

printf '%s\n' '=== fixture serving and test ranges ==='
nl -ba tests/load/load_origin.rs | sed -n '90,373p'

Length of output: 3623


@seonghobae Static review completed for exact head ea32917f97c81d1c3053302ec9b2099de8990ea5 only.

I found no blocking issue in the requested scope.

  • The delta against 389801461e28f422c166fb0918a2805d7085d05a contains only the four declared paths.
  • tests/load/gateway_smoke.js sends 400 bodyless HTTP GET requests across four VUs. tests/load/load_origin.rs returns the expected HTTP/1.1 200, fixed Content-Length, Connection: keep-alive, and upstream-ok body. This preserves the existing load contract.
  • The fixture uses 32 workers and a bounded 64-socket queue by default. A worker releases the receiver mutex before it serves a socket. The synchronous sender can apply backpressure when the queue is full, but it has no circular wait with the workers. The four-VU load shape is well below the worker budget.
  • The load job installs, selects, and verifies Rust 1.98.1 before cargo, rustfmt, and direct rustc commands. It checks formatting, compiles fixture tests with -D warnings, runs the tests, then compiles the optimized /tmp/load_origin helper.
  • Exact-head tracked-file searches found no stale reference to tests/load/upstream_fixture.py. They also found no remaining Python HTTP-server reference in the measured load path.
  • The direct fixture tests cover startup parsing, framing, and header-boundary logic. They do not directly exercise a live keep-alive exchange or queue saturation. This is not a defect for the current low-contention k6 contract.

The exact-head CI checks are still queued. This review does not treat queued checks as execution evidence. I did not transfer review credit from #35, #42, or #62.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact current head bad9e0ed158d633c259861106f50e223247370dd against exact base 389801461e28f422c166fb0918a2805d7085d05a. Pay particular attention to tests/load_evidence_workflow_contract.rs and the RED→GREEN change that separates successful-summary enforcement from the always-run artifact step, so pre-k6 failures retain their primary cause without weakening successful k6 evidence. Do not transfer predecessor review credit.

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="389801461e28f422c166fb0918a2805d7085d05a"
head="bad9e0ed158d633c259861106f50e223247370dd"
repo="ContextualWisdomLab/pingora-gateway"

printf '%s\n' '=== repository state and exact revisions ==='
git rev-parse HEAD
git cat-file -t "$base"
git cat-file -t "$head"
git status --short

printf '%s\n' '=== exact changed paths and diff ==='
git diff --name-status "$base" "$head"
git diff --check "$base" "$head"
git diff --find-renames --find-copies --unified=100 "$base" "$head" -- \
  .github/workflows/ci.yml \
  tests/load_evidence_workflow_contract.rs \
  tests/load \
  TEST_STRATEGY.md

printf '%s\n' '=== focused file outline ==='
ast-grep outline tests/load_evidence_workflow_contract.rs --items all --view expanded

printf '%s\n' '=== relevant files with line numbers ==='
nl -ba tests/load_evidence_workflow_contract.rs
printf '%s\n' '--- .github/workflows/ci.yml ---'
nl -ba .github/workflows/ci.yml

printf '%s\n' '=== load-evidence workflow and contract references ==='
rg -n -i -C 6 \
  'load_evidence_workflow_contract|load-contract|always\(\)|artifact|summary|k6|gateway_smoke|failure\(\)|success\(\)|if:' \
  .github tests TEST_STRATEGY.md \
  -g '!target/**' -g '!node_modules/**'

printf '%s\n' '=== exact-head GitHub metadata and checks ==='
gh pr view 64 --repo "$repo" --json number,headRefOid,baseRefOid,isDraft,mergeStateStatus,statusCheckRollup
gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \
  --jq '.check_runs[] | [.name, .status, .conclusion, .details_url] | `@tsv`'

Length of output: 42528


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head="bad9e0ed158d633c259861106f50e223247370dd"
repo="ContextualWisdomLab/pingora-gateway"

printf '%s\n' '=== gateway smoke script ==='
cat tests/load/gateway_smoke.js

printf '%s\n' '=== focused workflow range ==='
sed -n '60,175p' .github/workflows/ci.yml

printf '%s\n' '=== focused workflow contract ==='
cat tests/load_evidence_workflow_contract.rs

printf '%s\n' '=== summary producer and all scoped references ==='
rg -n -C 4 -F 'k6-summary.json' .github tests TEST_STRATEGY.md \
  -g '!target/**' -g '!node_modules/**'
rg -n -C 3 -i 'handleSummary|summary.*json|k6 run|Exercise concurrent loopback traffic contract|Require loopback latency summary|Upload loopback latency evidence' \
  .github tests TEST_STRATEGY.md \
  -g '!target/**' -g '!node_modules/**'

printf '%s\n' '=== test registration and YAML dependency evidence ==='
rg -n -C 3 -P 'load_evidence_workflow_contract|serde_yaml' Cargo.toml Cargo.lock tests \
  -g '!target/**' -g '!node_modules/**'

printf '%s\n' '=== exact-head GitHub metadata and checks ==='
gh pr view 64 --repo "$repo" --json number,headRefOid,baseRefOid,isDraft,mergeStateStatus,statusCheckRollup
gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \
  --jq '.check_runs[] | [.name, .status, .conclusion, .details_url] | `@tsv`'

Length of output: 40791


@seonghobae Static review completed for exact head bad9e0ed158d633c259861106f50e223247370dd against exact base 389801461e28f422c166fb0918a2805d7085d05a.

I found no blocking issue in the requested scope.

  • The delta contains the Rust origin change set plus tests/load_evidence_workflow_contract.rs.
  • tests/load/gateway_smoke.js writes k6-summary.json through handleSummary.
  • The workflow runs Require loopback latency summary after Exercise concurrent loopback traffic contract and before Upload loopback latency evidence.
  • The summary step runs test -s k6-summary.json with no explicit if. GitHub Actions therefore applies the default success-only condition. A successful k6 path cannot complete without a non-empty summary.
  • The upload step retains if: ${{ always() }}. Its if-no-files-found: ignore setting prevents an absent summary from adding an artifact failure after an earlier checkout, build, origin-startup, gateway-startup, or k6 failure.
  • tests/load_evidence_workflow_contract.rs parses the workflow YAML and verifies the step order, the exact summary check, the default summary condition, and the always-run/ignore-missing upload configuration.

The RED→GREEN change preserves the primary cause for pre-k6 failures. It also preserves successful-k6 evidence enforcement.

The exact-head checks are queued. This static review does not treat queued checks as execution evidence. I did not transfer review credit from predecessor work.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review the current exact head bad9e0ed158d633c259861106f50e223247370dd, including the post-ea32917f evidence-path RED→GREEN changes in .github/workflows/ci.yml, tests/load_evidence_workflow_contract.rs, and TEST_STRATEGY.md. Do not transfer predecessor coverage; verify the current five-path effective range from exact base 389801461e28f422c166fb0918a2805d7085d05a, the success-only non-empty k6 summary gate, and that the always-run upload cannot obscure a pre-k6 causal failure.

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="389801461e28f422c166fb0918a2805d7085d05a"
head="bad9e0ed158d633c259861106f50e223247370dd"
repo="ContextualWisdomLab/pingora-gateway"

printf '%s\n' '=== exact revisions ==='
git cat-file -t "$base"
git cat-file -t "$head"
git rev-parse HEAD
printf '%s\n' '=== exact effective range ==='
git diff --name-status "$base" "$head"
git diff --check "$base" "$head"
printf '%s\n' '=== exact scoped diff ==='
git diff --find-renames --find-copies --unified=100 "$base" "$head" -- \
  .github/workflows/ci.yml \
  tests/load/load_origin.rs \
  tests/load/upstream_fixture.py \
  tests/load_evidence_workflow_contract.rs \
  TEST_STRATEGY.md

printf '%s\n' '=== workflow contract outline ==='
ast-grep outline tests/load_evidence_workflow_contract.rs --items all --view expanded
printf '%s\n' '=== exact workflow job and evidence contract ==='
nl -ba .github/workflows/ci.yml | sed -n '55,190p'
nl -ba tests/load_evidence_workflow_contract.rs
printf '%s\n' '=== exact strategy references ==='
rg -n -C 5 -i \
  'k6|summary|artifact|always|load origin|Python|Rust|loopback|latency evidence' \
  TEST_STRATEGY.md

printf '%s\n' '=== scoped summary producers and consumers ==='
rg -n -C 5 -F 'k6-summary.json' \
  .github tests TEST_STRATEGY.md \
  -g '!target/**' -g '!node_modules/**'
printf '%s\n' '=== workflow control-flow references ==='
rg -n -C 4 \
  'load-contract|always\(\)|success\(\)|failure\(\)|if-no-files-found|Upload loopback latency evidence|Require loopback latency summary|Exercise concurrent loopback traffic contract' \
  .github/workflows/ci.yml tests/load_evidence_workflow_contract.rs

printf '%s\n' '=== stale removed-fixture and Python server references at exact head ==='
git grep -n -i -E 'upstream_fixture\.py|ThreadingHTTPServer|http\.server' "$head" -- \
  .github TEST_STRATEGY.md tests ':!tests/production_path.rs' || true

printf '%s\n' '=== exact-head GitHub status ==='
gh pr view 64 --repo "$repo" --json number,headRefOid,baseRefOid,isDraft,mergeStateStatus,statusCheckRollup
gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \
  --jq '.check_runs[] | [.name, .status, .conclusion] | `@tsv`'

Length of output: 43161


🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="389801461e28f422c166fb0918a2805d7085d05a"
head="bad9e0ed158d633c259861106f50e223247370dd"
repo="ContextualWisdomLab/pingora-gateway"

printf '%s\n' '=== effective range count and paths ==='
git diff --name-only "$base" "$head" | awk 'END { print "changed_path_count=" NR } { print }'

printf '%s\n' '=== exact-head load-contract workflow ==='
git show "${head}:.github/workflows/ci.yml" | sed -n '55,180p'

printf '%s\n' '=== exact-head workflow contract ==='
git show "${head}:tests/load_evidence_workflow_contract.rs"

printf '%s\n' '=== exact-head test strategy load paragraph ==='
git show "${head}:TEST_STRATEGY.md" | rg -n -C 3 \
  'gateway_smoke\.js|load_origin\.rs|k6-summary\.json|always-run|artifact'

printf '%s\n' '=== integration-test registration and YAML dependency ==='
git show "${head}:Cargo.toml" | rg -n -C 3 'serde_yaml|dev-dependencies|\[\[test\]\]'
git ls-tree -r --name-only "$head" -- tests | rg -n 'load_evidence_workflow_contract\.rs|load_origin\.rs|upstream_fixture\.py'

printf '%s\n' '=== exact-head summary references ==='
git grep -n -C 4 -F 'k6-summary.json' "$head" -- \
  .github tests TEST_STRATEGY.md || true

printf '%s\n' '=== exact-head stale removed-fixture/Python server references ==='
git grep -n -i -E 'upstream_fixture\.py|ThreadingHTTPServer|http\.server|python3' "$head" -- \
  .github TEST_STRATEGY.md tests ':!tests/production_path.rs' || true

printf '%s\n' '=== exact-head PR and check status ==='
gh pr view 64 --repo "$repo" --json number,headRefOid,baseRefOid,isDraft,mergeStateStatus,statusCheckRollup
gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \
  --jq '.check_runs[] | [.name, .status, .conclusion, .details_url] | `@tsv`'

Length of output: 28814


@seonghobae Static review completed for exact head bad9e0ed158d633c259861106f50e223247370dd against exact base 389801461e28f422c166fb0918a2805d7085d05a.

I found no blocking issue in the requested scope.

  • The effective range contains exactly five paths:

    • .github/workflows/ci.yml
    • TEST_STRATEGY.md
    • tests/load/load_origin.rs
    • tests/load/upstream_fixture.py
    • tests/load_evidence_workflow_contract.rs
  • The workflow runs Require loopback latency summary after Exercise concurrent loopback traffic contract and before Upload loopback latency evidence.

  • The summary step runs test -s k6-summary.json with no explicit if. GitHub Actions therefore applies the default success-only condition. If measured traffic succeeds, the job requires a non-empty k6 summary.

  • tests/load/gateway_smoke.js creates k6-summary.json through handleSummary. The summary gate verifies that this expected evidence is present and non-empty.

  • If checkout, build, origin startup, gateway startup, or k6 fails, GitHub Actions skips the success-only summary step. The upload step still runs because it uses if: ${{ always() }}. Its if-no-files-found: ignore setting prevents an absent summary from creating a second artifact failure. The prior failure remains the causal failure.

  • tests/load_evidence_workflow_contract.rs enforces the step order, the exact summary command, the default summary condition, and the always-run upload with the ignored missing-file policy. Cargo discovers this file as an integration test. serde_yaml is available to parse the workflow.

  • TEST_STRATEGY.md describes the same boundary. It states that successful traffic requires a non-empty summary and that a pre-k6 failure must not be replaced by a missing-summary artifact error.

  • Exact-head searches found no stale reference to tests/load/upstream_fixture.py, ThreadingHTTPServer, http.server, or python3 in the scoped workflow, test, and strategy paths.

The test, load-contract, oci-runtime, and candidate-evidence checks are queued. This static review does not treat queued checks as execution evidence.

I did not transfer review credit from predecessor work.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review current exact head 1b6c5307e6ff7837dd7504ea2cc23936ab44a86c against exact base 389801461e28f422c166fb0918a2805d7085d05a. Focus on the five-path Rust-only load-origin scope and verify that the latest commit is formatter-only, preserves the bounded origin and unchanged 400-request / 4-VU / zero-failure / p95 <20 ms contract, and does not weaken causal failure evidence.

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Oops, something went wrong! Please try again later. 🐰 💔

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review current exact head 1b6c5307e6ff7837dd7504ea2cc23936ab44a86c against exact base 389801461e28f422c166fb0918a2805d7085d05a. The first exact-head request returned a transient bot error. Re-check the five-path Rust-only load-origin scope, especially the formatter-only final commit, bounded worker/queue/header behavior, direct origin readiness without gateway warm-up, unchanged 400-request / 4-VU / zero-failure / p95 <20 ms contract, and fail-closed causal evidence handling. Do not transfer review credit from predecessor ea32917f...; report exact-head coverage explicitly.

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Oops, something went wrong! Please try again later. 🐰 💔

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Review current exact head 1b6c5307e6ff7837dd7504ea2cc23936ab44a86c against exact base 389801461e28f422c166fb0918a2805d7085d05a. Two earlier exact-head attempts failed transiently, while the docs review service has since recovered. Do not transfer predecessor ea32917f... credit. Verify the five-path Rust-only load-origin scope, formatter-only final commit, bounded worker/queue/header behavior, direct origin readiness without gateway-route warm-up, unchanged 400-request / 4-VU / zero-failure / p95 <20 ms contract, and causal evidence handling. Report exact-head coverage explicitly.

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="389801461e28f422c166fb0918a2805d7085d05a"
head="1b6c5307e6ff7837dd7504ea2cc23936ab44a86c"
previous="bad9e0ed158d633c259861106f50e223247370dd"
repo="ContextualWisdomLab/pingora-gateway"

printf '%s\n' '=== exact revisions and workspace ==='
git cat-file -t "$base"
git cat-file -t "$previous"
git cat-file -t "$head"
git rev-parse HEAD
git status --short

printf '%s\n' '=== exact effective range ==='
git diff --name-status "$base" "$head"
git diff --check "$base" "$head"
git diff --stat "$base" "$head"

printf '%s\n' '=== final commit metadata and formatter-only diff ==='
git show --no-patch --format=fuller "$head"
git diff --check "$previous" "$head"
git diff --find-renames --find-copies --unified=100 "$previous" "$head"

printf '%s\n' '=== full scoped exact-range diff ==='
git diff --find-renames --find-copies --unified=80 "$base" "$head" -- \
  .github/workflows/ci.yml \
  TEST_STRATEGY.md \
  tests/load/load_origin.rs \
  tests/load/upstream_fixture.py \
  tests/load_evidence_workflow_contract.rs

printf '%s\n' '=== fixture and workflow-contract outlines ==='
ast-grep outline tests/load/load_origin.rs --items all --view expanded
ast-grep outline tests/load_evidence_workflow_contract.rs --items all --view expanded

printf '%s\n' '=== exact-head fixture ==='
git show "${head}:tests/load/load_origin.rs"

printf '%s\n' '=== exact-head workflow load contract ==='
git show "${head}:.github/workflows/ci.yml" | sed -n '55,210p'

printf '%s\n' '=== exact-head k6 and workflow evidence contract ==='
git show "${head}:tests/load/gateway_smoke.js"
git show "${head}:tests/load_evidence_workflow_contract.rs"

printf '%s\n' '=== exact-head strategy load evidence ==='
git show "${head}:TEST_STRATEGY.md" | rg -n -C 5 \
  'gateway_smoke\.js|load_origin\.rs|k6-summary\.json|always-run|artifact|warm|loopback|400|4 VU|p95|zero'

printf '%s\n' '=== exact-head relevant references ==='
git grep -n -i -C 4 -E \
  'upstream_fixture\.py|ThreadingHTTPServer|http\.server|python3|load_origin|fixture-ready|k6-summary\.json|Require loopback latency summary|Upload loopback latency evidence|Exercise concurrent loopback traffic contract' \
  "$head" -- .github tests TEST_STRATEGY.md ':!tests/production_path.rs' || true

printf '%s\n' '=== exact-head test registration and rust authority ==='
git show "${head}:Cargo.toml" | rg -n -C 3 'serde_yaml|dev-dependencies|\[\[test\]\]'
git ls-tree -r --name-only "$head" -- tests | rg -n \
  'load_origin\.rs|gateway_smoke\.js|load_evidence_workflow_contract\.rs|upstream_fixture\.py'
fd -HI -t f 'rust-toolchain.*|Cargo.toml' . | sort | \
  xargs -r -n1 sh -c 'echo "--- $0"; cat -n "$0"'

printf '%s\n' '=== exact-head GitHub status ==='
gh pr view 64 --repo "$repo" --json number,headRefOid,baseRefOid,isDraft,mergeStateStatus,statusCheckRollup
gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \
  --jq '.check_runs[] | [.name, .status, .conclusion, .details_url] | `@tsv`'

Length of output: 111635


@seonghobae Static review completed for exact head 1b6c5307e6ff7837dd7504ea2cc23936ab44a86c against exact base 389801461e28f422c166fb0918a2805d7085d05a.

I found no blocking issue in the requested scope.

Exact-head coverage included these five changed paths:

  • .github/workflows/ci.yml
  • TEST_STRATEGY.md
  • tests/load/load_origin.rs
  • tests/load/upstream_fixture.py
  • tests/load_evidence_workflow_contract.rs

The final commit is formatter-only. It changes only formatting in tests/load/load_origin.rs. It does not change fixture behavior or workflow behavior.

The Rust origin preserves the required low-contention HTTP/1.1 behavior:

  • It emits HTTP/1.1 200 OK, Content-Type: text/plain, fixed Content-Length, and Connection: keep-alive by default.
  • It prebuilds the response and applies TCP_NODELAY to each accepted socket.
  • It bounds request-header buffering.
  • It starts 32 workers by default and uses a bounded 64-socket queue.
  • A worker releases the receiver mutex before it serves a connection. The sender can block only when the queue is full. No circular wait exists between the sender and workers.
  • The four-VU load is below the worker and queue budgets.

The k6 contract remains unchanged. tests/load/gateway_smoke.js still uses 4 VUs and 400 iterations. It still requires status and body checks, zero failed HTTP requests, and http_req_duration p95 below 20 ms.

The workflow installs and verifies Rust 1.98.1 before it runs cargo, rustfmt, and direct rustc commands. It checks tests/load/load_origin.rs with rustfmt, compiles and runs its direct tests with rustc -D warnings, and produces the optimized /tmp/load_origin executable. The fixture remains outside Cargo production and example targets.

The direct readiness probe calls 127.0.0.1:18081/fixture-ready. It runs before the gateway starts measured traffic. It does not send an application request through the gateway. The gateway readiness probe separately calls /livez.

The causal evidence path remains fail-closed:

  • Require loopback latency summary runs after k6 and before upload.
  • The step runs test -s k6-summary.json with the default success-only condition.
  • A successful k6 run cannot complete without a non-empty summary.
  • The upload step uses if: ${{ always() }} and if-no-files-found: ignore.
  • Therefore, an earlier checkout, build, startup, or traffic failure is not replaced by a missing-summary artifact failure.

tests/load_evidence_workflow_contract.rs verifies the required ordering, summary command, success-only summary condition, always-run upload, and ignored missing-file policy.

No scoped exact-head reference remains to tests/load/upstream_fixture.py, ThreadingHTTPServer, http.server, or python3.

The exact-head test, load-contract, oci-runtime, and candidate-evidence checks completed successfully. I did not transfer review credit from ea32917f or other predecessor work.

You are interacting with an AI system.

seonghobae added a commit that referenced this pull request Sep 6, 2026
@seonghobae
seonghobae merged commit 32e0aee into test/pingora-peer-options-debug-contract-v1 Sep 6, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant