Skip to content

Bytecode compat - Align Call/Return and Expression Emission #21

@youknowone

Description

@youknowone

Background:
Frequent mismatches show CALL/LOAD_CONST, FORMAT_SIMPLE/BINARY_OP, and related
expression-sequence rewrites, indicating divergence in call and expression lowering
order.

Task:

  • Review bytecode generation around function/method calls, unary/binary operations, and
    formatted string/format-like code paths.
  • Ensure RustPython emits equivalent pre/post stack state for:
    • CALL argument preparation
    • BINARY_OP classification
    • FORMAT_SIMPLE handling
  • Keep instruction-level stack effect consistent with CPython for equivalent source
    snippets.

Acceptance criteria:

  • Mismatch counts for pairs involving CALL/BINARY_OP/FORMAT_SIMPLE decrease.
  • No regression in small syntax/format-heavy modules (e.g., string formatting tests, AST
    unparse paths).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions