Repository navigation
Reuse source preparation during class candidate replay - #521
Merged
Merged
Conversation
CaelmBleidd
force-pushed
the
caelmbleidd/calls-replay-preparation-cache
branch
from
October 15, 2026 13:52
6833851 to
35703bd
Compare
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.
Real class cells recreate the complete original and instrumented TypeScript replay workspace for every candidate. In the Perm pilot, 144 completed candidate pairs spent a median 1,238 ms each, while their two native executions accounted for about 432 ms. A 30-second search produced 1,839 candidates, so repeated source preparation substantially delayed native validation.
Prepare each original/instrumented scenario lazily once per cell and reuse that preparation for its subsequent candidates. Every candidate still executes in a fresh supervised Node.js process with its own timeout; input transport, source verification, original/instrumented agreement, class statement universe, ordered durable journals, and resume validation are unchanged. Cached workspaces close together when the replay stage finishes or fails. The cache retains at most two workspaces per encountered scenario until then.
Validation: the two focused regressions pass, covering fresh module state and coverage counters across repeated inputs, and a hard timeout followed by a successful input without a stale observation. Calls Detekt main/test report zero findings; git diff --check passes. No symbolic machine run or full local suite was performed for this change. End-to-end throughput improvement still needs measurement on the real cohort.