Page MenuHomePhabricator

temporarily store visited objects during ZWrapper formation
Open, Stalled, MediumPublic

Description

What/Why:
During follow-up investigation from this task, there was evidence that there were repeated/redundant calls made just within ZWrapper class during a single execute().

How:
Temporarily cache visited/'resolved' objects in a Map object and retrieve when needed and prevent duplicate logic.

Details

Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
Draft: memoize visited objects during executionrepos/abstract-wiki/wikifunctions/function-orchestrator!300ecarggrace/T388075/temp-store-during-zwrappermain
Customize query in GitLab

Event Timeline

ecarg changed the task status from Open to In Progress.
ecarg triaged this task as High priority.
ecarg moved this task from To Triage to 25Q3 (Jan–Mar) on the Abstract Wikipedia team board.
ecarg edited projects, added function-orchestrator; removed function-evaluator.
ecarg renamed this task from temporarily store objects during ZWrapper formation to temporarily store visited objects during ZWrapper formation.Mar 5 2025, 11:22 PM
ecarg lowered the priority of this task from High to Medium.
  • how to consider cache in/validation: use request-id? uuid? hashing?

I think I'll need to use request-id so that we can clear cache per unique call and then generate unique id's too per subcalls...

  • TTL and/or clear cache per request?
  • keep cache encapsulated in ZWrapper (but this may not work when values change?) or create a utility class or store in Invariants?

More things to consider:

  • the ID for an empty Scope should always be the same
  • the ID for a Scope that introduces no variables should be the same as the ID of its enclosing Scope

organizing my thoughts:

  • set up memoizer to only be instantiated when execute is invoked; in Invariants
  • which will ensure that there will only be one cached once per outer execution (aka. per request/id)
  • created utility class that handles memoizing: get, validate, set.
  • added scopeId_ that creates a unique ID per new Scope which will be used as key to cached values?!!?
  • when initializing memo/cache instance, it will generate a hash so that at the end, we will return the most recent cached version
ecarg changed the task status from In Progress to Stalled.Apr 28 2025, 11:42 PM
  • Status: we do not know if memo is possible with current logic
  • However: next most-reasonable step to consider is to use createZObjectKey() as a cacheKey, however we do not know if createZObjectKey() works as expected :/

I'm going to deprioritize this work as it is not majorly blocking a specific task and there are other tasks that can be more promptly resolved. This work is a sequence of new discovery, pivots, and demands careful thought; big time consumer, albeit non-trivial if succeeds.

We should move this back to ready, right? @ecarg

DSantamaria changed the task status from Stalled to Open.May 15 2025, 5:49 PM
ecarg changed the task status from Open to Stalled.Sep 8 2025, 5:22 PM

Not sure if this should be marked as 'stalled' or 'invalid'. It's 'stalled' bc this is something we should implement (I tried incorporating memoization and that uncovered too many knots; not viable) in some way; perhaps using the new memcache? But this is 'invalid' in that the initial plan of attack proved unfeasible.