Skip to content

Backend: Spring-style beans, transactions, scheduling, metrics and MCP, resolved at build time - #5908

Merged
shai-almog merged 58 commits into
masterfrom
backend-spring-model
Oct 1, 2026
Merged

shai-almog merged 58 commits into
masterfrom
backend-spring-model

Conversation

@shai-almog

Copy link
Copy Markdown
Collaborator

What

The backend now reads like a Spring application -- @Service, @Autowired, @Value, @ConfigurationProperties, @Bean, scopes, @Profile/@ConditionalOnProperty, @Transactional, @Async, @Scheduled, @ManagedResource/@Timed/@Counted, @McpTool -- all under com.codename1.backend.annotations, and all resolved at build time:

  • Injection: a new BackendBeanAnnotationProcessor resolves the bean graph and the entry point's generated BackendWiring constructs and injects every bean with straight-line new/setter calls. Private @Autowired fields get a woven setter. Missing, ambiguous or cyclic dependencies are build errors naming the injection point.
  • Aspects: @Transactional, @Async, @Timed, @Counted rewrite the method itself (body moved aside, the method delegates to a generated helper) -- no proxy, so self-calls, private methods and new-built objects get them too.
  • Runtime: thread-bound Transactions (all seven propagations, savepoints, read-only) that DataSource, daos and managed sessions join; Scheduler (cron masks computed by the build, fixed rate/delay, DB lock across replicas); Tasks/TaskExecutor including fd-less virtual-thread tasks with a per-host wake pipe; HttpSession with memory and JDBC stores; OTLP metrics + /manage endpoints (health, JSON, Prometheus, jobs, managed beans); an MCP endpoint serving @McpTool methods and, on dev profiles, development tools (backend_routes, backend_beans, backend_call, backend_requests, backend_sql, ...), excluded from cn1:backend-package by default.
  • Skill/archetype/docs: backend.md and full-stack-loop.md references in the Initializr skill, archetype/Initializr backend sample with an injected service, new Backend guide sections with compiled snippets.

Fixes found on the way

  • Virtual-thread yield reason was sticky (host-side reset is a no-op), so yieldNow() from a handler hung and IO parks after GC backpressure were misreported as runnable; each yield site now sets its reason.
  • Future.get() on a virtual thread blocked the host and could wedge every host; it now yields cooperatively.
  • A handler taking HttpServer.Request was refused ($ vs . in the nested type name).

Verification

  • Plugin: 2550 tests incl. 11 new end-to-end tests that compile, process, and run the generated server. Backend: 324 tests incl. transaction propagation, scheduler, sessions, metrics, MCP; server-engine test passed against PostgreSQL 16 and MySQL 8.
  • Native vm/tests backend suites (HTTP 72/72, WebSocket, OTel, runtime self-test, DB/ORM on all three engines) pass; a sample packaged with cn1:backend-package exercised every feature and survived a 7000-request concurrent soak.
  • SpotBugs 0, native signature gate, control characters/ASCII, copyright, Vale and LanguageTool on the Backend chapter, guide structure checks, Initializr fixture scripts.

Known limits

Aspects apply to project classes only; request/session/lazy beans need a non-final class with a no-arg constructor (run once for the stand-in); no transaction isolation levels; session-bean @PreDestroy not run on expiry; cn1app-archetype-test.sh extended but not run locally.

🤖 Generated with Claude Code

…P, resolved at build time

The backend gains Spring's programming model under com.codename1.backend.annotations
-- @Service/@Component/@repository, @Autowired, @value, @ConfigurationProperties,
@bean, scopes, profiles and conditions, @transactional, @async, @scheduled,
@ManagedResource/@Timed/@counted and @mcptool -- with every decision made by the
build: a generated BackendWiring constructs and injects the beans with plain code,
and aspects are woven into the annotated methods. No container, scan, proxy or
reflection at run time.

Runtime: thread-bound transactions that the pool, daos and sessions join, a cron
and fixed-rate scheduler with an optional database lock, task executors including
fd-less virtual-thread tasks with a per-host wake pipe, HTTP sessions (memory or
JDBC store), OTLP metrics and management endpoints, and an MCP endpoint with
development tools.

Also fixes the sticky virtual-thread yield reason (yieldNow from a handler hung),
a handler taking HttpServer.Request being refused, and adds the backend and
full-stack references to the generated agent skill.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-01T10:09:49.870088Z 21320aa Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Developer Guide build artifacts are available for download from this workflow run:

Developer Guide quality checks:

  • AsciiDoc linter: No issues found (report)
  • Vale: No alerts found (report)
  • Paragraph capitalization: No paragraph capitalization issues (report)
  • LanguageTool: No grammar matches (report)
  • Image references: No unused images detected (report)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6dd51f4064

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread vm/backend/src/com/codename1/backend/Sessions.java Outdated
Comment thread vm/backend/src/com/codename1/backend/TaskExecutor.java Outdated
Comment thread vm/backend/src/com/codename1/backend/mcp/McpServer.java Outdated
Comment thread vm/backend/src/com/codename1/backend/otel/OtlpSchema.java Outdated
Comment thread vm/backend/src/com/codename1/backend/Sessions.java Outdated
Comment thread vm/backend/src/com/codename1/backend/Scheduler.java Outdated
Comment thread vm/backend/src/com/codename1/backend/mcp/DevTools.java Outdated
@shai-almog

shai-almog commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 172 screenshots: 172 matched.
Native Windows port (x64 / Intel-AMD): full hellocodenameone screenshot suite rendered offscreen with Direct2D/DirectWrite, plus the real benchmarks (base64 native/CN1/SIMD, image createMask/applyMask/modifyAlpha/PNG/JPEG, SSE2 SIMD kernels). Compared against the in-repo baseline in scripts/windows/screenshots.

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 44ms / native 3ms = 14.6x speedup
SIMD float-mul (64K x300) java 43ms / native 2ms = 21.5x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 native bridge unavailable (CN1 + SIMD + image benchmarks only)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path gated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode 60.000 ms
Base64 CN1 decode 72.000 ms
Base64 SIMD encode 91.000 ms
Base64 encode ratio (SIMD/CN1) 1.517x (51.7% slower)
Base64 SIMD decode 81.000 ms
Base64 decode ratio (SIMD/CN1) 1.125x (12.5% slower)
Image encode benchmark iterations 100
Image createMask (SIMD off) 11.000 ms
Image createMask (SIMD on) 4.000 ms
Image createMask ratio (SIMD on/off) 0.364x (63.6% faster)
Image applyMask (SIMD off) 18.000 ms
Image applyMask (SIMD on) 22.000 ms
Image applyMask ratio (SIMD on/off) 1.222x (22.2% slower)
Image modifyAlpha (SIMD off) 35.000 ms
Image modifyAlpha (SIMD on) 18.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.514x (48.6% faster)
Image modifyAlpha removeColor (SIMD off) 32.000 ms
Image modifyAlpha removeColor (SIMD on) 18.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.563x (43.8% faster)

