Skip to content

WIP: JavaJive task-pack correctness and bounded decompilation - #11

Draft
VillanCh wants to merge 52 commits into
mainfrom
codex/grok-javajive-correctness
Draft

VillanCh wants to merge 52 commits into
mainfrom
codex/grok-javajive-correctness

Conversation

@VillanCh

@VillanCh VillanCh commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

JavaJive's task-pack correctness work is still in progress. This branch improves generated Java for two bytecode patterns that made Commons Collections4 fail to compile, while retaining the earlier DoubleMetaphone short-circuit/loop fix. The PR remains Draft with ai long term because the complete contract and historical-JAR gates have not passed.

The new constructor fix distinguishes real this(...) delegation from new CurrentClass(...) in a factory. Only a same-arity delegation can accidentally bind to the enclosing constructor and need an overload-pin cast. For factory allocations, a generic array must remain an array argument rather than becoming an invalid element cast; non-array generic constructor casts remain available for cases such as Byte Buddy's Map<String, byte[]> inference. The field-store fix folds a CHECKCAST temporary into field = condition ? (T[]) array.clone() : null only when the exact cast→goto→two-predecessor field merge, null opposite arm, unique producer, straight-line branch paths, and matching exception-handler scope are proven. It is limited to array field stores, after a broader rule exposed unrelated OkHttp errors during review.

Three trusted Java 8 fixtures now compile, decompile in Precision and Compatibility modes, recompile, and compare runtime behavior: a generic-array factory call, a different-arity this(...) call, and guarded array clones assigned to fields. The existing load-bearing same-arity constructor-cast fixture also passes. All three new fixtures are in the existing fast algorithm CI selector; no new CI job or JDK matrix was added. Local core/rewriter/resource-guard race tests and the complete quick selector passed on the source tree in commit 3b0ee5dabcc73b8c99279e6214d3c77f89e36905.

The pinned 38-JAR corpus ran in the T30 Docker worker (no network, nonroot, read-only container, bounded resources, cleanup verified). Relative to b72ff315efb1c712c5988d247ca3011b2f6dc2d2, Collections4 javac errors fell from 16 to 6 across all 524 generated source units. Across all 38 JARs, recorded compiler errors fell from 1339 to 1320, with no new stubs and six fully compiling targets unchanged. The strict differential comparator still fails on one Byte Buddy diagnostic: ThreadSwitchingClassLoadingDelegate.java now reports an uncaught InterruptedException at Future.get(). That generated source file is byte-for-byte unchanged from the baseline; the diagnostic was exposed as more Byte Buddy classes became compilable (71 errors versus 74, rebuilt verifier successes 347 versus 5). This is an unresolved generated exception-scope defect, so the strict gate is not declared green. The audit checks compile/stub/verifier surfaces, not runtime equivalence.

For the next debugging pass, reproduce each remaining Collections4 error from the exact generated unit and inspect the bytecode control-flow predecessors before changing render-time strings. The six current errors are: IterableUtils$8 self-referential ternary, BooleanComparator.equals losing the comparator-typed local, and two synthetic static accessor methods each in PredicatedList and TransformedList casting to a class type variable that is out of scope. For Byte Buddy, compare the Future.get() bytecode handler interval with the generated try boundary; merely suppressing the javac diagnostic would not preserve the original exception behavior. Keep a trusted compile→decompile→recompile→run oracle for each algorithm change, then rerun the isolated corpus and strict comparison.

The earlier Codec change repaired shared short-circuit branch targets and loop advancement in generated DoubleMetaphone, including SCHCH and SZ. Its trusted Java round-trip, direct helper observations, focused primary/alternate runtime outputs, and JDK 8/21 task-contract gate passed on its commit. This PR is not ready for review until the remaining task-pack contracts, unresolved audit diagnostics, production-path checks, and latest-head applicable CI are complete; it will not be merged automatically.

@VillanCh VillanCh added the ai long term AI implementation and independent verification in progress label Sep 21, 2026
Provisional local checkpoint only. Classparser still has 20 baseline and 3 new failing test names. T04 proof, test strength, runtime lookup, budget and evidence integration reviews remain open. Not task-pack acceptance.
Local checkpoint after Grok quota exhaustion. Full classparser still failed baseline20 plus Freemarker; OBR failed in rest. Cross interrupted by Grok exit. Test-oracle and overload review remains open; not acceptance.
@VillanCh VillanCh changed the title JavaJive correctness: preserve UTF-16 and invocation semantics WIP: JavaJive task-pack correctness and bounded decompilation Sep 21, 2026
Provisional checkpoint. Contract audit findings remain open; not full acceptance.

This branch has not been deployed

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

Labels

ai long term AI implementation and independent verification in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant