Skip to content

[DFA] Move all variable storage to Flow #6985

Draft
Brian Norman (bnorm) wants to merge 4 commits into
masterfrom
bnorm/KT-87940-remove-variable-storage
Draft

[DFA] Move all variable storage to Flow #6985
Brian Norman (bnorm) wants to merge 4 commits into
masterfrom
bnorm/KT-87940-remove-variable-storage

Conversation

@bnorm

Copy link
Copy Markdown
Member

Instead of storing variable information in a mutable data stucture like
VariableStorage, store known variables and their members in Flow
instead. This makes sure variable information persists across DFA state
changes and removes the need to create snapshots.

Instead of maintaining duplicate read-only functions in both
PersistentFlow and MutableFlow, create abstract properties in the parent
class `Flow`. These properties can then be used to directly implement
the previously abstract functions instead, thus, simplifying the
implementation of both subclasses.

^KT-87940
Unify naming to `getKnown*` or `remember*`, dependeing on if
`createReal` is set to true or not.

^KT-87940
Instead of storing variable information in a mutable data stucture like
VariableStorage, store known variables and their members in Flow
instead. This makes sure variable information persists across DFA state
changes and removes the need to create snapshots.

^KT-87940 Fixed
@kotlin-safemerge

Copy link
Copy Markdown

Code Owners

RuleOwnersApproval
/​analysis/​
kotlin-analysis-api

UNASSIGNED
/​compiler/​fir/​, /​compiler/​testData/​diagnostics/​
kotlin-frontend

UNASSIGNED
PR commands for maintainers
CommandDescriptionParameters
/safe-mergeRebase-merges with automatic fixup commit squashing--fixup Autosquash fixup commits (on by default)
/safe-squash-mergeSquash-merges with optional commit title/body override--title Title of the squashed commit
--message Body of the squashed commit
/dry-runRuns the test pipeline with changes rebased on latest master--retry Retry the CI run on failure
/test-publicTriggers the public test suite without rebasing on latest master
/test-privateTriggers the private test suite without rebasing on latest master
/codeownersTriggers code owners check and comment update
/fixupSquashes fixup commits and force pushes the branch
/cancel-coordinatorCancels the merge coordinator currently running for this branch

@bnorm

Copy link
Copy Markdown
Member Author

/dry-run

@KotlinBuild

This comment has been minimized.

This is an exploratory change to move the lazy PropertyStability value
from a RealVariable into a Flow. This makes RealVariable stateless, so
maintaining the same instance is no longer a performance optimization,
only a memory optimization (something we can tackle again later).

^KT-87944
@bnorm
Brian Norman (bnorm) force-pushed the bnorm/KT-87940-remove-variable-storage branch from ddcfa15 to 7aad85f Compare July 24, 2026 12:49
@bnorm

Copy link
Copy Markdown
Member Author

/dry-run

@kotlin-safemerge

Copy link
Copy Markdown

Couldn't reach TeamCity - please try again in a few minutes.

@bnorm

Copy link
Copy Markdown
Member Author

/dry-run

@KotlinBuild

This comment has been minimized.

@bnorm

Copy link
Copy Markdown
Member Author

/dry-run

@KotlinBuild

Build Server (KotlinBuild) commented Jul 26, 2026

Copy link
Copy Markdown

THIS IS A DRY RUN

Quality gate is triggered at https://buildserver.labs.intellij.net/build/1013359859 — use this link to get full insight.

Quality gate was triggered with the following revisions:

kotlin
Branch: refs/merge/GITHUB-6985/safe-merge
Commit: 2ab18d4


Quality gate failed. See https://buildserver.labs.intellij.net/build/1013359859 to get full insight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants