Skip to content

feat: model class literals as ClassConstant nodes (tag 16) - #226

Merged
johnsonlee merged 1 commit into
mainfrom
feat/class-constant-node
Nov 16, 2026
Merged

johnsonlee merged 1 commit into
mainfrom
feat/class-constant-node

Conversation

@johnsonlee

@johnsonlee johnsonlee commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Closes #223

Problem

The JVM frontend mapped every class literal to IntConstant(0) (the fallback for unmodelled constants in ValueNodes.getOrCreateConstant). The type was lost at build time, every literal collided with a real 0, and a reflective registration such as register(Payload.class, parser) could not be proved from the graph.

Change

  • Model: new ClassConstant(id, value); value is the JVM type descriptor (Lsample/Payload;, [Lsample/Payload;, [[I). SootUp's ClassConstant maps to it, interned under its own key so it never merges with a StringConstant that spells the same text.
  • Persistence: node record tag 16 (one string-table index, the StringConstant layout) in the JVM writer/readers (eager and mapped), the mmap spill format, the type index and the branch-definition validator; Rust NodeKind::ClassConstant, TAG_COUNT = 17, is_constant_tag/CONSTANT_TAGS, and the interchange importer. The node data header stays at version 3.
  • Query (Kotlin and Rust): MATCH (n:ClassConstant), labels(n) = ["ClassConstant", "Constant"], n.value with =, STARTS WITH, IN, CONTAINS, ENDS WITH, =~; value joins the Rust raw string column (appended slot, earlier slots unchanged) and the Kotlin direct/mapped string paths. Both parsers now split statements only on semicolons outside string literals and escaped names, since a descriptor contains ; (previously WHERE n.value = 'Lx;' failed to parse in both engines).
  • Explorer: rendering in both servers and both web UIs (Payload[].class).
  • Docs: docs/webgraph-storage.md (format and compatibility), README, frontend correctness gate, agent skill reference.

Compatibility

Graphs built before this change contain IntConstant(0) for class literals; the type is not in the file, so rebuild to get ClassConstant nodes. Readers that predate tag 16 reject a graph containing one (Unknown node tag: 16). Graphs without class literals differ only by one empty entry in graph.typeindex, which older readers skip.

Unchanged by design: MethodHandle/MethodType ldc constants still use the logged IntConstant(0) fallback (now covered by a test), and fold rules still cannot name a class literal argument (ConstantFoldTest expectation unchanged).

Tests

  • ClassLiteralNodeTest (SootUp): descriptors incl. arrays and int[][], the equal string stays a separate StringConstant, interning, flow through a local into a call argument, the remaining fallback.
  • Frontend correctness gate: new class-literal cases for Java and Android/DEX (require descriptor and return flow, forbid int:0 and the string), node:ClassConstant covered.
  • ClassConstantPersistenceTest (webgraph): eager and mapped load of class literals with local and branch definitions; Cypher over both load modes; a SootUp-built graph from both node builders saved for the native interop step.
  • ClassConstantCypherTest (Kotlin engine) and backend/cypher/tests/class_constant.rs (Rust): save, load (directory and packed container), labels, properties/keys/maps, string predicates, dataflow, and the JVM-written fixture (GRAPHITE_CLASS_CONSTANT_FIXTURE, required in rust.yml).
  • Graph parity baseline: 102 IntConstant(0) fact occurrences become their ClassConstant(...) descriptors; after mapping them back the baseline is identical (no fact lost).

Local runs: cargo fmt --check, cargo clippy --workspace --all-targets -D warnings, cargo test --workspace (incl. the interop test against a freshly written JVM fixture), ./gradlew check koverXmlReport and check-coverage.py (all seven modules 100%) pass. frontend/web, Apple and CI TypeScript helpers are untouched and were not run.

Local benchmark

Ran locally with graphite-benchmark run on an Apple M3 Max (16 cores, 64 GB, macOS 14.3, OpenJDK 17.0.21). Base is main d4dd8ee6, head is this PR's c69f5433, and the trusted controller is base. Nothing else was running.

Gate result: base-head-reviewed-semantics fails, as expected; every other check passes.

  • The failure is the same on the hosted run 43729611853.
  • Passing checks: frontend build/save correctness, heap and coverage for both revisions (real64 plus whole Tika/Hive/Kotlin, 7 G1 JVM receipts under 4 GiB), real64 pressure correctness, and concurrent error recovery.
  • The whole-JAR node/edge count assertions pass unchanged. A class literal was already its own node, interned by the SootUp constant, so only its kind changes.
  • 70 of 73 cases match byte for byte. The 3 that differ are exactly the intended IntConstant(0) → ClassConstant transition, checked row by row against the hosted run's retained bodies:
Case Base → head
schema-label-histogram IntConstant 157,407 → 126,774 and a new ClassConstant row of 30,633; the sum is conserved and all other labels are unchanged
schema-relationship-histogram (ORDER BY c DESC LIMIT 40) IntConstant→CallSite DATAFLOW −35,112 and IntConstant→Local DATAFLOW −10,881 appear as the new ClassConstant rows with exactly those counts. Those two rows push the two smallest buckets out of the top 40: Float→Return 385 and Null→CallSite CONTROL_FLOW 194. IntConstant→Field −128, →Return −417 and CONTROL_FLOW→Local −44 move to ClassConstant buckets below the cut
shape-label-scan-constant (MATCH (n:Constant) RETURN n.value LIMIT 200) Rows that read 0 now carry descriptors such as Ljavax/xml/validation/SchemaFactory;

The controller marks every timing row non-comparable while any response differs. The base and head values it records are listed below with the deltas computed by hand. They are single local runs: observations, not acceptance evidence.

Case Stage Measurement Base ms Head ms Δ ms Δ %
real64-build-save frontend-build-save JMH SingleShotTime, 1 sample 255,809.1 257,452.5 +1,643.4 +0.64%
real64-loading registry-ready single fresh-process boundary 17,831.4 18,328.6 +497.1 +2.79%
real64-loading startup through first-use oracle single fresh-process boundary 18,221.9 18,724.9 +502.9 +2.76%
schema-relationship-histogram pressure p50 / p95 15.30 / 16.20 15.13 / 15.50 −0.17 / −0.70
shape-label-scan-constant pressure p50 / p95 1.01 / 2.33 1.06 / 1.74 +0.05 / −0.58
schema-label-histogram pressure p50 / p95 0.58 / 0.70 0.60 / 0.66 +0.02 / −0.04
  • 292 query timing rows in all. No case reaches 50 ms locally; the slowest base value is 49.3 ms.

  • Largest absolute changes:

    • shape-equality pressure p95: 6.4 → 2.0 ms (−4.4)
    • shape-group-count pressure p95: 46.0 → 49.0 ms (+3.0)
    • shape-with-aggregate pressure p50: 43.1 → 44.8 ms (+1.6) and p95: 49.3 → 50.6 ms (+1.3)

    Every other row moves by less than 1.3 ms.

  • On loading: the main-vs-main-plus-fix(sootup): read DEX declarations without converting or retaining bodies #225 run on the same machine moved +0.70 s with no change to loading, so +0.5 s is within single-sample run-to-run noise. Loading still counts TAG_CLASS_CONSTANT with the other constants in the type index.

To make the gate pass: exact transition rules for these three cases, bound to the base/head product identities, have to land in the trusted benchmark/src/transitions.rs on main in a separate policy PR, as was done for #193 (#195). The current identities are base a6edb466… and head aa06cf4f…. They will be re-read after this branch is rebased onto the final main.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Y7fuheyv6BkFkWh5taa18M

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

📊 Test Coverage

Module Line Coverage
core ✅ 100.00% (3047/3047)
cypher ✅ 100.00% (6770/6770)
explore ✅ 100.00% (5507/5507)
ir ✅ 100.00% (180/180)
query ✅ 100.00% (363/363)
sootup ✅ 100.00% (6051/6051)
webgraph ✅ 100.00% (8258/8258)

View full logs

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Benchmark report

Base: cdb3cb8b587151ff0fd1999a0fa7affcebff9b66 · Head: 5c6ab25c6b64458cae19502f321787d2acaf277e

Workflow and raw evidence · Full report

Benchmark correctness and OOM: PASS

Timing differences are report-only; correctness, OOM and required coverage decide this gate. GitHub runner timings do not establish performance acceptance.

Base: cdb3cb8b587151ff0fd1999a0fa7affcebff9b66
Head: 5c6ab25c6b64458cae19502f321787d2acaf277e

frontend-build-save

  • PASS base frontend build/save correctness: fresh real64 build/save plus whole Tika/Hive/Kotlin correctness/readback complete; 7 G1 JVM receipts under 4 GiB; ExitOnOutOfMemoryError rejects even recoverable production OOM
  • PASS base frontend build/save heap: fresh real64 build/save plus whole Tika/Hive/Kotlin correctness/readback complete; 7 G1 JVM receipts under 4 GiB; ExitOnOutOfMemoryError rejects even recoverable production OOM
  • PASS base frontend build/save coverage: fresh real64 build/save plus whole Tika/Hive/Kotlin correctness/readback complete; 7 G1 JVM receipts under 4 GiB; ExitOnOutOfMemoryError rejects even recoverable production OOM
  • PASS head frontend build/save correctness: fresh real64 build/save plus whole Tika/Hive/Kotlin correctness/readback complete; 7 G1 JVM receipts under 4 GiB; ExitOnOutOfMemoryError rejects even recoverable production OOM
  • PASS head frontend build/save heap: fresh real64 build/save plus whole Tika/Hive/Kotlin correctness/readback complete; 7 G1 JVM receipts under 4 GiB; ExitOnOutOfMemoryError rejects even recoverable production OOM
  • PASS head frontend build/save coverage: fresh real64 build/save plus whole Tika/Hive/Kotlin correctness/readback complete; 7 G1 JVM receipts under 4 GiB; ExitOnOutOfMemoryError rejects even recoverable production OOM
  • PASS host OOM events: before=Some({"high": 0, "low": 0, "max": 0, "oom": 0, "oom_group_kill": 0, "oom_kill": 0, "sock_throttled": 0}); after=Some({"high": 0, "low": 0, "max": 0, "oom": 0, "oom_group_kill": 0, "oom_kill": 0, "sock_throttled": 0})
Case Stage Measurement N base/head Base ms Head ms Delta ms Delta %
real64-build-save frontend-build-save JMH SingleShotTime 1/1 442175.657 457596.054 15420.398 +3.49%

native-real64

  • PASS base-real64-pressure-correctness: All complete responses, repeated-request stability and semantic scope assertions passed
  • PASS head-real64-pressure-correctness: All complete responses, repeated-request stability and semantic scope assertions passed
  • PASS matched-real-source-inputs: source JAR/shard hashes match: true; exact 73 query texts match: true
  • PASS base-head-reviewed-semantics: Exact queries and complete typed responses, or compiled-in directed expectations bound to both product content identities; exact query match: true; exact response match: false; see semantic-transitions.json
  • PASS fixed-real64-pressure-protocol: 73 cases; concurrency4; first-use1/warmup2/pressure20; pressure p50<100ms selects isolated40 at concurrency1. Selection changes reporting only, never acceptance.
  • PASS native-host-oom: Linux cgroup OOM counters must remain unchanged; every native process must survive all requests. JVM heap ceilings are checked by frontend-build-save
  • PASS base-native-concurrent-error-recovery: Separate real64 server: four concurrent complete requests, outcome metrics, invalid inputs and exact recovery results passed; deterministic rejection/deadline contracts are covered by production-handler unit tests, not these paired network probes; no performance samples
  • PASS head-native-concurrent-error-recovery: Separate real64 server: four concurrent complete requests, outcome metrics, invalid inputs and exact recovery results passed; deterministic rejection/deadline contracts are covered by production-handler unit tests, not these paired network probes; no performance samples
Case Stage Measurement N base/head Base ms Head ms Delta ms Delta %
real64-loading registry-ready single fresh-process boundary 1/1 49482.300 49824.251 UNAVAILABLE UNAVAILABLE
real64-loading startup-through-first-use-oracle single fresh-process boundary 1/1 51026.627 51311.336 UNAVAILABLE UNAVAILABLE
zero/global-wide-four-properties pressure nearest-rank p50 20/20 1.700 1.866 UNAVAILABLE UNAVAILABLE
zero/global-wide-four-properties pressure nearest-rank p95 20/20 5.788 4.038 UNAVAILABLE UNAVAILABLE
zero/global-wide-class-pair pressure nearest-rank p50 20/20 0.978 1.361 UNAVAILABLE UNAVAILABLE
zero/global-wide-class-pair pressure nearest-rank p95 20/20 4.937 4.645 UNAVAILABLE UNAVAILABLE
zero/global-wide-name-pair pressure nearest-rank p50 20/20 0.878 0.841 UNAVAILABLE UNAVAILABLE
zero/global-wide-name-pair pressure nearest-rank p95 20/20 4.263 4.665 UNAVAILABLE UNAVAILABLE
zero/global-wide-caller-class pressure nearest-rank p50 20/20 0.997 1.315 UNAVAILABLE UNAVAILABLE
zero/global-wide-caller-class pressure nearest-rank p95 20/20 2.732 6.002 UNAVAILABLE UNAVAILABLE
zero/global-wide-callee-class pressure nearest-rank p50 20/20 1.113 1.430 UNAVAILABLE UNAVAILABLE
zero/global-wide-callee-class pressure nearest-rank p95 20/20 3.629 3.617 UNAVAILABLE UNAVAILABLE
zero/global-wide-provenance pressure nearest-rank p50 20/20 0.993 1.183 UNAVAILABLE UNAVAILABLE
zero/global-wide-provenance pressure nearest-rank p95 20/20 5.783 3.215 UNAVAILABLE UNAVAILABLE
zero/global-wide-aliased pressure nearest-rank p50 20/20 1.043 0.881 UNAVAILABLE UNAVAILABLE
zero/global-wide-aliased pressure nearest-rank p95 20/20 3.640 5.906 UNAVAILABLE UNAVAILABLE
zero/global-wide-parameterized-as-literal pressure nearest-rank p50 20/20 0.877 1.103 UNAVAILABLE UNAVAILABLE
zero/global-wide-parameterized-as-literal pressure nearest-rank p95 20/20 5.459 2.802 UNAVAILABLE UNAVAILABLE
zero/global-wide-wrapped-case-insensitive pressure nearest-rank p50 20/20 1.041 1.091 UNAVAILABLE UNAVAILABLE
zero/global-wide-wrapped-case-insensitive pressure nearest-rank p95 20/20 2.608 4.180 UNAVAILABLE UNAVAILABLE
zero/global-wide-wrapped-case-insensitive-distinct pressure nearest-rank p50 20/20 1.543 1.190 UNAVAILABLE UNAVAILABLE
zero/global-wide-wrapped-case-insensitive-distinct pressure nearest-rank p95 20/20 3.283 4.704 UNAVAILABLE UNAVAILABLE
targeted/global-wide-four-properties pressure nearest-rank p50 20/20 62.147 51.889 UNAVAILABLE UNAVAILABLE
targeted/global-wide-four-properties pressure nearest-rank p95 20/20 92.800 84.301 UNAVAILABLE UNAVAILABLE
targeted/global-wide-class-pair pressure nearest-rank p50 20/20 4.396 2.360 UNAVAILABLE UNAVAILABLE
targeted/global-wide-class-pair pressure nearest-rank p95 20/20 70.562 69.534 UNAVAILABLE UNAVAILABLE
targeted/global-wide-name-pair pressure nearest-rank p50 20/20 2.149 1.708 UNAVAILABLE UNAVAILABLE
targeted/global-wide-name-pair pressure nearest-rank p95 20/20 5.261 5.912 UNAVAILABLE UNAVAILABLE
targeted/global-wide-caller-class pressure nearest-rank p50 20/20 1.792 1.640 UNAVAILABLE UNAVAILABLE
targeted/global-wide-caller-class pressure nearest-rank p95 20/20 3.295 2.927 UNAVAILABLE UNAVAILABLE
targeted/global-wide-callee-class pressure nearest-rank p50 20/20 1.462 1.659 UNAVAILABLE UNAVAILABLE
targeted/global-wide-callee-class pressure nearest-rank p95 20/20 2.972 3.408 UNAVAILABLE UNAVAILABLE
targeted/global-wide-provenance pressure nearest-rank p50 20/20 1.560 1.364 UNAVAILABLE UNAVAILABLE
targeted/global-wide-provenance pressure nearest-rank p95 20/20 3.438 2.998 UNAVAILABLE UNAVAILABLE
targeted/global-wide-aliased pressure nearest-rank p50 20/20 1.377 1.474 UNAVAILABLE UNAVAILABLE
targeted/global-wide-aliased pressure nearest-rank p95 20/20 2.755 3.354 UNAVAILABLE UNAVAILABLE
targeted/global-wide-parameterized-as-literal pressure nearest-rank p50 20/20 1.764 1.539 UNAVAILABLE UNAVAILABLE
targeted/global-wide-parameterized-as-literal pressure nearest-rank p95 20/20 3.893 3.250 UNAVAILABLE UNAVAILABLE
targeted/global-wide-wrapped-case-insensitive pressure nearest-rank p50 20/20 1.254 1.400 UNAVAILABLE UNAVAILABLE
targeted/global-wide-wrapped-case-insensitive pressure nearest-rank p95 20/20 2.704 2.915 UNAVAILABLE UNAVAILABLE
targeted/global-wide-wrapped-case-insensitive-distinct pressure nearest-rank p50 20/20 1.840 1.692 UNAVAILABLE UNAVAILABLE
targeted/global-wide-wrapped-case-insensitive-distinct pressure nearest-rank p95 20/20 3.956 5.463 UNAVAILABLE UNAVAILABLE
dense/global-wide-four-properties pressure nearest-rank p50 20/20 4.533 4.543 UNAVAILABLE UNAVAILABLE
dense/global-wide-four-properties pressure nearest-rank p95 20/20 9.347 7.988 UNAVAILABLE UNAVAILABLE
dense/global-wide-class-pair pressure nearest-rank p50 20/20 4.592 4.691 UNAVAILABLE UNAVAILABLE
dense/global-wide-class-pair pressure nearest-rank p95 20/20 7.753 9.724 UNAVAILABLE UNAVAILABLE
dense/global-wide-name-pair pressure nearest-rank p50 20/20 3.733 4.546 UNAVAILABLE UNAVAILABLE
dense/global-wide-name-pair pressure nearest-rank p95 20/20 5.882 7.754 UNAVAILABLE UNAVAILABLE
dense/global-wide-caller-class pressure nearest-rank p50 20/20 4.013 4.229 UNAVAILABLE UNAVAILABLE
dense/global-wide-caller-class pressure nearest-rank p95 20/20 8.266 8.993 UNAVAILABLE UNAVAILABLE
dense/global-wide-callee-class pressure nearest-rank p50 20/20 3.733 4.716 UNAVAILABLE UNAVAILABLE
dense/global-wide-callee-class pressure nearest-rank p95 20/20 5.437 7.498 UNAVAILABLE UNAVAILABLE
dense/global-wide-provenance pressure nearest-rank p50 20/20 4.156 4.710 UNAVAILABLE UNAVAILABLE
dense/global-wide-provenance pressure nearest-rank p95 20/20 7.223 6.918 UNAVAILABLE UNAVAILABLE
dense/global-wide-aliased pressure nearest-rank p50 20/20 4.242 4.396 UNAVAILABLE UNAVAILABLE
dense/global-wide-aliased pressure nearest-rank p95 20/20 7.964 5.427 UNAVAILABLE UNAVAILABLE
dense/global-wide-parameterized-as-literal pressure nearest-rank p50 20/20 4.249 3.857 UNAVAILABLE UNAVAILABLE
dense/global-wide-parameterized-as-literal pressure nearest-rank p95 20/20 7.421 5.431 UNAVAILABLE UNAVAILABLE
dense/global-wide-wrapped-case-insensitive pressure nearest-rank p50 20/20 4.717 4.687 UNAVAILABLE UNAVAILABLE
dense/global-wide-wrapped-case-insensitive pressure nearest-rank p95 20/20 11.043 9.671 UNAVAILABLE UNAVAILABLE
dense/global-wide-wrapped-case-insensitive-distinct pressure nearest-rank p50 20/20 12.812 12.030 UNAVAILABLE UNAVAILABLE
dense/global-wide-wrapped-case-insensitive-distinct pressure nearest-rank p95 20/20 15.722 17.107 UNAVAILABLE UNAVAILABLE
localized-early/global-wide-four-properties pressure nearest-rank p50 20/20 2.473 2.315 UNAVAILABLE UNAVAILABLE
localized-early/global-wide-four-properties pressure nearest-rank p95 20/20 5.534 3.765 UNAVAILABLE UNAVAILABLE
localized-middle/global-wide-four-properties pressure nearest-rank p50 20/20 3.333 3.069 UNAVAILABLE UNAVAILABLE
localized-middle/global-wide-four-properties pressure nearest-rank p95 20/20 5.832 6.605 UNAVAILABLE UNAVAILABLE
localized-late/global-wide-four-properties pressure nearest-rank p50 20/20 2.867 3.563 UNAVAILABLE UNAVAILABLE
localized-late/global-wide-four-properties pressure nearest-rank p95 20/20 5.303 6.176 UNAVAILABLE UNAVAILABLE
broad-all-64/global-wide-four-properties pressure nearest-rank p50 20/20 4.242 4.092 UNAVAILABLE UNAVAILABLE
broad-all-64/global-wide-four-properties pressure nearest-rank p95 20/20 113.437 7.172 UNAVAILABLE UNAVAILABLE
schema-label-histogram pressure nearest-rank p50 20/20 2.437 2.603 UNAVAILABLE UNAVAILABLE
schema-label-histogram pressure nearest-rank p95 20/20 5.718 5.602 UNAVAILABLE UNAVAILABLE
schema-key-histogram pressure nearest-rank p50 20/20 4.037 3.697 UNAVAILABLE UNAVAILABLE
schema-key-histogram pressure nearest-rank p95 20/20 10.779 12.855 UNAVAILABLE UNAVAILABLE
schema-relationship-histogram pressure nearest-rank p50 20/20 144.366 164.616 UNAVAILABLE UNAVAILABLE
schema-relationship-histogram pressure nearest-rank p95 20/20 309.508 314.495 UNAVAILABLE UNAVAILABLE
shape-wide-contains pressure nearest-rank p50 20/20 5.558 5.891 UNAVAILABLE UNAVAILABLE
shape-wide-contains pressure nearest-rank p95 20/20 9.834 9.686 UNAVAILABLE UNAVAILABLE
shape-label-scan-callsite pressure nearest-rank p50 20/20 4.952 3.698 UNAVAILABLE UNAVAILABLE
shape-label-scan-callsite pressure nearest-rank p95 20/20 9.355 10.101 UNAVAILABLE UNAVAILABLE
shape-label-scan-method pressure nearest-rank p50 20/20 4.162 4.215 UNAVAILABLE UNAVAILABLE
shape-label-scan-method pressure nearest-rank p95 20/20 13.453 6.718 UNAVAILABLE UNAVAILABLE
shape-label-scan-constant pressure nearest-rank p50 20/20 3.444 3.616 UNAVAILABLE UNAVAILABLE
shape-label-scan-constant pressure nearest-rank p95 20/20 9.823 7.831 UNAVAILABLE UNAVAILABLE
shape-label-scan-field pressure nearest-rank p50 20/20 3.360 4.371 UNAVAILABLE UNAVAILABLE
shape-label-scan-field pressure nearest-rank p95 20/20 9.054 8.417 UNAVAILABLE UNAVAILABLE
shape-all-nodes pressure nearest-rank p50 20/20 4.884 4.481 UNAVAILABLE UNAVAILABLE
shape-all-nodes pressure nearest-rank p95 20/20 9.975 10.585 UNAVAILABLE UNAVAILABLE
shape-equality pressure nearest-rank p50 20/20 104.124 114.959 UNAVAILABLE UNAVAILABLE
shape-equality pressure nearest-rank p95 20/20 124.639 133.972 UNAVAILABLE UNAVAILABLE
shape-inequality pressure nearest-rank p50 20/20 5.812 3.180 UNAVAILABLE UNAVAILABLE
shape-inequality pressure nearest-rank p95 20/20 11.053 8.792 UNAVAILABLE UNAVAILABLE
shape-id-lookup pressure nearest-rank p50 20/20 3.024 2.546 UNAVAILABLE UNAVAILABLE
shape-id-lookup pressure nearest-rank p95 20/20 5.876 5.212 UNAVAILABLE UNAVAILABLE
shape-in-list pressure nearest-rank p50 20/20 3.064 1.822 UNAVAILABLE UNAVAILABLE
shape-in-list pressure nearest-rank p95 20/20 8.378 3.841 UNAVAILABLE UNAVAILABLE
shape-null-check pressure nearest-rank p50 20/20 2.999 2.772 UNAVAILABLE UNAVAILABLE
shape-null-check pressure nearest-rank p95 20/20 5.461 7.773 UNAVAILABLE UNAVAILABLE
shape-regex pressure nearest-rank p50 20/20 3.814 2.907 UNAVAILABLE UNAVAILABLE
shape-regex pressure nearest-rank p95 20/20 5.910 5.263 UNAVAILABLE UNAVAILABLE
shape-one-hop pressure nearest-rank p50 20/20 3.679 1.994 UNAVAILABLE UNAVAILABLE
shape-one-hop pressure nearest-rank p95 20/20 7.286 5.094 UNAVAILABLE UNAVAILABLE
shape-one-hop-typed pressure nearest-rank p50 20/20 2.979 2.907 UNAVAILABLE UNAVAILABLE
shape-one-hop-typed pressure nearest-rank p95 20/20 8.392 5.643 UNAVAILABLE UNAVAILABLE
shape-two-hop pressure nearest-rank p50 20/20 4.074 2.923 UNAVAILABLE UNAVAILABLE
shape-two-hop pressure nearest-rank p95 20/20 6.578 7.516 UNAVAILABLE UNAVAILABLE
shape-incoming pressure nearest-rank p50 20/20 2.911 3.777 UNAVAILABLE UNAVAILABLE
shape-incoming pressure nearest-rank p95 20/20 6.534 4.923 UNAVAILABLE UNAVAILABLE
shape-var-length pressure nearest-rank p50 20/20 2.969 3.059 UNAVAILABLE UNAVAILABLE
shape-var-length pressure nearest-rank p95 20/20 6.971 5.904 UNAVAILABLE UNAVAILABLE
shape-path pressure nearest-rank p50 20/20 4.318 3.416 UNAVAILABLE UNAVAILABLE
shape-path pressure nearest-rank p95 20/20 6.826 6.129 UNAVAILABLE UNAVAILABLE
shape-traverse-filtered pressure nearest-rank p50 20/20 58.836 68.076 UNAVAILABLE UNAVAILABLE
shape-traverse-filtered pressure nearest-rank p95 20/20 92.871 103.176 UNAVAILABLE UNAVAILABLE
shape-count-all pressure nearest-rank p50 20/20 1.578 0.986 UNAVAILABLE UNAVAILABLE
shape-count-all pressure nearest-rank p95 20/20 3.853 4.999 UNAVAILABLE UNAVAILABLE
shape-count-label pressure nearest-rank p50 20/20 1.696 1.437 UNAVAILABLE UNAVAILABLE
shape-count-label pressure nearest-rank p95 20/20 4.323 5.720 UNAVAILABLE UNAVAILABLE
shape-group-count pressure nearest-rank p50 20/20 188.672 201.468 UNAVAILABLE UNAVAILABLE
shape-group-count pressure nearest-rank p95 20/20 248.262 256.957 UNAVAILABLE UNAVAILABLE
shape-distinct pressure nearest-rank p50 20/20 25.135 30.466 UNAVAILABLE UNAVAILABLE
shape-distinct pressure nearest-rank p95 20/20 35.882 44.520 UNAVAILABLE UNAVAILABLE
shape-collect pressure nearest-rank p50 20/20 2.167 1.956 UNAVAILABLE UNAVAILABLE
shape-collect pressure nearest-rank p95 20/20 5.060 4.210 UNAVAILABLE UNAVAILABLE
shape-count-traversal pressure nearest-rank p50 20/20 153.959 152.736 UNAVAILABLE UNAVAILABLE
shape-count-traversal pressure nearest-rank p95 20/20 172.852 164.775 UNAVAILABLE UNAVAILABLE
shape-order-by pressure nearest-rank p50 20/20 4.041 3.978 UNAVAILABLE UNAVAILABLE
shape-order-by pressure nearest-rank p95 20/20 11.395 11.417 UNAVAILABLE UNAVAILABLE
shape-order-by-desc pressure nearest-rank p50 20/20 2.769 2.889 UNAVAILABLE UNAVAILABLE
shape-order-by-desc pressure nearest-rank p95 20/20 10.000 6.718 UNAVAILABLE UNAVAILABLE
shape-skip pressure nearest-rank p50 20/20 5.087 4.792 UNAVAILABLE UNAVAILABLE
shape-skip pressure nearest-rank p95 20/20 10.313 6.083 UNAVAILABLE UNAVAILABLE
shape-function-calls pressure nearest-rank p50 20/20 6.009 5.685 UNAVAILABLE UNAVAILABLE
shape-function-calls pressure nearest-rank p95 20/20 9.248 7.900 UNAVAILABLE UNAVAILABLE
shape-case-expr pressure nearest-rank p50 20/20 2.167 3.099 UNAVAILABLE UNAVAILABLE
shape-case-expr pressure nearest-rank p95 20/20 9.785 8.219 UNAVAILABLE UNAVAILABLE
shape-coalesce pressure nearest-rank p50 20/20 4.208 4.101 UNAVAILABLE UNAVAILABLE
shape-coalesce pressure nearest-rank p95 20/20 9.822 7.160 UNAVAILABLE UNAVAILABLE
shape-labels-fn pressure nearest-rank p50 20/20 3.735 3.939 UNAVAILABLE UNAVAILABLE
shape-labels-fn pressure nearest-rank p95 20/20 9.535 10.887 UNAVAILABLE UNAVAILABLE
shape-with-filter pressure nearest-rank p50 20/20 4.025 3.090 UNAVAILABLE UNAVAILABLE
shape-with-filter pressure nearest-rank p95 20/20 7.703 11.630 UNAVAILABLE UNAVAILABLE
shape-with-aggregate pressure nearest-rank p50 20/20 193.371 193.291 UNAVAILABLE UNAVAILABLE
shape-with-aggregate pressure nearest-rank p95 20/20 211.877 266.025 UNAVAILABLE UNAVAILABLE
shape-cartesian pressure nearest-rank p50 20/20 3.109 2.081 UNAVAILABLE UNAVAILABLE
shape-cartesian pressure nearest-rank p95 20/20 8.938 5.827 UNAVAILABLE UNAVAILABLE
shape-union pressure nearest-rank p50 20/20 1.730 2.023 UNAVAILABLE UNAVAILABLE
shape-union pressure nearest-rank p95 20/20 5.564 5.555 UNAVAILABLE UNAVAILABLE

Full methods, comparability reasons, isolated observations, raw request bodies and logs are retained in the downloadable report/evidence artifacts. UNAVAILABLE never means zero; a zero baseline has no defined percentage change.

The JVM frontend turned every class literal (`Payload.class`, `Payload[].class`)
into `IntConstant(0)`, the fallback for constants it did not model, so the type
was lost at build time and the literal collided with a real 0. A reflective
registration (`register(Payload.class, ...)`) could not be proved.

- core: `ClassConstant(id, value)` whose value is the JVM type descriptor
  (`Lsample/Payload;`, `[Lsample/Payload;`, `[[I`); `typeName` spells it as
  source does. SootUp's ClassConstant maps to it, interned by its own kind so it
  never merges with a StringConstant of the same text.
- persistence: node record tag 16 (string-table index, StringConstant layout) in
  the JVM writer/reader, the mmap spill format, the type index and the branch
  definition validator; Rust `NodeKind::ClassConstant`, `TAG_COUNT` 17,
  `is_constant_tag`/`CONSTANT_TAGS`, and the interchange importer.
- query: `ClassConstant` label with `labels(n)` = [ClassConstant, Constant] in
  both engines; `value` joins the raw string column (Rust, appended slot) and
  the Kotlin direct/mapped string paths, so =, STARTS WITH, IN, CONTAINS and
  ENDS WITH use the fast paths. Both parsers now split statements only on
  semicolons outside literals: a descriptor holds one.
- explorer: rendering in both servers and both web UIs.
- tests: adapter (descriptors, array literals, string kept distinct, flow
  through a local), frontend correctness gate cases for Java and DEX, eager and
  mapped round-trip with local and branch definitions, Kotlin and Rust Cypher
  (save, load, labels, properties, predicates, dataflow), and a JVM-to-native
  interop fixture wired into the Rust workflow. The graph parity baseline moves
  102 IntConstant(0) fact occurrences to their ClassConstant descriptors;
  nothing else.
- docs: storage format and compatibility (graphs built before this hold
  IntConstant(0) and must be rebuilt; older readers reject tag 16).

Closes #223

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7fuheyv6BkFkWh5taa18M
@johnsonlee
johnsonlee force-pushed the feat/class-constant-node branch from 002413a to 5c6ab25 Compare November 16, 2026 06:46
@johnsonlee
johnsonlee merged commit 70f908c into main Nov 16, 2026
12 checks passed
@johnsonlee
johnsonlee deleted the feat/class-constant-node branch November 16, 2026 10:31
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.

JVM frontend loses class literals: Payload.class becomes IntConstant(0)

1 participant