Skip to content

Image validation: Firebase harness, Android coexistence and remaining device checks #779

Closed

Description

@leehack

Part of the delivered image-generation v1 (#776/#786). This issue now tracks the remaining qualification work.

Implemented or recorded

  • Unit coverage for validation, PNG encoding, errors and cancellation; local-only generation/determinism/cancel/concurrency coverage; local E2E scenario and matrix row.
  • Recorded SDXS device results for iPhone 16 Pro, iPhone SE 3, Galaxy S24 and Galaxy A53, with timings and peak RSS, in the September 30 validation comment.
  • Recorded llama.cpp/image coexistence on macOS and Linux/Windows CPU/Vulkan. Linux/Windows image smoke passed 6/6 in that evidence.

These are historical runs at their recorded stack revision (05a89ef14); no new device run was performed during organization. The SE 3 result used bundled SDXS because the pool could not reach Hugging Face.

Remaining acceptance

Backlog index: #922.

Activity

  1. added
    enhancement
    priority:P2
    on Sep 29, 2026
  2. leehack commented on Sep 30, 2026

    @leehack
    OwnerAuthor

    Cross-platform validation of the stack (#784 → #785 → #786) at 05a89ef14, real models, 2026-09-30. SDXS Q8_0 and SD-Turbo q8 + TAESD, 512x512, 1 step, seed 42.

    Mobile (Firebase Test Lab, chat app E2E plus an extended scratch test)

    Galaxy S24 (Android 16) Galaxy A53 (Android 16) iPhone 16 Pro (18.3) iPhone SE 3 (18.4)
    Backend CPU CPU Metal Metal
    SDXS generate, warm 5.8 s 28.2 s 1.4 s 3.9 s
    SDXS peak RSS 1.61 GB 1.40 GB 1.06 GB 0.74 GB (RSS under-counts Metal)
    SD-Turbo + TAESD 11.4 s, 2.55 GB refused by memory preflight (2.62 GiB needed, 2.48 available); not killed 2.2 s refused by preflight (1.97 GiB available); not killed
    Android CPU gate pass pass n/a n/a
    • Also verified by hand on a Pixel 9 Pro (release build).
    • All outputs are real images; same-seed reruns are deterministic, and the two Android phones produce byte-identical SDXS output.
    • SE 3 could not reach Hugging Face from the Firebase pool, so SDXS was bundled into the test and the SD-Turbo row checks the preflight only (placeholder files of the real sizes).

    Desktop (GCE g2-standard-4, NVIDIA L4)

    OS Build SDXS warm SD-Turbo + TAESD warm Peak RSS (SDXS)
    Linux x64 CPU (2 cores) 16.3 s 28.7 s 1.5 GB
    Linux x64 Vulkan (L4) 176 ms 225 ms 0.8 GB
    Windows Server 2022 CPU (2 cores) 18.1 s 31.6 s 1.5 GB
    Windows Server 2022 Vulkan (L4) 571 ms 634 ms 1.2 GB
    • First Vulkan image in a new process includes a shader compile (12 s Linux, 45 s Windows); later processes reuse the cache.
    • image-generation-smoke passes 6/6 on Linux and Windows, CPU and Vulkan.
    • llama.cpp text generation and image generation ran together in one process on both OSes, CPU and Vulkan; text matched a solo run. libstable-diffusion.so exports 0 ggml_ symbols on Linux x64.
    • x64 CPU gates pass on real hardware. Missing-Vulkan-loader errors are typed LlamaUnsupportedException with correct advice on Linux (libvulkan.so.1) and Windows (error 126); with a loader but no GPU driver, Linux falls back to CPU.

    Findings to fix

    1. Windows without the Visual C++ runtime (P2, feat: add experimental ImageGenerationEngine (stacked on #784) #785): stock Windows Server 2022 lacks msvcp140.dll/vcruntime140.dll, which stable-diffusion.dll imports (CPU and Vulkan builds). Even the CPU build then fails, and the error-126 message wrongly advises installing the Vulkan loader or selecting CPU. Installing vc_redist.x64 fixes it. Name the missing DLL (probe vulkan-1.dll / msvcp140.dll) and document the requirement; llama.cpp's DLLs need the same runtime and it is undocumented. Same line has a doubled period.
    2. Chat app E2E test fails on physical iOS (feat: experimental on-device image generation (stable_diffusion runtime, API, chat app) #786, test bug): enterText is dropped in release-mode integration tests (registerTestTextInput false; Flutter only accepts client id -1 in debug asserts), so the seed stays empty and expect(output.seed, 42) fails. Set the field's controller text directly and unfocus before tapping Generate.
    3. Pre-existing tooling: on Windows, run_local_e2e.dart --dry-run prints POSIX shell syntax that cmd/PowerShell cannot run.
  3. changed the title [-]Image generation tests and device validation[/-] [+]Image validation: Firebase harness, Android coexistence and remaining device checks[/+] on Oct 3, 2026
  4. leehack commented on Oct 13, 2026

    @leehack
    OwnerAuthor

    Physical-iPhone image end-to-end result for 0.12.0 is recorded on #789: passed on an iPhone 16 Pro (iOS 18.3.2) at d3351a49. Desktop image models also generate on Linux and Windows through Vulkan on an NVIDIA L4 at 95973464 (SDXS and SD-Turbo+TAESD, 512×512); details in #966.

  5. leehack commented on Oct 14, 2026

    @leehack
    OwnerAuthor

    0.12.0 validation update (#966):

    • Android coexistence: on a physical Galaxy S24 (SC-51E, Android 16, Firebase Test Lab, debug build at 3575bef7, in-repo packages, llama.cpp v0.6.0-2 + stable_diffusion v0.2.0-3, independently reviewed), in one process with both engines on CPU, a greedy 32-token reply was identical before the image runtime was used and after an image was generated with it loaded, and a seeded 512×512 SDXS image was byte-identical twice. Peak RSS 2.65 GB; no crash or kill. The test is example/chat_app/integration_test/text_image_coexistence_e2e_test.dart (#1026). Not established: GPU text beside images, LiteRT-LM beside images, concurrent generation, a release build, other Android devices.
    • Android image end-to-end: passed on the same phone model at d3351a49 with the maintained image verifier (CPU, exact clean source).
    • Deferred past 0.12.0 by maintainer decision (2026-10-14): integrating a Firebase image-generation profile into packages/llamadart_validation. The 0.12.0 image runs used the committed chat-app integration tests with hand-built bundles, because the validation kit's Android image build omits the source-commit defines its own verifier requires.
  6. leehack commented on Oct 14, 2026

    @leehack
    OwnerAuthor

    The deferred validation-package item is done: #1028 adds image-generation profiles (image-sdxs-cpu for Android, image-sdxs-metal for iOS) to the maintained validation.dart build → plan → run → collect flow. The build embeds the exact clean source commit, Android pulls the evidence directory, iOS attaches it as XCTest attachments, and collect grades it with the maintained image verifier. First runs through the tool on 2026-10-14 graded evidence_verified: true on a Galaxy S24 (CPU) and an iPhone 16 Pro (Metal); the iPhone run is the first iOS image run whose PNG bytes were verified.

  7. leehack commented on Oct 14, 2026

    @leehack
    OwnerAuthor

    All remaining acceptance is done: image profiles in the validation flow (#1028), Android llama.cpp + image coexistence on a Galaxy S24 (#1026), the physical-iPhone rerun (#789), and #805/#803 closed. Not established, carried to #514: GPU text beside images, LiteRT-LM beside images, concurrent generation, release builds, other Android devices. The iPhone full-VAE failure is #1033.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpriority:P2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions