Skip to content

feat(core, analyzer, go-server): Add model support to analyzer - #387

Merged
Gr-i-niy merged 12 commits into
mainfrom
misonijnik/go-models-core
Nov 2, 2026
Merged

Gr-i-niy merged 12 commits into
mainfrom
misonijnik/go-models-core

Conversation

@misonijnik

Copy link
Copy Markdown
Member

No description provided.

@misonijnik misonijnik changed the title feat(model): Add model support to core feat(core): Add model support to core Aug 29, 2026
@misonijnik
misonijnik force-pushed the misonijnik/go-models-core branch 5 times, most recently from 7677cea to d324e41 Compare September 5, 2026 11:39
@misonijnik misonijnik changed the title feat(core): Add model support to core feat(core, analyzer): Add model support to core Sep 5, 2026
@misonijnik misonijnik changed the title feat(core, analyzer): Add model support to core feat(core, analyzer, go-server): Add model support to core Sep 5, 2026
@misonijnik misonijnik changed the title feat(core, analyzer, go-server): Add model support to core feat(analyzer, go-server): Add model support to core Sep 5, 2026
@misonijnik misonijnik changed the title feat(analyzer, go-server): Add model support to core feat(analyzer, go-server): Add model support to analyzer Sep 5, 2026
@misonijnik
misonijnik force-pushed the misonijnik/go-models-core branch from d324e41 to 0e8a2ce Compare October 13, 2026 10:12
@misonijnik misonijnik changed the title feat(analyzer, go-server): Add model support to analyzer feat(core, analyzer, go-server): Add model support to analyzer Oct 13, 2026

@Saloed Saloed left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make a more clear and resource efficient transformation logic.

  1. Introduce lookups (similar to JVM IR). The instructions shouldn't hold the resolved function/type references
  2. Apply transformation during lookup resolution. The transformation intercepts the lookup, then bypass the lookup if it is not responsible.
  3. We don't need transformation caches at all. We can cache resolved lookups where we need it.

Base automatically changed from misonijnik/isolated-approximations-cli to main October 27, 2026 10:26
@misonijnik
misonijnik added this pull request to stack #420 October 27, 2026 10:38
Address review 5615028707 by moving model path normalization into an IR transformer, making package ownership immutable, and replacing body copying with decoding in the lookup context. Remove transformation caches and add lookup interception regressions.

Validation: 131 Go IR tests and 5 analyzer tests passed; affected consumers compile; git diff --check passes. Benchmark and roundtrip tasks excluded.
@misonijnik
misonijnik force-pushed the misonijnik/go-models-core branch from f22e3ee to 773bdeb Compare October 27, 2026 11:02

@Saloed Saloed left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The general IR architecture is ok. However, we should try to reduce the plenty of miscellaneous entities. Also, we should carefully verify that all the introduced entities have a correct equals implementation

Address review 5673574297 by removing the intermediate model entities and giving the remaining views an equals/hashCode consistent with the IR implementations.

- The model transformer is no longer a GoIRProgram; it intercepts package lookup and builds GoIRPackageImpl/GoIRNamedTypeImpl instead of the overlay package and named-type views.
- ModelFunctionCandidate and the transformer's function re-wrapping are gone; the overlay emits ModelFunction/ApproximatedFunction directly.
- ModelPathNormalizer is folded into GoIRModelPathTransformer, dropping its unused package view.
- The transformer chain builds GoIRGlobalImpl/GoIRConstImpl instead of anonymous delegating views.
- Package and named-type views compare by import path/full name, like their Impl counterparts.
- Function identity is fullName plus model-ness, shared by GoIRFunctionImpl and all function views, so an approximation never equals the function it replaces (bodies and instruction locations inherit function equality).

Validation: 134 Go IR tests (new identity regression included), GoUnitResolverTest and EntryPointSelectionTest pass; git diff --check clean.
Resolve models through package lookup on a single GoIRProgramImpl instead
of a transformer-chain program that re-wrapped every function, package and
named type. The model transformer now builds concrete IR objects
(GoIRPackageImpl, GoIRNamedTypeImpl, GoIRModelFunctionImpl,
GoIRApproximatedFunctionImpl) and maps opentaint/<target> paths while
decoding model bodies, like the JVM approximation instruction substitutor.

Removes GoIRTransformerChain, its function/package/named-type views, the
delegating model function wrappers, GoIRModelPathTransformer and
GoIRBodyReader. GoIRProgram.originalProgram is gone; originals are reached
through GoIRApproximatedFunction.original.
@Gr-i-niy
Gr-i-niy merged commit 98f319b into main Nov 2, 2026
12 checks passed
@Gr-i-niy
Gr-i-niy deleted the misonijnik/go-models-core branch November 2, 2026 13:11
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.

3 participants