-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathbugs.json
More file actions
58 lines (58 loc) · 5.4 KB
/
Copy pathbugs.json
File metadata and controls
58 lines (58 loc) · 5.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{
"_meta": {
"source": "MicroPython tests/basics differential vs CPython 3.13",
"verified": "each repro re-run through VM + python3",
"count": 6,
"fixed": "94 bugs fixed and migrated to vm.json (try/finally + with unwinding cluster; 11 builtin/parser/format divergences from rows 1-11 of the low-NEWLINE triage; generator_return, string_format_modulo_int %*d, seq_unpack list targets, class_getattr dunder-on-type, builtin_slice type identity, containment dict/set-led tuple, range sequence-unpack; yield-from-as-expression cluster: gen_yield_from + gen_yield_from_ducktype + gen_yield_from_exc + gen_yield_from_stopped via a parse_atom Yield arm plus a LoadYieldFrom opcode that carries the subiterator return/StopIteration value, 40 regression cases; range_iter_overflow: AFL sig:06 abort on a range whose step increment crossed the i64 edge, fixed by checked_add in the three range walkers (iter_to_vec_for_spread, IterFrame::next_item, IterCursor::Range::next), 10 regression cases; range_iter_truncation: for-loop/comprehension (IterFrame::next_item) and spread/unpack (iter_to_vec_for_spread) yielded Val::int past the 47-bit inline range instead of promoting, routed both through range_int (pub(crate)) so values auto-promote to LongInt, 10 regression cases; range_contains: `x in range(...)` always returned False (contains had a catch-all Ok(false) for Range) — replaced with an O(1) bounds+step check over i128 that also matches integral floats like CPython, 10 regression cases; set_binop: augmented set `|=`/`&=`/`^=` rebound to a new set instead of mutating in place — added InPlaceBitOr/And/Xor opcodes (parser maps the augmented ops, handle_bitwise routes to set_iop_and_push) that rewrite the left set in place, frozenset still rebinds, 10 regression cases; del_deref: `del` of a closed-over variable cleared only the local slot, not the shared cell, so closures still read the old value — the Del handler now also unbinds the frame's cell for that slot, 10 regression cases; list_sort: `list.sort()` and `sorted()` used a pure `lt_vals` comparator that never dispatched a user `__lt__`, raising TypeError on class instances — added `sort_lt` (tries the `__lt__` dunder, then `lt_vals`) used by both sort paths, threaded chunk/slots through `call_sorted`/`sort_by_lt`/`sort_by_key` with GC rooting, and routed all `list.sort()` through `exec_sort` (both call paths) since the builtin-method table can't carry a frame, 10 regression cases)"
},
"bugs": [
{
"id": "assign_expr",
"category": "control-flow",
"summary": "any() does not short-circuit, so a walrus var assigned inside the generator keeps the last-iteration value instead of stopping at the matching element.",
"repro": "def foo():\n any((hit := i) == 8 for i in range(20))\n return hit\nprint(foo())",
"expected": "8",
"actual": "19"
},
{
"id": "gen_yield_from_executing",
"category": "scoping",
"summary": "A generator that yields from itself via a module-global name raises NameError on that validly-bound name instead of the expected ValueError; the global binding is lost on generator re-entry.",
"repro": "def f():\n yield 1\n yield from g\ng = f()\nprint(next(g))\ntry:\n next(g)\nexcept ValueError:\n print('ValueError')",
"expected": "1\nValueError",
"actual": "1"
},
{
"id": "scope_implicit",
"category": "scoping",
"summary": "Implicit nonlocal closure over a variable defined in the enclosing scope after the nested function raises NameError instead of capturing it.",
"repro": "def f():\n def g():\n return x\n x = 3\n return g\nprint(f()())",
"expected": "3",
"actual": "__VMERR__ NameError: name 'x' is not defined"
},
{
"id": "generator_closure",
"category": "stack-underflow",
"summary": "A generator expression nested inside another generator expression triggers an internal stack underflow on valid supported syntax.",
"repro": "gg = ((x for x in range(2)) for y in range(2))\nfor i in gg:\n for j in i:\n print(j)",
"expected": "0\n1\n0\n1",
"actual": "__VMERR__ RuntimeError: stack underflow"
},
{
"id": "fun_kwvarargs",
"category": "wrong-value",
"summary": "A call mixing a starred argument that is itself a function call with a keyword argument whose value is also a function call corrupts argument evaluation and raises TypeError: object is not callable.",
"repro": "def f(*a, **k):\n print(a, k)\ndef g(x):\n return x\nf(*g([1, 2]), z=g(3))",
"expected": "(1, 2) {'z': 3}",
"actual": "__VMERR__ TypeError: object is not callable"
},
{
"id": "gen_next_nested_arg",
"category": "stack-corruption",
"summary": "Calling next(gen) as a nested argument of another call (e.g. out.append(next(it))) corrupts the operand stack: the second such next raises StopIteration prematurely instead of yielding. A sequential a=next(it);b=next(it) or a for-loop over the same generator works. resume_coroutine splices the coroutine stack onto the outer CallMethod's partial frame. Latent pre-existing; surfaced once generator exhaustion became a catchable StopIteration.",
"repro": "def g():\n yield 1\n yield 2\ndef take(it):\n out = []\n out.append(next(it))\n out.append(next(it))\n return out\nprint(take(g()))",
"expected": "[1, 2]",
"actual": "__VMERR__ StopIteration"
}
]
}