Skip to content

Developer guide: generate the properties binding figure from its sample - #5786

Merged
shai-almog merged 4 commits into
masterfrom
devguide-io-figures-2
Sep 12, 2026
Merged

Developer guide: generate the properties binding figure from its sample#5786
shai-almog merged 4 commits into
masterfrom
devguide-io-figures-2

Conversation

@shai-almog

Copy link
Copy Markdown
Collaborator

The io chapter's properties form was a 2015 screenshot. It is now generated from the sample that draws it, so the listing beside the picture is the code that produced it.

This figure was written once before and backed out: the gender row is three RadioButton.createToggle controls, no theme defined ToggleButton, and the row rendered as bare unshaped text. Publishing it then would have documented a theme gap as the intended appearance. #5757 gave the UIID a style, so the row now draws as the segmented control it always meant to be.

Determinism

Everything rendered is constructed inside the tagged region -- one Contact, no network, no clock, no filesystem. Two deliberate details:

  • The date picker is left unset, so it shows its placeholder. That is what the sample produces, and one less thing that can vary between runs.
  • The figure focuses a text field before returning. Focus otherwise lands on the first focusable control, and a focused toggle resolves sel# -- the accent ring -- whether or not it is checked, which would have put a ring on the very row this figure exists to show.

Verification

check-guide-structure, check-guide-xrefs, find_unused_images, validate-guide-snippets, check-missing-code-blocks (34, unchanged), asciidoctor --failure-level WARN, asciidoctor-pdf, Vale 0/0/0, LanguageTool status: ok 0, paragraph capitalization, control characters.

The committed baseline is a local render, so the figure check will flag it on the first run -- Java2D rounds font metrics differently here than on the runner. I will reseed it from that run's artifact.

🤖 Generated with Claude Code

This figure was written once before and backed out: the gender row is three
RadioButton.createToggle controls, ToggleButton was defined by no theme, and the
row rendered as bare text. Publishing that would have documented a theme gap as
the intended appearance. With the UIID themed the row draws as the segmented
control it always meant to be, so the figure can be generated from the sample
rather than shipped as a 2015 screenshot of it.

The figure focuses a text field on the way out. Focus lands on the first
focusable control otherwise, and a focused toggle resolves sel# -- the accent
ring -- whether or not it is checked, which would have put a ring on the gender
row this figure exists to show.

Everything it renders is constructed in the tagged region: one Contact, no
network, no clock, no filesystem. The date picker is left unset so it shows its
placeholder, which is both what the sample produces and one less thing that can
differ between runs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 12, 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-09-12T10:14:19.575552Z 575afa1 New commits
ℹ️ 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.

@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: 7d76667ee5

ℹ️ 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".

@github-actions

Copy link
Copy Markdown
Contributor

Cloudflare Preview

The FloatingHint component draws its label with the FloatingHint UIID, which no
theme defined until recently -- the label inherited the default style. The
chapter illustrated it with a 2015 screenshot; it is now generated from the
sample, so the picture shows what the component does today.

The render happens to catch both of its states at once. Focus lands on the first
field, so that hint has floated above it while the second still sits inside its
field, which is the whole behaviour the component exists for and the reason to
leave focus where the renderer puts it.

Co-Authored-By: Claude Opus 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: f3b077fcf9

ℹ️ 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 figure check was red for the reason the PR predicted: a committed local
render cannot match the runner byte for byte, because Java2D rounds font metrics
differently here. Both new figures are replaced with the run's own artifact, and
all 50 committed figures now match it exactly, none on a tolerance sidecar.
Predicting a failure is not the same as leaving one, and this should have been
seeded from a run before the figures were registered.

The floating-hint caption promised a field with content beside an empty one. The
sample creates both empty, and FloatingHint animates the label up on focus
gained, so what the picture actually shows is the focused field's hint floated
and the unfocused one's still inside its field. The caption now says that. It is
still both states of the component in one still, which is the reason to leave
focus where the renderer puts it.

