Background:
There are repeated differences where LOAD_CONST and LOAD_SMALL_INT/numeric literals
diverge, often accompanied by subsequent stack changes. This likely stems from constant
folding or literal emission policy.
Task:
- Reconcile constant-literal emission rules in compiler constant folding/codegen phases.
- Normalize behavior where CPython would emit constant object vs inline small-int
opcodes.
- Audit for cases where tuple/list/dict literal assembly diverges (
LOAD_CONST shapes,
tuple packing, slice/build helpers).
Acceptance criteria:
- Large
LOAD_CONST-related mismatches reduced, especially in numeric-heavy code paths.
- Bytecode shape remains semantically equivalent for float/int/string constant
expressions.
Background:
There are repeated differences where
LOAD_CONSTandLOAD_SMALL_INT/numeric literalsdiverge, often accompanied by subsequent stack changes. This likely stems from constant
folding or literal emission policy.
Task:
opcodes.
LOAD_CONSTshapes,tuple packing, slice/build helpers).
Acceptance criteria:
LOAD_CONST-related mismatches reduced, especially in numeric-heavy code paths.expressions.