Work clock #1376
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.50) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 418 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.361
Shallow Review Depth
shallow_review_depth
0.344
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #1376"
general
weight: 0.35
samuelcolvin
"clock" that uses instructions, not the OS clock.
<!-- This is an auto-generated description by cubic. -->
---
Summary by cubic
Adds a third execution clock,
Work, that counts executed work instead of reading the OS clock, so duration limits work on every platform — including WebAssembly, where clocks stand still during compute and which previously accepted only wall time. The VM charges units per bytecode instruction,Opcode::extra_workweights costlier ones, native operations (big-int arithmetic, regex, JSON, string scans, sorts, allocations) charge per cost, andmonty-alloccounts allocated bytes as a floor. Units convert to time at a fixed per-build rate, so budgets and reported durations are deterministic across runs rather than wall-clock estimates.Work sessions arm no wall duration backstop, like CPU sessions: counted time doesn't predict how long a turn takes, so a wall backstop would end healthy turns.
request_timeoutstays the only wall bound.execution_clock='work'/executionClock: 'work'select it on the Python, JS and WASM pools; workers that predate the protocol refuse work sessions, and dumps still require the saved clock on load.Charges also cover work that produces no result: failed regex matches,
re.splitwithout groups and with a negativemaxsplit, three-argumentpow's base reduction, a raisingjson.dumps, non-ASCII character-offset searches, andprintseparators and ends. Short dividends are not charged, and the wasm pool rejectsexecutionClock: null.Calibration
make fit-work-clockfits every weight at once from opcode and work-event counts and measured wasm time, regeneratingop_weights.rsandwork_weights.rs; no weight is written by hand.make calibrate-work-clockmeasures per-category, per-construct and corpus scripts on the work and wall clocks, natively and in WASM, failing on more than 3× category drift; CI runs the reports without the timing check.NANOS_PER_UNITrates.re.subexpands into a scratch string instead of revalidating the result per replacement, fixing quadratic behavior.<sup>Written for commit 0154653fba9f189ced0e5d8111dd4c81b09e001b. Summary will update on new commits.</sup>
<a href="https://cubic.dev/pr/pydantic/monty/pull/1376?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a> <a href="https://www.cubic.dev/action/auto-fix/pr/pydantic/monty/1376?returnTo=https%3A%2F%2Fgithub.com%2Fpydantic%2Fmonty%2Fpull%2F1376&source=description" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img alt="Turn on auto-fix" src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->