Skip to content

L4 port lattice is disconnected from the statement ddg: a formal_in has out-degree zero #227

Description

@rahlk

Problem

The level-4 port vertices (formal_in, actual_in, formal_out, actual_out) are emitted, and the lattice edges between them are emitted, but no dependence edge ever touches a port. A formal_in — a callable's entry point for a parameter, and the natural seed for "what does this argument reach" — has out-degree zero.

Measured on a full-depth Neo4j projection holding daytrader8 and ThingsBoard (3.0.1, contract 2.0.0):

MATCH (p:JBodyNode)-[r:J_DDG]->()  WHERE p.kind IN ['formal_in','actual_in','formal_out','actual_out']
RETURN count(r)   // 0
MATCH ()-[r:J_DDG]->(p:JBodyNode)  WHERE p.kind IN ['formal_in','actual_in','formal_out','actual_out']
RETURN count(r)   // 0

Zero of 134,742 J_DDG edges and zero of 46,936 J_CDG edges have a port at either end. The lattice's only edges are J_PARAM_IN (actual_in→formal_in), J_PARAM_OUT (formal_out→actual_out) and J_SUMMARY (actual_in→actual_out), so the port layer is an island: reachable from the statement graph in neither direction.

This is not a projection artefact. The same gap is in analysis.json, on the committed -a 4 fixture and on a whole-application -a 4 run.

The sibling analyzers fixed this

  • codeanalyzer-python#115 — closed. Its graph now has 262,582 PY_DDG edges leaving a port.
  • codeanalyzer-typescript#80 and Fix issue #79 #81 — both closed.

Java appears to be the last of the three with the layer disconnected.

Why it matters downstream

Interprocedural value questions are exactly what L4 exists to answer, and each of them silently degenerates. In the SDK, slice_forward from a parameter returns the seed alone, paths_between returns no paths, and flows_to_call/flows_to_argument return Falsefor every input, whatever the program does. An empty answer that is indistinguishable from "no flow exists" is worse than an error, so the SDK now refuses those four on a Java graph rather than answering, via a probe for whether any dependence edge touches a port. When this is fixed they will answer with no SDK change, and the probe will pass on its own.

slice_backward is unaffected and is not gated: it walks J_PARAM_IN in reverse and reaches the argument vertex at each call site.

Repro

java -jar codeanalyzer-3.0.1.jar -i <any project> -a 4 -o out

then, on out/analysis.json, count ddg edges whose src or dst is a formal_in/actual_in/formal_out/actual_out key. Zero on every project tried.

Definition of done

  • A parameter's formal_in has outgoing ddg to the statements that read it, and the statements that compute a returned value have ddg into formal_out — the shape codeanalyzer-python#115 landed.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions