Skip to content

Run the open-loop scale benchmark over the corpus - #1048

Open
ejc3 wants to merge 2 commits into
bench/request-cpufrom
bench/scale-corpus
Open

ejc3 wants to merge 2 commits into
bench/request-cpufrom
bench/scale-corpus

Conversation

@ejc3

@ejc3 ejc3 commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Stacked on: bench/request-cpu

The render benchmark page says throughput under load is not measured on the corpus. reqscale.py, the open-loop harness, took one --url. It served its UFFD backend in copy mode whatever mode the corpus runs used. Its host control Chromium rendered that same URL, which for a corpus page would resolve on the live internet. No target ran it against the corpus replay.

Contract: make bench-chromium-corpus MEASURE=scale SCALE_… runs the open-loop benchmark over the 14 corpus URLs. It runs inside the campaign's golden, verify, diag and DNS-evidence bracket, in the campaign's memory-server mode, with a host control that renders against the local replay server.

Downstream impact: reqscale gains optional flags, and each request record gains a url field. Single-URL runs behave as before.

Changes

reqscale.py

  • --url may be a comma-separated list. request_url() cycles it by pair index, so the FILE and UFFD halves of a pair always render the same page, and each record names its URL.
  • A list requires --control-url, exactly one URL.
  • --control-resolve-all-to IP adds --host-resolver-rules=MAP * IP to the control Chromium. Provenance records it as host_control.resolve_all_to.
  • --uffd-mode (copy or minor, default copy) and --uffd-prefetch (on or off, default on) reach fcvm snapshot serve.
  • The control's and the server's argv are built by command() methods, so they are testable.

Other files

  • reqscale_analyze.py: the host-control key set includes resolve_all_to.
  • Makefile: adds SCALE_UFFD_MODE, SCALE_UFFD_PREFETCH, SCALE_CONTROL_URL and SCALE_CONTROL_RESOLVE_ALL_TO.
  • corpus_campaign.sh: MEASURE=scale swaps the serial run for bench-chromium-scale over the corpus. The control renders the corpus's first URL against 127.0.0.1, and rates, bursts, seed and gates come from the caller's SCALE_*. It refuses WebKit and non-UFFD backends.

Evidence

Each new test was observed failing on the parent:

  • CorpusPairing, ControlResolverRule, ServeMode
  • ConcurrentRequestRecords.test_a_corpus_request_renders_its_pairs_url_and_says_so
  • PlanOnlyCli (two refusal tests)
  • DnsBrackets.test_measure_scale_runs_the_open_loop_benchmark_over_the_corpus
$ python3 -m unittest discover -s bench/chromium -p 'test_*.py'
Ran 1070 tests in 262.548s
OK

reqscale.py has never run end to end on any host; its first run is the pbox campaign that follows. Fixes from that run land here before merge.

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 8e60221f-f6b4-4545-a56d-26af4b150ee2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-02T03:13:33.634095Z 38dd066 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 38dd066e2a

ℹ️ 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".

Comment on lines +940 to +944
SCALE_URL="$URLS" SCALE_TAG="$TAG" SCALE_OUT="$RESULTS/scale" \
SCALE_UFFD_MODE="$UFFD_MODE" SCALE_UFFD_PREFETCH="$UFFD_PREFETCH" \
SCALE_CONTROL_URL="${SCALE_CONTROL_URL:-${URLS%%,*}}" \
SCALE_CONTROL_RESOLVE_ALL_TO="${SCALE_CONTROL_RESOLVE_ALL_TO:-127.0.0.1}" \
make -C "$REPO" bench-chromium-scale 2>&1 | tee "$LOGDIR/run.log" || run_rc=$?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Bind the scale run before writing DNS evidence

When MEASURE=scale completes successfully, this target writes raw artifacts under $RESULTS/scale, but it never creates the $RESULTS/analysis.json that write_dns_evidence exclusively reads to obtain the measured run_id. The evidence writer therefore marks every scale run unclean, and the final verdict check exits 1, so the new advertised campaign mode can never complete successfully. Analyze the scale output or bind its provenance/status directly before writing the evidence.

AGENTS.md reference: bench/chromium/AGENTS.md:L262-L268

Useful? React with 👍 / 👎.

ejc3 added 2 commits October 2, 2026 03:40
reqscale.py took one --url, served its UFFD backend in copy mode whatever
the corpus used, and its host control Chromium rendered the same --url,
which for a corpus page would resolve on the live internet. No target ran
it against the corpus replay.

bench/chromium/reqscale.py:
- --url may be a comma-separated list. request_url() cycles it by pair
  index, so the FILE and UFFD halves of a pair render the same page, and
  each request record carries the url it rendered.
