python / python/cpython

Widen specialized int fast paths to full int64 range

Offen
#150,424 8 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

interpreter-core performance type-feature
Vorherrschende Sprache
Python
Sterne
77.2k
Forks
35.9k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

This work widens the interpreter’s specialized int fast paths (tier-2 / uop execution) from the compact-only range to the full int64_t range.

It also fixes follow-up correctness issues in the widened specialized paths for non-compact exact PyLongObjects and on 15-bit builds.

Scope:

  • widen specialized integer add/subtract/multiply fast paths to operate across the full int64_t range
  • accept exact int operands that fit in int64_t, including non-compact PyLongObjects
  • keep specialized in-place mutation compact-only and fall back safely for non-compact inputs
  • handle widened integer compare without compact-only assumptions
  • construct widened arithmetic results with PyLong_FromInt64() so 15-bit builds do not narrow through stwodigits
  • add regression coverage for widened operations, non-compact exact ints, boundary cases, and overflow fallback
  • add benchmark scripts for measuring widened specialized integer fast-path performance
Linked PRs
  • gh-150425

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, die spezialisierten Fast Paths für Integer-Addition, -Subtraktion, -Multiplikation und -Vergleich des Interpreters in tier-2/uop zu lokalisieren, einschließlich der Behandlung von PyLongObject-Operanden. Prüfe die für erweiterte Operationen hinzugefügte Regressionstestabdeckung und die Benchmark-Skripte. Verifiziere anschließend die vollständigen int64_t-Grenzen, nicht-kompakte Exact-Ints, den Fallback bei Überlauf, das Verhalten bei In-Place-Mutationen und 15-Bit-Builds.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
c, python
Bereich
compilers
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.