You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python PHIR interpreter's Result decode cache grows without bound between resets #1350
The pure-Python PHIR interpreter (PhirClassicalInterpreter, #1314 branch) caches the decoded references of each executed Result op in a plain dict keyed by the op object. The cache is cleared only by init() and reset().
A caller that builds a fresh COp("Result", ...) for every handle_cops/execute call grows the cache by one entry per call until the next reset. No caller in the repo does this today: HybridEngine executes the program's own ops. The README documents that decoded Results are held until the next init or full reset.
Direction
Bound the cache, for example by evicting entries for ops that are not part of the loaded program, or by caching only program ops. Keep the per-shot hot path free of JSON/FFI work: a WeakKeyDictionary was tried and measured 7.6% slower on the Result path, and it needed pickling hooks.
Activity