Repository navigation
Conversation
This was referenced Oct 25, 2026
This branch has not been deployed
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.
An independent precondition solve could remove a clause from all later solves in the same process:
_pruned_clauses=set()was allocated once at function definition and updated in place.Use a
Nonedefault and initialize a fresh set only when none is supplied. Recursive children continue sharing the explicit set, and caller-supplied sets retain their existing update/reuse behavior.Concrete reproduction with real trace/clause inference: solve A has phase
trainin both positive and negative examples and distinguishes them bysignal=TrueversusFalse. A learns the signal clause and prunes the phase clause. Independent solve B needsphase=trainto distinguish positivetrainfrom negativeeval:Python RNG state is unchanged in every sequence. This exposes dependence on prior process history, including which earlier tasks ran in a reused worker, independently of RNG.
Validation: six focused tests had five failures before the fix and all pass afterward. Coverage includes independent/reversed/repeated solves, fresh-process versus warm-process histories, explicit set reuse, recursive sibling sharing, and separate root sets. Repository-pinned Ruff/Mypy/Black/isort hooks pass. Compact reproduction evidence and a test command are in
docs/measurements/precondition-state-isolation.md.A complete configured replay on the same 573,494-row trace also finished: 835 → 836 emitted invariants; 105 → 104 failed hypotheses. All 940 non-precondition hypothesis identities match. One
Linear.forward → checkpoint._internal_asserthypothesis moved from failed to emitted; 833 previous emitted records are structurally identical. Two others gain substantive constraints:RMSNorm.forward → checkpoint._internal_assertgoes from one to seven clauses, andget_rng_state → current_devicefrom two to three. These are not clause-order differences.That replay applied only the two production hunks to the cache candidate, preserving its existing RNG isolation; this PR's standalone source/base remains unchanged. All 17 combined tests passed. The single-worker replay disabled
FunctionLeadRelationandFunctionCoverRelation; source/input hashes and context states were unchanged. Compact source and output evidence is indocs/measurements/precondition-state-isolation-replay-20261025.json.All three changed/new predicates contain concrete trace-specific thread IDs. Their applicability to future checking runs is unvalidated. The output changes are not ground-truth correctness labels or a speed/memory comparison. This PR does not claim global order/scheduling determinism, unchanged large-trace outputs, or a multi-worker-count matrix.
Engineering hardening
Signed commit
aec748egives the regression records, solve fixtures, and recursion observer explicit types. The observer requires the actual recursive call fields, and fresh-process tests compare the complete expected serialized precondition. Production behavior is unchanged. Pinned Mypy 1.9 reports 14 → 0 errors for the test module with--check-untyped-defs --disallow-untyped-defs --disallow-any-generics --follow-imports=silent --ignore-missing-imports; this scoped result does not certify strict typing of imported legacy modules. All six tests pass, the repository hooks pass, and explicit pinned Ruff/Black/isort checks pass for the test file. The earlier full-replay results remain tied to their recorded source revisions; this hardening adds no performance claim.