Repository navigation
docs(contrail): measure what the zxcvbn crate would cost the Worker - #170
Merged
Merged
Conversation
D-023 replaced Plane's zxcvbn score with a short rule because a zxcvbn port "carries a frequency dictionary into the Worker (not measured)". The owner confirmed it on 2026-11-14 with that measurement open. This measures it and records the result, and changes no behaviour. Built the deploy bundle (`worker-build --release . --no-default-features`) from the base and with the crate called from `password_is_strong`: 4.756 MiB to 6.765 MiB (+2.01 MiB, +42%), against ADR-0090's 20 MiB reopen trigger. The dictionary text is 0.76 MiB of that. Startup is unchanged (13 to 15 ms locally). The first strength check in an isolate builds the dictionaries: about 30 ms on local workerd, 8 ms native, not measured on Cloudflare. So the reason D-023 gave does not hold. What does count against the crate: it declares wasm-bindgen, js-sys and web-sys on wasm32, which scripts/check-deps.sh forbids in thrust-core's graph. Tried, the guard fails with 15 hits across five crates, and passes with none on the base. The uncalled-reference control was not byte-equal to the base (+2,633 B, no dictionary and no zxcvbn path in it, cause not established); the note says so. Not measured: Cloudflare cpuTime, whether the Rust crate scores as Python's does, and its panic exposure. The D-023 row and the doc comment on password_is_strong now say what was measured, in place of "not measured". The rule itself is unchanged. Refs: #44 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This was referenced Nov 14, 2026
aRustyDev
added a commit
that referenced
this pull request
Nov 14, 2026
The owner reopened D-023 to check the Cloudflare cpuTime of the first strength check, the one figure #170 left as a local proxy. This records it, and changes no behaviour. On Cloudflare, with the #146 harness (a tail consumer writes cpuTime to KV), the first zxcvbn call in a fresh isolate costs a median 60.5 ms of CPU above a cold start of about 25 ms (95% interval 54.5 to 64.0). A warm check is 1 to 2 ms. 666 requests over 18 fresh Workers, two requests that are both refused before any hashing, three arms (baseline build, variant build, variant build with zxcvbn); all six variant-Z rounds lie above all twelve S rounds. The 2 MiB bigger module costs a cold start nothing measurable (cold medians 26 and 25 ms). That misses the bar set before measuring (no more than one argon2 hash, about 45 ms p50) by about 15 ms at the median. A first call blocks its isolate, so concurrent requests start more isolates and each builds the dictionaries again. The local figures understated the platform by 2 to 8 times. One control did not behave as pre-registered: the first request of a same-connection sequence on the S arms cost 0 to 45 ms where 0 was expected, because the new connection sometimes reaches a fresh isolate. The sequences are therefore not used for the figure, and the note says why. A first pilot also showed that a redeploy leaks traffic to the previous version for seconds, so the run uses a new Worker per round. The 19 Workers and the KV namespace were deleted and checked. The D-023 row and the doc comment on password_is_strong carry the figure. D-023 is not changed: the rule stays as confirmed until the owner decides. Refs: #44 Co-authored-by: Claude Sonnet 5.5 <[email protected]>
This was referenced Nov 15, 2026
Closed
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Measures the open question in D-023: would a zxcvbn port's dictionary be too big for the Worker? It would not. This records the numbers, and
changes no behaviour.
.agents/plans/contrail/research/0015-zxcvbn-worker-cost.md(new): the method, the figures, the controls, what was not measured..agents/plans/contrail/DEVIATIONS.md, D-023: "(not measured here)" and "with the bundle-size measurement still open" are replaced by theresult. The rule stays as the owner confirmed it.
crates/thrust-core/src/auth.rs: the doc comment onpassword_is_strongsaid the dictionary's size "was not measured". Comment only.Findings
zxcvbn3.1.1scripts/check-deps.shwith the crate inthrust-corewasm-bindgen,js-sys,web-sys); 0 on the baseSo the reason D-023 gave, bundle size, does not hold. What counts against the crate is the guard, not the size: adopting it needs a port and an
adapter crate, as
thrust-adapters-oidchas.Left open on purpose
cpuTimeof the first call (the plan's bar 3: no more than one argon2 hash, about 45 ms p50). The local figure is within 2x ofit, so it is not settled. The deployed measurement reuses
scripts/measure-argon2.shand writes throwaway Workers to the owner's account; theowner chose not to run it now. The note says how.
Checks
uncalled control.
not equal. No dictionary and no crate path is in it and
index.jsis identical; the cause is not established. It bounds the noise at 0.1% of the delta.repeat 409, no token 401.
scripts/check-deps.shon the base: exit 0, 0 hits (the control for the 15).cargo check -p thrust-coreafter the comment edit. Nothing else in the tree changed; the variant code was throwaway and is not in this PR.Refs: #44. Closes nothing: #44 is already closed.
🤖 Generated with Claude Code