- A list needs --control-url, one URL, for the host control.
- --control-resolve-all-to IP maps every name the control Chromium
  resolves to IP (--host-resolver-rules=MAP * IP); provenance records it as
  host_control.resolve_all_to.
- --uffd-mode (copy|minor, default copy) and --uffd-prefetch (on|off,
  default on) reach `fcvm snapshot serve`.
- The control Chromium's and the memory server's argv are built by
  command() methods, so they can be checked without starting either.

bench/chromium/reqscale_analyze.py: host_control's key set includes
resolve_all_to.

Makefile: SCALE_UFFD_MODE, SCALE_UFFD_PREFETCH, SCALE_CONTROL_URL and
SCALE_CONTROL_RESOLVE_ALL_TO reach reqscale.py.

bench/chromium/corpus_campaign.sh: MEASURE=scale replaces the serial run
with make bench-chromium-scale over the 14 corpus URLs, inside the same
golden, verify, diag and DNS-evidence bracket, in the campaign's UFFD mode,
with the control rendering the corpus's first URL against this host's replay
server (127.0.0.1). Rates, bursts, seed, gates and the control binary come
from the caller's SCALE_* variables. MEASURE=scale refuses ENGINE=webkit and
BACKEND other than uffd.

Tests, each observed failing on the parent:
- CorpusPairing, ConcurrentRequestRecords.test_a_corpus_request_renders_its_pairs_url_and_says_so
- ControlResolverRule, ServeMode
- PlanOnlyCli: a list without --control-url, a list as the control URL, and
  a non-IPv4 resolver target are refused
- DnsBrackets.test_measure_scale_runs_the_open_loop_benchmark_over_the_corpus

Tested: python3 -m unittest discover -s bench/chromium -p 'test_*.py'
(1070 tests, OK). `make -n -o build bench-chromium-scale ...` shows the new
flags on the reqscale.py command line.
…check the restore path

From a Codex review of the previous commit.

bench/chromium/reqscale.py:
- The URL list is part of ScheduleConfig and the durable schedule (urls,
  url_selection), so the analyzer's rebuild checks it.
- A list of more than one page needs every rate's scored window to hold
  whole cycles of it: at 2 rps 120 scored pairs gave eight of 14 pages 9
  renders and six 8, the same bias in every burst, so the rate curve was
  confounded with the page mix. Rates that are multiples of 1.4 rps fit a
  14-page corpus.
- require_serve_mode(): the memory server must run the requested mode; fcvm
  coerces minor to copy for NV2 snapshots.
- file_restore_refusal(): a hugepage snapshot, a snapshot with a kernel
  profile (NV2), or FCVM_FORCE_UFFD makes `fcvm snapshot run` restore through
  an implicit UFFD server, so the FILE arm would be UFFD; the run is refused.
- Provenance schema v2 (host_control.resolve_all_to).

bench/chromium/reqscale_analyze.py:
- Rebuilds the schedule with its urls, and each request must carry the url
  of its pair's slot.
- Requires provenance v2; resolve_all_to must be null or canonical IPv4.
- corpus_dns_gate(): a corpus run (more than one url, or a control resolver
  rule) is publishable only beside a clean dns-evidence.json that names its
  run. Otherwise publishable is false and publication_blocked_by says why.
  The analysis also lists the corpus.

bench/chromium/corpus_campaign.sh: MEASURE=scale failed every run, because
write_dns_evidence read $RESULTS/analysis.json, which a scale run never
writes. The scale branch analyzes into scale/analysis-pre-evidence.json,
the evidence names its run from ANALYSIS_JSON, and after a clean verdict
the run is analyzed again into scale/analysis.json, which must say
publishable or the campaign fails.

Tests, each observed failing on the previous commit (SpawnedArgv on main):
- CorpusPairing: every scored window of every burst renders each page
  equally often per backend; a cycle-splitting rate is refused
- AnalyzerHoldsTheCorpus: a request that rendered another page, the DNS
  gate, the resolver field
- RestorePathIsWhatItSays: the FILE-arm refusal and the serve mode
- SpawnedArgv: the argv start() actually hands Popen for the memory server
  and the control Chromium (replaces the helper-only tests)
- DnsBrackets.test_measure_scale_runs_the_open_loop_benchmark_over_the_corpus
  now checks both make calls and the evidence's analysis path; the fake make
  records each call's environment by target

Tested: python3 -m unittest discover -s bench/chromium -p 'test_*.py'
(1088 tests, OK).
@ejc3
ejc3 force-pushed the bench/request-cpu branch from 3dd8c2e to 5404b32 Compare October 2, 2026 03:52
@ejc3
ejc3 force-pushed the bench/scale-corpus branch from 38dd066 to 7d86279 Compare October 2, 2026 03:52

This branch has not been deployed

No deployments
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