Skip to content

chore: remove dead native bindings, stub entries, Rust items and test helpers - #1217

Merged
kvlonge merged 1 commit into
mainfrom
chore/remove-dead-surface
Oct 22, 2026
Merged

kvlonge merged 1 commit into
mainfrom
chore/remove-dead-surface

Conversation

@kvlonge

@kvlonge kvlonge commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Why

The native extension, its type stub, several crates and the test helpers carried surface that nothing uses. It costs build and review time and hides real drift: the stub declared names the extension no longer registers.

Changes

  • Remove 33 #[pyfunction]s with no caller besides registration. Python uses were checked across all tracked files, including string-name uses. Callback and atexit hooks are kept.
  • Prune 355 _native.pyi entries that no Python code names, keeping classes that kept entries annotate (18,051 → 15,940 lines).
  • Add make check-native-stub to make check-ci. Every stub function, class and constant must be registered by the built extension; protocols, typed dicts, aliases and private stub-only classes are exempt.
  • Remove unused Rust constants and methods, test-only main wrappers (tests now call the owned helpers), and a test-only text span API.
  • Remove 33 unused test helpers and an empty test package, 9 stale verify.yml path filters, and the unused rich dependency.

No behaviour, output or diagnostics change.

Verification

  • Compiler differential 374/374; planner differential 11/11 against a base recording.
  • Compile output and plan --json byte-identical on two large synthetic projects, except Rules cache keys that embed the extension build identity.
  • Runtime instruction counts at parity (dense compile, warm plan).
  • Rust tests for every touched crate, 5.3k focused Python tests, workspace clippy -D warnings, fensu and make check-ci pass.

@kvlonge
kvlonge enabled auto-merge (squash) October 22, 2026 12:26
@kvlonge
kvlonge force-pushed the chore/remove-dead-surface branch 2 times, most recently from b84e5fe to a2a7d4b Compare October 22, 2026 13:26
… helpers

Remove 33 native functions that no Python or Rust code calls besides
their registration, the stub entries no Python code names (keeping
every class a kept entry annotates), public Rust constants, methods
and wrappers nothing uses, unused test helpers and a dead test helper
package, nine workflow path filters that match deleted directories,
and the unused `rich` runtime dependency.

Add `make check-native-stub`, part of `make check-ci`: the stub may
declare only functions, classes and constants the extension
registers; protocols, typed dicts, type aliases and private stub-only
classes are typing-only and exempt.
@kvlonge
kvlonge force-pushed the chore/remove-dead-surface branch from a2a7d4b to e92f46e Compare October 22, 2026 14:32
@kvlonge
kvlonge merged commit 870b9cc into main Oct 22, 2026
44 checks passed
@kvlonge
kvlonge deleted the chore/remove-dead-surface branch October 22, 2026 15:10
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