Repository navigation
Conversation
Essoz
marked this pull request as ready for review
October 25, 2026 11:03
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.
Repeated function-call time-window queries scan all event rows before grouping, including full-column type membership tests. Add a lazy process/thread timestamp index for conservative native numeric cases, then restore original row order and retain the existing pandas grouping, assertions, and fresh record construction. Unsupported dtypes, mixed-precision/scalar comparisons, and malformed queries fall back to the original mask.
This PR is stacked on #144. The full-trace experiment applies the separate #145 pruning-state correction to both variants; that correctness change is not bundled in this PR.
Measured result
Three sequential alternating pairs on the complete saved tiny-Llama trace (573,494 events, six enabled relations, one CPU worker/native thread):
Median 101.796 → 76.748 s: 1.326×, 24.61% less wall time. All six complete outputs match the corrected reference: 836 invariants and 104 failed-hypothesis records, with arrays and multiplicity preserved. Raw output and full/stage context files are also byte-identical across variants. Source/input integrity checks passed; independent audit verified the retained source/output/context evidence and recomputed the statistics.
Median sampled child-session PSS increased 2.129 → 2.168 GiB (+40.15 MiB). The first baseline peak was higher than later baseline peaks; all per-run peaks are retained in the report. Fresh-process timings include lazy index construction. A separate 200k-row/1k-query synthetic benchmark measures 2.662 → 0.340 s, with first-query build cost shown separately.
Validation and limits
TracePandas. Storage grows O(N).Measurement report and compact provenance include reproduction instructions, all run timings, memory tradeoffs, source/trace/output digests, and retained archive identity. Raw trace/output records remain private study artifacts.
Engineering hardening
Typed numeric time-index storage and query boundaries, retaining conservative dtype/scalar validation and exact fallback semantics (
8dc1fd1), plus signed parent hardening updates. All 97 affected inference tests, all three benchmark smoke checks, pinned hooks, and six stronger Mypy 1.9 module/tool/test scopes pass. A new bounded replay of sourcece25c12plus the common #145 production patch emits all 836 invariants and 104 failed hypotheses byte-for-byte identical to the corrected reference; both context files are also identical. The verification run took 76.794 seconds, without a new paired speedup claim. Exact source/runtime/equality evidence is indocs/measurements/inference-hardening-validation-20261025.json.Separately composed updated production sources pass 140 affected Linux regression tests, whole-source Mypy (77 files), Ruff, and isort. Whole-source Black still reports three unchanged legacy files, down from six in the original base; changed-file hooks pass. Strict checks are scoped and do not establish repository-wide strict typing. Historical performance numbers above retain their original measured revisions; this hardening pass does not re-estimate them.