ParparVM vs HotSpot (JDK 25): Windows x64

Runner CPU: AMD64 Family 25 Model 17 Stepping 1, AuthenticAMD (baseline windows-x64@amd64-family-25-model-17-authenticamd)

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 regression is a ratio more than 15% (time) / 15% (RAM) above its baseline in vm/selfhost/perf-baseline.json (more, for a row whose calibration runs were noisier; the file records it), and for RAM also more than 0.05x above it in absolute terms. Both run unpinned on all of the runner's CPUs, with their own default thread counts.

Benchmark Cores Time RAM Status
hello (WinHelloMain) 4 1.33x (base 1.38x, -3.1%) 0.69x (base 0.77x, -9.7%) ok
translator (self) 4 0.67x (base 0.64x, +4.8%) 0.55x (base 0.55x, -0.5%) ok
intArithmetic 4 1.10x (base 1.10x, +0.4%) 0.05x (base 0.06x, -4.2%) ok
longArithmetic 4 1.08x (base 1.08x, -0.1%) 0.05x (base 0.06x, -2.3%) ok
mathTranscendental 4 0.85x (base 0.85x, +0.1%) 0.06x (base 0.06x, +1.1%) ok
arraySequential 4 1.69x (base 1.72x, -1.6%) 0.38x (base 0.38x, -0.1%) ok
arrayRandom 4 1.02x (base 1.01x, +0.1%) 0.23x (base 0.23x, +0.1%) ok
objectAllocation 4 5.08x (base 6.09x, -16.5%) 0.43x (base 0.42x, +2.1%) ok
valueEscape 4 0.10x (base 0.10x, -1.3%) 0.05x (base 0.04x, +1.4%) ok
hashMapChurn 4 1.30x (base 1.39x, -6.4%) 0.10x (base 0.10x, +2.4%) ok
stringBuilding 4 1.36x (base 1.36x, -0.0%) 0.27x (base 0.28x, -4.2%) ok
recursion 4 1.38x (base 1.43x, -3.2%) 0.06x (base 0.06x, +0.7%) ok
quicksort 4 1.12x (base 1.11x, +0.4%) 0.12x (base 0.12x, -0.7%) ok

Result: no regression

@shai-almog

shai-almog commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 172 screenshots: 172 matched.
Native Windows port, REAL shipping pipeline: the hellocodenameone screenshot suite rendered by a binary CROSS-COMPILED on Linux (clang-cl + xwin, WebView2 linked) and RUN on a Windows x64 runner. Compared against the in-repo baseline in scripts/windows/screenshots.

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 62ms / native 5ms = 12.4x speedup
SIMD float-mul (64K x300) java 57ms / native 4ms = 14.2x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 native bridge unavailable (CN1 + SIMD + image benchmarks only)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path gated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode 77.000 ms
Base64 CN1 decode 89.000 ms
Base64 SIMD encode 108.000 ms
Base64 encode ratio (SIMD/CN1) 1.403x (40.3% slower)
Base64 SIMD decode 103.000 ms
Base64 decode ratio (SIMD/CN1) 1.157x (15.7% slower)
Image encode benchmark iterations 100
Image createMask (SIMD off) 12.000 ms
Image createMask (SIMD on) 6.000 ms
Image createMask ratio (SIMD on/off) 0.500x (50.0% faster)
Image applyMask (SIMD off) 25.000 ms
Image applyMask (SIMD on) 24.000 ms
Image applyMask ratio (SIMD on/off) 0.960x (4.0% faster)
Image modifyAlpha (SIMD off) 30.000 ms
Image modifyAlpha (SIMD on) 22.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.733x (26.7% faster)
Image modifyAlpha removeColor (SIMD off) 35.000 ms
Image modifyAlpha removeColor (SIMD on) 20.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.571x (42.9% faster)

@github-actions

Copy link
Copy Markdown
Contributor

Cloudflare Preview

@shai-almog

shai-almog commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 172 screenshots: 172 matched.
Native Linux port (x64), GTK3/Cairo/Pango, ParparVM bytecode-to-C (no JVM): the hellocodenameone screenshot suite rendered by a native ELF built + run on the GitHub x64 runner. Baseline: scripts/linux/screenshots.

ParparVM vs HotSpot (JDK 25): Linux x64

Runner CPU: AMD EPYC 7763 64-Core Processor (baseline linux-x64@amd-epyc-7763-64-core-processor)

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 regression is a ratio more than 15% (time) / 15% (RAM) above its baseline in vm/selfhost/perf-baseline.json (more, for a row whose calibration runs were noisier; the file records it), and for RAM also more than 0.05x above it in absolute terms. Both run unpinned on all of the runner's CPUs, with their own default thread counts.

