Skip to content

Chart transitions: updateChart() never applied the buffer, and the package had no prose - #5830

Merged
shai-almog merged 5 commits into
masterfrom
dg-chart-transitions
Sep 15, 2026
Merged

shai-almog merged 5 commits into
masterfrom
dg-chart-transitions

Conversation

@shai-almog

Copy link
Copy Markdown
Collaborator

Two things, one package.

The bug. SeriesTransition.updateChart() is documented as
animateChart() with a duration of 0. Its whole body was
chart.repaint(). Values written into the transition buffer were
therefore never read -- the next initTransition() discarded them --
and the series kept the numbers it already had. Nothing threw and
nothing was logged; the chart just did not change. It now runs the
three steps the animated path reaches through the animation, back to
back: initTransition(), update(100), cleanup(). Draining the
buffer at the end leaves the transition in the state an animation would
have left it in, so it can be reused either way.

XYTransitionsTest.updateChartAppliesTheBufferWithoutAnimating was run
against the old body first and fails there with
expected: <5.0> but was: <1.0>; the existing
updateChartForcesRepaint still passes, since the repaint is still
there.

The prose. com.codename1.charts.transitions was not mentioned
anywhere in the developer guide. The charts chapter now explains the
buffer -- the shape to end at, every point of it, rather than a delta,
which is the part that is easy to get wrong -- along with easing,
duration, and both entry points.

…g documented the package

SeriesTransition.updateChart() is documented as animateChart() with a
duration of 0 and was a bare chart.repaint(). The buffer was never read,
so every value written into it was discarded by the next
initTransition() and the series kept the numbers it already had --
silently: no exception, no log, a chart that simply did not change. It
now runs the three steps the animation reaches through, back to back:
initTransition(), update(100), cleanup(). The regression test fails
against the old body with 'expected: <5.0> but was: <1.0>'.

com.codename1.charts.transitions had no prose in the guide at all, so
the charts chapter now explains what the buffer means -- the shape to
end at, every point of it, not a delta -- and shows both entry points.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 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-14T19:15:20.524009Z 87ed6e1 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: 7dee5216c2

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

…eplaces

updateChart() on a transition animateChart() had already registered left
it registered, and its own initTransition() restarted the motion. The
next frame therefore ran update() at a low progress against start values
captured a moment earlier, walking the series back off the numbers the
caller had just asked for -- so an immediate update issued during an
animation was undone and replayed as one.

Deregister first, latch finished after applying, so a frame already
queued behind the call finds the transition complete and returns false
instead of moving anything. The regression test fails against the
previous body with 'the transition is still animating'.
@github-actions

github-actions Bot commented Sep 14, 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)
    • βœ… 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.

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

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

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

@github-actions

Copy link
Copy Markdown
Contributor

Cloudflare Preview

@shai-almog

shai-almog commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 151 screenshots: 151 matched.

