Core batch: ParparVM perf improvements + RichText component & GPU shadow rendering#5421
Conversation
5d25e03 to
b12b3e3
Compare
658fa10 to
60b776c
Compare
|
Compared 12 screenshots: 12 matched. |
Cloudflare Preview
|
|
Compared 146 screenshots: 146 matched. Benchmark ResultsDetailed Performance Metrics
|
|
Compared 181 screenshots: 181 matched. |
60b776c to
3ba3d93
Compare
…ichText component & GPU shadow Groups a set of independent Codename One core improvements into one PR to validate CI together. No public API is removed or broken. ## ParparVM (vm/) — iOS bytecode → C translation - Compact strings (JEP 254-style): String.value holds byte[] (Latin-1) or char[] (UTF-16) with a coder discriminator, halving footprint for ASCII; coder-aware fast paths in nativeMethods.m. - Fused string allocation: byte[] backing store inlined into the String object block (single allocation) via the BiBOP allocator, init-before- publish safe under the concurrent collector. - Direct-digit Long/Integer.toString fast path (no intermediate buffer). - String concat lowering: makeConcat/makeConcatWithConstants sites with 2-5 all-String parts rewritten to a cn1ConcatN native that sizes the result once and fills it directly. - Per-usage escape analysis de-gates scalar replacement. - Double comparison codegen avoids clang's fcsel if-conversion; dcmp fusion and a noreturn OOB helper that unblocks LICM under -fno-strict-aliasing. - Concurrent-GC sweep crash fix on abandoned unpublished object slots. - Updated self-contained micro-benchmark suite (vm/benchmarks). ## Compact-string native ABI follow-through Because compact strings changes String's native representation, hand-written native code that reads String.value as char[] is made coder-aware: - iOS port IOSNative.m splitString now reads through the coder-safe charAt/ substring accessors instead of casting the backing array to char[]. - The StackOverflow VM integration test's native helper decodes byte[] or char[] based on the value array class. ## UI components (CodenameOne/src, Ports/) - RichTextComponent + RichRunPainter: rich text rendering component with a block model (RichBlocks/RichView/HtmlImporter/TextStyle), unit test. - GPU-accelerated shape shadows for RoundRectBorder: Graphics.fillShapeShadow / isShapeShadowSupported avoids the per-border bitmap cache where supported (JavaSE paints directly; Android falls back to the cached path). - Clipboard content plumbing; MCP tooling updates. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3ba3d93 to
440d7ba
Compare
|
Compared 148 screenshots: 148 matched. Benchmark Results
Detailed Performance Metrics
|
|
Compared 144 screenshots: 144 matched. |
|
Compared 151 screenshots: 151 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
|
Compared 143 screenshots: 143 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
✅ ByteCodeTranslator Quality ReportTest & Coverage
Benchmark Results
Static Analysis
Generated automatically by the PR CI workflow. |
|
Compared 149 screenshots: 149 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
|
Compared 146 screenshots: 146 matched. Benchmark ResultsDetailed Performance Metrics
|
|
Compared 146 screenshots: 146 matched. Benchmark ResultsDetailed Performance Metrics
|
…suite SIGSEGV - RichTextComponent: use Font.equals() instead of == (PMD CompareObjectsWithEquals). - cn1_globals.m: TEMP diagnostic SIGSEGV/SIGABRT/SIGBUS handler that symbolizes the native fault site (backtrace_symbols_fd, async-signal-safe, glibc-only). The full native screenshot suite crashes deterministically (exit 139) in the theme phase and the VM installs no fatal-signal handler, so there is no crash output. This surfaces the fault address + native stack to isolate the compact-string / GC interaction. To be removed before merge. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Compared 217 screenshots: 217 matched. |
…marker The stderr crash output was not captured by the CN1SS screenshot harness (it tees stdout). Emit the SIGSEGV/SIGABRT/SIGBUS fault site + backtrace to stdout (fd 1) as well, and print a one-line install confirmation so we can verify the handler is wired into the native suite build. Still TEMP -- to be removed before merge. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
cn1GcInstallSignalHandler (gated on CN1_CONSERVATIVE_GC_ROOTS + first GC) did not emit the install marker on the desktop suite build, so the SIGSEGV handler was never active. Install it from an __attribute__((constructor)) at process load so it is guaranteed present regardless of GC configuration. Still TEMP -- remove before merge. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…SEGV) Gate the NoZero single-allocation String fast paths behind CN1_ENABLE_FUSED_STRINGS (undefined = off): cn1InlSbToString, java_lang_StringBuilder_toString (routes to the non-fused toStringImpl twin), and cn1FusedLatin1Begin (used by newStringFromAsciiLen + cn1FusedConcat, which fall back to the safe __NEW+__INIT+separate-array path). These NoZero paths leave the slot GC-invisible (parentCls==0) with garbage fields during the fill, and the non-Latin-1 abandon branch is heavily exercised by theme-icon codepoints (>0xFF) in the native theme-fidelity tests where the suite deterministically SIGSEGVs. Compact byte[]/char[] string representation is unchanged; only single-alloc fusion is dropped. If this clears the crash, the NoZero window is the cause. Co-Authored-By: Claude Opus 4.8 (1M context) <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 147 screenshots: 147 matched. |
|
Compared 147 screenshots: 147 matched. |
Summary
A batch of independent Codename One core improvements, grouped into one PR to validate CI together and keep the work focused. Two areas: ParparVM (the iOS bytecode→C translator + C runtime + minimal Java API) and a set of UI component / rendering additions. No public API is removed or broken, and both
parparvmandcorecompile clean against currentmaster.ParparVM (
vm/)Strings & allocation
String.valueholds abyte[](Latin-1) orchar[](UTF-16) with acoderdiscriminator, halving footprint for the common ASCII case. Coder-aware fast paths innativeMethods.m.byte[]backing store is inlined into theStringobject block (single allocation) via the BiBOP allocator, using an init-before-publish discipline safe under the concurrent collector.Long/Integer.toStringfast path (no intermediate buffer).makeConcat/makeConcatWithConstantssites with 2–5 all-Stringparts are rewritten to acn1ConcatNnative that sizes the result once and fills it directly.Arithmetic & escape analysis
fcselif-conversion (which serializes FP recurrences) by biasing the guard to a branch;dcmpfusion plus anoreturnOOB helper that unblocks LICM under-fno-strict-aliasing.Concurrent GC
Benchmarks
vm/benchmarks) that runs identically on Java SE and the translated C runtime.UI components (
CodenameOne/src,Ports/)RichBlocks/RichView/HtmlImporter/TextStyle), with a unit test.RoundRectBorder. NewGraphics.fillShapeShadow/isShapeShadowSupportedpath avoids the per-border bitmap cache where the platform supports it (JavaSE paints directly; Android falls back to the cached path, documented inline).CodenameOneImplementation; MCP tooling updates (MCPServer/MCPSocketTransport).Testing
mvn -pl parparvm compile— BUILD SUCCESS.mvn -pl core compile -Plocal-dev-javase— BUILD SUCCESS.RichTextComponentTestcovers the component.Risk
Low-to-moderate. Changes are confined to
vm/,CodenameOne/src, and platform ports; no public API changes. The compact-string representation is the most invasive VM change (covered by the string benchmark + concurrent-GC sweep fix); the GPU-shadow path degrades gracefully to the existing cached rendering where unsupported.🤖 Generated with Claude Code