Defer exact classifier residual deviation until needed - #20
Merged
Merged
Conversation
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.
When a trajectory already meets an earlier classification gate, the classifier currently computes regression and residual population deviation that cannot affect the verdict. This change evaluates those gates first and defers residual deviation until the oscillation gate requires it. Public
extract_features()remains eager and keeps the exactstatistics.pstdevcalculation and rounding.The two-point ratio gate, liveness/first-tie semantics, custom threshold boundaries, large integers, and non-finite exception behavior are covered by 27 new regression tests. Only the classifier and those tests change; no thresholds, dependencies, version, or public APIs change.
Validation
mainat8c3eec4bd2d55cfa271c281c40638abd2290dd19, the same baseline used by the accepted benchmark. Both modified files are byte-identical to the validated candidate.Original benchmark evidence and limits
The separately versioned accepted Mac campaign completed 24 paired blocks plus fresh bracketing A/A controls: composite runtime reduction 46.628%; conservative simultaneous A/A bias-adjusted lower improvement bound 45.280%, exceeding the unchanged 2% minimum. All timing/allocation guards passed the unchanged 5% regression margin. The tightest adjusted guard was full-feature extraction at -4.443%, a narrow 0.557 percentage-point margin. No approximate variance math or candidate tuning was accepted.
Synthetic GC-controlled CPU overhead does not establish production latency, answer quality, or provider spending savings. Supported-Python/framework coverage is supplied by repository CI; original Mac acceptance was Python 3.12.8. Cross-environment baseline p-value drift, the preserved failed initial A/A prerequisite, the reviewed pre-candidate protocol correction, and durable-completion recovery after disconnects are disclosed in the original evidence. Cloud and Mac results are not pooled; the old incomplete cloud confirmation remains invalid.
Original evidence:
LoopGain-Mac-complete-evidence.zip, Library identitylibfile_ba56c3e69df48191965c17716d5e08a2, version 3, SHA-2561f3e07f33be573657ce2631d4cb8f2d7d5108379698dfce050abd85341120901. The interactive report isLoopGain-cloud-and-Mac.html, Library identitylibfile_c86395b976e481918c57c3d202292373, version 2. Original artifacts and integration logs remain preserved separately. Draft for review; no merge or deployment performed.Terminal CI result
CI run 36765995379 completed successfully for commit
c25cac78e0a84dfda5c6084fb6e1ee0a06330768; all 11 jobs passed. Python 3.10, 3.11, 3.12, and 3.13 each passed 256 tests with 12 documented optional skips. All six framework jobs executed with zero skips: LangGraph 3, CrewAI 4, AutoGen 3, LangChain 4, OpenAI Agents 4 (including the offline real Runner), and Claude Agent SDK 4 tests. Lint/security/build/metadata/installed-wheel CI passed. All six opt-in container tests passed locally in the 262-test full suite.