Skip to content

Rebuilt and extended analysis for unarchival - #75

Merged
vitsalis merged 7 commits into
vitsalis:mainfrom
babyvitbot:pr/pycg-3
Nov 15, 2026
Merged

vitsalis merged 7 commits into
vitsalis:mainfrom
babyvitbot:pr/pycg-3

Conversation

@babyvitbot

Copy link
Copy Markdown
Contributor

No description provided.

babyvitbot and others added 7 commits November 15, 2026 15:16
The analysis of the ICSE 2021 paper, ported to run on Python 3.12 to 3.15
with the small fixes that the port needed, on uv, ruff and one CI workflow.
The micro-benchmark is checked against real executions
(micro-benchmark/validate.py), and the ground-truth edges that the check
found wrong are corrected; the cases that this analysis fails are listed as
strict expected failures.

This commit is the "original PyCG" of the evaluation, the tag
baseline-original-engine. The commits after it replace the analysis.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The settings of the project for the redesigned PyCG: pyproject.toml and the
lock file, the Makefile's lint and test targets, the CI workflow (lint and
tests on Python 3.12 to 3.15, also on pushes to dev), and AGENTS.md, which
states the rules of the project for contributors and agents.

This commit starts a series of six that replaces the 2021 analysis with the
redesigned one; the tree builds and its tests pass at the end of the series.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
docs/design.md is the specification of the analysis: the five ideas, every
rule with its limits, why the result does not depend on the solver's order
and why the solve ends, and the open problems. docs/format.md specifies
the JSON document that PyCG writes.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A new analysis for Python 3.12 and later, fully static: it never imports
or runs the analysed code. It follows the values of a program (functions,
classes, instances, containers) through an assignment graph solved to a
fixpoint, models classes with their MROs, descriptors and decorators,
reports the calls that the interpreter makes (iteration, context managers,
operators, subscripts, await), and names calls into code outside the
package through type stubs. One setting, the cap on the objects kept per
value. The output is one deterministic JSON document; pycg-view renders it
as one HTML page.

It scales to large packages: the records of an attribute access through
an instance are made only once the class can answer, the node of an
instance attribute at its first write, and the parameter nodes of a
stubbed call when a rule first reads them. None of this changes a
result; a reference test compares the solve, round by round, with one
that makes every record at once.

The 2021 analysis is the tag baseline-original-engine.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each case is a small program with the call graph that Python has when it
runs; micro-benchmark/validate.py checks a case against a real run. The
cases cover the language up to Python 3.15. The duplicate tree
micro-benchmark-key-errs goes. tools/generate_stubs.py builds the stub
data that the analysis reads.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Unit tests of the analysis through its public entry points, the
micro-benchmark run against its expected call graphs, properties of the
solver (order independence, termination), and the tests of the viewer and
of the benchmark's tools. tests/known_failures.txt lists the cases that the
analysis does not handle, each with its cause, as strict expected
failures; tests/triage.py regenerates it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The archive notice goes. The README says what the analysis resolves, how
to install PyCG from a checkout (this version is not on PyPI yet), how to
use it, and where the evaluation is (vitsalis/pycg-evaluation).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@vitsalis
vitsalis merged commit c5c6a89 into vitsalis:main Nov 15, 2026
5 checks passed
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