The review also asked for the Contact labels to be restored to Name, E-Mail and
Date Of Birth. There are none to restore: no Contact in this chapter calls
setLabel, and getLabel answers with the property's name when none was set, so
the printed listing produces exactly the lower-case labels in the picture.
Adding them to the figure's copy alone would make the picture show something the
chapter's own Contact cannot produce, which is the mismatch this figure was
written to remove. The reasoning is in the class rather than the thread, where
the next person will meet it.

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

github-actions Bot commented Sep 12, 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)

Moving components-floatinghint.png under img/generated left a dangling URL in
CodenameOne/src/com/codename1/ui/package-info.java, whose javadoc embeds the
published figure. Both website and docs builds went red on it.

The gate that caught it is the one added earlier in this work for exactly this
-- a figure URL in a Java source that points at a file the site does not ship --
and it did its job. I did not run it after deleting the legacy images, which is
why CI found this rather than I did. The neighbouring entries in that file
already use the img/generated path, so the reference now matches them.

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

shai-almog commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 151 screenshots: 151 matched.

Native Android coverage

  • 📊 Line coverage: 9.24% (9188/99417 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 9.00% (47232/524920), branch 3.56% (1772/49739), complexity 3.53% (1873/53026), method 5.44% (1516/27888), class 10.92% (408/3736)
    • 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.24% (9188/99417 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 9.00% (47232/524920), branch 3.56% (1772/49739), complexity 3.53% (1873/53026), method 5.44% (1516/27888), class 10.92% (408/3736)
    • 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 232ms / native 217ms = 1.0x speedup
SIMD float-mul (64K x300) java 134ms / native 168ms = 0.7x 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 103.000 ms
Base64 CN1 decode 113.000 ms
Base64 native encode 504.000 ms
Base64 encode ratio (CN1/native) 0.204x (79.6% faster)
Base64 native decode 414.000 ms
Base64 decode ratio (CN1/native) 0.273x (72.7% faster)
Image encode benchmark status skipped (SIMD unsupported)

@github-actions

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)
    • 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.

@shai-almog

shai-almog commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator Author

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

@shai-almog

shai-almog commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator Author

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

Benchmark Results

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

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 54ms / native 3ms = 18.0x speedup
SIMD float-mul (64K x300) java 54ms / native 2ms = 27.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 156.000 ms
Base64 CN1 decode 91.000 ms
Base64 native encode 658.000 ms
Base64 encode ratio (CN1/native) 0.237x (76.3% faster)
Base64 native decode 198.000 ms
Base64 decode ratio (CN1/native) 0.460x (54.0% faster)
Base64 SIMD encode 49.000 ms
Base64 encode ratio (SIMD/CN1) 0.314x (68.6% faster)
Base64 SIMD decode 43.000 ms
Base64 decode ratio (SIMD/CN1) 0.473x (52.7% faster)
Base64 encode ratio (SIMD/native) 0.074x (92.6% faster)
Base64 decode ratio (SIMD/native) 0.217x (78.3% 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) 34.000 ms
Image applyMask (SIMD on) 20.000 ms
Image applyMask ratio (SIMD on/off) 0.588x (41.2% faster)
Image modifyAlpha (SIMD off) 24.000 ms
Image modifyAlpha (SIMD on) 20.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.833x (16.7% faster)
Image modifyAlpha removeColor (SIMD off) 25.000 ms
Image modifyAlpha removeColor (SIMD on) 20.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.800x (20.0% faster)

@shai-almog

shai-almog commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator Author

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

Benchmark Results

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

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 61ms / native 3ms = 20.3x speedup
SIMD float-mul (64K x300) java 67ms / native 3ms = 22.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 167.000 ms
Base64 CN1 decode 112.000 ms
Image encode benchmark iterations 100
Image createMask (SIMD off) 10.000 ms
Image createMask (SIMD on) 2.000 ms
Image createMask ratio (SIMD on/off) 0.200x (80.0% faster)
Image applyMask (SIMD off) 112.000 ms
Image applyMask (SIMD on) 30.000 ms
Image applyMask ratio (SIMD on/off) 0.268x (73.2% faster)
Image modifyAlpha (SIMD off) 27.000 ms
Image modifyAlpha (SIMD on) 25.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.926x (7.4% faster)
Image modifyAlpha removeColor (SIMD off) 36.000 ms
Image modifyAlpha removeColor (SIMD on) 31.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.861x (13.9% faster)

@shai-almog

shai-almog commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator Author

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

Benchmark Results

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

Build and Run Timing

Metric Duration
Simulator Boot 97000 ms
Simulator Boot (Run) 1000 ms
App Install 16000 ms
App Launch 1000 ms
Test Execution 492000 ms

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 154ms / native 6ms = 25.6x speedup
SIMD float-mul (64K x300) java 84ms / native 5ms = 16.8x 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 776.000 ms
Base64 CN1 decode 233.000 ms
Base64 native encode 2081.000 ms
Base64 encode ratio (CN1/native) 0.373x (62.7% faster)
Base64 native decode 876.000 ms
Base64 decode ratio (CN1/native) 0.266x (73.4% faster)
Base64 SIMD encode 90.000 ms
Base64 encode ratio (SIMD/CN1) 0.116x (88.4% faster)
Base64 SIMD decode 85.000 ms
Base64 decode ratio (SIMD/CN1) 0.365x (63.5% faster)
Base64 encode ratio (SIMD/native) 0.043x (95.7% faster)
Base64 decode ratio (SIMD/native) 0.097x (90.3% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 15.000 ms
Image createMask (SIMD on) 6.000 ms
Image createMask ratio (SIMD on/off) 0.400x (60.0% faster)
Image applyMask (SIMD off) 90.000 ms
Image applyMask (SIMD on) 129.000 ms
Image applyMask ratio (SIMD on/off) 1.433x (43.3% slower)
Image modifyAlpha (SIMD off) 72.000 ms
Image modifyAlpha (SIMD on) 66.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.917x (8.3% faster)
Image modifyAlpha removeColor (SIMD off) 64.000 ms
Image modifyAlpha removeColor (SIMD on) 65.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 1.016x (1.6% slower)

@shai-almog

shai-almog commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 143 screenshots: 143 matched.
✅ Native iOS screenshot tests passed.

Benchmark Results

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

Build and Run Timing

Metric Duration
Simulator Boot 90000 ms
Simulator Boot (Run) 2000 ms
App Install 19000 ms
App Launch 3000 ms
Test Execution 536000 ms

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 172ms / native 2ms = 86.0x speedup
SIMD float-mul (64K x300) java 167ms / native 4ms = 41.7x 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 318.000 ms
Base64 CN1 decode 293.000 ms
Base64 native encode 471.000 ms
Base64 encode ratio (CN1/native) 0.675x (32.5% faster)
Base64 native decode 829.000 ms
Base64 decode ratio (CN1/native) 0.353x (64.7% faster)
Base64 SIMD encode 65.000 ms
Base64 encode ratio (SIMD/CN1) 0.204x (79.6% faster)
Base64 SIMD decode 74.000 ms
Base64 decode ratio (SIMD/CN1) 0.253x (74.7% faster)
Base64 encode ratio (SIMD/native) 0.138x (86.2% faster)
Base64 decode ratio (SIMD/native) 0.089x (91.1% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 11.000 ms
Image createMask (SIMD on) 3.000 ms
Image createMask ratio (SIMD on/off) 0.273x (72.7% faster)
Image applyMask (SIMD off) 171.000 ms
Image applyMask (SIMD on) 104.000 ms
Image applyMask ratio (SIMD on/off) 0.608x (39.2% faster)
Image modifyAlpha (SIMD off) 119.000 ms
Image modifyAlpha (SIMD on) 89.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.748x (25.2% faster)
Image modifyAlpha removeColor (SIMD off) 182.000 ms
Image modifyAlpha removeColor (SIMD on) 169.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.929x (7.1% faster)

@shai-almog

shai-almog commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator Author

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

@shai-almog

shai-almog commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator Author

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

@shai-almog
shai-almog merged commit 47f8b65 into master Sep 12, 2026
38 checks passed
@shai-almog
shai-almog deleted the devguide-io-figures-2 branch September 12, 2026 15:19
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.

2 participants