Benchmark Cores Time RAM Status
hello (LinuxHelloMain) 4 0.82x (base 0.85x, -3.4%) 0.82x (base 0.84x, -2.4%) ok
translator (self) 4 0.44x (base 0.48x, -9.7%) 0.52x (base 0.52x, -0.0%) ok
intArithmetic 4 1.10x (base 1.12x, -1.2%) 0.07x (base 0.06x, +33.1%) ok
longArithmetic 4 1.08x (base 1.08x, +0.0%) 0.07x (base 0.05x, +37.6%) ok
mathTranscendental 4 1.09x (base 1.08x, +0.9%) 0.06x (base 0.07x, -23.0%) ok
arraySequential 4 2.07x (base 2.00x, +3.3%) 0.38x (base 0.36x, +4.8%) ok
arrayRandom 4 1.29x (base 0.91x, +42.1%) 0.22x (base 0.21x, +8.5%) ok
objectAllocation 4 4.40x (base 5.01x, -12.1%) 0.36x (base 0.37x, -1.7%) ok
valueEscape 4 0.10x (base 0.10x, -0.4%) 0.04x (base 0.04x, -9.8%) ok
hashMapChurn 4 1.44x (base 1.48x, -3.2%) 0.10x (base 0.09x, +2.5%) ok
stringBuilding 4 1.57x (base 1.39x, +12.7%) 0.26x (base 0.26x, -0.2%) ok
recursion 4 1.19x (base 1.25x, -5.1%) 0.08x (base 0.08x, +0.5%) ok
quicksort 4 1.10x (base 1.07x, +2.6%) 0.11x (base 0.11x, -1.9%) ok

Result: no regression

@shai-almog

shai-almog commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 172 screenshots: 172 matched.
Native Linux port (arm64), GTK3/Cairo/Pango, ParparVM bytecode-to-C (no JVM): the hellocodenameone screenshot suite rendered by a native ELF built + run on the GitHub arm64 runner. Baseline: scripts/linux/screenshots-arm.

ParparVM vs HotSpot (JDK 25): Linux arm64

Runner CPU: Neoverse-N2 (baseline linux-arm64@neoverse-n2)

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 regression is a ratio more than 15% (time) / 15% (RAM) above its baseline in vm/selfhost/perf-baseline.json (more, for a row whose calibration runs were noisier; the file records it), and for RAM also more than 0.05x above it in absolute terms. Both run unpinned on all of the runner's CPUs, with their own default thread counts.

Benchmark Cores Time RAM Status
hello (LinuxHelloMain) 4 0.94x (base 0.93x, +1.1%) 0.85x (base 0.87x, -2.6%) ok
translator (self) 4 0.62x (base 0.62x, -0.8%) 0.55x (base 0.54x, +0.6%) ok
intArithmetic 4 1.05x (base 1.04x, +0.0%) 0.03x (base 0.03x, +0.9%) ok
longArithmetic 4 0.79x (base 0.79x, -0.1%) 0.03x (base 0.03x, +1.0%) ok
mathTranscendental 4 1.10x (base 1.10x, +0.0%) 0.03x (base 0.03x, -0.1%) ok
arraySequential 4 0.35x (base 0.36x, -2.5%) 0.37x (base 0.37x, -0.1%) ok
arrayRandom 4 0.94x (base 0.94x, +0.0%) 0.20x (base 0.20x, +0.1%) ok
objectAllocation 4 3.38x (base 3.04x, +11.2%) 0.23x (base 0.24x, -3.7%) ok
valueEscape 4 0.51x (base 0.51x, -0.1%) 0.03x (base 0.03x, +0.7%) ok
hashMapChurn 4 0.85x (base 0.84x, +0.8%) 0.12x (base 0.12x, -3.7%) ok
stringBuilding 4 1.32x (base 1.36x, -3.1%) 0.26x (base 0.26x, -0.2%) ok
recursion 4 1.41x (base 1.43x, -1.4%) 0.03x (base 0.04x, -2.9%) ok
quicksort 4 1.00x (base 0.99x, +0.8%) 0.09x (base 0.09x, -0.1%) ok

Result: no regression

@shai-almog

