Skip to content

TypedPython: chunked range loops poll every 16.7M iterations instead of every 4096 #280

Closed

Description

@b-re-w

cgen.py ~2081 (#206 chunked polling) runs a chunk of TP_POLL_INTERVAL iterations and then calls self.poll(), which emits the countdown form tp_pc_tick(&tp_pc) && tp_poll_slow(...). The countdown also starts at TP_POLL_INTERVAL, so tp_poll_slow runs once per 4096*4096 iterations. A compiled loop under ~16.7M iterations never reaches a safepoint: it blocks stop-the-world (gc.get_objects on 3.15t), KeyboardInterrupt and other eval-breaker work for its whole duration. Found while writing the #143 gc race test.

Done when: the chunk loop calls the slow poll once per chunk; a test asserts a signal/breaker set during a long compiled loop is seen within about TP_POLL_INTERVAL iterations.

Activity

  1. added a commit that references this issue on Oct 25, 2026
  2. b-re-w commented on Oct 25, 2026

    @b-re-w
    MemberAuthor

    Landed in develop via the PR from feat/tp-chunk-poll.

  3. added a commit that references this issue on Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions