Skip to content

Refine Java overload ambiguity with resolver-owned argument types - #62

Merged
aksOps merged 11 commits into
mainfrom
codex/stream-c-java-args
Jul 30, 2026
Merged

Refine Java overload ambiguity with resolver-owned argument types#62
aksOps merged 11 commits into
mainfrom
codex/stream-c-java-args

Conversation

@aksOps

@aksOps aksOps commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Stream C is the Java consumer of C0 (#60) and C1 (#61). C0 added optional argument types to Reference/RefKey; C1 made use of that key dimension resolver-owned and default-off. This PR populates a Java argument vector only when every argument is inside the approved file-local Stage-1 surface; unsupported or unknown shapes keep None. It refines a key only after the authoritative legacy pass returns AmbiguousOverload.

The typed retry preserves strict, loose, then varargs phase order; exact-array fixed arity; zero-tail varargs; integer radix, suffix, and range; unary numeric promotion; canonical java.lang spellings; and the stable legacy-first candidate union. Unsupported or unknown vectors remain honestly ambiguous. Java graph revision becomes 1; every other language remains at 0.

The planning card's pre-measurement AmbiguousOverload <= 2,800 estimate is superseded by the owner ruling and the measured residual boundary: 3,152 commons-lang AO occurrences have no argument vector inside Stage 1. Their calls, nulls, lambdas, member expressions, array access, and general operators remain assigned to Streams H/I rather than being guessed here.

The final-heavy array regression is also repaired: declared array receivers stop at NeedsTypeInference, while true local and parameter receivers remain LocalBinding. Commons-lang's 71 rows/75 occurrences and gson's 12 rows/12 occurrences retain their full C0 keys.

This diff changes Java-track implementation, Java tests, documentation, and attributed Java baselines/pins only. It makes no core/schema/model/store/pipeline, unresolved-reason taxonomy, dependency, or network-code change.

Attributed corpus results

Corpus Resolved Unresolved External Local binding Rate
commons-lang 34,217 -> 38,222 16,279 -> 12,274 63,385 -> 63,385 15,162 -> 15,162 67.8% -> 75.7%
gson 12,885 -> 13,306 6,105 -> 5,684 16,737 -> 16,737 6,706 -> 6,706 67.9% -> 70.1%
Corpus AmbiguousOverload NeedsExpressionType NeedsTypeInference NoMatchingDefinition UnindexedSupertype
commons-lang 9,218 -> 5,213 6,566 -> 6,566 342 -> 342 123 -> 123 30 -> 30
gson 1,282 -> 861 4,713 -> 4,713 72 -> 72 37 -> 37 1 -> 1

Occurrence totals are conserved: commons-lang 129,043, gson 42,433, and Java probes 22. The whole-row join reports zero changed non-AO rows and zero changed non-AO occurrences.

The movement units remain separate:

Corpus AO -> Resolved rows / occurrences Retained refined-AO rows / occurrences AO -> AO common-full-key payload reclassification rows New unique graph-edge identities Removed graph-edge identities Existing resolved targets re-aimed Existing pin rows re-keyed Changed non-AO rows / occurrences
commons-lang 1,768 / 4,005 571 / 2,061 317 1,702 0 0 0 0 / 0
gson 286 / 421 302 / 321 21 274 0 0 0 0 / 0
Java probes 0 / 0 0 / 0 0 0 0 0 0 0 / 0
Corpus DefKind::Alias census Existing pins held New resolved pin rows Vanished Moved Re-keyed Final pin rows
commons-lang 390 -> 9,617 16,111 1,768 0 0 0 17,879
gson 30 -> 3,083 9,075 286 0 0 0 9,361
Java probes 0 -> 9 n/a 0 0 0 0 n/a

Only the Alias census changes; every other definition kind is unchanged. The new entries are synthetic runtime forwarding identities for callable signatures, not a new definition category. The reporting audit found no alias/node cardinality entering scan reports, JSON/MCP output, baseline counts, or rate denominators.

Rebase provenance

The writes used the release binary built from signed commit babb1f507b2a1ad25b7318595d1d31188ffcd821, SHA-256 f5c39ebbc25edcd904b3d9369270aac7835847ae6d9b81e2ab97b7adb69ae87b.

The exact commands were:

/tmp/arthron-0.1.0-orchestrator/stream-c/final-heavy2-rerun/branch-target/release/arthron gate corpus/java/commons-lang --language java --baseline baselines/java-commons-lang.toml --rebase --commit 598dfc1
/tmp/arthron-0.1.0-orchestrator/stream-c/final-heavy2-rerun/branch-target/release/arthron gate corpus/java/gson --language java --baseline baselines/java-gson.toml --rebase --commit 3ff35d6
/tmp/arthron-0.1.0-orchestrator/stream-c/final-heavy2-rerun/branch-target/release/arthron pin corpus/java/commons-lang --pins pins/java-commons-lang.pins --write --commit 4ed8b2c1c974afafc255df3390543931cea3b938
/tmp/arthron-0.1.0-orchestrator/stream-c/final-heavy2-rerun/branch-target/release/arthron pin corpus/java/gson --pins pins/java-gson.pins --write --commit 4ed8b2c1c974afafc255df3390543931cea3b938

The --commit values above are the exact committed provenance strings; baseline and pin formats print but do not verify them.

Recorded verification

  • cargo fmt --check: rc 0.
  • cargo check --tests: rc 0.
  • cargo test --test java_resolve: 47 passed.
  • Direct array/varargs suffix guard: 1 passed, 874 filtered out.
  • cargo test --release --test java_corpus: 6 passed.
  • Commons-lang and gson edge-pin tests: 1 passed each.
  • README/baseline parity test: 1 passed.
  • Literal committed corpus gates: 29/29 returned rc 0.
  • Java implementation, array repair, alias reporting, and attributed-rebase reviews: CLEAR.
  • git diff --check origin/main...HEAD: rc 0.

Final gate

The earlier full-suite run stopped on the subsequently withdrawn, unmeasured AmbiguousOverload <= 2,800 estimate; it is not reported as a pass. The final gate used clean commit b2d82b7f3dda817310be2344b4b4345286593f11 and finished PASS_WITH_DEFERRED_WARM_TARGET:

  • cargo test --release --all-features: rc 0.
  • cargo clippy --all-targets --all-features -- -D warnings: rc 0.
  • Mutation suite: 27/27 mapped behavioral mutations killed, zero survivors in the reported set.
  • Warm-upgrade and twice-clean determinism: complete stores equal across files, nodes, collision dispositions, rows, edges, candidates, and supers for commons-lang, gson, and the Java probes.
  • Source hand-checks: 15/15 matched the recorded argument vector and full selected signature; 8 commons-lang and 7 gson sites.
  • Product-network observation: strace -f -e trace=network returned rc 0 and recorded no network syscall; the changed production-file manifest contains no network-code path.

Performance used /usr/bin/time -v with taskset -c 0,1. The small-repository budgets are cold <=5 seconds, warm <=0.3 seconds, and RSS <=128 MiB; every Flask and Express run passed:

Side/corpus Cold wall / RSS Warm wall / RSS Result
origin / Python Flask 0.71 s / 21,772 kB 0.10 s / 10,896 kB PASS
branch / Python Flask 0.74 s / 21,644 kB 0.10 s / 10,636 kB PASS
origin / JavaScript Express 0.90 s / 15,232 kB 0.10 s / 10,252 kB PASS
branch / JavaScript Express 0.89 s / 15,104 kB 0.10 s / 10,752 kB PASS

At 5M+ lines, cold peak RSS must remain below the 524,288 kB hard ceiling; 450,000 kB is the separate program-margin target. Cold <=60 seconds/MLOC and warm no-change <=1 second are timing targets, not Stream C gates.

Run Corpus/size Wall time Normalized time Maximum RSS Result
Cold Kubernetes / 5,353,211 lines 108.80 s 20.32 s/MLOC 294,672 kB PASS: hard ceiling and margin
Warm no-change same 12.29 s n/a 125,772 kB DEFERRED_TARGET_MISS: Stream B owns the <=1 s target

@aksOps
aksOps enabled auto-merge (squash) July 30, 2026 06:25
@aksOps
aksOps merged commit 875e909 into main Jul 30, 2026
12 checks passed
@aksOps
aksOps deleted the codex/stream-c-java-args branch July 30, 2026 06:32
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.

1 participant