Skip to content

perf(research): cut overlap query wall time by 48.7% - #6161

Merged
Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
petalas:research/w8-1022ak-original-result
Oct 28, 2026
Merged

Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
petalas:research/w8-1022ak-original-result

Conversation

@petalas

@petalas petalas commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Empirical tooling improvement with a scoped equivalence proof and finite regression evidence. The complete offline joint-query-controller overlap command takes 48.7% less wall time, median 1.015105 s → 0.521243 s, on the recorded workload. No new kappa or selected-frontier change.

 numeric-reference lookup
+ if its mandatory literal number is absent, return no match
  otherwise run the unchanged boundary-aware regex

Every accepted regex match contains the escaped literal number. The new rejection is therefore exact; present numbers still receive the original boundary checks and offsets. Explicit literal queries keep their original path. Matches, scores, excerpts, ordering, coverage and warnings are preserved.

Produced by Nick Petalas. Credit Douglas Colkitt's overlap helper, Nick Petalas's #3002 numeric-reference rules, Ali Romman's #5736 Unicode excerpt handling and retained contributors. Literal prefiltering is standard; this contribution is its integration, complete-command measurement and controls. Advance CLAIM.

Evidence

  • Seven alternating runs per side, zero errors, all fourteen complete JSON reports identical after excluding only searched_at. Baseline range 0.994940–1.087073 s; candidate range 0.510642–0.535762 s. Both sides include interpreter startup, imports, local inventory, cached parsing, search and JSON output. Separate profiles identify regex scans as the removed cost.
  • The external 16,945,386-byte cache contains 407 open PRs and 5,816 Discussion records. Sparse coverage and all 8,278 omitted-note warnings are retained. The package records the cache/source hashes and every sample in BENCHMARK.json.
  • Normal and optimized checks pass 39,216 reference offsets, 39,216 literal offsets, eight complete search comparisons on 289 constructed records, and work/boundary controls. All 37 focused overlap tests pass. The three registered commands pass locally in 0.126, 0.198 and 0.710 seconds, each below 120 seconds.
  • Committed-byte, source-history and executable-mode preflight passes at 1278601c6832bbecb47c2207240eede23f99a2fe. Official eleven-file export integrity passes. Normal and optimized Git-free replays with empty PATH and read-only files pass, preserving all twelve exported file hashes.

Exact reproduction from the repository root, CPython 3.12 and standard library only:

/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -I -W error -B research/overlap-reference-prefilter/verify.py
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/research_package.py --package research/overlap-reference-prefilter
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/check_research_commit.py --package research/overlap-reference-prefilter --check-source-history --check-modes
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -I -W error -B research/overlap-reference-prefilter/benchmark.py --cache /absolute/path/overlap.json --samples 7

Expected correctness markers are PASS_OVERLAP_REFERENCE_PREFILTER, PASS_REGISTERED_RESEARCH_PACKAGE and PASS_RESEARCH_COMMIT_BYTES. Another CPython 3.12 installation may replace the local interpreter path. The optional benchmark needs Git and the pinned reachable main history.

Limitations and unrun obligations

Timing is workload-specific. The historical public cache is hash-identified but not vendored, so the exact timing cannot be reconstructed from this package alone after that cache is removed. The harness accepts an external cache and checks all output fields on that workload. The deterministic verifier and CLI tests need no historical cache. No universal speedup is claimed for reference-dense corpora or other checkout layouts.

No supplier mathematics, native operator, full multiplier, selected cold replay, Lean or Docker is audited or run. Independent human and formal proof-kernel review are unclaimed. All of this package's registered commands ran locally; none is deferred to CI.

Open next questions

Does the same gain hold for other cards and a complete checkout? Run the unchanged harness on the intended immutable cache before optimizing a different mechanism. The first verified improvement is shipped here.

Related open work

The completion refresh read this account's fifteen open PRs created since the CLAIM at 2026-10-28T16:15:54Z. No other submission changes this numeric-reference predicate or reports its complete overlap-command timing. These submissions also change shared verifier tooling under the same replay-runtime card:

  • #6155 defers mismatch-only digests in scripts/check_research_commit.py. It measures publication byte/history checking; this PR measures overlap search. Their timings are not compared or combined.
  • #6162 reuses authenticated publication metadata in scripts/check_research_commit.py. It removes duplicate Git reads in a different command; no combined speedup is claimed.
  • #6156 bounds working-source comparison memory in scripts/research_package.py. That module is a shared dependency of the overlap tool, but this PR retains the baseline module and claims no combined memory or timing benefit.

The other refreshed submissions study different constructions or quantities. No additional computations were run to compare their results.

CI notes

Uncertified by CI at head 1278601c6832bbecb47c2207240eede23f99a2fe. In run 40726915850, plan failed and replay was skipped. The package replay did not run in CI. A maintainer re-run is needed after main is fixed.

The onboarding job reports FAILED (failures=2, skipped=23). Its only two failures are the existing documentation mismatches on canonical main 721c03822c421b7f7fcbb2598993b947c4d88419, the PR6030 kappa admission pushed with [skip ci]. That commit changed the selected record without matching the status marker and CI navigation:

  • test_research_current_status.CurrentStatusTests.test_current_section_matches_selected_record expects standalone **0.003125804** in docs/research/current-status.md. Main instead bolds the larger expression 0.003125804 = 781451/250000000.
  • test_research_current_status.CurrentCiNavigationTests.test_current_ci_section_matches_selected_record expects make frontier6030-verify. The test reads docs/ci-verification.md; its current CI section still names Raise conditional kappa to 0.00310045 with independent helper splits #5599 and make frontier5599-verify.

PR #6120 run 40691776027 fails the same two tests. Open PR #6050 targets the documentation fix. The edits to scripts/find_overlap.py and its test introduced no additional failure in this onboarding step. This does not certify the skipped package replay. No code or documentation was pushed after the CI failure.

Local evidence remains separate: all three registered commands, normal/optimized direct checks, the 37 focused overlap tests, committed-byte/history/mode preflight, export integrity and Git-free replays pass. The broad local onboarding run initially had sparse-fixture errors; after materializing the omitted paths, all ten descendant-source-role tests and all fourteen queue-group tests pass. The complete local suite was not repeated after those targeted reruns.

Replay planning selects this package and three existing dependents. overlap-discussion-batching and replay-input-head-spelling pass their registered replays locally. overlap-path-index stops at source blob provenance mismatch: scripts/find_overlap.py. Its manifest is byte-identical to main and declares blob 34677253e224a8a2df51113dcd82b48f8826f81c, while its declared base contains 2668844310ea52bb4fe3c4561dd4ee16fcdd20cc. This pre-existing provenance inconsistency is preserved. That dependent's downstream replay is unrun after the metadata failure.

Merge Danger

Door: two-way.

Blast Radius: coordination. Four shared-script lines, one regression test and one isolated research package. Existing source notices, frozen evidence and the selected frontier are preserved.

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.

2 participants