Native Android coverage

  • πŸ“Š Line coverage: 9.24% (9184/99417 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 8.99% (47193/524920), branch 3.55% (1767/49739), complexity 3.52% (1868/53026), method 5.43% (1514/27888), class 10.89% (407/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% (9184/99417 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 8.99% (47193/524920), branch 3.55% (1767/49739), complexity 3.52% (1868/53026), method 5.43% (1514/27888), class 10.89% (407/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 188ms / native 150ms = 1.2x speedup
SIMD float-mul (64K x300) java 148ms / native 86ms = 1.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 126.000 ms
Base64 CN1 decode 138.000 ms
Base64 native encode 548.000 ms
Base64 encode ratio (CN1/native) 0.230x (77.0% faster)
Base64 native decode 438.000 ms
Base64 decode ratio (CN1/native) 0.315x (68.5% faster)
Image encode benchmark status skipped (SIMD unsupported)

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

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

@shai-almog

shai-almog commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 181 screenshots: 181 matched.
βœ… JavaScript-port screenshot tests passed.

@shai-almog

shai-almog commented Sep 14, 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: 269 seconds

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 57ms / native 3ms = 19.0x speedup
SIMD float-mul (64K x300) java 56ms / native 3ms = 18.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 active (NEON-accelerated)
Base64 CN1 encode 182.000 ms
Base64 CN1 decode 93.000 ms
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) 37.000 ms
Image applyMask (SIMD on) 30.000 ms
Image applyMask ratio (SIMD on/off) 0.811x (18.9% faster)
Image modifyAlpha (SIMD off) 32.000 ms
Image modifyAlpha (SIMD on) 25.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.781x (21.9% faster)
Image modifyAlpha removeColor (SIMD off) 33.000 ms
Image modifyAlpha removeColor (SIMD on) 26.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.788x (21.2% faster)

The buffer is created lazily by getBuffer(), so initTransition() read a
null cachedSeries and threw. animateChart() has always done that; the
previous commit gave updateChart() the same lifecycle and so the same
crash, on a call that used to be a harmless repaint.

Reading through getBuffer() fixes both: an empty buffer copies no
values, the tween has nothing to move, and the series is left exactly
as it is -- which is what 'apply no pending changes' should mean.

@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: 2de27de0a2

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

updateChart() ends the transition itself, and a frame already queued
behind it reaches animate()'s terminal branch -- so cleanup() ran twice
for one pass. The built-ins only clear a buffer, but the method is
overridable and a subclass can release something or fire a completion
effect in it.

A flag reset by initTransition() makes it once per pass, whichever route
out gets there first. The test counts the calls and reports 2 against
the previous body.
The gate only asks for one on a file a change adds or modifies, so an
untouched sibling keeps going without it -- which is why this surfaced
now rather than when the file was written.
@shai-almog

shai-almog commented Sep 14, 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 commented Sep 14, 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: 2040 seconds

Build and Run Timing

Metric Duration
Simulator Boot 95000 ms
Simulator Boot (Run) 0 ms
App Install 17000 ms
App Launch 5000 ms
Test Execution 410000 ms

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 78ms / native 3ms = 26.0x speedup
SIMD float-mul (64K x300) java 259ms / native 76ms = 3.4x 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 197.000 ms
Base64 CN1 decode 168.000 ms
Base64 native encode 793.000 ms
Base64 encode ratio (CN1/native) 0.248x (75.2% faster)
Base64 native decode 513.000 ms
Base64 decode ratio (CN1/native) 0.327x (67.3% faster)
Base64 SIMD encode 68.000 ms
Base64 encode ratio (SIMD/CN1) 0.345x (65.5% faster)
Base64 SIMD decode 62.000 ms
Base64 decode ratio (SIMD/CN1) 0.369x (63.1% faster)
Base64 encode ratio (SIMD/native) 0.086x (91.4% faster)
Base64 decode ratio (SIMD/native) 0.121x (87.9% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 7.000 ms
Image createMask (SIMD on) 2.000 ms
Image createMask ratio (SIMD on/off) 0.286x (71.4% faster)
Image applyMask (SIMD off) 44.000 ms
Image applyMask (SIMD on) 36.000 ms
Image applyMask ratio (SIMD on/off) 0.818x (18.2% faster)
Image modifyAlpha (SIMD off) 34.000 ms
Image modifyAlpha (SIMD on) 26.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.765x (23.5% faster)
Image modifyAlpha removeColor (SIMD off) 33.000 ms
Image modifyAlpha removeColor (SIMD on) 26.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.788x (21.2% faster)

@shai-almog

shai-almog commented Sep 14, 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 14, 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: 326 seconds

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 80ms / native 3ms = 26.6x speedup
SIMD float-mul (64K x300) java 69ms / native 5ms = 13.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 206.000 ms
Base64 CN1 decode 93.000 ms
Base64 native encode 662.000 ms
Base64 encode ratio (CN1/native) 0.311x (68.9% faster)
Base64 native decode 334.000 ms
Base64 decode ratio (CN1/native) 0.278x (72.2% faster)
Base64 SIMD encode 49.000 ms
Base64 encode ratio (SIMD/CN1) 0.238x (76.2% faster)
Base64 SIMD decode 46.000 ms
Base64 decode ratio (SIMD/CN1) 0.495x (50.5% faster)
Base64 encode ratio (SIMD/native) 0.074x (92.6% faster)
Base64 decode ratio (SIMD/native) 0.138x (86.2% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 23.000 ms
Image createMask (SIMD on) 7.000 ms
Image createMask ratio (SIMD on/off) 0.304x (69.6% faster)
Image applyMask (SIMD off) 101.000 ms
Image applyMask (SIMD on) 70.000 ms
Image applyMask ratio (SIMD on/off) 0.693x (30.7% faster)
Image modifyAlpha (SIMD off) 74.000 ms
Image modifyAlpha (SIMD on) 60.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.811x (18.9% faster)
Image modifyAlpha removeColor (SIMD off) 69.000 ms
Image modifyAlpha removeColor (SIMD on) 36.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.522x (47.8% faster)

@shai-almog
shai-almog merged commit 33fbb50 into master Sep 15, 2026
39 checks passed
@shai-almog
shai-almog deleted the dg-chart-transitions branch September 15, 2026 02:06
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