GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — big_100: skip p303 lru_cache over-grow test (upstream CPython gh-148180) · robertsdotpm/runloom@1903957

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • tests/big_100
    • p303_lru_cache_conservation.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎tests/big_100/p303_lru_cache_conservation.py‎

Copy file name to clipboardExpand all lines: tests/big_100/p303_lru_cache_conservation.py
+30-7Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
"""big_100 / 303 -- functools.lru_cache C list+dict under cross-hub eviction churn.
22
3+
SKIPPED FOR NOW -- the currsize<=maxsize bound this program asserts is violated by a
4+
KNOWN UPSTREAM CPython free-threading bug, NOT a runloom defect:
5+
https://github.com/python/cpython/issues/148180
6+
"functools.lru_cache critical section locks self but _LockHeld dict APIs assert
7+
self->cache is locked" (open, type-crash, topic-free-threading)
8+
Reproduced with PLAIN threading.Thread (no runloom) on arm64 3.13t: the cache dict
9+
exceeds maxsize (currsize=129 for maxsize=128); GIL-on and x86-64 stay clean, so it
10+
is an arm64 weak-memory window on the wrapper's wrong-object critical section. The
11+
program skips via setup()'s note_scale_limit until CPython fixes it; re-enable then.
12+
313
No existing program touches functools at all -- and `functools.lru_cache`'s
414
internals are exactly the kind of MUTATING shared C container that the M:N model
515
stresses in a new way. The C `_lru_cache_wrapper` keeps three coupled pieces of
@@ -145,21 +155,34 @@ def worker(H, wid, rng, state):
145155
H.task_done(wid)
146156

147157

158+
SKIP_REASON = (
159+
"lru_cache maxsize over-grow is UPSTREAM CPython gh-148180 "
160+
"(https://github.com/python/cpython/issues/148180 -- functools.lru_cache "
161+
"critical section locks self, not self->cache); reproduced with PLAIN threads "
162+
"on arm64 3.13t (currsize=129 > maxsize=128; GIL-on + x86 clean) -- NOT a "
163+
"runloom bug. Skipped for now; re-enable when CPython fixes it.")
164+
165+
148166
def setup(H):
149-
f_bounded, f_unbounded = make_caches()
150-
# A handful of clearers: enough to race clear-vs-lookup hard, but a small
151-
# minority so the steady-state is eviction churn, not a perpetually empty
152-
# cache. >= 2 even for tiny --funcs smoke runs.
153-
nclear = min(8, max(2, H.funcs // 200))
154-
H.state = {"f_bounded": f_bounded, "f_unbounded": f_unbounded,
155-
"nclear": nclear}
167+
# KNOWN UPSTREAM CPython bug -- skip for now (see module docstring + gh-148180).
168+
H.note_scale_limit(SKIP_REASON)
169+
H.state = None
170+
# When gh-148180 is fixed, delete the two lines above and restore:
171+
# f_bounded, f_unbounded = make_caches()
172+
# H.state = {"f_bounded": f_bounded, "f_unbounded": f_unbounded,
173+
# "nclear": min(8, max(2, H.funcs // 200))}
156174

157175

158176
def body(H):
177+
if H.state is None:
178+
return # skipped in setup (upstream CPython gh-148180)
159179
H.run_pool(H.funcs, worker, H.state)
160180

161181

162182
def post(H):
183+
if H.state is None:
184+
H.log("SKIPPED: " + (H.scale_limit_reason or "upstream CPython gh-148180"))
185+
return
163186
f_bounded = H.state["f_bounded"]
164187
f_unbounded = H.state["f_unbounded"]
165188
bi = f_bounded.cache_info()

0 commit comments

Comments
0 (0)
You are visitor 01402605 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.