Skip to content

[finding] The Worker size reading is deterministic given identical bundle bytes, so #277's spread is upstream of wrangler — in the build or the packaging #280

Description

@os-bill

Fell out of the deploy of d725081 (#279 / #277). Nobody set this experiment up; it runs on every push to main and nobody had read it as one.

#277 established that the size gate's reading moves by up to 4.42 KiB between two runs of a byte-identical tree, and deliberately claimed nothing about why. This narrows the where by one step, using measurements that already exist.

What the deploy chain measures twice

On a push to main, the same Worker bundle is weighed at two separate points, on two different runners:

  1. build job, wrangler deploy --dry-run on the .open-next it just produced — this is the size gate's reading.
  2. Deploy docs / Publish the tested Worker job, the real opennextjs-cloudflare deploy, on the docs-worker artifact downloaded from that build job.

Step 2's input is provably the same bytes as step 1's: actions/download-artifact runs with digest-mismatch: error and the log records SHA256 digest of downloaded artifact is 8ef1681c688f09b4569f6601ffe06356ceb1435efad24dc94fc3c50b2c699c38, matching the expected digest.

Run 34278684275, d725081 — the two readings agree exactly

where job runner Total Upload gzip
build, dry-run 102237903050 1000701848 58549.58 KiB 8800.18 KiB
deploy, real upload 102238672265 1000701864 58549.58 KiB 8800.18 KiB

Identical to the hundredth of a KiB, in both columns, across two runner instances and two different wrangler invocations (--dry-run versus a real publish).

What that does and does not narrow

Rules out: wrangler's measurement and reporting as a source of the spread, and the artifact round-trip as a source. Given identical input bytes, the figure is reproducible across machines and across invocation modes. So "the gate measures noisily" is not the explanation.

Leaves: the spread is upstream of the artifact — it is in pnpm turbo run build (the Next build) or in opennextjs-cloudflare build (the packaging), both of which run before the artifact exists. Those two are not separated by this observation.

Does not establish: anything about magnitude. This is one comparison on one commit. It says the two readings agreed here; it does not prove they always will. n = 1.

The experiment this makes obvious, and cheap

#277's control already exists: re-run a workflow on an empty commit and you get two builds of a byte-identical tree. The unanswered question is which file differs. Hash every file under .open-next in both runs and diff the manifests. Either one file differs — and its name says whether it is a timestamp, an embedded path, a hash-ordering artifact or genuine build non-determinism — or none does, which would falsify this finding and put the variance back in the measurement after all.

That is a bounded task, and it is the step that would let the gate attribute single-digit-KiB deltas instead of disclaiming them.

What must not happen to ci.yml

The comment block #279 landed is a frozen snapshot at named commits, deliberately unmaintained. This finding is not a reason to append to it. If the cause is ever found, that block gets replaced by a statement of the cause, not extended by another reading.

Filed unassigned — recording, not claiming.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions