Repository navigation
perf(xtask): add request-credential perf fixtures (ENG-1066) - #351
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b29fdd477d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Slice AP4b. Three deterministic H0 metrics land before AP5/AP6 change the credential path, so both slices record baseline and candidate with the same metric inventory and fixture version: - xai_request_credential_resolution_ns and xai_request_credential_concurrent_resolution_ns: one, and eight concurrent, RequestCredentialProvider::credential calls for a stored, unexpired xAI OAuth credential through CredentialStore with an in-memory keyring; - request_time_authorized_stream_ns: one Chat Completions request compiled with HttpAuth::RequestTimeBearer, Provider::stream to the terminal event, against a keep-alive loopback that checks each request carried the stored bearer. Budget rows are added and the fixture version goes 5 -> 6, so version 5 reports are no longer comparable; the runbook and perf README say so.
The AP4b workload wiring shifts two existing perf.rs test sleeps by 12 lines; their legacy entries follow them. No sleep is added (73/73).
…(ENG-1066) Review of b29fdd4 (#351): - CredentialStore::offline installs token clients that refuse every exchange, refresh and device call without network I/O and count them; both credential workloads use it and fail their correctness check if a sample ever calls one, so a refresh regression cannot reach xAI. - The keep-alive loopback is now a task on the caller's runtime with a bounded connection set; the workload stops it and awaits every connection before returning, and Drop aborts it on an early return, so no listener, socket or thread outlives the workload.
f42ce31 to
256f0cc
Compare
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
AP4b: request-credential perf fixtures
Spec: docs/plans/auth-providers.md (AP4b) Linear: ENG-1066 Stacked on: #350
This adds benchmarks and budget rows only. Runtime behaviour doesn't change. AP4b lands before AP5 and AP6 change the credential path, so both of those slices can record their baseline and candidate with the same metric inventory and fixture version:
validate_metric_contractsrejects reports whose metric inventories differ.What changed
xtask/src/perf/credentials.rs(new) adds three H0 metrics. They run against an in-memory keyring and a loopback server, so they measure QQ's credential path, not a real keyring or a network:xai_request_credential_resolution_ns: oneRequestCredentialProvider::credentialcall for a stored, unexpired xAI OAuth credential, throughCredentialStorewith an in-memoryKeyringBackend. The token is valid for a day, so no sample triggers a refresh.xai_request_credential_concurrent_resolution_ns: eight concurrent calls on one provider, timed from start to the last completion. AP5 needs this one: before AP5, Codex holds its cache lock across the whole load, so concurrent warm requests run one at a time.request_time_authorized_stream_ns: one Chat Completions request compiled withHttpAuth::RequestTimeBearer, timed fromProvider::streamto the terminal event, against a keep-alive loopback server. A correctness check fails the recording unless every request carried the stored bearer token.benchmarks/perf/budgets-v1.json: budget rows for the three metrics (20%, 20% and 15% maximum regression), andfixture_versiongoes from 5 to 6. Version 5 reports can no longer be compared; the runbook andbenchmarks/perf/README.mdsay so.xtask/src/legacy-sleeps.txt: two existing sleep baselines are updated to their new line numbers after the wiring moved them down. No sleep was added (73/73).How verified
cargo xtask check
Head
b29fdd477d11vsorigin/main; 9 changed file(s); scope: qq, xtask.cargo fmt --all -- --checkcargo xtask lintcargo clippy --color never -p qq -p xtask --all-targets --all-features -- -D warningscargo nextest run --color never --profile default -p qq -p xtaskAll gates passed in 74.6s.
perf::tests::credential_fixtures_resolve_the_stored_bearer_without_refreshruns all three workloads and checks their names, sample counts and correctness checks. To confirm the bearer check is real, I temporarily changed the expected value: the check failed with "0 of 6 requests carried the stored bearer".request_time_authorized_stream_nshad a median of about 0.5 ms.cargo xtask perf baselinesmoke recording is still running. I'll add its receipt to the ledger when it finishes.Compatibility