Skip to content

Python: arch_time misses perf_counter and other clocks (recall 0.54) #8859

Closed

Description

@squid-protocol

What is wrong

The Python time_date_logic rule (arch_time) is datetime.datetime|timedelta|time.sleep|time.time|calendar. Timing with the clocks used for measurement is invisible: time.perf_counter is called in 1,183 functions of the engine's own code and none score. Recall 0.54, precision 1.00 against ast. Also missed: datetime.now / strftime (when datetime is imported by name), time.monotonic, time.process_time, time.perf_counter_ns, time.time_ns.

Reproduce

import time

def timer():
    return time.perf_counter()

Scans with arch_time == 0.

Expected

arch_time > 0 for functions that read a clock or format/parse a time. Add the clock names above; decide whether datetime.now() after from datetime import datetime should match (it needs the bare now( form, which is noisy).

How this was found

A pilot that compares each function_data signal with what Python's own ast says the function does (72,044 functions of GitGalaxy's own code; see the pilot note, with corrections and one-function-per-case reproductions in temporal-crucible PR #188). This is part of the keyword-family validity epic (linked below once filed).

Rules for the fix

  • Any change to a keyword list adds or removes regex work, so time it: CPU seconds on keyword-rosetta and language-crucible before and after, and say the number in the PR.
  • If keyword-rosetta counts move, label the PR rosetta:rebless-owed and rebless as usual.
  • Add the case below as a test (one function per case, so a regression names itself).

Activity

  1. added
    bug
    python
    core-engine
    on Nov 21, 2026
  2. squid-protocol commented on Nov 21, 2026

    @squid-protocol
    OwnerAuthor

    Part of #8863 (keyword-family validity epic).

  3. squid-protocol commented on Nov 21, 2026

    @squid-protocol
    OwnerAuthor

    Claimed by promoter-bot host melek, lease renewed 2026-11-21T21:53Z. It lapses after 6 h without a renewal. To take it back, assign someone or remove the claim:melek label.

  4. added a commit that references this issue on Nov 27, 2026
    8972b2f
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

    bugclaim:melekcore-enginepriority: mediumpython

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions