Skip to content

feat(suite): cap the pre-run payloads kept in a suite - #304

Merged
qu0b merged 4 commits into
masterfrom
qu0b/skip-large-pre-run-uploads
Aug 11, 2026
Merged

feat(suite): cap the pre-run payloads kept in a suite#304
qu0b merged 4 commits into
masterfrom
qu0b/skip-large-pre-run-uploads

Conversation

@qu0b

@qu0b qu0b commented Aug 11, 2026

Copy link
Copy Markdown
Member

Implements @skylenet's suggestion: a size limit on pre-run bundles, 512MB default, anything over it skipped.

Why

The jochemnet bloatnet pre-run bundle is a single 9.4 GiB pre-run.request — roughly 8k blocks of setup. CreateSuiteOutput copies it into the suite directory on every job, and the runner then uploads it. Nothing consumes it: the runner replays pre-runs from the fixtures cache, not from the suite, and the UI has no use for a bundle that size.

What it does

A pre-run step over runner.benchmark.tests.max_pre_run_step_size (default 512MB) is recorded in summary.json and not copied, so it never reaches the bucket. 0 disables the limit.

"pre_run_steps": [
  { "og_path": "pre_run/pre-run.request", "size_bytes": 10062313486, "omitted": true }
]

Two details worth flagging for review:

Checked with a stat before the copy, not at upload time. Skipping it at the upload layer would still leave a 9.4 GiB write into RUNNER_TEMP on every job. Doing it here costs neither the write nor the transfer, and keeps the uploader generic — it has no business knowing which files are pre-run steps.

The entry is recorded as omitted, not dropped. The suite stays honest about what the run replayed, and the UI gets something to check before offering the file for viewing — TestFilesList.tsx:147 currently links suites/<hash>/<og_path>/pre_run.request unconditionally, which would 404 for an omitted bundle. That UI guard is a separate change; this PR gives it the flag to read.

Tests

  • TestCreateSuiteOutput_OmitsOversizedPreRunSteps — over the limit: no file written, summary records omitted and the true size, test steps unaffected.
  • TestCreateSuiteOutput_KeepsPreRunStepsWithinLimit — under the limit and with the limit disabled, the bundle is stored exactly as before.

How this relates to the other PRs

Verification

make build-core, make lint-core (0 issues), full go test ./pkg/... ./cmd/... all pass locally.

qu0b added 2 commits August 11, 2026 10:00
The jochemnet bloatnet pre-run bundle is a single 9.4 GiB pre-run.request —
~8k blocks of setup. CreateSuiteOutput copies it into the suite directory on
every job and the runner then uploads it, so it costs a 9.4 GiB local write
plus a 9.4 GiB transfer per completed run. Nothing consumes it: the runner
replays pre-runs from the fixtures cache, not from the suite, and the UI has
no use for a bundle that size.

Cap it. A pre-run step over max_pre_run_step_size (default 512MB) is recorded
in summary.json with its size and "omitted": true, but not copied — so it is
never uploaded either. The size is checked with a stat before the copy, so an
oversized bundle costs neither the write nor the transfer. "0" disables the
limit.

Recording the omission rather than silently dropping the entry keeps the suite
honest about what the run replayed, and gives the UI something to check before
offering the file for viewing. The bytes remain in the fixtures artifact the
step came from.
Stat the step first so an omitted bundle leaves no empty step directory
implying a file that was never stored, and so the provider path does not
materialise content it is about to discard.
…it for what it does

max_pre_run_step_size under tests read like a test-execution setting; nothing
in the name said it governs what gets uploaded with a suite. It is now
results_upload.max_pre_run_upload_size, next to the rest of the upload config,
where both the path and the name say what it affects.

Also documents it in docs/configuration.md, with a section covering why the cap
exists, what an omitted bundle looks like in summary.json, and where to find
the bytes when one is skipped.
@qu0b

qu0b commented Aug 11, 2026

Copy link
Copy Markdown
Member Author

Both addressed.

Renamed and moved. You're right that the name didn't say what it affects — and under tests it read like a test-execution setting, which made it worse. It's now runner.benchmark.results_upload.max_pre_run_upload_size, sitting next to the rest of the upload config so the path and the name both point at what it governs:

runner:
  benchmark:
    results_upload:
      max_pre_run_upload_size: 512MB

I went with max_* over skip_upload_pre_runs_size to match the existing size options, but it's a one-line change if you prefer yours.

Docs. docs/configuration.md gets the option in the results_upload table plus a Pre-Run Upload Size section covering why the cap exists, what an omitted bundle looks like in summary.json, and that the bytes stay in the fixtures artifact if anyone needs to inspect one. config.example.yaml moved with it.

One other change since you looked: the size check now runs before anything is created, so an omitted bundle leaves no empty pre_run/ directory implying a file that was never stored.

qu0b added a commit that referenced this pull request Aug 11, 2026
The ETag check was there to catch same-size-different-bytes. With the pre-run
cap in #304 every remaining suite file is under the part size, so that branch
covers all of them — meaning a full read and MD5 of the whole suite, 1-3 GB,
on every run, to avoid re-sending the same 1-3 GB.

It was insurance against something the design already rules out: a suite hash
is a digest of exactly these step files, and only benchmarkoor writes under
that prefix, so a key cannot hold different bytes at the same size without the
hash changing too. Drop it and compare size, which the listing already gives
us for free.

summary.json stays exempt. It is the one file that is rewritten rather than
content-addressed, so a label edit that happens to preserve its length is
plausible in a way it is not for the rest.

Net 63 lines and one crypto import gone.
@qu0b
qu0b merged commit 59cf6a2 into master Aug 11, 2026
8 checks passed
@qu0b
qu0b deleted the qu0b/skip-large-pre-run-uploads branch August 11, 2026 08:29
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