Skip to content

v0.8.0

Latest

Choose a tag to compare

@github-actions github-actions released this 30 Apr 11:12
v0.8.0
8831dfd

v0.8.0 — v1/v2 split + v0.8.x roadmap

Date: 2026-04-30
Spec: notes/Spec/1500/1575_gocopy_v08x_full_cpython_port.md
Template: notes/Spec/1500/1576_v2_per_port_spec_template.md

v0.8.0 is the preparatory cut for the v0.8.x port cycle. No behaviour
change — cmd/gocopy still drives the v1 (formerly compiler/)
pipeline end-to-end. The release sets up the repo layout and the CI
posture that the next six phase releases (v0.8.1–v0.8.6) build on.

Why the major bump

v0.7.x grew the visitor pipeline shape-by-shape behind 11 validate*
allowlist gates, with a legacy classifier as fallback for unsupported
shapes. That worked to keep the oracle green during construction but
produced two compilers in one repo: the v0.7 visitor (partial, gated)
and the v0.6 classifier (full, ad-hoc). Patching v1 in place would
carry the architectural baggage forward forever.

v0.8.x takes the opposite approach: freeze v1/ and write v2/ from
scratch as a structural mirror of CPython 3.14 Python/*.c. Each
v2/<pkg>/ ports exactly one upstream .c file, with the same
function names (Go-idiomatic), same control flow, same
SOURCE: Python/<file>.c:<line> cites. Per-port specs gate each
phase release.

Repo restructure

  • git mv compiler v1 — every existing compiler/ package now
    lives at v1/<same-name>/. 79 .go files moved.
  • All in-tree github.com/tamnd/gocopy/compiler/... imports
    rewritten to github.com/tamnd/gocopy/v1/....
  • cmd/gocopy/main.go updated in lockstep — still wires v1's
    Compile. No behaviour change.
  • v1/parser_boundary_test.go allow-list strings updated from
    compiler/... to v1/....

v2/ skeleton

One Go package per CPython Python/*.c file. No internal/
subfolders
— every package is importable so per-port specs and
tests can target each translation unit directly.

v2/ package Mirrors
v2/preprocess/ Python/ast_preprocess.c
v2/future/ Python/future.c
v2/symtable/ Python/symtable.c
v2/codegen/ Python/codegen.c
v2/instrseq/ Python/instruction_sequence.c
v2/flowgraph/ Python/flowgraph.c
v2/assemble/ Python/assemble.c
v2/compile/ Python/compile.c
v2/ast/ parser AST alias surface (parity with v1/ast/)
v2/lower/ parser→ast translation (parity with v1/lower/)
v2/dump/ (no upstream) stage-dump + diff tooling vs CPython

Each package has only a doc.go for now, citing the upstream source
file and the per-port spec slot. Implementation lands in v0.8.1+.

CI: oracle warn-only during v0.8.x

The cpython oracle diff job in .github/workflows/ci.yml is
expected to be partially red until v2/ reaches byte parity (target:
v0.8.6). The oracle step now:

  • runs tests/run.sh for visibility
  • emits the N/M fixtures byte-identical summary into
    $GITHUB_STEP_SUMMARY
  • emits a ::warning:: annotation referencing spec 1575
  • always exits 0 (warn-only mode)

Strict mode returns in v0.8.6 once oracle hits 441/441.

v0.8.x roadmap (spec 1575)

Six phases mapped to six phase releases:

Release Phase CPython source Oracle target
v0.8.0 prep (repo restructure) 343/441
v0.8.1 1 (tooling — no upstream) 343/441
v0.8.2 2 future.c + ast_preprocess.c ~345/441
v0.8.3 3 symtable.c ~345/441
v0.8.4 4 instruction_sequence.c + codegen.c ~410/441
v0.8.5 5 flowgraph.c + assemble.c ~435/441
v0.8.6 6 compile.c + delete v1/ 441/441

Per-port specs land alongside each release's PRs under
~/notes/Spec/1500/15xx_v2_<pkg>_port.md, following the template
introduced as spec 1576.

Added

  • v2/ directory tree (11 packages, one doc.go per package).
  • notes/Spec/1500/1575_gocopy_v08x_full_cpython_port.md —
    full v0.8.x roadmap (this spec).
  • notes/Spec/1500/1576_v2_per_port_spec_template.md —
    template for per-port specs that gate phase release PRs.

Changed

  • .github/workflows/ci.yml — oracle step switched to warn-only
    for v0.8.x cycle. Step summary captures the byte-identical count;
    workflow warning annotation references spec 1575.
  • cmd/gocopy/main.go — import path compiler → v1.
  • v1/parser_boundary_test.go (was compiler/parser_boundary_test.go)
    — allow-list updated for the v1/ tree.
  • 79 .go files moved from compiler/ to v1/ (verbatim).

Tests

  • go vet ./...: clean.
  • go build ./...: clean (v1 + v2 stubs both build).
  • go test ./...: green (v1 unit tests pass post-rename;
    v2 packages have no tests yet).
  • tests/run.sh: 343/441 (unchanged from v0.7.11.3 baseline —
    the rename is mechanical only).

Out of scope (deferred to v0.8.1+)

  • Any change to compiler behaviour. v0.8.0 is purely the cut.
  • Stage-dump tooling, --dump-stage=* CLI flags,
    tests/scripts/{cpython,gocopy}_dump.py,
    tests/scripts/diff_stages.py — all v0.8.1.
  • v2/preprocess/ and v2/future/ implementation — v0.8.2.
  • All other v2/ packages — v0.8.3 through v0.8.6.
  • Deletion of v1/ — v0.8.6, after oracle hits 441/441.