Repository navigation
v0.7.10.5
v0.7.10.5 — funcbody fixtures: small-int return + is None + Compare with const
Date: 2026-04-30
Spec: notes/Spec/1500/1563_gocopy_v07105_load_small_int_isnone.md
Roadmap: notes/Spec/1500/1558_gocopy_v0710x_release_roadmap.md
v0.7.10.5 is a fixture-only release. It adds 6 named regression
fixtures under tests/fixtures/funcbody/ for shapes the
post-v0.7.10.4 pipeline already supports but did not have a
dedicated fixture for: small-int returns, is None /
is not None returns, and single-op Compares with mixed
operand kinds. No source change in compiler/.
Added
tests/fixtures/funcbody/009_expr_const_small_int.py—
def f(): return 7. Pins LOAD_SMALL_INT 7 + RETURN_VALUE in
the trivial zero-arg const-return shape.tests/fixtures/funcbody/011_expr_cmp_is_none.py—
def f(x): return x is None. Pins
LOAD_FAST_BORROW x + LOAD_CONST None + IS_OP 0 + RETURN_VALUE.tests/fixtures/funcbody/012_expr_cmp_is_not_none.py—
def f(x): return x is not None. Pins IS_OP 1.tests/fixtures/funcbody/013_expr_cmp_eq_small_int.py—
def f(x): return x == 0. Pins
LOAD_FAST_BORROW x + LOAD_SMALL_INT 0 + COMPARE_OP eq + RETURN_VALUE.tests/fixtures/funcbody/014_expr_cmp_lt_small_int.py—
def f(x): return x < 5. Pins COMPARE_OP lt with a small-int
RHS.tests/fixtures/funcbody/015_expr_cmp_eq_str.py—
def f(x): return x == "foo". Pins COMPARE_OP eq with a str
constant RHS (forces the const pool to grow past the
small-int slot 0).
Changed
CHANGELOG.md— v0.7.10.5 entry added.
Tests
- Oracle (
bash tests/run.sh): 260/260 fixtures byte-identical
(was 254/254; +6). - Visitor parity (
go test ./compiler/ -run TestVisitorParity):
byte-identical=219 not-implemented=41 mismatched=0 errored=0(was 213/41/0/0; +6 fixtures, all routed through
visitFuncBodyDef→visitFuncCompareExpr/
visitFuncConstantExpr). - No new unit tests: every new fixture exercises an existing
code path; the parity counter is the regression net.
Out of scope (deferred)
fold_const_unaryopport — v0.7.10.6. Fixture
010_expr_const_negative.py(def f(): return -3) is
reserved but not shipped: CPython folds it to
consts=(3, -3) + LOAD_CONST 1, gocopy currently emits
LOAD_SMALL_INT 3 + UNARY_NEGATIVE. The port lands in
v0.7.10.6.basicblock_optimize_load_const+remove_unused_consts
port — v0.7.10.6. Together these will replace the visitor's
emitFuncBodyConstLoadFirstIntfirst-int hack with the
flowgraph machinery CPython uses to produce the same byte
output. (Spec 1558's "delete the quirk" note was overstated
— the behavior is correct CPython output, not a quirk; the
port deletes the visitor-side shortcut, not the behavior.)- Compare-chain shape (
a < b < cand longer) — release TBD.
Both the visitor and the classifier currently reject
multi-op Compares; supporting them needs the chained-CMP
bytecode shape (COPY 1 + TO_BOOL + POP_JUMP_IF_FALSE+
fall-through merge with SWAP/POP) on both paths. Not part
of any currently-scheduled v0.7.10.x release.