shai-almog commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 172 screenshots: 172 matched.
Native Windows port (arm64 / Apple Silicon - Arm): full hellocodenameone screenshot suite rendered offscreen with Direct2D/DirectWrite, plus the real benchmarks (base64 native/CN1/SIMD, image createMask/applyMask/modifyAlpha/PNG/JPEG, NEON SIMD kernels). Compared against the in-repo baseline in scripts/windows/screenshots.

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 53ms / native 3ms = 17.6x speedup
SIMD float-mul (64K x300) java 53ms / native 3ms = 17.6x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 native bridge unavailable (CN1 + SIMD + image benchmarks only)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path gated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode 60.000 ms
Base64 CN1 decode 71.000 ms
Base64 SIMD encode 77.000 ms
Base64 encode ratio (SIMD/CN1) 1.283x (28.3% slower)
Base64 SIMD decode 69.000 ms
Base64 decode ratio (SIMD/CN1) 0.972x (2.8% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 4.000 ms
Image createMask (SIMD on) 1.000 ms
Image createMask ratio (SIMD on/off) 0.250x (75.0% faster)
Image applyMask (SIMD off) 15.000 ms
Image applyMask (SIMD on) 17.000 ms
Image applyMask ratio (SIMD on/off) 1.133x (13.3% slower)
Image modifyAlpha (SIMD off) 15.000 ms
Image modifyAlpha (SIMD on) 9.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.600x (40.0% faster)
Image modifyAlpha removeColor (SIMD off) 18.000 ms
Image modifyAlpha removeColor (SIMD on) 5.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.278x (72.2% faster)

ParparVM vs HotSpot (JDK 25): Windows arm64

Runner CPU: ARMv8 (64-bit) Family 8 Model D49 Revision 0, MICROSOFT CORPORATION (baseline windows-arm64@armv8-64-bit-family-8-model-d49-microsoft-corporation)

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 regression is a ratio more than 15% (time) / 15% (RAM) above its baseline in vm/selfhost/perf-baseline.json (more, for a row whose calibration runs were noisier; the file records it), and for RAM also more than 0.05x above it in absolute terms. Both run unpinned on all of the runner's CPUs, with their own default thread counts.

Benchmark Cores Time RAM Status
hello (WinHelloMain) 4 1.07x (base 1.11x, -3.1%) 0.89x (base 0.90x, -1.4%) ok
translator (self) 4 0.76x (base 0.75x, +1.5%) 0.56x (base 0.54x, +3.2%) ok
intArithmetic 4 1.04x (base 1.04x, -0.0%) 0.06x (base 0.06x, -0.1%) ok
longArithmetic 4 0.80x (base 0.80x, +0.1%) 0.06x (base 0.06x, +0.3%) ok
mathTranscendental 4 0.72x (base 0.72x, -0.0%) 0.06x (base 0.06x, +0.0%) ok
arraySequential 4 0.36x (base 0.39x, -9.9%) 0.39x (base 0.39x, -0.2%) ok
arrayRandom 4 0.94x (base 0.94x, +0.0%) 0.23x (base 0.23x, +0.0%) ok
objectAllocation 4 2.96x (base 2.73x, +8.3%) 0.45x (base 0.46x, -3.1%) ok
valueEscape 4 0.76x (base 0.76x, +0.1%) 0.05x (base 0.05x, -1.0%) ok
hashMapChurn 4 0.99x (base 0.98x, +0.7%) 0.11x (base 0.12x, -7.9%) ok
stringBuilding 4 1.44x (base 1.43x, +0.8%) 0.27x (base 0.27x, -0.4%) ok
recursion 4 1.46x (base 1.46x, -0.1%) 0.06x (base 0.07x, -0.8%) ok
quicksort 4 1.00x (base 1.00x, +0.1%) 0.12x (base 0.12x, -0.3%) ok

Result: no regression

@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

✅ Continuous Quality Report

Test & Coverage

Static Analysis

  • SpotBugs [Report archive]
    • ✅ ByteCodeTranslator: 0 findings (no issues)
    • ✅ android: 0 findings (no issues)
    • ✅ backend: 0 findings (no issues)
    • ✅ build-hint-catalog: 0 findings (no issues)
    • ✅ build-hint-tools: 0 findings (no issues)
    • ✅ codenameone-maven-plugin: 0 findings (no issues)
    • ✅ core-unittests: 0 findings (no issues)
    • ✅ ios: 0 findings (no issues)
  • ✅ PMD: 0 findings (no issues) [Report archive]
  • ✅ Checkstyle: 0 findings (no issues) [Report archive]

Generated automatically by the PR CI workflow.

@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

✅ ByteCodeTranslator Quality Report

Test & Coverage

  • ✅ Tests: 740 total, 0 failed, 57 skipped

Benchmark Results

  • Execution Time: 28283 ms

  • Hotspots (Top 20 sampled methods):

    • 8.25% com.codename1.tools.translator.BytecodeMethod.equals (174 samples)
    • 5.69% com.codename1.tools.translator.IteratorEscape.ctorOnlyStoresParamsIntoThis (120 samples)
    • 5.50% java.util.ArrayList.indexOf (116 samples)
    • 3.65% java.lang.StringBuilder.append (77 samples)
    • 2.61% com.codename1.tools.translator.IteratorEscape.mangle (55 samples)
    • 2.56% org.objectweb.asm.tree.analysis.SourceInterpreter.merge (54 samples)
    • 2.42% java.lang.String.equals (51 samples)
    • 2.28% java.lang.System.identityHashCode (48 samples)
    • 2.28% com.codename1.tools.translator.ByteCodeClass.hasDeclaredMethod (48 samples)
    • 1.80% com.codename1.tools.translator.IteratorEscape.walk (38 samples)
    • 1.76% com.codename1.tools.translator.BytecodeMethod.optimize (37 samples)
    • 1.61% java.util.HashMap.hash (34 samples)
    • 1.42% java.util.HashMap.putVal (30 samples)
    • 1.38% com.codename1.tools.translator.bytecodes.Invoke.resolveDirectTarget (29 samples)
    • 1.33% org.objectweb.asm.tree.analysis.Frame.merge (28 samples)
    • 1.23% com.codename1.tools.translator.JavascriptReachability.enqueueResolved (26 samples)
    • 1.14% com.codename1.tools.translator.BytecodeMethod.updateInlinableFieldDependencies (24 samples)
    • 1.09% com.codename1.tools.translator.NativeSymbolIndex.<init> (23 samples)
    • 1.09% java.io.FileOutputStream.writeBytes (23 samples)
    • 1.00% java.lang.Object.hashCode (21 samples)
  • ⚠️ Coverage report not generated.

Static Analysis

  • ✅ SpotBugs: no findings (report was not generated by the build).
  • ⚠️ PMD report not generated.
  • ⚠️ Checkstyle report not generated.

Generated automatically by the PR CI workflow.

@shai-almog

shai-almog commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 193 screenshots: 193 matched.
✅ JavaScript-port screenshot tests passed.

- Sessions: the session cookie goes on a copy of the handler's Response,
  never into it (it may be a shared constant); cn1.session.secure refuses
  anything but auto/true/false.
- TaskExecutor: virtual submissions are refused after shutdown and counted
  active before the hand-off; @async accessors re-fetch a shut-down executor.
- MCP: only loopback or listed origins pass (the Host match let DNS
  rebinding through); byte/short tool arguments are range-checked;
  backend_call uses https against a TLS server.
- Request metrics are recorded in a finally, so failures count and the
  route label is cleared.
- Factory beans inherit their configuration class's @Profile and
  @ConditionalOnProperty; request-scoped beans' destroyMethod runs.
- Scheduler lock: an INSERT failure with no existing row is rethrown.
- OTLP histogram bucket_counts stays fixed64 (per metrics.proto), now held
  by a test decoding with the generated opentelemetry-proto classes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@shai-almog

shai-almog commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 157 screenshots: 157 matched.

Native Android coverage

  • 📊 Line coverage: 9.37% (9335/99611 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 9.10% (47873/525841), branch 3.61% (1797/49819), complexity 3.58% (1902/53096), method 5.53% (1544/27918), class 11.06% (414/3742)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6367 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.ClassReader – 0.00% (0/1524 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1187 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.MethodWriter – 0.00% (0/922 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/736 lines covered)
      • com.google.common.cache.com.google.common.cache.LocalCache$Segment – 0.00% (0/726 lines covered)
      • okio.okio.Buffer – 0.00% (0/687 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/625 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.Frame – 0.00% (0/570 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 9.37% (9335/99611 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 9.10% (47873/525841), branch 3.61% (1797/49819), complexity 3.58% (1902/53096), method 5.53% (1544/27918), class 11.06% (414/3742)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6367 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.ClassReader – 0.00% (0/1524 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1187 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.MethodWriter – 0.00% (0/922 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/736 lines covered)
      • com.google.common.cache.com.google.common.cache.LocalCache$Segment – 0.00% (0/726 lines covered)
      • okio.okio.Buffer – 0.00% (0/687 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/625 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.Frame – 0.00% (0/570 lines covered)

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend scalar fallback (no native SIMD)
SIMD int-add (64K x300) java 170ms / native 154ms = 1.1x speedup
SIMD float-mul (64K x300) java 117ms / native 83ms = 1.4x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path gated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode 91.000 ms
Base64 CN1 decode 88.000 ms
Base64 native encode 481.000 ms
Base64 encode ratio (CN1/native) 0.189x (81.1% faster)
Base64 native decode 303.000 ms
Base64 decode ratio (CN1/native) 0.290x (71.0% faster)
Image encode benchmark status skipped (SIMD unsupported)

@shai-almog

shai-almog commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 150 screenshots: 150 matched.
✅ Native Apple TV (tvOS, Metal) screenshot tests passed.

@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e31da12f35

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread vm/backend/src/com/codename1/backend/HttpSession.java Outdated
Comment thread vm/backend/src/com/codename1/backend/Backend.java Outdated
Comment thread vm/backend/src/com/codename1/backend/mcp/McpServer.java Outdated
Comment thread vm/backend/src/com/codename1/backend/Transactions.java Outdated
Comment thread vm/backend/src/com/codename1/backend/Sessions.java Outdated
Comment thread vm/backend/src/com/codename1/backend/Backend.java Outdated
Comment thread vm/backend/src/com/codename1/backend/otel/OtlpMetricExporter.java Outdated
Comment thread vm/backend/src/com/codename1/backend/Backend.java Outdated
Comment thread vm/backend/src/com/codename1/backend/Backend.java Outdated
@shai-almog

shai-almog commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 155 screenshots: 155 matched.
✅ Native iOS Metal screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 2313 seconds

Build and Run Timing

Metric Duration
Simulator Boot 3000 ms
Simulator Boot (Run) 1000 ms
App Install 24000 ms
App Launch 5000 ms
Test Execution 446000 ms

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 85ms / native 3ms = 28.3x speedup
SIMD float-mul (64K x300) java 77ms / native 3ms = 25.6x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path active (NEON-accelerated)
Base64 CN1 encode 83.000 ms
Base64 CN1 decode 81.000 ms
Base64 native encode 3704.000 ms
Base64 encode ratio (CN1/native) 0.022x (97.8% faster)
Base64 native decode 3631.000 ms
Base64 decode ratio (CN1/native) 0.022x (97.8% faster)
Base64 SIMD encode 83.000 ms
Base64 encode ratio (SIMD/CN1) 1.000x (0.0% slower)
Base64 SIMD decode 110.000 ms
Base64 decode ratio (SIMD/CN1) 1.358x (35.8% slower)
Base64 encode ratio (SIMD/native) 0.022x (97.8% faster)
Base64 decode ratio (SIMD/native) 0.030x (97.0% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 1021.000 ms
Image createMask (SIMD on) 4.000 ms
Image createMask ratio (SIMD on/off) 0.004x (99.6% faster)
Image applyMask (SIMD off) 91.000 ms
Image applyMask (SIMD on) 591.000 ms
Image applyMask ratio (SIMD on/off) 6.495x (549.5% slower)
Image modifyAlpha (SIMD off) 91.000 ms
Image modifyAlpha (SIMD on) 541.000 ms
Image modifyAlpha ratio (SIMD on/off) 5.945x (494.5% slower)
Image modifyAlpha removeColor (SIMD off) 97.000 ms
Image modifyAlpha removeColor (SIMD on) 834.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 8.598x (759.8% slower)

…lit the guide

Review fixes:
- Sessions, MCP tools and managed beans are per server (Backend.getSessions,
  Environment.registerTool/registerManaged, Builder.mcpTool); two servers in
  one process no longer share cookies, sessions or tools.
- @SessionScope beans are kept by the server for the session's lifetime and
  destroyed on invalidate, expiry and stop; a negative session timeout fails.
- Transactions: no process-wide default pool; a NESTED method before the
  first statement sets its savepoint after BEGIN. setRollbackOnly in the
  method that began the transaction rolls back without throwing.
- Backend.stop runs destroy callbacks once; a failed start destroys built
  beans; management routes precede application handlers; session-store
  failures are logged as 500s; metrics shutdown is bounded by its timeout.
- Weaving keeps synchronized on the body, so a synchronized @async method
  holds its monitor where it runs.
- Injection points and lifecycle methods inherited from base classes are
  wired; @ConditionalOnMissingBean matches the bean's exposed types and
  takes explicit ones.

Docs: the backend chapter is split into nine chapters (web, beans, data and
transactions, sessions, scheduling, observability, MCP, operations) with
diagrams and compiled samples.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@shai-almog

shai-almog commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 223 screenshots: 223 matched.
✅ Native Apple Watch (watchOS, Core Graphics) screenshot tests passed.

@shai-almog

shai-almog commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 166 screenshots: 166 matched.
✅ Native Mac screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 241 seconds

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 68ms / native 2ms = 34.0x speedup
SIMD float-mul (64K x300) java 73ms / native 3ms = 24.3x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 native bridge unavailable (CN1 + SIMD + image benchmarks only)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path active (NEON-accelerated)
Base64 CN1 encode 53.000 ms
Base64 CN1 decode 97.000 ms
Image encode benchmark iterations 100
Image createMask (SIMD off) 8.000 ms
Image createMask (SIMD on) 6.000 ms
Image createMask ratio (SIMD on/off) 0.750x (25.0% faster)
Image applyMask (SIMD off) 77.000 ms
Image applyMask (SIMD on) 66.000 ms
Image applyMask ratio (SIMD on/off) 0.857x (14.3% faster)
Image modifyAlpha (SIMD off) 91.000 ms
Image modifyAlpha (SIMD on) 60.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.659x (34.1% faster)
Image modifyAlpha removeColor (SIMD off) 63.000 ms
Image modifyAlpha removeColor (SIMD on) 65.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 1.032x (3.2% slower)

ParparVM vs HotSpot (JDK 25): macOS arm64

Runner CPU: Apple M1 (Virtual) (baseline macos-arm64)

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 regression is a ratio more than 15% (time) / 15% (RAM) above its baseline in vm/selfhost/perf-baseline.json (more, for a row whose calibration runs were noisier; the file records it), and for RAM also more than 0.05x above it in absolute terms. Both run unpinned on all of the runner's CPUs, with their own default thread counts.

Benchmark Cores Time RAM Status
hello (HelloCodenameOne) 3 0.75x (base 0.96x, -21.5%) 1.27x (base 1.34x, -5.3%) ok
translator (self) 3 0.55x (base 0.54x, +2.0%) 0.75x (base 0.74x, +1.9%) ok
intArithmetic 3 1.06x (base 1.03x, +2.8%) 0.12x (base 0.12x, +0.3%) ok
longArithmetic 3 1.06x (base 1.03x, +2.8%) 0.11x (base 0.11x, +0.9%) ok
mathTranscendental 3 0.95x (base 1.01x, -5.8%) 0.12x (base 0.12x, -0.5%) ok
arraySequential 3 0.43x (base 0.42x, +1.3%) 0.53x (base 0.53x, -0.0%) ok
arrayRandom 3 0.96x (base 0.99x, -3.0%) 0.32x (base 0.32x, -0.3%) ok
objectAllocation 3 3.95x (base 3.70x, +7.0%) 0.50x (base 0.48x, +3.1%) ok
valueEscape 3 0.51x (base 0.51x, +0.1%) 0.09x (base 0.09x, -1.9%) ok
hashMapChurn 3 1.04x (base 1.18x, -11.8%) 0.07x (base 0.07x, +11.0%) ok
stringBuilding 3 0.87x (base 0.84x, +3.5%) 0.46x (base 0.54x, -14.2%) ok
recursion 3 1.22x (base 1.24x, -1.2%) 0.12x (base 0.12x, -0.7%) ok
quicksort 3 1.00x (base 1.01x, -1.1%) 0.11x (base 0.11x, -0.5%) ok

Result: no regression

@shai-almog

shai-almog commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 155 screenshots: 155 matched.
✅ Native iOS Metal screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 1314 seconds

Build and Run Timing

Metric Duration
Simulator Boot 62000 ms
Simulator Boot (Run) 1000 ms
App Install 13000 ms
App Launch 3000 ms
Test Execution 401000 ms

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 53ms / native 3ms = 17.6x speedup
SIMD float-mul (64K x300) java 72ms / native 3ms = 24.0x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path active (NEON-accelerated)
Base64 CN1 encode 53.000 ms
Base64 CN1 decode 56.000 ms
Base64 native encode 811.000 ms
Base64 encode ratio (CN1/native) 0.065x (93.5% faster)
Base64 native decode 1134.000 ms
Base64 decode ratio (CN1/native) 0.049x (95.1% faster)
Base64 SIMD encode 53.000 ms
Base64 encode ratio (SIMD/CN1) 1.000x (0.0% slower)
Base64 SIMD decode 48.000 ms
Base64 decode ratio (SIMD/CN1) 0.857x (14.3% faster)
Base64 encode ratio (SIMD/native) 0.065x (93.5% faster)
Base64 decode ratio (SIMD/native) 0.042x (95.8% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 6.000 ms
Image createMask (SIMD on) 1.000 ms
Image createMask ratio (SIMD on/off) 0.167x (83.3% faster)
Image applyMask (SIMD off) 39.000 ms
Image applyMask (SIMD on) 27.000 ms
Image applyMask ratio (SIMD on/off) 0.692x (30.8% faster)
Image modifyAlpha (SIMD off) 48.000 ms
Image modifyAlpha (SIMD on) 26.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.542x (45.8% faster)
Image modifyAlpha removeColor (SIMD off) 56.000 ms
Image modifyAlpha removeColor (SIMD on) 31.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.554x (44.6% faster)

@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 28cad305bb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread vm/backend/src/com/codename1/backend/Tasks.java Outdated
Comment thread vm/backend/src/com/codename1/backend/Backend.java Outdated
Comment thread vm/backend/src/com/codename1/backend/CronSchedule.java
Comment thread vm/backend/src/com/codename1/backend/TaskExecutor.java
Comment thread vm/backend/src/com/codename1/backend/metrics/Histogram.java
Comment thread vm/backend/src/com/codename1/backend/Backend.java Outdated
Comment thread vm/backend/src/com/codename1/backend/Backend.java Outdated
@shai-almog

shai-almog commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 154 screenshots: 154 matched.
✅ Native Mac screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 422 seconds

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 54ms / native 2ms = 27.0x speedup
SIMD float-mul (64K x300) java 63ms / native 5ms = 12.6x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path active (NEON-accelerated)
Base64 CN1 encode 77.000 ms
Base64 CN1 decode 78.000 ms
Base64 native encode 844.000 ms
Base64 encode ratio (CN1/native) 0.091x (90.9% faster)
Base64 native decode 425.000 ms
Base64 decode ratio (CN1/native) 0.184x (81.6% faster)
Base64 SIMD encode 71.000 ms
Base64 encode ratio (SIMD/CN1) 0.922x (7.8% faster)
Base64 SIMD decode 67.000 ms
Base64 decode ratio (SIMD/CN1) 0.859x (14.1% faster)
Base64 encode ratio (SIMD/native) 0.084x (91.6% faster)
Base64 decode ratio (SIMD/native) 0.158x (84.2% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 13.000 ms
Image createMask (SIMD on) 7.000 ms
Image createMask ratio (SIMD on/off) 0.538x (46.2% faster)
Image applyMask (SIMD off) 110.000 ms
Image applyMask (SIMD on) 86.000 ms
Image applyMask ratio (SIMD on/off) 0.782x (21.8% faster)
Image modifyAlpha (SIMD off) 87.000 ms
Image modifyAlpha (SIMD on) 74.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.851x (14.9% faster)
Image modifyAlpha removeColor (SIMD off) 56.000 ms
Image modifyAlpha removeColor (SIMD on) 80.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 1.429x (42.9% slower)

- Executors belong to the server that opened them: request, task,
  scheduler and start-up threads carry it, stopping one server no longer
  shuts down another's, and generated @async code looks the executor up
  per call. At the shutdown deadline queued tasks are dropped rather than
  run against destroyed beans, and running ones are interrupted; a virtual
  task a host cannot run falls back to its own executor.
- Every server applies cn1.session.* (handler-only ones sent a TLS
  session cookie without Secure); a failing request still stores its
  session so its session beans are kept or destroyed.
- Request beans are destroyed while their request is still current;
  @PreDestroy runs subclass before superclass; factory beans run
  inherited lifecycle methods.
- Health reports STARTING until the start-up hook returns.
- A cron time inside a DST gap is skipped instead of firing an hour late.
- The metrics exporter can be reopened; histograms copy and validate
  their bounds and labels.
- A managed resource must be a singleton and cannot overload operations.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d4d761e707

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread vm/backend/src/com/codename1/backend/Backend.java
Comment thread vm/backend/src/com/codename1/backend/Sessions.java
Comment thread vm/backend/src/com/codename1/backend/Sessions.java Outdated
Comment thread vm/backend/src/com/codename1/backend/Transactions.java Outdated
Comment thread vm/backend/src/com/codename1/backend/CronSchedule.java Outdated
Comment thread vm/backend/src/com/codename1/backend/mcp/DevTools.java
shai-almog and others added 4 commits September 30, 2026 10:09
…ations

- Backend no longer names Management or McpServer. Only the builder's
  management() and mcp() do, and the generated entry point calls them only
  when the build asked (@enablemanagement / @EnableMcpServer / an @mcptool /
  a literal cn1.*.enabled=true in any application*.properties, or a dev
  build). The translator drops the uncalled builder method and the classes
  with it; BackendOtelTest now asserts from nm that a server that never asked
  carries neither, against a control that links both.
- Typed settings annotations -- @serverconfig, @SessionConfig,
  @DataSourceConfig, @StaticFilesConfig, exporter settings on
  @opentelemetry, paths on the Enable* ones -- compiled in as the bottom
  configuration layer (Config.withCompiledDefaults), under the files and the
  environment. Values the runtime would refuse, and two classes disagreeing,
  are build errors naming the class.
- OtlpTracerTest.partialSuccessIsCounted waited on a flush that could run
  before the request's span was queued (the span ends after the response is
  written); it now waits for the span first.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…as JSON

A route may now return an entity or DTO (and collections or String-keyed
maps of them) and take one as @RequestBody, as a Spring controller does
through Jackson. The build writes a <Name>Cn1Json codec per class -- plain
code, no reflection -- in the app's @mapped JSON form, so a class shared by
app and backend round-trips: fields (public directly, others via bean
accessors), @JsonProperty/@JsonIgnore (now shared with the backend), Date as
epoch millis (read from millis or ISO-8601), byte[] base64, enums by name,
subclasses written as themselves, unknown members ignored.

- A body the codec refuses is a 400 naming the path
  ($.lines[0].quantity: expected ...); a response nesting past 64 objects
  (a cycle) is a 500 pointing at @JsonIgnore.
- Generic type-variable fields, body classes without a no-arg constructor,
  interfaces, arrays other than byte[], and runtime types such as
  HttpServer.Response inside a list stay build errors, with the reason.
- HttpServer renders a deferred JSON body before the write, into the same
  buffer, so a throw there (a Writable, a codec) is answered 500 and recorded
  as the handler's failure instead of dropping the connection unanswered.
- The guide's order example is compiled from the guide's own files and run
  end to end by BackendBeansTest.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…host

A virtual thread used to park only on the socket it served. An outbound
read -- a PostgreSQL or MySQL query, a Web call, a TLS handshake -- did a
blocking recv() on the host pthread, and with one host per core that many
slow calls stopped the server answering anything.

- Native: a per-virtual-thread wait record (descriptors, events, timeout)
  and cn1BackendVtWait/cn1BackendAwaitFd; resume answers WAITING (3) for
  it. Outbound Tcp descriptors stay non-blocking for life and every wait
  (connect, read, write, TLS handshake/read/write) parks on a virtual
  thread and polls anywhere else, so platform threads behave as before.
  SO_RCVTIMEO/SO_SNDTIMEO become the wait's deadline. Web drives libcurl
  through the multi interface on a virtual thread.
- Host: WAITING registers the descriptors with the host's own poller for
  exactly the wait, wakes on readiness or deadline, and the stop drain
  keeps pumping tasks that wait on outbound I/O.
- Docs/javadoc/skill: network databases, Web and TLS are fine on VIRTUAL;
  SQLite, file access, host-name resolution and Object.wait still block.
- Tests: SelfTest (Tcp, Web, TLS handshake, TLS read, read deadline) and
  DbCheck (pg_sleep / SLEEP against a one-host server) prove another
  request is served while the call waits; both fail with the old
  blocking wait.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- The seven AvoidUsingHardCodedIP findings are loopback and wildcard
  literals that recognise or bind the local interface and dial nothing;
  each carries a //NOPMD with that reason, the convention ServerSocket and
  Credentials already use. The OwnRoute overrides get @OverRide.
- SelfTest exercises JsonCodec on the translated runtime: range and
  fraction refusals with their paths, dates from millis and ISO-8601 with
  offsets and fractions, an impossible date refused, base64, writeDate.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 903a18fb09

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread vm/backend/src/com/codename1/backend/JsonCodec.java Outdated
Comment thread vm/backend/src/com/codename1/backend/mcp/McpServer.java Outdated
Comment thread vm/backend/src/com/codename1/backend/mcp/McpServer.java
…and paths

- An Object or raw Map/List field is written by its run-time class through a
  generated cn1app.JsonValues: a class the build writes goes through its
  codec, Date as millis, enums by name, JDK shapes through Json; any other
  class is a 500 instead of its toString().
- A TreeSet body needs a Comparable element; refused at build time otherwise.
- readLong bounds a fractional-free double by 2^63 before converting, so
  9223372036854775808.0 is refused instead of clamped to Long.MAX_VALUE.
- MCP and management match the canonical path (pathFrom), as the routers,
  static files and relay do: /%6dcp is /mcp.
- MCP answers an allowed origin's CORS preflight before authentication and
  names the origin on every reply to it (new Response.header).
- The guide's order example uses one source block per include, which the
  snippet validator requires.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8a415127f0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread vm/backend/src/com/codename1/backend/Sessions.java
Comment thread vm/backend/src/com/codename1/backend/DataSource.java Outdated
Comment thread vm/backend/src/com/codename1/backend/Scheduler.java
shai-almog and others added 2 commits October 1, 2026 09:32
…s, lease check

- PINNING. ParparVM identifies a monitor's owner by its OS thread, which
  every virtual thread on a host shares, so a virtual thread that parked
  inside `synchronized` let the next one on that host into the same critical
  section. With outbound I/O now parking, that became likely. A virtual
  thread now counts the monitors it holds (one TLS load per monitorEnter/
  Exit, zero off a virtual thread) and never switches out while the count is
  above zero: every park -- socket wait, collector handshake, nap -- asks
  cn1BackendCanPark/cn1VirtualThreadPinned and waits like a platform thread
  instead. SelfTest reproduces the interleave on one host: two requests
  waiting on a slow socket inside one monitor; with pinning disabled it sees
  two inside at once.
- DataSource reserves pool capacity under its monitor and opens the
  connection outside it, and a virtual thread waits for a free connection by
  napping rather than wait(); DbCheck runs concurrent lazy opens on one host
  against real PostgreSQL.
- @mcptool parameters other than scalars are read through the shared JSON
  codecs (List<Integer> holds Integers, DTOs are built, a bad value is a tool
  error naming its path), results are written through them, and shapes they
  cannot serve are build errors. The codec set is shared between the bean
  and router processors.
- A scheduler claim that lands after its lease ran out is not run.
- Response.header no longer fully qualifies an imported class (forbidden PMD).
- The DB session purge's cross-replica limit is recorded as a Spring-matching
  decision.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

…stay parkable

With virtual threads pinned while they hold a monitor, Database's
synchronized methods pinned every query, and a PostgreSQL or MySQL wait held
its host again -- DbCheck's "another request is served while a query waits"
failed on one host. The exclusion a connection needs (one operation at a
time, a transaction reserved to its caller) is now a reentrant gate: a flag
taken and returned under a monitor held only for that instant. A virtual
thread waiting for it naps; anything else waits on the monitor as before.
Transaction ownership is keyed by the virtual thread, not
Thread.currentThread(), which every virtual thread on a host shares, and a
caller waiting on another's transaction gives the gate up meanwhile, as
wait() gave up the monitor.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fbe9a07fc5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…rved

- A body value read into float or Float is refused (400) when a float
  cannot hold it, instead of narrowing 1e100 to infinity or 1e-100 to zero;
  the same rule MCP float arguments already had.
- @Timed/@counted names are checked against the server's own instruments at
  build time, by name and by Prometheus series. Taken at run time, the clash
  surfaced in the woven finally after the body's work had committed.
- An Object or raw collection field holding a class with no codec stays a
  run-time 500 by design; the reasoning is in BackendJsonCodecs.check.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e86694ec3a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…ntry fixes

- Two classes whose JSON codec names fold together (Outer_Inner and
  Outer.Inner) are a build error instead of one codec silently replacing
  the other.
- Every class the bean processor generates -- aspects, proxies, tool and
  managed adapters, codecs -- is checked against the project's own classes
  before it is compiled; an existing class of that name is a build error
  instead of being overwritten in the output directory.
- Subclass dispatch walks ancestors on the compile classpath too, so a
  project subclass reaching the declared type through a dependency's class
  is written with its own fields.
- A module whose only request is @enablemanagement gets an entry point.

Each has a test asserting the failure or the outcome; the dispatch and
entry-point tests fail with their fixes reverted.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

String value = System.getProperty(key);
if (value != null && value.length() > 0) {
return value;
}
return environment(environmentName(key));

P2 Badge Preserve empty high-priority configuration overrides

When a lower-priority properties file defines a string setting and deployment deliberately supplies an empty system-property override, this treats the empty value as absent and silently reactivates the file value. For example, -Dcn1.static.root= cannot disable a static root compiled into application.properties, so files continue to be served despite the highest-priority layer explicitly clearing the setting; accept a present empty property here and let each setting's reader decide what empty means.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread vm/backend/src/com/codename1/backend/Backend.java
…cket fallbacks

- An @ManagedOperation returning anything beyond a scalar or String is
  written through the JSON codecs; one returning a shape they cannot write
  is a build error. A DTO result was sent as its quoted toString().
- A websocket fallback router sees the server's sessions on the handshake
  (the upgrade bypasses the request wrapper), and what the handshake did to
  them is stored and released afterwards.
- perf-baseline: calibrate linux-x64@amd-epyc-9v45-96-core-processor, a
  runner CPU model the gate had no row for (ratios within the spread of the
  existing AMD/Intel linux rows).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 114c900cd0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread vm/backend/src/com/codename1/backend/Management.java Outdated
…ounted servers

- An @ManagedAttribute that is not a number or a boolean is a build error;
  it was listed under /manage/managed and silently missing from metrics.
- A module that only serves static files (@StaticFilesConfig or
  cn1.static.root in a properties file) gets an entry point.
- cn1.management.path=/ mounts the endpoints at the server root instead of
  being refused as not starting with /.

Each has a test; the two outcome tests fail with their fix reverted.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 21320aa4d8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

The arm64 gate flagged stringBuilding RAM at 0.32x against a 0.26x
baseline. Not a regression: the VM, JavaAPI and benchmark are identical
between this head and 3666deb, which read 0.27x, and master reads 0.26x
on every run -- the same code, two readings, one row's RAM moving between
runs. The baseline stays 0.26x; the row gets the 0.3 memory tolerance other
noisy RAM rows carry, so +30% is still a regression.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@shai-almog
shai-almog merged commit 65ae4d8 into master Oct 1, 2026
66 of 71 checks passed
@shai-almog
shai-almog deleted the backend-spring-model branch October 1, 2026 14:49
shai-almog added a commit that referenced this pull request Oct 1, 2026
…plates

Master's Spring-style backend beans (#5908) land in build-engine, where the
annotation processors moved: the dev-tools switch goes through BackendPackager
for both plugins (-Pcn1.backend.devTools for Gradle), the bean tests run there
with their SQLite driver, and the Gradle backend templates gain the Greeter
service the archetype now injects into Api. Conversion's untouched-skeleton
check expects that pair, and the Gradle backend checks call /greet so the
wiring is exercised, not just /healthz. The skill's new backend references
give the Gradle tasks beside the Maven goals.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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