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
Tensor variable count semantics under k-CFA context sensitivity #371
The test(...) helper in TestTensorflow2Model counts tensor variables by iterating over all (CGNode, vn) pairs in the analysis results that match the target function name. Under k-CFA context sensitivity, the same IR variable (same value number in the same method) can appear under multiple calling contexts (e.g., distinct trampolines), inflating the count relative to context-insensitive analysis.
This is a design question, not clearly a bug: tests could reasonably reflect either context-sensitive counts (current behavior) or IR-level source counts (one entry per (CGNode, vn) regardless of context).
Design Question
Should the test helper count:
By (CGNode, vn) — current behavior. Faithfully reflects what the analysis computed. Count changes when context-sensitivity depth changes.
By vn only — deduplicate across contexts. Count reflects IR-level source variables. Stable under context-sensitivity changes.
Option 1 is the current implementation; option 2 is what older tests assumed before higher-k context sensitivity was added.
Impact of the Current Behavior
Test expectations become coupled to context-sensitivity implementation details.
Changes to calling-context structure (e.g., adding/removing trampolines, changing k in k-CFA) silently shift the expected count.
Possible Resolution
Decide on the counting semantics (option 1 or option 2 above) and document it in the test helper's Javadoc.
If option 2: deduplicate by vn in the test helper; existing tests that expected the context-insensitive count continue to work.
If option 1: accept that test expectations may need updating when context-sensitivity changes; document this as a known maintenance cost.
Activity
Add `testDenseModelCall` as isolated repro for wala#371.
Set aspirational expectations for `testNeuralNetwork` with runtime-ve…
Set aspirational expectations for `testNeuralNetwork` with runtime-ve…
[-]Test helper double-counts tensor variables under multiple calling contexts[/-][+]Tensor variable count semantics under k-CFA context sensitivity[/+]Reword `testNeuralNetwork` TODO to reflect wala#371's design question.
Bump `testNeuralNetwork`'s tensor-variable count to 4 and refresh its…
Union actual tensor types across contexts in the test helper.