Skip to content

fix(tao): give the GraalVM test image the classes it was compiled against - #657

Merged
kdroidFilter merged 1 commit into
nucleus-2.6from
fix/graalvm-native-test-material3
Sep 6, 2026
Merged

fix(tao): give the GraalVM test image the classes it was compiled against#657
kdroidFilter merged 1 commit into
nucleus-2.6from
fix/graalvm-native-test-material3

Conversation

@kdroidFilter

Copy link
Copy Markdown
Collaborator

Summary

test-graalvm fails on all three platforms with NoClassDefFoundError: androidx/compose/material3/MaterialThemeKt, thrown on the Tao main thread, which closes the event loop and takes the whole job down. examples/tao-native-test compiles decorated-window-tao's test suites into a native image, but taoTestArtifacts published only the compiled classes — every dependency of that test source set had to be repeated in the consumer, and Material 3 was not. The configuration now extends testImplementation, so a dependency added to the suites reaches the image without being repeated.

Reproduced and verified on the JVM (:examples:tao-native-test:run --args=headful), which shares that classpath — two minutes instead of a 24-minute native build.

With the film cases finally reaching their own code, three things they had never been green on:

  • Zero-height content. They compose into a ColumnScope next to the harness's default fillMaxSize background, so the forty rows of text that exist to make the owner's per-frame present cost something rendered nowhere. paintDefaultBackground = false.
  • The grabber started before the warm-up and spent its whole frame budget on it, leaving the curve with nothing after the timestamp it measures from — reported as "the dialog never showed up on screen".
  • One capture session covered both halves, so the appearance consumed the budget and the disappearance got no frames, which is what the two matches the in-scene layer cases were failing on. Each half films in its own session now, within the same total budget.

Test plan

  • :examples:tao-native-test:run --args=headful — the NoClassDefFoundError is gone and the suite runs past the Material 3 cases
  • taoHeadfulTest -Dnucleus.tao.headful.filter=appearance under Xvfb + openbox: 6 failures → 0, two consecutive runs
  • :decorated-window-tao:test, ktlintCheck, detekt, apiCheck; :examples:tao-native-test:compileKotlin
  • test-graalvm on all three platforms in CI

Known, not addressed here

graphicsLayer translation filmed — native popup layer hangs on Linux, which is what makes that leg reach the 900 s watchdog. It draws a GraphicsLayer created from the owner window's GraphicsContext inside the popup's own GL context, with alpha forcing the saveLayer path; the in-scene variant of the same case passes. Pre-existing, and its own investigation.

The native popup layer matches the in-scene layer comparison is borderline under Xvfb (slide-in measured 15 px vs 10 px against a 4 px tolerance) — a 6 ms sample period is coarse for a 10 dp slide. Tolerances left as calibrated.

…inst

`examples/tao-native-test` compiles decorated-window-tao's test suites into a
native image, but `taoTestArtifacts` published only the classes, so every
dependency of that test source set had to be repeated in the consumer. Material
3 was not, and the first case that reaches an `AlertDialog` throws
`NoClassDefFoundError: androidx/compose/material3/MaterialThemeKt` **on the Tao
main thread**, which closes the loop and fails the whole `test-graalvm` job on
all three platforms. The configuration now extends `testImplementation`, so a
dependency added to the suites reaches the image without being repeated —
reproduced and verified on the JVM (`:examples:tao-native-test:run
--args=headful`), which shares the classpath.

While the film cases were finally running, three things they had never been
green on:

- Their content is composed into a `ColumnScope` next to the harness's default
  `fillMaxSize` background, so it was laid out at zero height: the forty rows of
  text that exist to make the owner's per-frame present cost something rendered
  nowhere. `paintDefaultBackground = false`.
- The grabber started *before* the warm-up and spent its whole frame budget on
  it, leaving the curve with nothing after the timestamp it measures from —
  reported as "the dialog never showed up on screen".
- One capture session covered both halves, so the appearance consumed the budget
  and the disappearance got no frames at all, which is what the comparison cases
  were failing on. Each half films in its own session now, within the same total
  budget.

Under Xvfb + openbox the `appearance` series goes from 6 failures to 0. The
`native popup layer matches the in-scene layer` comparison is borderline there
(slide-in measured 15 px vs 10 px against a 4 px tolerance) because a 6 ms
sample period is coarse for a 10 dp slide; the tolerances are left as calibrated.

Not addressed: `graphicsLayer translation filmed — native popup layer` hangs on
Linux, which is what makes that leg reach the 900 s watchdog. It draws a
`GraphicsLayer` created from the *owner window's* `GraphicsContext` inside the
popup's own GL context, with alpha forcing the saveLayer path; the in-scene
variant of the same case passes. Pre-existing and its own investigation.
@kdroidFilter
kdroidFilter merged commit 1589b3c into nucleus-2.6 Sep 6, 2026
17 of 23 checks passed
@kdroidFilter
kdroidFilter deleted the fix/graalvm-native-test-material3 branch September 6, 2026 13:50
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