Skip to content

perf(python): narrow class and wildcard registry scans - #2535

Open
DeusData wants to merge 10 commits into
mainfrom
fix/python-module-range-v2
Open

DeusData wants to merge 10 commits into
mainfrom
fix/python-module-range-v2

Conversation

@DeusData

@DeusData DeusData commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Python class binding and wildcard invalidation scan every registry entry for each module operation. Use qualified-name ranges from the shared registry indexes to find matching entries, then restore their original array order before applying the existing binding rules.

Add a shared type-name index alongside the existing function index. Appended entries remain visible, and missing indexes or optional allocation failures use the full scan. Query storage is released after each module operation; retained bindings keep their existing ownership.

Regression coverage checks ordered results, prefix boundaries, shadowing, appended entries, failed allocations and exact Python call sites. Structural operation-count checks cover both small and larger pipeline fixtures. These counters do not measure sorting, string comparison costs or elapsed time; no measured speedup is claimed.

Depends on #2532 and its prerequisite stack, including the allocator corrections. This PR targets main, so its diff includes those dependencies until they land. Python re-export resolution remains a separate outstanding change.

Validation: source review, existing-test preservation review, formatting, and diff/integrity checks. Local tests, builds, compiler/syntax checks, lint, sanitizers, revert checks, benchmarks and local CI were not run under the session waiver. GitHub CI is the validation gate; no runtime or performance result is claimed.

Carry declared instance-field types through extraction and result
compaction into the shared Python type registry so chained calls through
imported classes resolve their receiver types.

Refs #1277

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Copy inherited field-type pointer arrays into the writable registry arena
before Python refines an existing field. Keep shared type objects intact
and avoid retaining per-file scratch types in the sealed fallback.

Add deterministic shared-state and later-overlay coverage, retaining the
sequential Python field regression and adding a forced-parallel variant.

Refs #1277

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Memoize C expression evaluation, index repeated scope and registry queries,
and report incomplete walks explicitly on memo or depth failure.

Refs #1527

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Preserve the arena-owned raw Module caller name so top-level resolutions
join the extractor in both pipeline drivers. Add occurrence and ownership
controls, including package modules and named lambdas.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Resolve symbols declared in __init__.py under their package while retaining
the raw module identity for file and top-level caller nodes. Carry explicit
language through registry callers, select Python package imports, preserve
long exact names, and report scope allocation failures without partial output.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Capture ordered Python namespace facts and retain them through compact, spill,
and versioned LSP surfaces. Reject unavailable metadata before incremental
reuse and rebuild on Python namespace changes or deletion.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Reuse a stable arena-owned function QN order for ambiguity marking and
submodule prefix lookup, preserving exact lookup policy and appended tails.
Add prefix/index failure regressions and a pipeline operation-count case.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Use tracked zeroed storage for the parallel LSP failure array and
release it with the matching memory class after worker joins.
Share import-filter failure cleanup without changing fallback state.
Keep existing raw-allocation allowances unchanged.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Preserve registry array order and full-scan fallback when optional query
storage is unavailable. Keep temporary range storage scoped to each module
operation and shared type indexes in the registry owner arena.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
@DeusData

DeusData commented Oct 3, 2026

Copy link
Copy Markdown
Owner Author

Checkpoint and handover (2026-10-03 UTC)

Published head: 2ff895f9293de8d054c6a4c792db2aa3e209a95e. The remote head was verified.

The class/wildcard range change is published across six files with eight new tests, all unrun locally; all 118 previous test bodies were preserved. Prerequisite: #2532. Source review covered original-order iteration, captured tails, shadowing rules, subtree boundaries, conservative full-scan fallback and arena ownership. No performance gain has been measured. The next recovered subscript store/delete/augmented-target investigation is paused at read-only preflight: no code was implemented. Before resuming, decide the bounded module-ingress scope and preserve nested receiver/key reads, class-comprehension targets and exact occurrence joins. The re-export resolver also remains separate and disabled.

Hosted snapshot at 2026-10-03 21:54:25 UTC: 9 queued, 1 skipped. Confirm the required checks on this exact head before treating it as ready.

No additional local build, test, lint, sanitizer, benchmark or CI runs were performed at this checkpoint, as requested. Earlier executed evidence remains historical; prepared tests and the newer source-reviewed changes must still be validated by the hosted gate.

The campaign is paused at the maintainer’s request. Local monitoring has stopped; hosted jobs remain running. No merge was performed. Thanks for reviewing this change.

This branch has not been deployed

No deployments
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.

1 participant