Skip to content

Preserve fractional replay clocks during redrive - #1138

Closed
rmcdaniel wants to merge 5 commits into
mainfrom
fix/992-replay-clock-precision
Closed

rmcdaniel wants to merge 5 commits into
mainfrom
fix/992-replay-clock-precision

Conversation

@rmcdaniel

Copy link
Copy Markdown
Member

Redrive can change a persisted workflow clock from .123456 to .000000, because it serializes the original run start and reused step times at whole-second precision. Preserve nonzero fractions while retaining the existing whole-second representation for exact seconds and passing previously recorded clock strings through unchanged. Deadline formatting is unchanged.

Adds a separate fractional-clock corpus fixture and a native first/repeated-redrive control that compares unrounded activity, timer and stored-start clocks through query and fresh replay, checks unchanged source history and verifies no new timer work. The accepted whole-second fixture stays unchanged. Fixes #1137.

Draft validation: source style/static, binding consumers, predecessor counterfactual, full quality and exact review remain pending. The local structural command could not start its PHP consumer because the host has no PHP; this is a runner limitation, not a passing corpus result. Published-package and actual SDK Worker qualification remain separate under Server #980.

@rmcdaniel

Copy link
Copy Markdown
Member Author

Corrected successor a990a42e keeps the original production precision change and append-only fractional fixture. It corrects the raw fixture's expected completion command, queries only the completed successor (failed runs correctly rethrow their recorded exception), resets test time in finally, preserves the accepted whole-second fixture controls, and compares existing native reuse assertions as full parsed instants.

Exact source passes ECS idempotence, full PHPStan, the complete raw replay corpus and complete embedded replay corpus. The new first/repeated/fresh-process fractional-clock case passes within the embedded corpus. All owned focused runtime/cache resources are removed.

The additional complete native redrive file reports 139 cases / 1,380 assertions with three SQLite database is locked errors. All three occur during the original source workflow's update admission, before any redrive or changed clock writer executes. This is retained as NONPASS; a normal MySQL feature-backend repeat and a bounded unchanged-runtime SQLite comparison remain to establish the precise fixture/backend boundary. No expected outcome was weakened.

The earlier 89ced9 CI failures remain attributable to that superseded source. Fresh official corpus/counterfactual, native/backend, full quality and exact source review are required on this successor before merge. No installed Server/SDK clock result is claimed.

@rmcdaniel

Copy link
Copy Markdown
Member Author

The clock branch is now normally composed with accepted main as 8f895c43dc768cfb74ecebbe0b1372835c1c14fb / tree 805d77ff6d134bd368c3f7a51f96790ac5ba287d. The only manual resolution is CHANGELOG.md, retaining both entries. The embedded corpus merges automatically; all six other clock-topic files remain byte-identical to a990a42e, and all 38 non-overlapping main paths remain exact.

Clarification: a990 had terminal passing scanning checks only. Its changelog merge conflict prevented the pull-request PHP workflow from being created, so those green checks did not establish PHP/corpus/backend qualification. This merge resolves that scheduling prerequisite. Fresh actual PHP checks and source composition review are required; the local frozen a990 evidence retains its original scope.

@sonarqubecloud

Copy link
Copy Markdown

@rmcdaniel

Copy link
Copy Markdown
Member Author

Security source/composition review of current frozen 8f895c43dc768cfb74ecebbe0b1372835c1c14fb / tree 805d77ff6d134bd368c3f7a51f96790ac5ba287d: PASS for the clock writer and corpus source only.

The merge has exactly parents a990a42e463cc07cf84f40393670d8412115ea23 and accepted main 5b0575f0ab044ad493390e15379dd7f1aee3e025. Against their common base, the clock topic changes eight paths and main changes 40. All six topic-only blobs equal a990 byte-for-byte and all 38 main-only blobs equal accepted main. The only overlaps are CHANGELOG.md and V2EmbeddedReplayRegressionCorpusTest.php; the merge retains the complete clock and accepted entity-reference additions from both sides, with no extra runtime edit.

The production change preserves the intended authorities:

  • formatRecordedAt() keeps the prior whole-second toIso8601String() representation when microseconds are zero and emits six fractional digits only when nonzero.
  • The original persisted run start and every reused activity, marker, update, timer, signal and child event writer now use that helper.
  • Already-reused payload strings still pass through originalRecordedAt() unchanged on later redrives, so the immediate source changes but the first recorded instant does not.
  • Deadline serialization and deadline authorities are untouched.

The append-only fractional fixture distinguishes persisted start, activity-completion and fired-timer instants; exercises first and repeated native redrive; requires exact serialized clock reuse, parsed full-precision query/replay results, unchanged source history and zero successor timer rows/tasks; and resets the test clock in finally. The accepted whole-second fixture bytes remain unchanged. The existing raw/embedded corpus changes compare full parsed instants rather than silently flooring them.

This verdict does not convert the retained native SQLite result into a pass: its three pre-redrive database is locked errors remain NONPASS. Fresh exact-head PHP/corpus/backend CI, the bounded unchanged-runtime comparison, normal MySQL proof and the separate installed Server/SDK #980 precision cohort remain required. No merge, release or installed-consumer authority is inferred.

@rmcdaniel

Copy link
Copy Markdown
Member Author

Exact combined 8f895c43 passes the complete native redrive file on the normal MySQL feature backend: 139 cases / 1,398 assertions, no failures/errors/skips, exit 0. Its real fractional-clock first/repeated/fresh-process case also passes independently (1 / 20). The original timer clock, repeated serialized strings, canonical source history and absent successor timer work are all checked. Owned runner/database/cache IDs are independently absent.

An unchanged accepted a717 runtime and unchanged native test file on file-backed SQLite reports 139 cases with 21 SQLite database-lock errors, no assertion failures. Every error has the same SQLite lock cause. The prior a990 SQLite attempt had three such errors. These are separately retained NONPASS observations, not equal-count comparisons or SQLite acceptance. The failing updates occur in original-source admission before the changed redrive clock writer. Diagnosis continues under the existing #783 contention record.

The normal MySQL result closes that focused repeat. Fresh combined official corpus/counterfactual, full unit/coverage/features/current CI and normal source/base/merge gates remain; no installed #980 outcome is inferred.

@rmcdaniel

Copy link
Copy Markdown
Member Author

The exact reviewed clock component is now preserved in active core prerequisite #1140 at 12467c2. Its original results and failed attempts retain their scopes; fresh combined qualification remains open there. Issue #1137 remains open, and no merge/package/installed claim is inferred.

@rmcdaniel rmcdaniel closed this Nov 14, 2026
@rmcdaniel
rmcdaniel deleted the fix/992-replay-clock-precision branch November 14, 2026 02:56
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.

Preserve fractional replay clocks through failed-run redrive

1 participant