Repository navigation
Device runtime: on-device Java IDE and live push, ready for TestFlight - #6335
shai-almog wants to merge 31 commits into
Conversation
Re-applies the closed device-runtime branch as one change. Its ASM use in the translator (InterpBundleWriter, InterpLambdaDesugar, DevicePush) now goes through the in-tree classfile package, which gains the class-header members, FieldNode, InnerClassNode, InsnList.set and Type.getMethodDescriptor it needs. The raw float/double bit natives master already provides are kept as they are. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On-device IDE: a Java editor with completion that compiles on the device and runs the result in the interpreter, with a phone and a tablet layout, an About and help screen, and a floating Stop over every running program. Push from a computer through Maven alone: cn1:push and cn1:push-stop. A paired computer can stop the running program (FRAME_STOP), and a received program can be opened in the editor, changed and run again (2.5.2). Red-team fixes: - pairing MACs are domain separated, so the device's proof of itself can no longer be replayed as a push answer - the pairing prompt has a deadline, so an abandoned pairing no longer holds the only prompt slot - stopping runs on the EDT; localRun is set under the install lock - editor: save before switching projects, never seed over a damaged project, confirm deletes, validate file and project names - completion: one import candidate per package, locale-safe matching App Store readiness: ios.featureScanExclude keeps the interpreter shims out of the capability scan (no HealthKit, HomeKit, VoIP, App Clip or extensions), accurate usage strings, a privacy manifest, store metadata and review notes. Removed @author tags the gate rejects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Codename One Instant javac from JDK 9 compiles string concatenation to an invokedynamic against StringConcatFactory, and the bundle writer rejected it, so every pushed project targeting Java 9 or later needed -XDstringConcat=inline. InterpLambdaDesugar now rewrites those sites, as it already did lambdas: each becomes a call to a synthetic static method on the owner class that builds the StringBuilder chain javac emits for Java 8, with recipe constants folded into the literal text. The flag is gone from cn1-push.sh, the IDE sample project, the guide and the error message. The interpreter test harness no longer passes the flag either, so every conformance fixture covers the rewrite when the tests run on JDK 9+: 22 fail against the previous translator, 99/99 pass with this one (JDK 17). Verified on the iOS simulator with a JDK 17 push. The app's display name, store titles, About fallback and docs now read "Codename One Instant". The bundle id is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… build tools The Gradle tasks mirror the Maven push/push-stop goals and fork the same DevicePush tool, resolved lazily from a detached configuration. They are configuration-cache safe and relay the tool's output through the logger so the pairing code is visible under the daemon. DevicePush takes --classes more than once, for Kotlin's separate output directory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Compared 12 screenshots: 12 matched. |
…erpreted-mode label The app records the Codename One version it is built against (a filtered resource from cn1.version, bumped by update-version.sh) and shows it in About. Bundles are now format 6 and carry the version the pushing project compiles against, inside the authenticated body; the device asks before running a program from a different version. Maven passes the codenameone-core dependency version, Gradle the plugin's own. The floating Stop button is replaced by a 'Slow interpreted mode' label: long-press stops the program, a tap explains. Its corner and visibility are in a new Settings screen. The developer guide references the pairing screenshot, which fixes the docs build's unused-image check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Developer Guide build artifacts are available for download from this workflow run:
Developer Guide quality checks: |
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
|
Compared 289 screenshots: 289 matched. Benchmark Results
Detailed Performance Metrics
ParparVM vs HotSpot (JDK 25): macOS arm64Runner CPU: Apple M1 (Virtual) (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 303 screenshots: 303 matched. Benchmark ResultsDetailed Performance Metrics
ParparVM vs HotSpot (JDK 25): Windows x64Runner CPU: AMD64 Family 25 Model 1 Stepping 1, AuthenticAMD (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 303 screenshots: 303 matched. Benchmark ResultsDetailed Performance Metrics
|
|
Compared 303 screenshots: 303 matched. Benchmark ResultsDetailed Performance Metrics
ParparVM vs HotSpot (JDK 25): Windows arm64Runner CPU: ARMv8 (64-bit) Family 8 Model D49 Revision 0, MICROSOFT CORPORATION (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 380 screenshots: 380 matched. |
|
Compared 303 screenshots: 303 matched. ParparVM vs HotSpot (JDK 25): Linux x64Runner CPU: AMD EPYC 9V45 96-Core Processor (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 303 screenshots: 303 matched. ParparVM vs HotSpot (JDK 25): Linux arm64Runner CPU: Neoverse-N2 (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 287 screenshots: 287 matched. |
- Self-hosted translator build: leave out DevicePush and InterpBundleFiles, the desktop push tool, which needs JDK networking and crypto that JavaAPI lacks and which nothing in the translator calls. - Device-Runtime.asciidoc started with a part heading, so the website guide saw each section as a chapter with the same slug; demote one level. - Device runtime snippet: self-contained, as the Playground snippet gate wants. - Copyright exclusions for the two vendored ASM tree classes. - The app's Maven wrapper downloads from repo.codenameone.com. - Checkstyle indentation in InterpPairingSecret. - Remove the goldens of Chart2SharedTooltipScreenshotTest, which master disabled while keeping its goldens; every port reported it missing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cloudflare Preview
|
The interp-host vtable test failed because three closed-world shortcuts still applied to interp-host builds, and the 4-byte header (#5903) gave a runtime-synthesized clazz no index of its own: - Invoke.resolveSingleTarget collapsed a virtual call with one compiled implementation into a direct call, bypassing the patched vtable slot. Gated like resolveConcreteInvokeOwner and resolveDevirtualizedOwner. - Parser.isLeafClass let instanceof compare header indices for a class with no compiled subclass, which is false for a synthesized subclass. - An interp-host build reserves 1024 header indices past the last class (cn1ClazzByIdFirstDynamic); the spike registers its clazz in one, since a copy carrying the parent's index resolves back to the parent. Also: TranslatorJavaApiSurfaceTest leaves out the desktop push tool like build-selfhost.sh; Chart2SharedTooltipScreenshotTest comes out of port_status.json (master disabled it); the image alt text is quoted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Compared 288 screenshots: 288 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
StoreAudit (master's agent-skill tool) plus a manual review: - Privacy and support listing URLs were 404s. New app-specific policy at /instant-privacy/ declaring every permission the app can prompt for, that results stay on the device with the user's program, that the network only reaches the paired computer, and that nothing is tracked. Linked from About. - Removed build hints copied from hellocodenameone: Health Connect permissions, Android Auto POI, messaging service, placeholder LVL key, the test app's debug keystore. android.allowBackup=false. - Listing text moves from fastlane/ (nothing used fastlane) to store/listing; the Play description now matches the app (editor). - Reviewer notes explain the permission prompts and the simulated purchase and sign-in APIs; store/review-findings.md logs each audit finding that does not apply and how the notes answer it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Running the audit on Codename One Instant showed two gaps: - No way to record a finding that was checked and does not apply, so a correct app failed every run. store-audit-accepted.txt (or --accepted) takes `<ID> [<path prefix>] -- <reason>`. A reason is required; accepted findings stop failing the run and are listed apart, --checklist turns the reasons into draft App Review notes, and an entry matching nothing is STALE-ACCEPT. - No rule for apps that run code they did not ship with (Apple 2.5.2, 4.7.2; Play Device and Network Abuse). DYNAMIC-CODE (HIGH) fires on ios.interpHost, the Codename One interpreter, script engines and class loaders, with a manual checklist item; store-review.md gains the section. The device runtime's accepted file records its five false positives and the 2.5.2 argument; the audit now passes on it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ ByteCodeTranslator Quality ReportTest & Coverage
Benchmark Results
Static Analysis
Generated automatically by the PR CI workflow. |
Conflicts: - windows-cross-build-run.yml: master folded it into the single CI workflow; this branch's retry tweak there was unrelated and is dropped. - IPhoneBuilder: master raises every embedded target to the SDK floor, so this branch's embeddedDeploymentTarget helper is removed. - Chart2SharedTooltipScreenshotTest: master re-enabled it; its runner entry, port_status.json and goldens are master's again. Cleanup: - hellocodenameone's settings and HelloCodenameOne.kt back to master: the device runtime moved to scripts/cn1-device-runtime and the placeholder hints and unused import were left over from when it lived there. - Instant's listing text moves to common/cn1-metadata, the layout `mvn cn1:metadata-push` uploads; review notes become store/review-notes.txt. - CLAUDE.md names scripts/cn1-device-runtime, pushes with cn1:push / cn1Push, and records the store submission workflow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Native fidelity (Android, Material 3)54 pairs compared -- median 95.6%, worst 91.3% ( Distribution --
Geometry vs native (bbox offset / size ratio / center offset / corner radius) -- gated separately from the visual score
Side-by-side comparisons (worst first)
|
…tree The guide now covers what a developer needs: using the editor, sending a project, what works, what doesn't, and how much slower it is. How the interpreter, shims and pairing work moved to scripts/cn1-device-runtime/INTERNALS.asciidoc for maintainers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed timeline snippet The horizontal ActivityTimeline snippet from master (#6360) named the previous snippet's form, which the doc-snippet gate compiles on its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Compared 286 screenshots: 286 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
…end-Security Hugo 0.156 removed site.Data and website-docs installs the latest Hugo, so every site build failed. hugo.Data is the replacement; the site builds clean with 0.171.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Takes master's Hugo and Backend-Security fixes (#6365) over this branch's copies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
macOS ships bash 3.2, where "${a[@]}" of an empty array is an unbound
variable under set -u, so scripts/website/build.sh (and the pre-push
gates' Hugo build) stopped at line 770 on every Mac.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Hugo site build ran under tools/env.sh's JDK 8, and the Skin Designer bundle it compiles targets release 17, so --full failed on every machine. website-docs runs on JDK 25; build.sh switches to JDK 8 itself for the steps that need it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
codenameone.com/discussion-forum/ is not a forum Codename One runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…icy gaps An app that runs its users' code cannot be audited by scanning its own sources. It now has to decide every capability area in store-capabilities.txt, declared ones must carry the hints that compile them in, and --policy checks the privacy policy names each one. HINT-INERT reports a lookalike purpose key the builder never acts on (NSLocationWhenInUse without locationUsageDescription). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…I does Without WEBSITE_BOOTSTRAP_CN1_SNAPSHOTS the Skin Designer compiled this tree's JavaScript port against a published core and failed on every class added since. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
macOS purges old files under its temp directory and keeps the folders, so the cached Maven had an empty bin/ and setup reused it: mvn: No such file or directory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The build writes the Skin Designer bundle into static/ and restamps cn1libs.json, so every --full run ended dirty and recorded nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>














































































































Ports the on-device interpreter from #5561 onto current master. Adds an on-device IDE, so Codename One programs can be written, compiled and run on an iPhone or iPad, and adds pushing from a computer through Maven.
What's in it
scripts/cn1-device-runtime): an editor with code completion. Compiling on the device takes about 200 ms, and the result runs in the interpreter. Phone and tablet layouts, an About and help screen, and a floating Stop button over every running program.mvn compile cn1:pushwith-Dcn1.push.lanor-Dcn1.push.device=...mvn cn1:push-stopFRAME_STOP, authenticated like a push.ios.featureScanExclude: the generated interpreter shims name every API. Without the hint, the iOS feature scan turned on HealthKit, HomeKit/Matter, VoIP, CarPlay, an App Clip and the extensions for an app that uses none of them.fastlane/metadata/ios)Red-team fixes
localRunis set under the install lockKnown limitations (for after the private beta)
-XDstringConcat=inlinebeforecn1:pushworks. The developer guide documents this.Verified
push-stopfrom the Mac returns the device to the pairing screenPrivacyInfo.xcprivacyat the bundle root.InterpPairingSecretTest8/8 passes, including a new domain-separation test🤖 Generated with Claude Code