refactor(interpreter): consolidate environment storage and generalize fact access - #732
Open
zhenrongliew wants to merge 2 commits into
Open
refactor(interpreter): consolidate environment storage and generalize fact access#732zhenrongliew wants to merge 2 commits into
zhenrongliew wants to merge 2 commits into
Conversation
zhenrongliew
added this pull request to stack #725
September 10, 2026 13:43
zhenrongliew
force-pushed
the
dl/env-store
branch
2 times, most recently
from
September 11, 2026 13:49
73a56f6 to
c557998
Compare
zhenrongliew
force-pushed
the
dl/env-store
branch
from
September 11, 2026 20:02
c557998 to
76b969a
Compare
- Introduced `EnvStore` and `Env` traits to manage environment storage and access. - Updated the environment model to use `EnvStore<K, SSAValue, V>` instead of `EnvStackStore<V>`. - Enhanced the `Env` trait with methods for reading, writing, and binding values. - Modified the interpreter's core to reflect changes in environment handling. - Updated documentation to clarify the new environment model and its components. - Added tests for the new environment storage and access patterns.
zhenrongliew
force-pushed
the
dl/env-store
branch
from
September 11, 2026 20:29
76b969a to
9b1654f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #729.
Problem
Facts stored differently: forward values in an environment,
sparse demand in a solver summary map, dense liveness split between block
summaries and a scope-qualified store.
Fix
Unify all interpreters into a shared storage pipeline:
EnvStore<K, A, V>replacesEnvStackStore<V>. One container owns context identity(K → EnvIndex)and per-environmentFactStore<A, V>maps.FactStore<A, F>is aanchor→payloadmap.Envis anchor-generic (type Anchor: LatticeAnchor). SSA positional binding lives onSSABinding: Env<Anchor = SSAValue>(blanket); dense/ProgramPoint engines implementEnvwithout it.Activation lifetime stays on
CallServices, sibling toEnv.CallFrameneeds onlyCallServices + Env<Anchor = SSAValue>.Context-insensitive keying:
ContextInsensitive::Key = LinkTarget; ConstPropContext::Key = (LinkTarget, CallCtx).